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
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_home, container, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}", "@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }" ]
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.6625158", "0.66195583", "0.66164845", "0.6608733", "0.6596594", "0.65928894", "0.6585293", "0.65842897", "0.65730995", "0.6571248", "0.6569152", "0.65689117", "0.656853", "0.6566686", "0.65652984", "0.6553419", "0.65525705", "0.65432084", "0.6542382", "0.65411425", "0.6538022", "0.65366334", "0.65355957", "0.6535043", "0.65329415", "0.65311074", "0.65310687", "0.6528645", "0.65277404", "0.6525902", "0.6524516", "0.6524048", "0.65232015", "0.65224624", "0.65185034", "0.65130377", "0.6512968", "0.65122765", "0.65116245", "0.65106046", "0.65103024", "0.6509013", "0.65088093", "0.6508651", "0.6508225", "0.6504662", "0.650149", "0.65011525", "0.6500686", "0.64974767", "0.64935696", "0.6492234", "0.6490034", "0.6487609", "0.6487216", "0.64872116", "0.6486594", "0.64861935", "0.6486018", "0.6484269", "0.648366", "0.6481476", "0.6481086", "0.6480985", "0.6480396", "0.64797544", "0.647696", "0.64758915", "0.6475649", "0.6474114", "0.6474004", "0.6470706", "0.6470275", "0.64702207", "0.6470039", "0.6467449", "0.646602", "0.6462256", "0.64617974", "0.6461681", "0.6461214" ]
0.0
-1
Creates new form SpriteClipperGUI
public SpriteClipperGUI() { initComponents(); /* Set up the button group */ rsAnchorGroup = new ButtonGroup(); rsAnchorGroup.add(tlRadioButton); rsAnchorGroup.add(tcRadioButton); rsAnchorGroup.add(trRadioButton); rsAnchorGroup.add(clRadioButton); rsAnchorGroup.add(crRadioButton); rsAnchorGroup.add(blRadioButton); rsAnchorGroup.add(bcRadioButton); rsAnchorGroup.add(brRadioButton); rsAnchorGroup.add(ccRadioButton); rsAnchorGroup.setSelected(blRadioButton.getModel(), true); connSelector.setSelectedIndex(1); spriteClipper.addObserver(this); clippedList.addListSelectionListener(spriteDetailer); addKeyListener(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CreateGUI() throws IOException{\r\n\t\tthis.setFocusable(false);\r\n\t\tthis.setTitle(\"Dance Dance Revolution - 201B Edition\");\r\n\t\tthis.setSize(800, 600);\t\t \t\r\n\t\tthis.setLocation(100, 100); \t\r\n\t\tthis.setVisible(true);\r\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tthis.setResizable(false);\r\n\t\tcp = getContentPane();\r\n\t\tcp.setBackground(Color.black);\r\n\t\tarrowlistener = new ArrowListener();\r\n\t\tscore = new Score();\r\n\t\tcombo = new ComboImage();\r\n\t}", "private void createGUI() {\n ResizeGifPanel newContentPane = new ResizeGifPanel();\n newContentPane.setOpaque(true); \n setContentPane(newContentPane); \n }", "public void createGUI() {\n\n\t\tcontents = getContentPane();\n\t\tcontents.setLayout(new GridLayout(size, size));\n\n\t\t// Set Up Menu Bar\n\t\tJMenuBar menuBar = new JMenuBar();\n\t\tsetJMenuBar(menuBar);\n\n\t\tJMenu game = new JMenu(\"Game\");\n\t\tmenuBar.add(game);\n\t\tJMenuItem clearBoard = new JMenuItem(\"New Game\");\n\t\tgame.add(clearBoard);\n\t\tJMenuItem boardSize = new JMenuItem(\"Change Size\");\n\t\tgame.add(boardSize);\n\t\tJMenuItem exit = new JMenuItem(\"Exit\");\n\t\tgame.add(exit);\n\n\t\tJMenu help = new JMenu(\"Help\");\n\t\tmenuBar.add(help);\n\t\tJMenuItem rules = new JMenuItem(\"How to Play\");\n\t\thelp.add(rules);\n\t\tJMenuItem about = new JMenuItem(\"About\");\n\t\thelp.add(about);\n\n\t\tJMenu playerSelect = new JMenu(\"Players: \" + players);\n\t\tmenuBar.add(playerSelect);\n\t\tJMenuItem players2 = new JMenuItem(\"2 Player Game\");\n\t\tplayerSelect.add(players2);\n\t\tJMenuItem players3 = new JMenuItem(\"3 Player Game\");\n\t\tplayerSelect.add(players3);\n\t\tJMenuItem players4 = new JMenuItem(\"4 Player Game\");\n\t\tplayerSelect.add(players4);\n\n\t\tmenuBar.add(Box.createHorizontalGlue());\n\n\t\tplayerTurnLbl.setFont(new Font(\"Lucida Grande\", Font.BOLD, 12)); // Player 1's Turn\n\t\tmenuBar.add(playerTurnLbl);\n\t\tplayerTurnLbl.setVisible(true);\n\n\t\tinvalidMoveLbl.setFont(new Font(\"Lucida Grande\", Font.BOLD, 12)); // Invalid Move Alert\n\t\tinvalidMoveLbl.setForeground(Color.RED);\n\t\tmenuBar.add(invalidMoveLbl);\n\t\tinvalidMoveLbl.setVisible(false);\n\n\t\t// Exit Button Action\n\t\texit.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t});\n\n\t\t// Board Size Button Action\n\t\tboardSize.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\trestartGame();\n\t\t\t}\n\t\t});\n\n\t\t// Reset Board Button Action\n\t\tclearBoard.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tresetBoard();\n\t\t\t}\n\t\t});\n\n\t\t// Rules Button Action\n\t\trules.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\"1. Players take turns moving up, down, left, or right to generate a self-avoiding walk.\\n\\tClick on a square to make your move.\\n\\n2. A player who makes a self-intersecting move loses the game. \\n\\n3. A player can win the game by making a self-intersecting move that creates a self-avoiding polygon.\\n\\tThis is only valid after at least 4 moves.\",\n\t\t\t\t\t\t\"Self-Avoiding Walk Game Rules\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t}\n\t\t});\n\n\t\t// About Button Action\n\t\tabout.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\"Self-Avoiding Walk Multiplayer Game\\nDeveloped by Adam Binder\\nCopyright 2019\", \"About\",\n\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\n\t\t\t}\n\t\t});\n\n\t\t// 2 Player Button Action\n\t\tplayers2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tplayers = 2;\n\t\t\t\tresetBoard();\n\t\t\t}\n\t\t});\n\n\t\t// 3 Player Button Action\n\t\tplayers3.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tplayers = 3;\n\t\t\t\tresetBoard();\n\t\t\t}\n\t\t});\n\n\t\t// 4 Player Button Action\n\t\tplayers4.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tplayers = 4;\n\t\t\t\tresetBoard();\n\t\t\t}\n\t\t});\n\n\t\t// Create event handlers:\n\t\tButtonHandler buttonHandler = new ButtonHandler();\n\n\t\t// Create and add board components:\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tfor (int j = 0; j < size; j++) {\n\t\t\t\tsquares[i][j] = new JButton();\n\t\t\t\tsquares[i][j].setBorder(null);\n\t\t\t\tsquares[i][j].setOpaque(true);\n\t\t\t\tsquares[i][j].setBorderPainted(false);\n\t\t\t\tif ((i + j) % 2 != 0) {\n\t\t\t\t\tsquares[i][j].setBackground(colorGray);\n\t\t\t\t\tsquares[i][j].setBorder(null);\n\t\t\t\t\tsquares[i][j].setOpaque(true);\n\t\t\t\t}\n\t\t\t\tcontents.add(squares[i][j]);\n\t\t\t\tsquares[i][j].addActionListener(buttonHandler);\n\t\t\t}\n\t\t}\n\t}", "private void createGUI() {\n\t\tframe = new JFrame();\n\t\tframe.setTitle(\"My first player\");\n\t\tframe.setBounds(100, 100, 450, 300);\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\t\tframe.getContentPane().setBackground(Color.PINK);\n\t\tbtnPlay.setFont(new Font(\"FreeSerif\", Font.BOLD, 16));\n\t\tbtnPlay.setBounds(27, 80, 107, 22);\n\t\tbtnPlay.setEnabled(false);\n\t\tbtnStop.setFont(new Font(\"FreeSerif\", Font.BOLD, 16));\n\t\tbtnStop.setBounds(321, 79, 117, 25);\n\t\tbtnStop.setEnabled(false);\n\t\tbtnPause.setFont(new Font(\"FreeSerif\", Font.BOLD, 16));\n\t\tbtnPause.setBounds(170, 79, 117, 25);\n\t\tbtnPause.setEnabled(false);\n\t\tbtnOpen.setFont(new Font(\"FreeSerif\", Font.BOLD, 16));\n\t\tbtnOpen.setBounds(113, 43, 249, 25);\n\t\tlblMyMusic.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlblMyMusic.setForeground(new Color(51, 51, 51));\n\t\tlblMyMusic.setFont(new Font(\"FreeSerif\", Font.BOLD, 20));\n\t\tlblMyMusic.setBounds(101, 174, 261, 57);\n\n\t}", "public MyGUI() {\n \t super(\"Mastermind\");\n \t guiManager = new GUIManager();\n createMenuComponents();\n createMastermindComponents(this,2);\n \n }", "private static void createAndShowGUI() {\n Font f = new Font(\"微软雅黑\", 0, 12);\n String names[] = {\"Label\", \"CheckBox\", \"PopupMenu\", \"MenuItem\", \"CheckBoxMenuItem\",\n \"JRadioButtonMenuItem\", \"ComboBox\", \"Button\", \"Tree\", \"ScrollPane\",\n \"TabbedPane\", \"EditorPane\", \"TitledBorder\", \"Menu\", \"TextArea\",\n \"OptionPane\", \"MenuBar\", \"ToolBar\", \"ToggleButton\", \"ToolTip\",\n \"ProgressBar\", \"TableHeader\", \"Panel\", \"List\", \"ColorChooser\",\n \"PasswordField\", \"TextField\", \"Table\", \"Label\", \"Viewport\",\n \"RadioButtonMenuItem\", \"RadioButton\", \"DesktopPane\", \"InternalFrame\"\n };\n for (String item : names) {\n UIManager.put(item + \".font\", f);\n }\n //Create and set up the window.\n JFrame frame = new JFrame(\"AutoCapturePackagesTool\");\n\n String src = \"/optimizationprogram/GUICode/u5.png\";\n Image image = null;\n try {\n image = ImageIO.read(new CaptureGUI().getClass().getResource(src));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n frame.setIconImage(image);\n //frame.setIconImage(Toolkit.getDefaultToolkit().getImage(src));\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setResizable(false);\n frame.setLocation(Toolkit.getDefaultToolkit().getScreenSize().width / 2 - 520 / 2,\n Toolkit.getDefaultToolkit().getScreenSize().height / 2 - 420 / 2);\n frame.getContentPane().add(new CaptureGUI());\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n }", "public PlayerGUI() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n rsAnchorGroup = new javax.swing.ButtonGroup();\n sheetPanel = new javax.swing.JPanel();\n spriteSheetScrollPane = new javax.swing.JScrollPane();\n jPanel1 = new javax.swing.JPanel();\n selectNoneButton = new javax.swing.JButton();\n selectAllButton = new javax.swing.JButton();\n findSpritesButton = new javax.swing.JButton();\n openButton = new javax.swing.JButton();\n reshapeButton = new javax.swing.JButton();\n closeButton = new javax.swing.JButton();\n mergeButton = new javax.swing.JButton();\n connLabel = new javax.swing.JLabel();\n connSelector = new javax.swing.JComboBox();\n storeClipsButton = new javax.swing.JButton();\n filterLabel = new javax.swing.JLabel();\n filterSelector = new javax.swing.JComboBox();\n jPanel2 = new javax.swing.JPanel();\n trRadioButton = new javax.swing.JRadioButton();\n tlRadioButton = new javax.swing.JRadioButton();\n clRadioButton = new javax.swing.JRadioButton();\n crRadioButton = new javax.swing.JRadioButton();\n tcRadioButton = new javax.swing.JRadioButton();\n brRadioButton = new javax.swing.JRadioButton();\n blRadioButton = new javax.swing.JRadioButton();\n bcRadioButton = new javax.swing.JRadioButton();\n ccRadioButton = new javax.swing.JRadioButton();\n storedPanel = new javax.swing.JPanel();\n jScrollPane2 = new javax.swing.JScrollPane();\n clippedList = new javax.swing.JList();\n removeButton = new javax.swing.JButton();\n saveToButton = new javax.swing.JButton();\n spriteDetailer = new com.fluffynukeit.SpriteClipper.GUI.SpriteDetailer();\n packButton = new javax.swing.JButton();\n packerLabel = new javax.swing.JLabel();\n packerSelector = new javax.swing.JComboBox();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Sprite Clipper\");\n setBounds(new java.awt.Rectangle(0, 0, 800, 600));\n setFocusable(false);\n setName(\"mainFrame\"); // NOI18N\n\n sheetPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Sprite Sheet\"));\n sheetPanel.setFocusable(false);\n\n spriteSheetScrollPane.setFocusable(false);\n\n jPanel1.setFocusable(false);\n\n selectNoneButton.setText(\"None\");\n selectNoneButton.setToolTipText(\"<html><div align=\\\"center\\\">Deselects all found sprites. (Ctrl+N)</div></html>\");\n selectNoneButton.setEnabled(false);\n selectNoneButton.setFocusable(false);\n selectNoneButton.setName(\"findSpritesButton\"); // NOI18N\n selectNoneButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n selectNoneButtonActionPerformed(evt);\n }\n });\n\n selectAllButton.setText(\"All\");\n selectAllButton.setToolTipText(\"<html><div align=\\\"center\\\">Selects all found sprites. (Ctrl+A)</div></html>\");\n selectAllButton.setEnabled(false);\n selectAllButton.setFocusable(false);\n selectAllButton.setName(\"findSpritesButton\"); // NOI18N\n selectAllButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n selectAllButtonActionPerformed(evt);\n }\n });\n\n findSpritesButton.setFont(new java.awt.Font(\"DejaVu Sans\", 0, 14));\n findSpritesButton.setText(\"<html><div align=\\\"center\\\">Find<br>Sprites!</div></html>\");\n findSpritesButton.setToolTipText(\"<html><div align=\\\"center\\\">Identifies sprites in the sprite sheet using selected <br> background filter and connectedness criterion. (Ctrl+F)</div></html>\");\n findSpritesButton.setEnabled(false);\n findSpritesButton.setFocusable(false);\n findSpritesButton.setName(\"findSpritesButton\"); // NOI18N\n findSpritesButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n findSpritesButtonActionPerformed(evt);\n }\n });\n\n openButton.setText(\"Open\");\n openButton.setToolTipText(\"<html><div align=\\\"center\\\">Opens a sprite sheet. (Ctrl+O)</div></html>\");\n openButton.setFocusable(false);\n openButton.setName(\"openButton\"); // NOI18N\n openButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n openButtonActionPerformed(evt);\n }\n });\n\n reshapeButton.setText(\"Reshape\");\n reshapeButton.setToolTipText(\"<html><div align=\\\"center\\\">Select multiple sprites on the sheet, an anchor point, then press reshape.<br>The bounds of all selected clips will be expanded to the same size. (Ctrl+R)</div></html>\");\n reshapeButton.setEnabled(false);\n reshapeButton.setFocusable(false);\n reshapeButton.setName(\"findSpritesButton\"); // NOI18N\n reshapeButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n reshapeButtonActionPerformed(evt);\n }\n });\n\n closeButton.setText(\"Close\");\n closeButton.setToolTipText(\"<html><div align=\\\"center\\\">Closes the open sprite sheet. (Ctrl+W)</div></html>\");\n closeButton.setEnabled(false);\n closeButton.setFocusable(false);\n closeButton.setName(\"closeButton\"); // NOI18N\n closeButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n closeButtonActionPerformed(evt);\n }\n });\n\n mergeButton.setText(\"Merge\");\n mergeButton.setToolTipText(\"<html><div align=\\\"center\\\">Combines multiple selected sprites. (Ctrl+M)</div></html>\");\n mergeButton.setEnabled(false);\n mergeButton.setFocusable(false);\n mergeButton.setName(\"findSpritesButton\"); // NOI18N\n mergeButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n mergeButtonActionPerformed(evt);\n }\n });\n\n connLabel.setText(\"Connected criterion:\");\n\n connSelector.setModel(new DefaultComboBoxModel(spriteClipper.getAvailableFinders()));\n connSelector.setFocusable(false);\n connSelector.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n connSelectorActionPerformed(evt);\n }\n });\n\n storeClipsButton.setFont(new java.awt.Font(\"DejaVu Sans\", 0, 14));\n storeClipsButton.setText(\"Clip!\");\n storeClipsButton.setToolTipText(\"<html><div align=\\\"center\\\">Adds selected sprites to the clipped sprites. (Ctrl+C)</div></html>\");\n storeClipsButton.setEnabled(false);\n storeClipsButton.setFocusable(false);\n storeClipsButton.setName(\"findSpritesButton\"); // NOI18N\n storeClipsButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n storeClipsButtonActionPerformed(evt);\n }\n });\n\n filterLabel.setText(\"Background is...\");\n\n filterSelector.setModel(new DefaultComboBoxModel(spriteClipper.getAvailableFilters()));\n filterSelector.setFocusable(false);\n filterSelector.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n filterSelectorActionPerformed(evt);\n }\n });\n\n jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(\"RS Anchor\"));\n jPanel2.setFocusable(false);\n\n trRadioButton.setEnabled(false);\n trRadioButton.setFocusable(false);\n\n tlRadioButton.setEnabled(false);\n tlRadioButton.setFocusable(false);\n\n clRadioButton.setEnabled(false);\n clRadioButton.setFocusable(false);\n\n crRadioButton.setEnabled(false);\n crRadioButton.setFocusable(false);\n\n tcRadioButton.setEnabled(false);\n tcRadioButton.setFocusable(false);\n\n brRadioButton.setEnabled(false);\n brRadioButton.setFocusable(false);\n\n blRadioButton.setEnabled(false);\n blRadioButton.setFocusable(false);\n\n bcRadioButton.setEnabled(false);\n bcRadioButton.setFocusable(false);\n\n ccRadioButton.setEnabled(false);\n ccRadioButton.setFocusable(false);\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()\n .addComponent(clRadioButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(ccRadioButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(crRadioButton))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()\n .addComponent(tlRadioButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(tcRadioButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(trRadioButton)))\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(blRadioButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(bcRadioButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(brRadioButton)))\n .addContainerGap())\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(tlRadioButton)\n .addComponent(tcRadioButton)\n .addComponent(trRadioButton))\n .addGap(6, 6, 6)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(clRadioButton)\n .addComponent(crRadioButton)\n .addComponent(ccRadioButton))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(bcRadioButton)\n .addComponent(blRadioButton)\n .addComponent(brRadioButton)))\n );\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(openButton)\n .addGap(8, 8, 8)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(filterLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)\n .addComponent(filterSelector, 0, 145, Short.MAX_VALUE)\n .addComponent(connLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(closeButton)\n .addGap(8, 8, 8)\n .addComponent(connSelector, 0, 145, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(findSpritesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(selectNoneButton, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(reshapeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(selectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(mergeButton, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(storeClipsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(24, 24, 24))\n );\n\n jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {mergeButton, reshapeButton, selectAllButton, selectNoneButton});\n\n jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {closeButton, openButton});\n\n jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {findSpritesButton, storeClipsButton});\n\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(selectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)\n .addComponent(mergeButton, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(selectNoneButton, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)\n .addComponent(reshapeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(filterLabel)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(openButton)\n .addComponent(filterSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(connLabel)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(closeButton)\n .addComponent(connSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(findSpritesButton, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)\n .addContainerGap())\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(storeClipsButton, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE))\n .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {mergeButton, reshapeButton, selectAllButton, selectNoneButton});\n\n jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {closeButton, openButton});\n\n javax.swing.GroupLayout sheetPanelLayout = new javax.swing.GroupLayout(sheetPanel);\n sheetPanel.setLayout(sheetPanelLayout);\n sheetPanelLayout.setHorizontalGroup(\n sheetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(sheetPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n .addComponent(spriteSheetScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 674, Short.MAX_VALUE)\n );\n sheetPanelLayout.setVerticalGroup(\n sheetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sheetPanelLayout.createSequentialGroup()\n .addComponent(spriteSheetScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n storedPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Clipped Sprites\"));\n storedPanel.setFocusable(false);\n\n clippedList.setModel(new DefaultListModel());\n clippedList.setCellRenderer(new ClipCellRenderer());\n clippedList.setFocusable(false);\n clippedList.setLayoutOrientation(javax.swing.JList.HORIZONTAL_WRAP);\n clippedList.setVisibleRowCount(-1);\n jScrollPane2.setViewportView(clippedList);\n\n removeButton.setText(\"Remove\");\n removeButton.setToolTipText(\"<html><div align=\\\"center\\\">Removes the selected clipped sprites. (Delete)</div></html>\");\n removeButton.setEnabled(false);\n removeButton.setFocusable(false);\n removeButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n removeButtonActionPerformed(evt);\n }\n });\n\n saveToButton.setText(\"Save To...\");\n saveToButton.setToolTipText(\"<html><div align=\\\"center\\\">Saves all selected clipped sprites to a directory. (Ctrl+S)</div></html>\");\n saveToButton.setEnabled(false);\n saveToButton.setFocusable(false);\n saveToButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n saveToButtonActionPerformed(evt);\n }\n });\n\n spriteDetailer.setFocusable(false);\n\n packButton.setText(\"Pack...\");\n packButton.setToolTipText(\"<html><div align=\\\"center\\\">Packs the selected sprite clips into a new, dense sheet using the<br>selected packing method, and writes definition text file. (Ctrl+P)</div></html>\");\n packButton.setEnabled(false);\n packButton.setFocusable(false);\n packButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n packButtonActionPerformed(evt);\n }\n });\n\n packerLabel.setText(\"Packing method:\");\n\n packerSelector.setModel(new DefaultComboBoxModel(spriteClipper.getAvailablePackers()));\n packerSelector.setFocusable(false);\n packerSelector.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n packerSelectorActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout storedPanelLayout = new javax.swing.GroupLayout(storedPanel);\n storedPanel.setLayout(storedPanelLayout);\n storedPanelLayout.setHorizontalGroup(\n storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, storedPanelLayout.createSequentialGroup()\n .addComponent(packerSelector, 0, 156, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(packButton))\n .addGroup(storedPanelLayout.createSequentialGroup()\n .addComponent(packerLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n .addGroup(storedPanelLayout.createSequentialGroup()\n .addComponent(saveToButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 72, Short.MAX_VALUE)\n .addComponent(removeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(spriteDetailer, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE)\n );\n storedPanelLayout.setVerticalGroup(\n storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(storedPanelLayout.createSequentialGroup()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(spriteDetailer, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(saveToButton)\n .addComponent(removeButton))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(packerLabel)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(packerSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(packButton)))\n );\n\n storedPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {removeButton, saveToButton});\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(sheetPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(storedPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(sheetPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(storedPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }", "public CaptureGUI() {\n initComponents();\n }", "public createNew(){\n\t\tsuper(\"Create\"); // title for the frame\n\t\t//layout as null\n\t\tgetContentPane().setLayout(null);\n\t\t//get the background image\n\t\ttry {\n\t\t\tbackground =\n\t\t\t\t\tnew ImageIcon (ImageIO.read(getClass().getResource(\"Wallpaper.jpg\")));\n\t\t}//Catch for file error\n\t\tcatch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tJOptionPane.showMessageDialog(null, \n\t\t\t\t\t\"ERROR: File(s) Not Found\\n Please Check Your File Format\\n\"\n\t\t\t\t\t\t\t+ \"and The File Name!\");\n\t\t}\n\t\t//Initialize all of the compenents \n\t\tlblBackground = new JLabel (background);\n\t\tlblTitle = new JLabel (\"Create Menu\");\n\t\tlblTitle.setFont(new Font(\"ARIAL\",Font.ITALIC, 30));\n\t\tlblName = new JLabel(\"Please Enter Your First Name.\");\n\t\tlblLastName= new JLabel (\"Please Enter Your Last Name.\");\n\t\tlblPhoneNumber = new JLabel (\"Please Enter Your Phone Number.\");\n\t\tlblAddress = new JLabel (\"Please Enter Your Address.\");\n\t\tlblMiddle = new JLabel (\"Please Enter Your Middle Name (Optional).\");\n\t\tbtnCreate = new JButton (\"Create\");\n\t\tbtnBack = new JButton (\"Back\");\n\t\t//set the font\n\t\tlblName.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblLastName.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblPhoneNumber.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblAddress.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\t\tlblMiddle.setFont(new Font(\"Times New Roman\",Font.BOLD, 18));\n\n\t\t//add action listener\n\t\tbtnCreate.addActionListener(this);\n\t\tbtnBack.addActionListener(this);\n\t\t//set bounds for all the components\n\t\tbtnCreate.setBounds(393, 594, 220, 36);\n\t\ttxtMiddle.setBounds(333, 249, 342, 36);\n\t\ttxtName.setBounds(333, 158, 342, 36);\n\t\ttxtLastName.setBounds(333, 339, 342, 36);\n\t\ttxtPhoneNumber.setBounds(333, 429, 342, 36);\n\t\ttxtAddress.setBounds(333, 511, 342, 36);\n\t\tbtnBack.setBounds(6,716,64,36);\n\t\tlblTitle.setBounds(417, 0, 182, 50);\n\t\tlblMiddle.setBounds(333, 201, 342, 36);\n\t\tlblName.setBounds(387, 110, 239, 36);\n\t\tlblLastName.setBounds(387, 297, 239, 36);\n\t\tlblPhoneNumber.setBounds(369, 387, 269, 36);\n\t\tlblAddress.setBounds(393, 477, 215, 30);\n\t\tbtnBack.setBounds(6,716,64,36);\n\t\tlblTitle.setBounds(417, 0, 182, 50);\n\t\tlblBackground.setBounds(0, 0, 1000, 1000);\n\t\t//add components to frame\n\t\tgetContentPane().add(btnCreate);\n\t\tgetContentPane().add(txtMiddle);\n\t\tgetContentPane().add(txtLastName);\n\t\tgetContentPane().add(txtAddress);\n\t\tgetContentPane().add(txtPhoneNumber);\n\t\tgetContentPane().add(txtName);\n\t\tgetContentPane().add(lblMiddle);\n\t\tgetContentPane().add(lblLastName);\n\t\tgetContentPane().add(lblAddress);\n\t\tgetContentPane().add(lblPhoneNumber);\n\t\tgetContentPane().add(lblName);\n\t\tgetContentPane().add(btnBack);\n\t\tgetContentPane().add(lblTitle);\n\t\tgetContentPane().add(lblBackground);\n\t\t//set size, visible and action for close\n\t\tsetSize(1000,1000);\n\t\tsetVisible(true);\n\t\tsetDefaultCloseOperation(EXIT_ON_CLOSE);\n\n\t}", "private void makeGUI() {\n //Create the canvas and Components for GUI.\n canvas = new Canvas();\n\n canvas.setBounds(0, 0, getWidth(), getHeight());\n getContentPane().setBackground(DrawAttribute.whiteblue);\n searchArea = new JTextField();\n searchArea.setForeground(Color.GRAY);\n searchArea.setText(promptText);\n\n //Make the components for the frame.\n makeComponents();\n addComponentsToLayers();\n }", "private void createAndShowGUI (){\n\n JustawieniaPowitalne = new JUstawieniaPowitalne();\n }", "public static void newUAV(){\n GridPane gp = new GridPane();\n Text title = new Text(\"Create a UAV:\\nUAV Settings\");\n title.setTextAlignment(TextAlignment.CENTER);\n title.setId(\"title\"); // Set CSS style for the title\n GridPane.setColumnSpan(title,3);\n GridPane.setHalignment(title, HPos.CENTER);\n\n gp.setId(\"gridpane\"); // Set CSS style ID for the gridpane\n gp.getStyleClass().add(\"grid\");\n\n // Create the labels for the menu\n Label nameLabel = new Label(\"Name:\");\n Label weightLabel = new Label(\"Weight (g):\");\n Label turnRadiusLabel = new Label(\"Turn Radius (m):\");\n Label maxInclineLabel = new Label(\"Max incline angle (deg):\");\n Label batteryLabel = new Label(\"Battery Type:\");\n Label batteryCapacityLabel = new Label(\"Battery Capacity (mAh):\");\n\n name.setPromptText(\"Name of craft\");\n weight.setPromptText(\"Weight of craft\");\n turnRadius.setPromptText(\"Min turn radius of craft\");\n maxIncline.setPromptText(\"Max incline/decline angle\");\n battery.setPromptText(\"Battery used in craft (Lipo, NiMH, Li-ion...)\");\n batteryCapacity.setPromptText(\"Battery capacity in mAh\");\n\n // Create the buttons for the menu\n Button save = new Button(\"Save\");\n Button cancel = new Button(\"Cancel\");\n Button clear = new Button(\"Clear\");\n\n // Add all elements to the menu gridpane\n gp.add(title,0,0);\n\n // Add the components to the menu gridpane\n gp.add(nameLabel,0,1);\n gp.add(weightLabel,0,2);\n gp.add(turnRadiusLabel,0,3);\n gp.add(maxInclineLabel,0,4);\n gp.add(batteryLabel,0,5);\n gp.add(batteryCapacityLabel,0,6);\n\n gp.add(name,1,1);\n gp.add(weight,1,2);\n gp.add(turnRadius,1,3);\n gp.add(maxIncline,1,4);\n gp.add(battery,1,5);\n gp.add(batteryCapacity,1,6);\n\n // Add the buttons to the menu\n gp.add(save,0,7);\n gp.add(cancel,2,7);\n gp.add(clear,1,7);\n\n gp.setHgap(10);\n gp.setVgap(20);\n gp.setAlignment(Pos.CENTER);\n\n // If the save button is pressed\n save.setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n // If a name has not been set\n if(name.getText().isEmpty()){\n System.out.println(\"Missing name for UAV\");\n }else {\n File file = new File(\"src/uavs/\"+name.getText()+\".uav\");\n if(file.exists()){\n dialogMessage.setText(\"The filename \"+ name.getText() +\n \".uav already exists in \"+path+\".\\n Would you like to overwrite?\");\n dialog.show();\n }else {\n writeUAV(); // Write the UAV settings\n createStage.close();\n }\n }\n }\n });\n\n // Close the menu\n cancel.setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n createStage.close();\n }\n });\n\n // Clear all text fields\n clear.setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n name.clear();\n weight.clear();\n turnRadius.clear();\n maxIncline.clear();\n battery.clear();\n batteryCapacity.clear();\n }\n });\n\n createScene = new Scene(gp,500,700);\n createScene.setUserAgentStylesheet(\"style/menus.css\"); // Set the style of the menu\n createStage.setScene(createScene);\n createStage.show();\n }", "public void createGui(){\n\t\twindow = this.getContentPane(); \n\t\twindow.setLayout(new FlowLayout());\n\n\t\t//\tAdd \"panel\" to be used for drawing \n\t\t_panel = new ResizableImagePanel();\n\t\tDimension d= new Dimension(1433,642);\n\t\t_panel.setPreferredSize(d);\t\t \n\t\twindow.add(_panel);\n\n\t\t// A menu-bar contains menus. A menu contains menu-items (or sub-Menu)\n\t\tJMenuBar menuBar; // the menu-bar\n\t\tJMenu menu; // each menu in the menu-bar\n\n\t\tmenuBar = new JMenuBar();\n\t\t// First Menu\n\t\tmenu = new JMenu(\"Menu\");\n\t\tmenu.setMnemonic(KeyEvent.VK_A); // alt short-cut key\n\t\tmenuBar.add(menu); // the menu-bar adds this menu\n\n\t\tmenuItem1 = new JMenuItem(\"Fruit\", KeyEvent.VK_F);\n\t\tmenu.add(menuItem1); // the menu adds this item\n\n\t\tmenuItem2 = new JMenuItem(\"Pacman\", KeyEvent.VK_S);\n\t\tmenu.add(menuItem2); // the menu adds this item\n\t\tmenuItem3 = new JMenuItem(\"Run\");\n\t\tmenu.add(menuItem3); // the menu adds this item \n\t\tmenuItem4 = new JMenuItem(\"Save Game\");\n\t\tmenu.add(menuItem4); // the menu adds this item\n\n\t\tmenuItem5 = new JMenuItem(\"Open Game\");\n\t\tmenu.add(menuItem5); // the menu adds this item\n\t\tmenuItem6 = new JMenuItem(\"Clear Game\");\n\t\tmenu.add(menuItem6); // the menu adds this item\n\t\tmenuItem1.addActionListener(this);\n\t\tmenuItem2.addActionListener(this);\n\t\tmenuItem3.addActionListener(this);\n\t\tmenuItem4.addActionListener(this);\n\t\tmenuItem5.addActionListener(this);\n\t\tmenuItem6.addActionListener(this);\n\n\t\tsetJMenuBar(menuBar); // \"this\" JFrame sets its menu-bar\n\t\t// panel (source) fires the MouseEvent.\n\t\t//\tpanel adds \"this\" object as a MouseEvent listener.\n\t\t_panel.addMouseListener(this);\n\t}", "public CovidGUI(){\n initComponents();\n }", "public GUI(){\n lifeCount = new Picture[5];\n for(int i = 0; i < lifeCount.length; i++){\n lifeCount[i] = new Picture(SimpleGfxGrid.PADDINGX + 672,9, \"sprites/lives/LIFE\" +i+\".png\");\n }\n vaccine = new Picture[2];\n vaccine[0] = new Picture(SimpleGfxGrid.PADDINGX + 636,38,\"sprites/powerups/Vaccine.png\");\n vaccine[1] = new Picture(SimpleGfxGrid.PADDINGX + 637,72,\"sprites/powerups/Vaccine.png\");\n\n heart = new Picture(SimpleGfxGrid.PADDINGX + 636,7, \"sprites/lives/heart.png\");\n\n mask = new Picture(SimpleGfxGrid.PADDINGX + 637, 9, \"sprites/powerups/Mask.png\");\n mask.grow(5, 2);\n\n timerNum = new Picture[3][10];\n for(int i = 0; i < 3; i++){\n for(int j = 0; j<10; j++)\n timerNum[i][j] = new Picture(SimpleGfxGrid.PADDINGX + 690 + (36*i),64,\"sprites/numbers/num\"+j+\n \".png\");\n }\n }", "private static void createGUI(){\n DrawingArea drawingArea = new DrawingArea();\n ToolSelect utilityBar = new ToolSelect();\n MenuBar menuBar = new MenuBar();\n JFrame.setDefaultLookAndFeelDecorated(true);\n JFrame frame = new JFrame(\"GUIMk1\");\n frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );\n frame.setLayout(new BorderLayout());\n frame.getContentPane().add(utilityBar, BorderLayout.WEST);\n frame.getContentPane().add(menuBar,BorderLayout.NORTH);\n frame.getContentPane().add(drawingArea);\n frame.setLocationRelativeTo( null );\n frame.setVisible(true);\n frame.pack();\n\n }", "public soal2GUI() {\n initComponents();\n }", "public void makeScoringOptions() {\n ScoringOptionsGUI scoringOptionsGUI = new ScoringOptionsGUI(player);\n scoringOptionsGUI.setTitle(\"Yahtzee!\");\n scoringOptionsGUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n scoringOptionsGUI.setSize(new Dimension(900, 750));\n scoringOptionsGUI.setVisible(true);\n dispose();\n }", "private static void createAndShowGUI() {\n\t\tgui = new GUI();\n\t}", "public void makeGUI()\n\t{\n\t\tbuttonPanel = new ButtonPanel(this,ship,planet);\n\t\tgamePanel = new GamePanel(this,ship,planet);\n\n\t\tJMenuBar menubar = new JMenuBar();\n\t\tJMenu menuHelp = new JMenu(\"Help\");\n\t\thelpItem = new JMenuItem(\"Help\");\n\t\tmenuHelp.add(helpItem);\n\t\tmenubar.add(menuHelp);\n\t\tsetJMenuBar(menubar);\n\n\t\tsounds = new AudioClip[2];\n\n\t\ttry\n\t\t{\n\t\t\turl = new URL(getCodeBase() + \"/thrust.au\");\n\t\t\tsounds[0] = Applet.newAudioClip(url);\n\t\t\turl = new URL(getCodeBase() + \"/crash.au\");\n\t\t\tsounds[1] = Applet.newAudioClip(url);\n\t\t}\n\t\tcatch(Exception e){}\n\n\t\thelpItem.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tif(e.getSource() == helpItem)\n\t\t\t\t{\n\t\t\t\t\tString helpMessage = \"The goal of the game is to land\\nthe ship on the red lines (pads).\\nThe ship must be completely contained\\nwithin the bounds of the red pad.\\nThere are 10 levels total\\nand you will have a certain amount\\nof time to complete each level.\\nGood Landing: velocities must be <10\\nOK Landing: velocities must be <20\\nThe ship's bottom must be facing the ground.\";\n\t\t\t\t\tJOptionPane.showMessageDialog(lander, helpMessage, \"Help Display\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tgetContentPane().add(gamePanel, BorderLayout.PAGE_START);\n\t\tgetContentPane().add(buttonPanel, BorderLayout.PAGE_END);\n\t\tsetVisible(true);\n\t}", "private void builder(){\r\n //Objects\r\n //Left\r\n canvasStackPane.setAlignment(Pos.TOP_LEFT);\r\n left1HintButton = new Button(\"Hint\");\r\n left2Button = new Button(\"New Graph\");\r\n left3Button = new Button(\"New GameMode\");\r\n left4Button = new Button(\"New GraphMode\");\r\n left5Button = new Button(\"Finished\");\r\n leftRestLabel = new Label();\r\n //Up\r\n upperLeftButton = new Label(\"Menu\");\r\n upperLeftButton.setAlignment(Pos.CENTER);\r\n upper1Label = new Label();\r\n upper2Label = new Label();\r\n upper3Label = new Label();\r\n upperRestLabel = new Label();\r\n //calculateVectors\r\n backPane.setPickOnBounds(false);\r\n textFieldVertices.setPromptText(\"Vertices\");\r\n textFieldEdges.setPromptText(\"Edges\");\r\n gameEnd.setSpacing(30);\r\n gameEnd.setAlignment(Pos.CENTER);\r\n gameWinStackPane.setAlignment(Pos.CENTER);\r\n hBoxWin.setAlignment(Pos.CENTER);\r\n hBoxWin.setSpacing(30);\r\n canvasStackPane.setPickOnBounds(true);\r\n canvas.setPickOnBounds(true);\r\n canvas.getGraphicsContext2D().setLineWidth(2.5);\r\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public adivinaGUI() {\n initComponents();\n }", "private void createInstructionManual() {\n TextButton mainMenuButton = new TextButton(\"Main Menu\", skin);\n mainMenuButton.addListener(\n new ChangeListener() {\n @Override\n public void changed(ChangeEvent changeEvent, Actor actor) {\n game.setScreen(GdxGame.ScreenType.MAIN_MENU);\n }\n });\n\n\n Image bgImage = new Image(ServiceLocator.getResourceService()\n .getAsset(\"game-instruction/tutorialScreen_new.png\", Texture.class));\n bgImage.setScaling(Scaling.fit);\n buttonTable = new Table();\n buttonTable.setFillParent(true);\n buttonTable.top().left();\n buttonTable.add(mainMenuButton);\n\n bgTable = new Table();\n bgTable.setFillParent(true);\n bgTable.center();\n bgTable.add(bgImage);\n // add the board to the stage first so that its can be under of score data\n stage.addActor(bgTable);\n stage.addActor(buttonTable);\n\n\n }", "public void newGame()\n\t{\n\t\tthis.setVisible(false);\n\t\tthis.playingField = null;\n\t\t\n\t\tthis.playingField = new PlayingField(this);\n\t\tthis.setSize(new Dimension((int)playingField.getSize().getWidth()+7, (int)playingField.getSize().getHeight() +51));\n\t\tthis.setLocation(new Point(200,20));\n\t\tthis.setContentPane(playingField);\n\t\t\n\t\tthis.setVisible(true);\n\t}", "private static void createAndShowGUI() {\n //Create and set up the window.\n JFrame frame = new JFrame(\"WAR OF MINE\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n //Create and set up the content pane.\n JComponent newContentPane = new Gameframe();\n newContentPane.setOpaque(true); //content panes must be opaque\n frame.setContentPane(newContentPane);\n\n //Display the window.\n frame.setSize(800,1000);\n frame.setVisible(true);\n }", "private static void createAndShowGUI() {\r\n //Disable boldface controls.\r\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE); \r\n\r\n //Create and set up the window.\r\n JFrame frame = new JFrame(\"Exertion Scripting\");\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\r\n //Create and set up the content pane.\r\n NetletEditor newContentPane = new NetletEditor(null);\r\n newContentPane.setOpaque(true); //content panes must be opaque\r\n frame.setContentPane(newContentPane);\r\n\r\n //Display the window.\r\n frame.pack();\r\n frame.setVisible(true);\r\n }", "private void createAndShowGUI() {\n /**\n * MENUBAR\n */\n JMenuBar menuBar = new JMenuBar();\n\n JMenu menuStart = new JMenu(\"Program\");\n menuBar.add(menuStart);\n\n JMenuItem menuNewGame = new JMenuItem(\"Nová hra\");\n menuStart.add(menuNewGame);\n menuNewGame.addActionListener(new ActionListenerChangeCard(container, CardStartScreen));\n menuNewGame.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));\n\n JMenuItem menuAbout = new JMenuItem(\"O autorovi\");\n menuStart.add(menuAbout);\n menuAbout.addActionListener(new ActionListenerChangeCard(container, CardAbout));\n menuAbout.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));\n\n JMenuItem menuQuit = new JMenuItem(\"Konec\");\n menuStart.add(menuQuit);\n menuQuit.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n dispose();\n }\n });\n menuQuit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_K, java.awt.event.InputEvent.CTRL_MASK));\n\n Font fMenu = menuStart.getFont().deriveFont(17f);\n menuStart.setFont(fMenu);\n menuNewGame.setFont(fMenu);\n menuAbout.setFont(fMenu);\n menuQuit.setFont(fMenu);\n\n this.setJMenuBar(menuBar);\n\n /**\n * START SCREEN\n */\n JPanel pStartScreen = new JPanel(new GridBagLayout());\n\n JButton bStartDivision = new JButton(\"Dělení\");\n pStartScreen.add(bStartDivision, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(25, 0, 25, 0), 25, 50));\n bStartDivision.addActionListener(new ActionListenerChangeCard(container, CardSettingsDivision));\n JButton bStartMultiplication = new JButton(\"Násobení\");\n pStartScreen.add(bStartMultiplication, new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(25, 0, 25, 0), 25, 50));\n bStartMultiplication.addActionListener(new ActionListenerChangeCard(container, CardSettingsMultiplication));\n\n Font fButton = bStartDivision.getFont().deriveFont(17f);\n bStartDivision.setFont(fButton);\n bStartMultiplication.setFont(fButton);\n\n container.add(pStartScreen, CardStartScreen);\n\n /**\n * SETTINGS INIT\n */\n JPanel pDivision = new JPanel();\n JLabel lDivident = new JLabel();\n JLabel lFactor = new JLabel();\n JRadioButton chdTens = new JRadioButton();\n JRadioButton chfUnits = new JRadioButton();\n JRadioButton chdHundreds = new JRadioButton();\n JRadioButton chfTens = new JRadioButton();\n JRadioButton chdThousands = new JRadioButton();\n JRadioButton chdMillions = new JRadioButton();\n JRadioButton chfCustom = new JRadioButton();\n JRadioButton chdCustom = new JRadioButton();\n JTextField tdCustom = new JTextField();\n JTextField tfCustom = new JTextField();\n\n JPanel pMultiplication = new JPanel();\n JLabel lmFactor = new JLabel();\n JRadioButton chmMilions = new JRadioButton();\n JRadioButton chmTens = new JRadioButton();\n JRadioButton chmThousands = new JRadioButton();\n JRadioButton chmHundreds = new JRadioButton();\n JRadioButton chmCustom = new JRadioButton();\n JTextField tmCustom = new JTextField();\n JRadioButton chmmUnits = new JRadioButton();\n JRadioButton chmmTens = new JRadioButton();\n JRadioButton chmmHundreds = new JRadioButton();\n JRadioButton chmmCustom = new JRadioButton();\n JTextField tmmCustom = new JTextField();\n\n Settings settingsDivision = new Settings(Settings.DIVISION);\n Settings settingsMultiplication = new Settings(Settings.MULTIPLICATION);\n\n /**\n * DIVISION SETTINGS\n */\n pDivision.setLayout(new GridBagLayout());\n\n final DivisionPanel dpanel = new DivisionPanel(container, settingsDivision);\n container.add(dpanel, CardDivision);\n\n JLabel ldNumberOfExcercises = new JLabel(\"Počet příkladů\");\n pDivision.add(ldNumberOfExcercises, Helper.gbc(0, 0, 1));\n\n JSlider sldNumberOfExcercises = new JSlider(JSlider.HORIZONTAL, 0, 30, 15);\n sldNumberOfExcercises.setMajorTickSpacing(5);\n sldNumberOfExcercises.setMinorTickSpacing(1);\n sldNumberOfExcercises.setPaintTicks(true);\n sldNumberOfExcercises.setPaintLabels(true);\n sldNumberOfExcercises.setPreferredSize(new Dimension(350, 75));\n sldNumberOfExcercises.addChangeListener(new ChangeListenerSettingsSlider(\"count\", settingsDivision));\n pDivision.add(sldNumberOfExcercises, Helper.gbc(0, 1, 2));\n\n ButtonGroup bgdSize = new ButtonGroup();\n lDivident.setText(\"Dělenec\");\n pDivision.add(lDivident, Helper.gbc(0, 2, 1, GridBagConstraints.NONE, GridBagConstraints.CENTER));\n chdTens.setText(\"Desítky\");\n chdTens.setSelected(true);\n chdTens.addActionListener(new ActionListenerSettings(99, \"divident\", settingsDivision, tdCustom));\n pDivision.add(chdTens, Helper.gbc(0, 3));\n chdHundreds.setText(\"Stovky\");\n chdHundreds.addActionListener(new ActionListenerSettings(999, \"divident\", settingsDivision, tdCustom));\n pDivision.add(chdHundreds, Helper.gbc(0, 4));\n chdThousands.setText(\"Tisíce\");\n chdThousands.addActionListener(new ActionListenerSettings(9999, \"divident\", settingsDivision, tdCustom));\n pDivision.add(chdThousands, Helper.gbc(0, 5));\n chdMillions.setText(\"Miliony\");\n chdMillions.addActionListener(new ActionListenerSettings(9999999, \"divident\", settingsDivision, tdCustom));\n pDivision.add(chdMillions, Helper.gbc(0, 6));\n chdCustom.setText(\"Vlastní\");\n chdCustom.addActionListener(new ActionListenerSettings(-1, \"divident\", settingsDivision, tdCustom));\n pDivision.add(chdCustom, Helper.gbc(0, 7));\n tdCustom.setText(\"9\");\n tdCustom.setEnabled(false);\n tdCustom.setPreferredSize(new Dimension(100, 25));\n tdCustom.getDocument().addDocumentListener(new DocumentListenerSettingsText(\"divident\", settingsDivision, tdCustom));\n pDivision.add(tdCustom, Helper.gbc(0, 8, 1, GridBagConstraints.NONE, GridBagConstraints.LINE_START, new Insets(0, 0, 0, 75)));\n bgdSize.add(chdTens);\n bgdSize.add(chdHundreds);\n bgdSize.add(chdThousands);\n bgdSize.add(chdMillions);\n bgdSize.add(chdCustom);\n\n ButtonGroup bgfSize = new ButtonGroup();\n lFactor.setText(\"Dělitel\");\n pDivision.add(lFactor, Helper.gbc(1, 2, 1, GridBagConstraints.NONE, GridBagConstraints.CENTER));\n chfUnits.setText(\"Jednotky\");\n chfUnits.setSelected(true);\n chfUnits.addActionListener(new ActionListenerSettings(9, \"factor\", settingsDivision, tfCustom));\n pDivision.add(chfUnits, Helper.gbc(1, 3));\n chfTens.setText(\"Desítky\");\n chfTens.addActionListener(new ActionListenerSettings(99, \"factor\", settingsDivision, tfCustom));\n pDivision.add(chfTens, Helper.gbc(1, 4));\n chfCustom.setText(\"Vlastní\");\n chfCustom.addActionListener(new ActionListenerSettings(-1, \"factor\", settingsDivision, tfCustom));\n pDivision.add(chfCustom, Helper.gbc(1, 7));\n tfCustom.setText(\"9\");\n tfCustom.setEnabled(false);\n tfCustom.setPreferredSize(new Dimension(100, 25));\n tfCustom.getDocument().addDocumentListener(new DocumentListenerSettingsText(\"factor\", settingsDivision, tfCustom));\n pDivision.add(tfCustom, Helper.gbc(1, 8, 1, GridBagConstraints.NONE, GridBagConstraints.LINE_START, new Insets(0, 0, 0, 75)));\n bgfSize.add(chfUnits);\n bgfSize.add(chfTens);\n bgfSize.add(chfCustom);\n\n JButton bdStart = new JButton(\"Spustit dělení\");\n bdStart.setFont(fButton);\n bdStart.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent e) {\n ((CardLayout) container.getLayout()).show(container, CardDivision);\n dpanel.reset();\n }\n });\n pDivision.add(bdStart, Helper.gbc(0, 9, 2, GridBagConstraints.BOTH, GridBagConstraints.LINE_START, new Insets(25, 0, 0, 0)));\n\n Font fLabel = lDivident.getFont().deriveFont(16f);\n lDivident.setFont(fLabel);\n lFactor.setFont(fLabel);\n ldNumberOfExcercises.setFont(fLabel);\n\n Font fRadio = chdTens.getFont().deriveFont(14f);\n chdTens.setFont(fRadio);\n chdHundreds.setFont(fRadio);\n chdThousands.setFont(fRadio);\n chdMillions.setFont(fRadio);\n chdCustom.setFont(fRadio);\n\n chfUnits.setFont(fRadio);\n chfTens.setFont(fRadio);\n chfCustom.setFont(fRadio);\n\n container.add(pDivision, CardSettingsDivision);\n\n /**\n * MULTIPLICATION SETTINGS\n */\n pMultiplication.setLayout(new java.awt.GridBagLayout());\n\n final MultiplicationPanel mpanel = new MultiplicationPanel(container, settingsMultiplication);\n container.add(mpanel, CardMultiplication);\n\n JLabel lmNumberOfExcercises = new JLabel(\"Počet příkladů\");\n lmNumberOfExcercises.setFont(fLabel);\n pMultiplication.add(lmNumberOfExcercises, Helper.gbc(0, 0, 1));\n\n JSlider slmNumberOfExcercises = new JSlider(JSlider.HORIZONTAL, 0, 30, 15);\n slmNumberOfExcercises.setMajorTickSpacing(5);\n slmNumberOfExcercises.setMinorTickSpacing(1);\n slmNumberOfExcercises.setPaintTicks(true);\n slmNumberOfExcercises.setPaintLabels(true);\n slmNumberOfExcercises.setPreferredSize(new Dimension(350, 75));\n slmNumberOfExcercises.addChangeListener(new ChangeListenerSettingsSlider(\"count\", settingsMultiplication));\n pMultiplication.add(slmNumberOfExcercises, Helper.gbc(0, 1, 2));\n\n ButtonGroup bgmSize = new ButtonGroup();\n lmFactor.setText(\"Činitelé\");\n lmFactor.setFont(fLabel);\n pMultiplication.add(lmFactor, Helper.gbc(0, 2));\n chmTens.setText(\"Desítky\");\n chmTens.setSelected(true);\n chmTens.addActionListener(new ActionListenerSettings(99, \"multiple\", settingsMultiplication, tmCustom));\n pMultiplication.add(chmTens, Helper.gbc(0, 3));\n chmHundreds.setText(\"Stovky\");\n chmHundreds.addActionListener(new ActionListenerSettings(999, \"multiple\", settingsMultiplication, tmCustom));\n pMultiplication.add(chmHundreds, Helper.gbc(0, 4));\n chmThousands.setText(\"Tisíce\");\n chmThousands.addActionListener(new ActionListenerSettings(9999, \"multiple\", settingsMultiplication, tmCustom));\n pMultiplication.add(chmThousands, Helper.gbc(0, 5));\n chmMilions.setText(\"Miliony\");\n chmMilions.addActionListener(new ActionListenerSettings(99999999, \"multiple\", settingsMultiplication, tmCustom));\n pMultiplication.add(chmMilions, Helper.gbc(0, 6));\n chmCustom.setText(\"Vlastní\");\n chmCustom.addActionListener(new ActionListenerSettings(-1, \"multiple\", settingsMultiplication, tmCustom));\n pMultiplication.add(chmCustom, Helper.gbc(0, 7));\n tmCustom.setText(\"9\");\n tmCustom.setEnabled(false);\n tmCustom.setPreferredSize(new Dimension(100, 25));\n tmCustom.getDocument().addDocumentListener(new DocumentListenerSettingsText(\"multiple\", settingsMultiplication, tmCustom));\n pMultiplication.add(tmCustom, Helper.gbc(0, 8, 1, GridBagConstraints.NONE, GridBagConstraints.LINE_START, new Insets(0, 0, 0, 75)));\n bgmSize.add(chmMilions);\n bgmSize.add(chmTens);\n bgmSize.add(chmHundreds);\n bgmSize.add(chmThousands);\n bgmSize.add(chmCustom);\n\n ButtonGroup bgmmSize = new ButtonGroup();\n chmmUnits.setText(\"Jednotky\");\n chmmUnits.setSelected(true);\n chmmUnits.addActionListener(new ActionListenerSettings(9, \"multiplebottom\", settingsMultiplication, tmmCustom));\n pMultiplication.add(chmmUnits, Helper.gbc(1, 3));\n chmmTens.setText(\"Desítky\");\n chmmTens.addActionListener(new ActionListenerSettings(99, \"multiplebottom\", settingsMultiplication, tmmCustom));\n pMultiplication.add(chmmTens, Helper.gbc(1, 4));\n chmmHundreds.setText(\"Stovky\");\n chmmHundreds.addActionListener(new ActionListenerSettings(999, \"multiplebottom\", settingsMultiplication, tmmCustom));\n pMultiplication.add(chmmHundreds, Helper.gbc(1, 5));\n chmmCustom.setText(\"Vlastní\");\n chmmCustom.addActionListener(new ActionListenerSettings(-1, \"multiplebottom\", settingsMultiplication, tmmCustom));\n pMultiplication.add(chmmCustom, Helper.gbc(1, 7));\n tmmCustom.setText(\"9\");\n tmmCustom.setEnabled(false);\n tmmCustom.setPreferredSize(new Dimension(100, 25));\n tmmCustom.getDocument().addDocumentListener(new DocumentListenerSettingsText(\"multiplebottom\", settingsMultiplication, tmmCustom));\n pMultiplication.add(tmmCustom, Helper.gbc(1, 8, 1, GridBagConstraints.NONE, GridBagConstraints.LINE_START, new Insets(0, 0, 0, 75)));\n bgmmSize.add(chmmUnits);\n bgmmSize.add(chmmTens);\n bgmmSize.add(chmmHundreds);\n bgmmSize.add(chmmCustom);\n\n JButton bmStart = new JButton(\"Spustit násobení\");\n bmStart.setFont(fButton);\n bmStart.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent e) {\n ((CardLayout) container.getLayout()).show(container, CardMultiplication);\n mpanel.reset();\n }\n });\n pMultiplication.add(bmStart, Helper.gbc(0, 9, 2, GridBagConstraints.BOTH, GridBagConstraints.LINE_START, new Insets(25, 0, 0, 0)));\n\n chmMilions.setFont(fRadio);\n chmTens.setFont(fRadio);\n chmHundreds.setFont(fRadio);\n chmThousands.setFont(fRadio);\n chmCustom.setFont(fRadio);\n\n chmmUnits.setFont(fRadio);\n chmmTens.setFont(fRadio);\n chmmHundreds.setFont(fRadio);\n chmmCustom.setFont(fRadio);\n\n container.add(pMultiplication, CardSettingsMultiplication);\n\n /**\n * ABOUT\n */\n JPanel pAbout = new JPanel(new GridBagLayout());\n JLabel laVersion = new JLabel(\"Verze: 1.0.0\");\n pAbout.add(laVersion, Helper.gbc(0, 0));\n JLabel laAuthor = new JLabel(\"Copyright (C) 2014 Ondřej Švec\");\n pAbout.add(laAuthor, Helper.gbc(0, 1));\n JButton baHomepage = new JButton(\"<HTML>Homepage: <FONT color=\\\"#000099\\\"><U>http://svecon.cz/</U></FONT></HTML>\");\n baHomepage.setBorderPainted(false);\n baHomepage.setBackground(new Color(0xEEEEEE));\n baHomepage.setToolTipText(\"http://svecon.cz/\");\n baHomepage.addActionListener(new ActionListener() {\n\n @Override\n public void actionPerformed(ActionEvent ae) {\n if (Desktop.isDesktopSupported()) {\n try {\n Desktop.getDesktop().browse(new URI(\"http://svecon.cz/\"));\n } catch (IOException | URISyntaxException e) {\n }\n } else {\n }\n }\n });\n pAbout.add(baHomepage, Helper.gbc(0, 2));\n\n container.add(pAbout, CardAbout);\n }", "public InventoryGUI() {\n initComponents();\n }", "public TrainModelGUI CreateNewGUI() {\n //Create a GUI object\n \ttrainModelGUI = new TrainModelGUI(this);\n \tsetValuesForDisplay();\n \treturn trainModelGUI;\n }", "private void initGUI(){\n this.currentBlock = 0;\n this.setSpawnToggle = false;\n this.editorState = 0;\n this.tempAreaPos = new Vector3Int();\n this.tempAreaSet = new Vector3Int();\n \n //Crosshair\n BitmapText crosshair = new BitmapText(guiFont);\n crosshair.setText(\"+\");\n crosshair.setSize(guiFont.getCharSet().getRenderedSize() * 2);\n crosshair.setLocalTranslation(\n (settings.getWidth() / 2) - (guiFont.getCharSet().getRenderedSize() / 3 * 2),\n (settings.getHeight() / 2) + (crosshair.getLineHeight() / 2), 0);\n guiNode.attachChild(crosshair);\n //Instructions\n BitmapText instructionsText1 = new BitmapText(guiFont);\n instructionsText1.setText(\"Movement: WASD\");\n instructionsText1.setLocalTranslation(0, settings.getHeight(), 0);\n guiNode.attachChild(instructionsText1);\n BitmapText instructionsText2 = new BitmapText(guiFont);\n instructionsText2.setText(\"Stats Screen Toogle: F5\");\n instructionsText2.setLocalTranslation(0, settings.getHeight() - instructionsText2.getLineHeight(), 0);\n guiNode.attachChild(instructionsText2);\n BitmapText instructionsText3 = new BitmapText(guiFont);\n instructionsText3.setText(\"Jump: Spacebar\");\n instructionsText3.setLocalTranslation(0, settings.getHeight() - (2 * instructionsText3.getLineHeight()), 0);\n guiNode.attachChild(instructionsText3);\n \n BitmapText instructionsText4 = new BitmapText(guiFont);\n instructionsText4.setText(\"Quit: Esc\");\n instructionsText4.setLocalTranslation(0, settings.getHeight() - (3 * instructionsText3.getLineHeight()), 0);\n guiNode.attachChild(instructionsText4);\n \n BitmapText instructionsText5 = new BitmapText(guiFont);\n instructionsText5.setText(\"Version: v2 r2\");\n instructionsText5.setLocalTranslation(0, settings.getHeight() - (4 * instructionsText3.getLineHeight()), 0);\n guiNode.attachChild(instructionsText5);\n \n //CurrentBlock indicator\n currentBlockDisplay = new BitmapText(guiFont);\n //currentBlockDisplay.setText(\"Current Block: 0 - BLOCK_GRASS\");\n //currentBlockDisplay.setLocalTranslation(0, settings.getHeight() - (5 * instructionsText3.getLineHeight()), 0);\n //guiNode.attachChild(currentBlockDisplay);\n \n //CurrentZone indicator\n currentZoneDisplay = new BitmapText(guiFont);\n currentZoneDisplay.setText(\"Current Zone: Zone 1\");\n currentZoneDisplay.setLocalTranslation(0, settings.getHeight() - (5 * instructionsText3.getLineHeight()), 0);\n guiNode.attachChild(currentZoneDisplay);\n }", "private static void createAndShowGUI()\n {\n Sudoku s = new Sudoku();\n }", "private static void createGUI(){\r\n\t\tframe = new JFrame(\"Untitled\");\r\n\r\n\t\tBibtexImport bib = new BibtexImport();\r\n\t\tbib.setOpaque(true);\r\n\r\n\t\tframe.setExtendedState(JFrame.MAXIMIZED_BOTH);\r\n\t\tframe.setContentPane(bib);\r\n\t\tframe.setJMenuBar(bib.menu);\r\n\t\tframe.pack();\r\n\t\tframe.setVisible(true);\r\n\t}", "private void InitGUI() {\n\n\t\t//Configuraciones de la ventana principal\n\t\tcontenedor = getContentPane();\n\t\tcontenedor.removeAll();\n\t\tgetContentPane().setLayout(null);\n\t\tthis.setUndecorated(true);\n\t\tlistener = new ManejadorDeBotones();\n\t\tmanejadorDesplazamientoVentana(this);\n\n\t\t// Logo del sofa\n\t\tJLabel imagenSofa = new JLabel(\"\");\n\t\timagenSofa.setIcon(new ImageIcon(GUIMenuAdmin.class.getResource(\"/images/sofa.png\")));\n\t\timagenSofa.setBounds(199, 15, 120, 80);\n\t\tgetContentPane().add(imagenSofa);\n\n\t\t// Etiqueta para el nombre al ladpo del logo\n\t\tJLabel lblMueblesYMuebles = new JLabel(\" Muebles y Muebles\");\n\t\tlblMueblesYMuebles.setFont(font);\n\t\tlblMueblesYMuebles.setForeground(Color.WHITE);\n\t\tlblMueblesYMuebles.setBounds(390, 77, 152, 32);\n\t\tgetContentPane().add(lblMueblesYMuebles);\n\n\t\t// Etiqueta para el logo XYZ\n\t\tJLabel imagenLogo = new JLabel(\"\");\n\t\timagenLogo.setIcon(\n\t\t\t\tnew ImageIcon(GUIMenuAdmin.class.getResource(\"/images/logo_blanco.png\")));\n\t\timagenLogo.setBounds(288, 23, 213, 82);\n\t\tgetContentPane().add(imagenLogo);\n\n\t\t//Boton para inicial crear ordenes de trabajo\n\t\tcrearOrden = new JButton(\"CREAR\");\n\t\tcrearOrden.setForeground(SystemColor.textHighlight);\n\t\tcrearOrden.setVerticalTextPosition(SwingConstants.BOTTOM);\n\t\tcrearOrden.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\tcrearOrden.setIcon(new ImageIcon(GUIMenuAdmin.class.getResource(\"/images/orden_crear.png\")));\n\t\tcrearOrden.setFocusPainted(false);\n\t\tcrearOrden.setBorderPainted(false);\n\t\tcrearOrden.setOpaque(true);\n\t\tcrearOrden.setBackground(new Color(227, 227, 227));\n crearOrden.setFont(font);\n crearOrden.setBounds(117, 219, 140, 120);\n crearOrden.addActionListener(listener);\n getContentPane().add(crearOrden);\n\n\t\t//Boton para modificar ordenes de trabajo\n\t\tmodificarOrden = new JButton(\"MODIFICAR\");\n\t\tmodificarOrden.setForeground(SystemColor.textHighlight);\n\t\tmodificarOrden.setVerticalTextPosition(SwingConstants.BOTTOM);\n\t\tmodificarOrden.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\tmodificarOrden.setIcon(new ImageIcon(GUIMenuAdmin.class.getResource(\"/images/orden_editar.png\")));\n\t\tmodificarOrden.setFocusPainted(false);\n\t\tmodificarOrden.setBorderPainted(false);\n\t\tmodificarOrden.setOpaque(true);\n\t\tmodificarOrden.setBackground(new Color(227, 227, 227));\n\t\tmodificarOrden.setFont(font);\n\t\tmodificarOrden.setBounds(267, 219, 140, 120);\n modificarOrden.addActionListener(listener);\n getContentPane().add(modificarOrden);\n\n\t\t//Boton para inicial la actualizacion de los usuarios\n\t\tconsultarOrden = new JButton(\"CONSULTAR\");\n\t\tconsultarOrden.setForeground(SystemColor.textHighlight);\n\t\tconsultarOrden.setVerticalTextPosition(SwingConstants.BOTTOM);\n\t\tconsultarOrden.setHorizontalTextPosition(SwingConstants.CENTER);\n\t\tconsultarOrden.setIcon(new ImageIcon(GUIMenuAdmin.class.getResource(\"/images/orden_buscar.png\")));\n\t\tconsultarOrden.setFocusPainted(false);\n\t\tconsultarOrden.setBorderPainted(false);\n\t\tconsultarOrden.setOpaque(true);\n\t\tconsultarOrden.setBackground(new Color(227, 227, 227));\n\t\tconsultarOrden.setFont(font);\n\t\tconsultarOrden.setBounds(417, 219, 140, 120);\n consultarOrden.addActionListener(listener);\n getContentPane().add(consultarOrden);\n\n //Boton salir\n\t\tsalir = new JButton(\"\");\n\t\tsalir.setIcon(new ImageIcon(GUIMenuAdmin.class.getResource(\"/images/salir.png\")));\n\t\tsalir.setBorderPainted(false);\n\t\tsalir.setBorder(null);\n\t\tsalir.setMargin(new Insets(0, 0, 0, 0));\n\t\tsalir.setContentAreaFilled(false);\n\t\tsalir.addActionListener(listener);\n\t\tsalir.setBounds(588, 411, 81, 59);\n\t\tgetContentPane().add(salir);\n\n\t\t//-- Eriqueta --//\n\t\tlabel_1 = new JLabel(\"ORDENES DE TRABAJO\");\n\t\tlabel_1.setForeground(SystemColor.textHighlight);\n\t\tlabel_1.setFont(font);\n\t\tlabel_1.setBounds(117, 192, 140, 14);\n\t\tgetContentPane().add(label_1);\n\n\t\t//-- Separadores --//\n\t\tseparator_1 = new JSeparator();\n\t\tseparator_1.setForeground(SystemColor.textHighlight);\n\t\tseparator_1.setBackground(new Color(255, 255, 255));\n\t\tseparator_1.setBounds(260, 199, 297, 9);\n\t\tgetContentPane().add(separator_1);\n\t\t\n\t\t//Etiqueta salir\n\t\tlblSalir = new JLabel(\"SALIR\");\n\t\tlblSalir.setHorizontalAlignment(SwingConstants.CENTER);\n\t\tlblSalir.setForeground(SystemColor.textHighlight);\n\t\tlblSalir.setFont(new Font(\"Tahoma\", Font.PLAIN, 14));\n\t\tlblSalir.setBounds(597, 391, 49, 14);\n\t\tgetContentPane().add(lblSalir);\n\t\t//Etiqueta superior azul\n\t\tJLabel fondoAzul = new JLabel(\"\");\n\t\tfondoAzul.setOpaque(true);\n\t\tfondoAzul.setBackground(new Color(45, 118, 232));// azul #2D76E8\n\t\tfondoAzul.setBounds(0, 0, 679, 120);\n\t\tgetContentPane().add(fondoAzul);\n\n\t\t//Titulo para tipo de usuario\n\t\tJLabel titulo = new JLabel(\"JEFE DE TALLER\");\n\t\ttitulo.setFont(new Font(\"Tahoma\", Font.BOLD, 16));\n\t\ttitulo.setForeground(SystemColor.textHighlight);\n\t\ttitulo.setBounds(417, 146, 140, 21);\n\t\tgetContentPane().add(titulo);\n\n\t\t\n\t\t// Etiqueta principal blanca\n\t\tJLabel fondoBlanco = new JLabel(\"\");\n\t\tfondoBlanco.setOpaque(true);\n\t\tfondoBlanco.setBackground(new Color(255, 255, 255));\n\t\tfondoBlanco.setBounds(0, 120, 679, 377);\n\t\tgetContentPane().add(fondoBlanco);\n\n\t\t//Configuraciones adicionales de la ventana principal\n\t\tsetSize(679, 497);\n\t\tsetResizable(false);\n\t\tsetVisible(true);\n\t\tsetLocationRelativeTo(null);\n\t\tsetShape(new java.awt.geom.RoundRectangle2D.Double(0, 0, getWidth(), getHeight(), 5, 5));\n\n }", "private GUI()\n {\n makeGUI();\n }", "private void createdComponent() {\r\n\r\n\t\tloadImage();\r\n\t\tresizeImage();\r\n\t\ttry {\r\n\t\t\tif (customFont == null) {\r\n\t\t\t\tcustomFont = FontLoader.getInstance().getXenipa();\r\n\t\t\t\tif (customFont == null) {\r\n\t\t\t\t\tcustomFont = new FontLoader().importFont();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (FontFormatException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t} catch (IOException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (InstantiationException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IllegalAccessException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (UnsupportedLookAndFeelException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tthis.init();\r\n\t\tthis.createpanel1();\r\n\t\tthis.createpanel2();\r\n\t\tthis.createpanel3();\r\n\t\tthis.createpanel4();\r\n\t\tthis.revalidate();\r\n\t}", "public void createChooseGameUI()\n {\n \tHashMap<InventoryRunnable, InventoryItem> inventoryStuff = new HashMap<InventoryRunnable, InventoryItem>();\n \t\n \tInventoryRunnable gladiatorJoinRunnable = new GladiatorJoinInventoryRunnable(plugin);\n \t\n \tArrayList<String> gladiatorLore = new ArrayList<String>();\n \tgladiatorLore.add(\"FIGHT TO THE DEATH AND WIN YOUR FREEDOM\");\n \tgladiatorLore.add(\"GOOD LUCK WARRIOR!\");\n \tInventoryItem gladiatorItem = new InventoryItem(plugin, Material.SHIELD, \"GLADIATOR\", gladiatorLore, 1, true, 1);\n \tinventoryStuff.put(gladiatorJoinRunnable, gladiatorItem);\n \t\n \tchooseGameUI = new GUIInventory(plugin, \"MINIGAMES\", inventoryStuff, 3);\n }", "public BoardGUI()\n {\n setBackground(Color.GRAY);\n setLayout(null);\n }", "private void initGUI(){\n setDefaultCloseOperation(EXIT_ON_CLOSE);\r\n setLayout(new GridLayout(3,1));\r\n setSize(896,504);\r\n setLocation(150,80);\r\n\r\n\r\n\r\n //Setting background img\r\n try{\r\n backGroundImg = javax.imageio.ImageIO.read(new File(\"MenuBackGround.jpg\"));\r\n setContentPane(new JPanel(new GridLayout(3,1)){\r\n @Override public void paintComponent(Graphics graphics){\r\n graphics.drawImage(backGroundImg,0,0,getWidth(),getHeight(),null);\r\n }\r\n });\r\n }catch(IOException ioe){\r\n System.out.println(\"Background image not found!\");\r\n }\r\n\r\n //Setting logo img\r\n try{\r\n logoImg = javax.imageio.ImageIO.read(new File(\"QuizAppLogo.jpg\"));\r\n logoLabel = new JLabel(new ImageIcon(logoImg));\r\n }catch (IOException ioe){\r\n System.out.println(\"Logo img not found!\");\r\n }\r\n\r\n //Setting-up the buttons\r\n solve = new JButton(Language.SOLVE_BUTTON_TEXT);\r\n solve.addActionListener(new SolveAction(this));\r\n\r\n create = new JButton(Language.CREATE_BUTTON_TEXT);\r\n create.addActionListener(new CreateAction());\r\n\r\n options = new JButton(Language.OPTIONS_BUTTON_TEXT);\r\n options.setEnabled(false);\r\n\r\n\r\n //Joining them all together\r\n buttonsPanel = new JPanel(new GridLayout(3,1));\r\n buttonsPanel.setOpaque(false);\r\n buttonsPanel.add(solve);\r\n buttonsPanel.add(create);\r\n //buttonsPanel.add(options);\r\n\r\n topPanel = new JPanel(new GridLayout(1,3));\r\n topPanel.add(logoLabel);\r\n topPanel.add(Box.createHorizontalGlue());\r\n topPanel.add(buttonsPanel);\r\n topPanel.setOpaque(false);\r\n\r\n\r\n\r\n add(topPanel);\r\n add(Box.createVerticalGlue());\r\n add(Box.createVerticalGlue());\r\n setVisible(true);\r\n }", "public void makeScorecard() {\n ScorecardGUI scorecardGUI = new ScorecardGUI(this);\n pack(); // temporarily resize the JFrame so that the scorecard can be seen\n setSize(new Dimension(900, 750)); // reset the size of the frame to its original dimensions\n }", "public void createAndShowGUI() {\n\t\tcontroller = new ControllerClass(); \r\n\r\n\t\t// Create and set up the window\r\n\t\twindowLookAndFeel();\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tsetTitle(\"Media Works - Add Screen\");\r\n\t\tsetResizable(false);\r\n\t\tadd(componentSetup());\r\n\t\tpack();\r\n\t\tsetSize(720,540);\r\n\t\tsetLocationRelativeTo(null);\r\n\t\tsetVisible(true);\r\n\t}", "public NewGameGUI(){\n\t \n super(\"Start New Game\");\n try{\n \n ObjectInputStream groupInput;\n ObjectInputStream courseInput;\n \n \n \t groupInput = new ObjectInputStream(\n \t\t\t Files.newInputStream(Paths.get(\"group.ser\")));\n \t courseInput = new ObjectInputStream(\n \t\t\t Files.newInputStream(Paths.get(\"course.ser\")));\n \t Group group = (Group) groupInput.readObject();\n \t GolfCourse course = (GolfCourse) courseInput.readObject();\n \t if (groupInput != null && courseInput != null){\n \t\t groupInput.close();\n \t\t courseInput.close();\n \t }\n \t\t \n \t \n \n \n String[] stringArray = new String[group.getPlayers().size()];\n \n for(int i = 0; i < group.getPlayers().size(); i++){\n \t String str = String.format(\"Please enter %s 's scores seperated by a space\", group.getPlayers().get(i).getName());\n \t stringArray[i] = JOptionPane.showInputDialog(str);\n }\n \n \n FlowLayout layout = new FlowLayout(); \n Container container = getContentPane(); // get container to layout\n setLayout(layout);\n \n \n // set up nassau and register listener\n JButton nassau = new JButton(\"Score Nassau\");\n add(nassau); // add left button to frame\n nassau.addActionListener(\n new ActionListener() // anonymous inner class\n {\n // process nassau event\n @Override \n public void actionPerformed(ActionEvent event){\n \t\n \tNassau game = new Nassau(course, group);\n \t\n \tfor (int i = 0; i < stringArray.length; i++){\n \t\tint[] integerArray = new int[18];\n \t\tScanner input = new Scanner(stringArray[i]);\n \t\tfor (int x = 0; x < 18; x++){\n \t\t\tintegerArray[x] = input.nextInt();\n \t\t}\n \t\tgame.setIndividualScore(i, integerArray);\n \t}\t\n \t\n \tgame.calculateGameScore();\n \tint[][] points= game.getNassauPointsPerPlayer();\n \tString string =\"\";\n \tfor(int i = 0; i < group.getPlayers().size(); i++){\n \t\tstring = string + String.format(\"Player %s points: Front Nine: %d Back Nine: %d %n\",\n \t\t\t\tgroup.getPlayers().get(i).getName(), points[i][0], points[i][1] );\n \t}\n \tJOptionPane.showMessageDialog(null, string);\n }\n }\n );\n \n // set up stableFord button and register listener\n JButton stableFord = new JButton(\"Score Stableford Game\");\n add(stableFord); // add center button to frame\n stableFord.addActionListener(\n new ActionListener() // anonymous inner class\n {\n // process newGame button event\n @Override\n public void actionPerformed(ActionEvent event){\n \t\n \tStableFord game = new StableFord(course, group);\n \t\n \tfor (int i = 0; i < stringArray.length; i++){\n \t\tint[] integerArray = new int[18];\n \t\tScanner input = new Scanner(stringArray[i]);\n \t\tfor (int x = 0; x < 18; x++){\n \t\t\tintegerArray[x] = input.nextInt();\n \t\t}\n \t\tgame.setIndividualScore(i, integerArray);\n \t} \n \t\n \tgame.calculateGameScore();\n \tint [] points = game.getArrayScore();\n \tString string =\"\";\n \tfor(int i = 0; i < group.getPlayers().size(); i++){\n \t\tstring = string + String.format(\"Player %s points: %d %n\",\n \t\t\t\tgroup.getPlayers().get(i).getName(), points[i] );\n \t}\n \tJOptionPane.showMessageDialog(null, string);\n }\n }\n ); \n \n }\n catch(IOException e){\n \t System.err.println(\"Error accessing file\");\n \t System.exit(1);\n }\n catch(ClassNotFoundException cnf){\n \t System.err.println(\"Invalid Object type. Terminating\");\n }\n }", "public void create() {\n\t\t// TODO Auto-generated method stub\n\t\tskin = new Skin(Gdx.files.internal(\"uiskin.json\"));\n\t\tstage = new Stage();\n\t\tfinal TextButton playButton = new TextButton(\"Play\", skin, \"default\"); // Creates button with label \"play\"\n\t\tfinal TextButton leaderboardButton = new TextButton(\"Leaderboards\", skin, \"default\"); // Creates button with\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// label \"leaderboards\"\n\t\tfinal TextButton optionsButton = new TextButton(\"Options\", skin, \"default\"); // Creates button with label\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"options\"\n\t\tfinal TextButton userInfoButton = new TextButton(\"User Info\", skin, \"default\");// Creates button with label\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"User Info\"\n\t\tfinal TextButton quitGameButton = new TextButton(\"Exit Game\", skin, \"default\");\n\n\t\t// Three lines below this set the widths of buttons using the constant widths\n\t\tplayButton.setWidth(Gdx.graphics.getWidth() / 3);\n\t\tleaderboardButton.setWidth(playButton.getWidth());\n\t\toptionsButton.setWidth(playButton.getWidth());\n\t\tuserInfoButton.setWidth(playButton.getWidth());\n\t\tquitGameButton.setWidth(playButton.getWidth());\n\n\t\t// Set the heights using constant height\n\t\tplayButton.setHeight(Gdx.graphics.getHeight() / 15);\n\t\tleaderboardButton.setHeight(playButton.getHeight());\n\t\toptionsButton.setHeight(playButton.getHeight());\n\t\tuserInfoButton.setHeight(playButton.getHeight());\n\t\tquitGameButton.setHeight(playButton.getHeight());\n\n\t\t// Sets positions for buttons\n\t\tplayButton.setPosition(Gdx.graphics.getWidth() / 20, Gdx.graphics.getHeight() / 3);\n\t\tleaderboardButton.setPosition(playButton.getX(), playButton.getY() - leaderboardButton.getHeight());\n\t\toptionsButton.setPosition(playButton.getX(), leaderboardButton.getY() - optionsButton.getHeight());\n\t\tuserInfoButton.setPosition(playButton.getX(), optionsButton.getY() - userInfoButton.getHeight());\n\t\tquitGameButton.setPosition(playButton.getX(), userInfoButton.getY() - quitGameButton.getHeight());\n\n\t\t// User Info Name and sign in/ sign out button at the top of the screen\n\t\tfinal Label userInfoLabel = new Label(\"HI GUYS: \" + Constants.user, skin, \"default\");\n\t\tfinal TextButton userSignButton = new TextButton(\"singin/out\", skin, \"default\");\n\t\tuserSignButton.setHeight(Gdx.graphics.getHeight() / 40);\n\t\tuserSignButton.setPosition(Gdx.graphics.getWidth() - userSignButton.getWidth(),\n\t\t\t\tGdx.graphics.getHeight() - userSignButton.getHeight());\n\t\tif (Constants.userID == 0)\n\t\t\tuserSignButton.setText(\"Sign In\");\n\t\telse\n\t\t\tuserSignButton.setText(\"Sign Out\");\n\t\tuserSignButton.addListener(new ClickListener() { // When Sign in/Sing out is pressed in the top right\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tif (Constants.userID == 0) { // If no one is signed in\n\t\t\t\t\tdispose();\n\t\t\t\t\tgame.setScreen(new UserInfoScreen(game));\n\t\t\t\t} else { // If a user is currently signed in\n\t\t\t\t\tConstants.userID = 0;\n\t\t\t\t\tConstants.user = \"Temporary User\";\n\t\t\t\t\tcreate();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tuserInfoLabel.setHeight(userSignButton.getHeight());\n\t\tuserInfoLabel.setPosition(Gdx.graphics.getWidth() - userInfoLabel.getWidth() - userSignButton.getWidth(),\n\t\t\t\tGdx.graphics.getHeight() - userInfoLabel.getHeight());\n\t\tstage.addActor(userInfoLabel);\n\t\tstage.addActor(userSignButton);\n\n\t\tplayButton.addListener(new ClickListener() { // This tells button what to do when clicked\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new LobbyScreen(game)); // Switch over to lobby screen\n\t\t\t}\n\t\t});\n\n\t\tleaderboardButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new LeaderboardScreen(game)); // Switch over to leaderboard screen\n\t\t\t}\n\t\t});\n\n\t\toptionsButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\t// Do some stuff when clicked\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new OptionsScreen(game));\n\n\t\t\t}\n\t\t});\n\n\t\tuserInfoButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new UserInfoScreen(game));\n\n\t\t\t}\n\t\t});\n\n\t\tquitGameButton.addListener(new ClickListener() {\n\t\t\t@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tGdx.app.exit();\n\t\t\t}\n\t\t});\n\n\t\t// Adds all buttons to stage to be rendered\n\t\tstage.addActor(playButton);\n\t\tstage.addActor(leaderboardButton);\n\t\tstage.addActor(optionsButton);\n\t\tstage.addActor(userInfoButton);\n\t\tstage.addActor(quitGameButton);\n\n\t\tGdx.input.setInputProcessor(stage);\n\t}", "public RegistroClientesGUI(){\n initComponents();\n obtenerSedes();\n \n //No olvidar agregar esto para agregarle las animaciones\n this.setLocationRelativeTo(null);\n\n this.setTitle(\"Empleados\");\n this.setResizable(false);\n \n \n }", "public void create() {\n connect();\n batch = new SpriteBatch();\n font = new BitmapFont();\n\n audioManager.preloadTracks(\"midlevelmusic.wav\", \"firstlevelmusic.wav\", \"finallevelmusic.wav\", \"mainmenumusic.wav\");\n\n mainMenuScreen = new MainMenuScreen(this);\n pauseMenuScreen = new PauseMenuScreen(this);\n settingsScreen = new SettingsScreen(this);\n completeLevelScreen = new CompleteLevelScreen(this);\n completeGameScreen = new CompleteGameScreen(this);\n\n setScreen(mainMenuScreen);\n }", "public void initGui()\r\n\t{\r\n\t\tthis.viewportTexture = new DynamicTexture(256, 256);\r\n\t\tthis.backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation(\"background\", this.viewportTexture);\r\n\t\tthis.widthCopyright = this.fontRenderer.getStringWidth(\"Copyright Mojang AB. Do not distribute!\");\r\n\t\tthis.widthCopyrightRest = this.width - this.widthCopyright - 2;\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setTime(new Date());\r\n\r\n\t\tif (calendar.get(2) + 1 == 12 && calendar.get(5) == 24)\r\n\t\t{\r\n\t\t\tthis.splashText = \"Merry X-mas!\";\r\n\t\t}\r\n\t\telse if (calendar.get(2) + 1 == 1 && calendar.get(5) == 1)\r\n\t\t{\r\n\t\t\tthis.splashText = \"Happy new year!\";\r\n\t\t}\r\n\t\telse if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31)\r\n\t\t{\r\n\t\t\tthis.splashText = \"OOoooOOOoooo! Spooky!\";\r\n\t\t}\r\n\r\n\t\tint i = 24;\r\n\t\tint j = this.height / 4 + 48;\r\n\r\n\t\tif (this.mc.isDemo())\r\n\t\t{\r\n\t\t\tthis.addDemoButtons(j, 24);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.addSingleplayerMultiplayerButtons(j, 24);\r\n\t\t}\r\n\r\n\t\tthis.buttonList.add(new GuiButton(0, this.width / 2 - 100, j + 72 + 12, 98, 20, I18n.format(\"menu.options\")));\r\n\t\tthis.buttonList.add(new GuiButton(4, this.width / 2 + 2, j + 72 + 12, 98, 20, I18n.format(\"menu.quit\")));\r\n\r\n\t\tsynchronized (this.threadLock)\r\n\t\t{\r\n\t\t\tthis.openGLWarning1Width = this.fontRenderer.getStringWidth(this.openGLWarning1);\r\n\t\t\tthis.openGLWarning2Width = this.fontRenderer.getStringWidth(this.openGLWarning2);\r\n\t\t\tint k = Math.max(this.openGLWarning1Width, this.openGLWarning2Width);\r\n\t\t\tthis.openGLWarningX1 = (this.width - k) / 2;\r\n\t\t\tthis.openGLWarningY1 = (this.buttonList.get(0)).y - 24;\r\n\t\t\tthis.openGLWarningX2 = this.openGLWarningX1 + k;\r\n\t\t\tthis.openGLWarningY2 = this.openGLWarningY1 + 24;\r\n\t\t}\r\n\r\n\t\tthis.mc.setConnectedToRealms(false);\r\n\r\n\t\tif (Minecraft.getMinecraft().gameSettings.getOptionOrdinalValue(GameSettings.Options.REALMS_NOTIFICATIONS) && !this.hasCheckedForRealmsNotification)\r\n\t\t{\r\n\t\t\tRealmsBridge realmsbridge = new RealmsBridge();\r\n\t\t\tthis.realmsNotification = realmsbridge.getNotificationScreen(this);\r\n\t\t\tthis.hasCheckedForRealmsNotification = true;\r\n\t\t}\r\n\r\n\t\tif (this.areRealmsNotificationsEnabled())\r\n\t\t{\r\n\t\t\tthis.realmsNotification.setGuiSize(this.width, this.height);\r\n\t\t\tthis.realmsNotification.initGui();\r\n\t\t}\r\n\t}", "public Pane buildGuiInDerSchonzeit() {\n\t\tVBox root = new VBox(10); \r\n\t\t// Der Hintergrund des GUI wird mit einem Transparenten Bild erstellt\r\n\t\tImage imageBackground = new Image(getClass().getResource(\"transparent.png\").toExternalForm()); // Ein Image wird erstellt und das Bild übergeben\r\n\t\tBackgroundImage backgroundImage = new BackgroundImage(imageBackground, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, BackgroundSize.DEFAULT);\r\n\t\tBackground background = new Background(backgroundImage); // Ein Background wird ertsellt und das Bild übergeben\r\n\t\troot.setBackground(background); // Der Hintergrund mit dem Bild wird dem root übergeben\r\n\t\t\r\n\t\t//\r\n\t\t// // Allse verschiedenen Boxen werden erstellt\r\n\t\t//\r\n\t\t\r\n\t\t// HBox für die erste Spalte\r\n\t\tHBox hBoxSpalte1 = new HBox(190);\r\n\t\t// 2mal VBox um Button und Text anzuzeigen \r\n\t\tVBox vBox1Spalte1 = new VBox();\r\n\t\tVBox vBox2Spalte1 = new VBox();\r\n\t\t\r\n\t\t// HBox für 2. Spalte\r\n\t\tHBox hBoxSpalte2 = new HBox(190);\r\n\t\t// 2 VBoxen für Bild und Text\r\n\t\tVBox vbox1Spalte2 = new VBox();\r\n\t\tVBox vbox2Spalte2 = new VBox();\r\n\t\t\r\n\t\t// HBox für die 3.Spalte\r\n\t\tHBox hboxSpalte3 = new HBox(190);\r\n\t\t// 2mal VBox für Bild und Text\r\n\t\tVBox vbox1Spalte3 = new VBox();\r\n\t\tVBox vbox2Spalte3 = new VBox();\r\n\t\t\r\n\t\t// HBox für die 4 Spalte\r\n\t\tHBox hboxSpalte4 = new HBox(190);\r\n\t\t// 2mal VBox für Bild und Text\r\n\t\tVBox vbox1Spalte4 = new VBox();\r\n\t\tVBox vbox2Spalte4 = new VBox();\r\n\t\t\r\n\t\t//\r\n\t\t// Button für die Fische\r\n\t\t//\r\n\t\t\r\n\t\t//Label Bild für Hecht\r\n\t\tLabel hechtbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage hechtimage = new Image(getClass().getResource(\"Hecht.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\thechtbildLabel.setGraphic(new ImageView(hechtimage)); // Das Bild wird dem Label übergeben\r\n\t\thechtbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Zander\r\n\t\tLabel zanderbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage zanderImage = new Image(getClass().getResource(\"Zander.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tzanderbildLabel.setGraphic(new ImageView(zanderImage)); // Das Bild wird dem Label übergeben\r\n\t\tzanderbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Aal\r\n\t\tLabel aalbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage aalImage = new Image(getClass().getResource(\"Aal.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\taalbildLabel.setGraphic(new ImageView(aalImage)); // Das Bild wird dem Label übergeben\r\n\t\taalbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Aesche\r\n\t\tLabel aeschebildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage aescheImage = new Image(getClass().getResource(\"Aesche.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\taeschebildLabel.setGraphic(new ImageView(aescheImage)); // Das Bild wird dem Label übergeben\r\n\t\taeschebildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Barsch\r\n\t\tLabel barschbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage barschImage = new Image(getClass().getResource(\"Barsch.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tbarschbildLabel.setGraphic(new ImageView(barschImage)); // Das Bild wird dem Label übergeben\r\n\t\tbarschbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Forelle\r\n\t\tLabel forellebildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage forelleImage = new Image(getClass().getResource(\"Regenbogenforelle.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tforellebildLabel.setGraphic(new ImageView(forelleImage)); // Das Bild wird dem Label übergeben\r\n\t\tforellebildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Schleie\r\n\t\tLabel schleiebildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage schleieImage = new Image(getClass().getResource(\"Schleie.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tschleiebildLabel.setGraphic(new ImageView(schleieImage)); // Das Bild wird dem Label übergeben\r\n\t\tschleiebildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Bild Karpfe\r\n\t\tLabel karpfenbildLabel = new Label(); // Das Label wird erstellt\r\n\t\tImage karpfenImage = new Image(getClass().getResource(\"Schuppenkarpfen.png\").toExternalForm()); // Ein Image mit dem Bild wird erstellt\r\n\t\tkarpfenbildLabel.setGraphic(new ImageView(karpfenImage)); // Das Bild wird dem Label übergeben\r\n\t\tkarpfenbildLabel.setTranslateX(100); // X-Achse des Labels\r\n\t\t\r\n\t\t//\r\n\t\t// Label für die Titel der Fische\r\n\t\t//\r\n\t\t\r\n\t\t// Label Hecht\r\n\t\tLabel hechtlabel = new Label(\"Hecht\"); // Das Label mit dem Namen wird erstellt\r\n\t\thechtlabel.setFont(new Font(30)); // Die Schriftgrösse\r\n\t\thechtlabel.setTranslateX(180); // X-Achse des Labels\r\n\t\t\r\n\t\t//Label Zander\r\n\t\tLabel zanderLabel = new Label(\"Zander\"); // DAs LAabel mit dem Namen wird erstellt\r\n\t\tzanderLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tzanderLabel.setTranslateX(160); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Aal\r\n\t\tLabel aaLabel = new Label(\"Aal\"); // Das Label mit dem Namen wird erstellt\r\n\t\taaLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\taaLabel.setTranslateX(200); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Aesche\r\n\t\tLabel aescheLabel = new Label(\"Äsche\"); // Das Label mit dem Namen wird erstellt\r\n\t\taescheLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\taescheLabel.setTranslateX(180); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Barsch\r\n\t\tLabel barschLabel = new Label(\"Flussbarsch\"); // Das Label mit dem Namen wird erstellt\r\n\t\tbarschLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tbarschLabel.setTranslateX(130); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Forelle\r\n\t\tLabel forelleLabel = new Label(\"Forelle\"); // Das Label mit dem Namen wird erstellt\r\n\t\tforelleLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tforelleLabel.setTranslateX(180); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Schleie\r\n\t\tLabel schleieLabel = new Label(\"Schleie\"); // Das Label mit dem Namen wird erstellt\r\n\t\tschleieLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tschleieLabel.setTranslateX(170); // X-Achse des Labels\r\n\t\t\r\n\t\t// Label Karpfe\r\n\t\tLabel karpfeLabel = new Label(\"Karpfe\"); // Das Label mit dem Namen wird erstellt\r\n\t\tkarpfeLabel.setFont(new Font(30)); // Schriftgrösse\r\n\t\tkarpfeLabel.setTranslateX(170); // X-Achse des Labels\r\n\t\t\r\n\t\t//\r\n\t\t// Label für die Anzeige in der Schonzeit\r\n\t\t//\r\n\t\t\r\n\t\t// Label Schonzeit für Hecht\r\n\t\tLabel schonzeitHechtLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitHechtLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitHechtLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Zander\r\n\t\tLabel schonzeitZanderLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitZanderLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitZanderLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Aal\r\n\t\tLabel schonzeitaaLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitaaLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitaaLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Aesche\r\n\t\tLabel schonzeitaescheLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitaescheLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitaescheLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit Barsch\r\n\t\tLabel schonzeitbarschLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitbarschLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitbarschLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit für Forelle\r\n\t\tLabel schonzeitforelleLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitforelleLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitforelleLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit Schleie\r\n\t\tLabel schonzeitschleieLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitschleieLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitschleieLabel.setTranslateX(140); // X-Achse im root\r\n\t\t\r\n\t\t// Label Schonzeit Karpfe\r\n\t\tLabel schonzeitkarpfeLabel = new Label(); // Das Label wird erstellt\r\n\t\tschonzeitkarpfeLabel.setFont(new Font(25)); // Schriftgrösse\r\n\t\tschonzeitkarpfeLabel.setTranslateX(140); // X-Achse im root\r\n\r\n\t\t\r\n\t\t// Das Label für die überschrift\r\n\t\tLabel fischeAuswahlLabel = new Label(\"Fische und Ihre Schonzeit\"); // Das Label wird mit dem Namen erstellt\r\n\t\tfischeAuswahlLabel.setFont(new Font(40)); // Schriftgrösse\r\n\t\tfischeAuswahlLabel.setTranslateX(10); // X-Achse des Labels\r\n\t\t\r\n\t\t//\r\n\t\t// // Buttons werden erstellt\r\n\t\t//\r\n\t\t\r\n\t\t// Button zurück Hauptmenu\r\n\t\tButton hauptmenuButton = new Button(\"Hauptmenü\"); // Button wird erstellt und Initialisiert\r\n\t\thauptmenuButton.setMinSize(200, 50); // Die Minimumgrösse wird gesetzt\r\n\t\thauptmenuButton.setTranslateX(345); // X- Achse des Buttons im root\r\n\t\thauptmenuButton.setFont(new Font(25)); // Schriftgrösse des Buttons\r\n\t\t// Zoom in und out wird hinzugefügt\r\n\t\tButtonHandling zoomButtonHandling = new ButtonHandling();\r\n\t\tzoomButtonHandling.zoomIn(hauptmenuButton);\r\n\t\tzoomButtonHandling.zoomOut(hauptmenuButton);\r\n\t\t// Funktion zurück ins Hauptmenü\r\n\t\thauptMenuAufrufen(hauptmenuButton);\r\n\t\t\r\n\t\t//\r\n\t\t// // Aktuelles Datum wird eingelesen um die Fische auf Ihre Schonzeit zu prüfen\r\n\t\t//\r\n\t\t\r\n\t\t// Aktueller Monat wird in der Variablen datumAktuell gespeichert.\r\n\t\tCalendar dateNow = Calendar.getInstance(); // Kalender wird erstellt\r\n\t\tint datum = dateNow.get(Calendar.MONTH) +1; // Der aktuelle Monat wird im Int Initialisiert. +1 Da die Monate ab 0 Beginnen\r\n\t\t// Datum Manuell setzten für Test und Debbug \r\n\t\t//int datum = 1;\r\n\t\t\r\n\t\t//\r\n\t\t// // Die einzelnen VBoxen für die Fische werden je nach Schonzeit gefüllt\r\n\t\t//\r\n\t\t\r\n\t\t// 1. Spalte und 1 Box\r\n\t\tvBox1Spalte1.getChildren().addAll(hechtlabel,hechtbildLabel);// Erste Linie und erste Spalte mit Bild und Text wird dem root übergeben\r\n\t\tif (datum >=1 && datum <= 4) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitHechtLabel.setText(\"hat Schonzeit !\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitHechtLabel.setTextFill(Color.RED); // Die Schrifftfarbe wird auf Rot gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitHechtLabel.setText(\"keine Schonzeit\"); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t\tschonzeitHechtLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den entsprecheneden Einstellungen übergeben\r\n\t\tvBox1Spalte1.getChildren().add(schonzeitHechtLabel);\r\n\t\t\r\n\t\t// 1. Spalte und 2. Box\r\n\t\tvBox2Spalte1.getChildren().addAll(zanderLabel,zanderbildLabel); // Erste Linie und zweite Spalte mit Bild und Text wird dem root übergeben\r\n\t\tif (datum >= 1 && datum <= 4) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitZanderLabel.setText(\"hat Schonzeit !\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitZanderLabel.setTextFill(Color.RED); // Die Schrifftfarbe wird auf Rot gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitZanderLabel.setText(\"keine Schonzeit\"); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t\tschonzeitZanderLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den entsprechenden Einstellungen übergeben\r\n\t\tvBox2Spalte1.getChildren().add(schonzeitZanderLabel);\r\n\t\t\r\n\t\t// 2. Spalte und 1. Box\r\n\t\tvbox1Spalte2.getChildren().addAll(aaLabel,aalbildLabel); // Zweite Linie erste Spalte mit Bild und Text\r\n\t\t// Der Aal hat keine Schonzeit\r\n\t\t\tschonzeitaaLabel.setText(\"keine Schonzeit\"); // Text wird gesetzt\r\n\t\t\tschonzeitaaLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den einstellungen übergeben\t\r\n\t\tvbox1Spalte2.getChildren().add(schonzeitaaLabel);\r\n\t\t\r\n\t\t// 2. Spalte und 2. Box\r\n\t\tvbox2Spalte2.getChildren().addAll(aescheLabel,aeschebildLabel); // Zweite Linie zweite Spalte mit Bild und Text\r\n\t\tif (datum >= 2 && datum <= 4) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitaescheLabel.setText(\"hat Schonzeit !\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitaescheLabel.setTextFill(Color.RED); // Die Schrifftfarbe wird auf Rot gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitaescheLabel.setText(\"keine Schonzeit\"); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t\tschonzeitaescheLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\r\n\t\tvbox2Spalte2.getChildren().add(schonzeitaescheLabel);\r\n\t\t\r\n\t\t// 3. Spalte und 1. Box\r\n\t\tvbox1Spalte3.getChildren().addAll(barschLabel,barschbildLabel); // Dritte Linie erste Spalte mit Bild und Text\r\n\t\t// Der Barsch hat keine Schonzeit\r\n\t\t\tschonzeitbarschLabel.setText(\"keine Schonzeit\");\r\n\t\t\tschonzeitbarschLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\t\r\n\t\tvbox1Spalte3.getChildren().add(schonzeitbarschLabel);\r\n\t\t\r\n\t\t// 3. Spalte und 2. Box\r\n\t\tvbox2Spalte3.getChildren().addAll(forelleLabel,forellebildLabel); // Dritte Linie zweite Spalte mit Bild und Text\r\n\t\tif (datum >= 3 && datum <= 9) { // Die Schonzeit wird geprüft\r\n\t\t\tschonzeitforelleLabel.setText(\"keine Schonzeit\"); // Trifft die IF zu wird dieser Text gesetzt\r\n\t\t\tschonzeitforelleLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t}else { // Wen die IF nicht erfüllt ist\r\n\t\t\tschonzeitforelleLabel.setText(\"hat Schonzeit !\"); // Die Schonzeit des Hechtes wird überprüft\r\n\t\t\tschonzeitforelleLabel.setTextFill(Color.RED); // Trift due IF nicht zu wird dieser Text gesetzt\r\n\t\t}\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\r\n\t\tvbox2Spalte3.getChildren().add(schonzeitforelleLabel);\r\n\t\t\r\n\t\t// 4. Spalte und 1. Box\r\n\t\tvbox1Spalte4.getChildren().addAll(schleieLabel,schleiebildLabel); // Vierte Linie erste Spalte mit Bild und Text\r\n\t\t// Die Schleie hat keien Schonzeit\r\n\t\t\tschonzeitschleieLabel.setText(\"keine Schonzeit\"); // Text wird gesetzt\r\n\t\t\tschonzeitschleieLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\t\r\n\t\tvbox1Spalte4.getChildren().add(schonzeitschleieLabel);\r\n\t\t\r\n\t\t// 4. Spalte und 2. Box\r\n\t\tvbox2Spalte4.getChildren().addAll(karpfeLabel,karpfenbildLabel); // Vierte Linie zweite Spalte mit Bild und Text\r\n\t\t// Der Karpfe hat keine Schonzeit\r\n\t\t\tschonzeitkarpfeLabel.setText(\"keine Schonzeit\"); // Text wird gesetzt\r\n\t\t\tschonzeitkarpfeLabel.setTextFill(Color.GREEN); // Die Schriftfarbe wird auf Grün gesetzt\r\n\t\t// Der VBox wird das Label mit den Einstellungen übergeben\t\r\n\t\tvbox2Spalte4.getChildren().add(schonzeitkarpfeLabel);\r\n\t\t\r\n\t\t//\r\n\t\t// // Die einzelnen HBoxen werden gefüllt für die Spalten in der Root\r\n\t\t//\r\n\t\thBoxSpalte1.getChildren().addAll(vBox1Spalte1,vBox2Spalte1); // Die erste Spalte wird mit den zwei Boxen gefüllt\r\n\t\t// HBox Spalte 2\r\n\t\thBoxSpalte2.getChildren().addAll(vbox1Spalte2,vbox2Spalte2); // Die zweite Spalte wird mit den zwei Boxen gefüllt\r\n\t\t// Hbox Spalte 3\r\n\t\thboxSpalte3.getChildren().addAll(vbox1Spalte3,vbox2Spalte3); // Die dritte Spalte wird mit den zwei Boxen gefüllt\r\n\t\t// Hbox Spalte 4\r\n\t\thboxSpalte4.getChildren().addAll(vbox1Spalte4,vbox2Spalte4); // Die vierte Spalte wird mit den zwei Boxen gefüllt\r\n\t\t\r\n\t\t// Elemente werden der HauptVBox root hinzugefügt\r\n\t\troot.getChildren().addAll(fischeAuswahlLabel,hBoxSpalte1,hBoxSpalte2,hboxSpalte3,hboxSpalte4,hauptmenuButton); // Alle gefüllten Boxen werden der Hauptbox übergeben\r\n\t\t\r\n\t\t// Das root wird zurückgegeben um Angezeigt zu werden\r\n\t\treturn root;\r\n\t}", "public void newGame() {\n NJPanel = new JPanel(new BorderLayout());\n setGame = new JButton(new ImageIcon(\"images\\\\set.png\"));\n setGame.addActionListener(setGameHand);\n setGame.setBackground(Color.white);\n randomGame = new JButton(new ImageIcon(\"images\\\\random.png\"));\n randomGame.setBackground(Color.white);\n randomGame.addActionListener(randGameHand);\n mixGame = new JButton(new ImageIcon(\"images\\\\mix.png\"));\n mixGame.setBackground(Color.white);\n mixGame.addActionListener(mixGameHand);\n jlabel = new JLabel(String.format(\"%120s\", \"Choose a form of game\"));\n NJPanel.add(jlabel, BorderLayout.NORTH);\n NJPanel.add(setGame, BorderLayout.EAST);\n NJPanel.add(randomGame, BorderLayout.CENTER);\n NJPanel.add(mixGame, BorderLayout.WEST); \n add(NJPanel);\n }", "private void setupGUI(){\r\n\t\t\r\n\t\tfinal GUIFactory guifactory = GUIFactory.instance();\r\n\t\tfinal MTApplication app = (MTApplication)item.getView().getRenderer();\r\n\t\tfinal float leftiness = app.getWidth()*5/6;\r\n\t\tfinal float xPos = leftiness + 5;\r\n\t\t\r\n\t\t\r\n\t\toverlay = new MTOverlayContainer( app);\r\n\t\titem.getView().getRoot().addChild( overlay);\r\n\t\t\r\n\t\t// _THE_ PANEL \r\n\t\t\r\n\t\tpnlPanel = guifactory.createPanel( leftiness, 0, app.getWidth()-leftiness, app.getHeight(),\"pnlPanel\", overlay);\t\t\t\r\n\t\t\r\n\t\t// INTERACTION PANEL\r\n\t\t\r\n\t\tpnlInteraction = guifactory.createPanel(\r\n\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getWidthXY( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getHeightXY( TransformSpace.GLOBAL),\r\n\t\t\t\t\"pnlInteraction\",\r\n\t\t\t\tpnlPanel);\r\n\t\tpnlInteraction.setNoFill( true);\r\n\t\t\r\n\t\t// EDIT PANEL\r\n\t\t\r\n\t\tpnlEdit = guifactory.createPanel(\r\n\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getWidthXY( TransformSpace.GLOBAL),\r\n\t\t\t\tpnlPanel.getHeightXY( TransformSpace.GLOBAL),\r\n\t\t\t\t\"pnlEdit\",\r\n\t\t\t\tpnlPanel);\r\n\t\tpnlEdit.setVisible( false);\r\n\t\tpnlEdit.setNoFill( true);\r\n\t\t\r\n\t\t\r\n\t\t// ITEM NAME TEXTAREA\r\n\t\t\r\n\t\tString itemName = item.getName();\r\n\t\tif(itemName == null || itemName.equals( \"\"))\r\n\t\t\titemName = item.getID();\r\n\t\ttxtItemName = guifactory.createTextArea(itemName, \"txtItemName\", pnlPanel);\r\n\t\ttxtItemName.setPositionGlobal(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\r\n\t\t\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL).getY() + 10\t\r\n\t\t\t\t));\r\n\r\n\r\n\t\t// PANEL PICTURE\r\n\r\n\t\tVector3D pnlInteractionPos = pnlInteraction.getPosition( TransformSpace.GLOBAL);\r\n\t\tpnlPicture = guifactory.createPanel( pnlInteractionPos.getX()+50, pnlInteractionPos.getY()+50, 100, 100, \"pnlPicture\", pnlInteraction);\r\n\t\tpnlPicture.setAnchor( PositionAnchor.CENTER);\r\n\t\tpnlPicture.setPositionGlobal(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\tpnlInteractionPos.getX() + pnlInteraction.getWidthXY( TransformSpace.GLOBAL)/2,\r\n\t\t\t\t\t\tpnlInteractionPos.getY() + 50 + pnlPicture.getHeightXY( TransformSpace.GLOBAL)/2\r\n\t\t\t\t));\r\n\t\tpnlPicture.setTexture( GUITextures.instance().getByDevice( DeviceType.getDeviceType( device)));\r\n\t\t\r\n\t\t\r\n\t\t// POWER USAGE TEXTAREA\r\n\t\t\r\n\t\tString powerUsage = \"n/a\";\r\n\t\tif( device.getPowerUsage() != null && device.getPowerUsage().getValue() != null){\r\n\t\t\tpowerUsage = device.getPowerUsage().getValue().toString();\r\n\t\t}\r\n\t\t\r\n\t\ttxtPowerUsage = guifactory.createTextArea( \"Power usage: \" + powerUsage + \" Watts\", \"txtPowerUsage\", pnlInteraction);\r\n\t\ttxtPowerUsage.setPositionGlobal(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\r\n\t\t\t\t\t\tpnlInteractionPos.getY() + 140\t\t\r\n\t\t\t\t\t\t));\r\n\t\ttxtPowerUsage.setVisible( false);\r\n\t\t\r\n\t\t\r\n\t\t// ON/OFF BUTTON\r\n\t\t\r\n\t\tbtnOnOff = guifactory.createButton( \"Turn device On/Off\", \"btnOnOff\", pnlInteraction);\r\n\t\tbtnOnOff.setPosition( txtPowerUsage.getPosition( TransformSpace.GLOBAL));\r\n\t\tbtnOnOff.addGestureListener( TapProcessor.class, new BtnOnOffListener());\r\n\t\t\r\n\t\t\r\n\t\t// SUBDEVICE BUTTON PANEL\r\n\t\t\r\n\t\tpnlSubDeviceButtons = guifactory.createPanel(\r\n\t\t\t\tpnlPanel.getPosition( TransformSpace.GLOBAL).getX(),\r\n\t\t\t\tbtnOnOff.getVectorNextToComponent( 10, false).getY(),\r\n\t\t\t\tpnlPanel.getWidthXY( TransformSpace.GLOBAL),\r\n\t\t\t\tdevice.getSubDevice().size() * (btnOnOff.getHeight()+10),\r\n\t\t\t\t\"pnlSubDeviceButtons\",\r\n\t\t\t\tpnlInteraction);\r\n\t\t\r\n\t\t// SUB DEVICE BUTTONS\r\n\t\t\r\n\t\tsubDeviceButtons = new LinkedList<MTButton>();\r\n\t\tfor( int i = 0; i < device.getSubDevice().size(); i++){\r\n\t\t\t\r\n\t\t\tPhysicalDevice subDevice = device.getSubDevice().get( i);\r\n\t\t\t\r\n\t\t\t// get button's caption\r\n\t\t\tString caption = subDevice.getName();\r\n\t\t\tif(caption == null || caption.equals( \"\"))\r\n\t\t\t\tcaption = subDevice.getId();\r\n\t\t\t\r\n\t\t\tMTButton btnSubDevice = guifactory.createButton( caption, \"btnSubDevice_\" + subDevice.getId(), pnlSubDeviceButtons);\r\n\t\t\tbtnSubDevice.setPosition(\r\n\t\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\t\r\n\t\t\t\t\t\tpnlSubDeviceButtons.getPosition( TransformSpace.GLOBAL).getY() + i*(btnSubDevice.getHeight() + 10)\r\n\t\t\t\t\t));\r\n\t\t\t\r\n\t\t\tsubDeviceButtons.add( btnSubDevice);\r\n\t\t\tbtnSubDevice.addGestureListener( TapProcessor.class, new BtnSubDeviceListener( subDevice));\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// EDIT BUTTON\r\n\t\t\r\n\t\tbtnEdit = guifactory.createButton( \"Edit\", \"btnEdit\", pnlInteraction);\r\n\t\tbtnEdit.setPosition( new Vector3D( xPos, app.getHeight() - 2*btnEdit.getHeight() - 30));\r\n\t\tbtnEdit.addGestureListener( TapProcessor.class, new BtnEditListener());\r\n\t\t\r\n\t\t\r\n\t\t// BUTTON HIDE\r\n\t\t\r\n\t\tbtnHide = guifactory.createButton( \"Hide menu\", \"btnHide\", pnlPanel);\r\n\t\tbtnHide.setPosition( new Vector3D( xPos, app.getHeight() - btnHide.getHeight() - 20));\r\n\t\tbtnHide.addGestureListener( TapProcessor.class, new BtnHideListener());\r\n\t\t\r\n\t\t\r\n\t\t///// EDIT-ELEMENTS /////\r\n\r\n\t\tchkMovePlanar = guifactory.createCheckButton( \"Move planar\", \"chkMovePlanar\", pnlEdit);\r\n\t\tchkMovePlanar.setPosition(\r\n\t\t\t\tnew Vector3D(\r\n\t\t\t\t\t\txPos,\r\n\t\t\t\t\t\ttxtItemName.getPosition( TransformSpace.GLOBAL).getY() + txtItemName.getHeightXY( TransformSpace.GLOBAL)+ 20\t\r\n\t\t\t\t));\r\n\t\tchkMovePlanar.addGestureListener( TapProcessor.class, new ChkMovePlanarListener());\r\n\r\n\t\t\r\n\t\tchkMoveY = guifactory.createCheckButton( \"Move up/down\", \"chkMoveY\", pnlEdit);\r\n\t\tchkMoveY.setPosition( chkMovePlanar.getVectorNextToComponent( 10, false));\r\n\t\tchkMoveY.addGestureListener( TapProcessor.class, new ChkMoveYListener());\r\n\r\n\t\t\r\n\t\tchkRotate = guifactory.createCheckButton( \"Rotate\", \"chkRotate\", pnlEdit);\r\n\t\tchkRotate.setPosition( chkMoveY.getVectorNextToComponent( 10, false));\r\n\t\tchkRotate.addGestureListener( TapProcessor.class, new ChkRotateListener());\r\n\r\n\t\t\r\n\t\tchkScale = guifactory.createCheckButton( \"Scale\", \"chkScale\", pnlEdit);\r\n\t\tchkScale.setPosition( chkRotate.getVectorNextToComponent( 10, false));\r\n\t\tchkScale.addGestureListener( TapProcessor.class, new ChkScaleListener());\r\n\r\n\t\t\r\n\t\tbtnChangeVisualisation = guifactory.createButton( \"Change Style\", \"btnChangeVisualisation\", pnlEdit);\r\n\t\tbtnChangeVisualisation.setPosition( chkScale.getVectorNextToComponent( 10, false));\r\n\t\tbtnChangeVisualisation.addGestureListener( TapProcessor.class, new BtnChangeVisualisationListener());\r\n\t\t\r\n\t\t\r\n\t\tbtnSave = guifactory.createButton( \"Save\", \"btnSave\", pnlEdit);\r\n\t\tbtnSave.setPosition( btnEdit.getPosition());\r\n\t\tbtnSave.addGestureListener( TapProcessor.class, new BtnSaveListener());\r\n\t}", "public LetsPlayGUI() {\n super(\"Let's Play!\");\n initComponents();\n setCardLayouts();\n showSplashPanel();\n }", "public GUI_Crear_Funcionario() {\r\n initComponents();\r\n lbl1.setVisible(false);\r\n lbl2.setVisible(false);\r\n lbl3.setVisible(false);\r\n lbl4.setVisible(false);\r\n lbl5.setVisible(false);\r\n lbl6.setVisible(false);\r\n lbl7.setVisible(false);\r\n lbl8.setVisible(false);\r\n lbl9.setVisible(false);\r\n lbl10.setVisible(false);\r\n groupSexoBtn.add(rBtn1);\r\n groupSexoBtn.add(rBtn2);\r\n cargarImagen(jdp4,foto1);\r\n ocultarBarraTitulo();\r\n \r\n }", "public ClientGUI() {\n initComponents();\n }", "public ClientGUI() {\n initComponents();\n }", "public ClienteGUI() {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public AddPlayer() {\n initComponents(); \n }", "public Parent creatPanel() {\r\n\t\t\r\n\t\thlavniPanel = new BorderPane();\r\n\t\thlavniPanel.setCenter(creatGameDesk());\r\n\t\thlavniPanel.setTop(createMenuBar());\r\n\t\t\r\n\t\thlavniPanel.setBackground(new Background(new BackgroundFill(Color.BURLYWOOD, CornerRadii.EMPTY, Insets.EMPTY)));\r\n\t\thlavniPanel.setPadding(new Insets(8));\r\n\t\treturn hlavniPanel;\r\n\t}", "public User_gui() {\n initComponents();\n }", "public void start() {\n Font menuFont = new Font(\"\", Font.BOLD, 16);\n JMenuBar menuBar = new JMenuBar();\n JMenu menu = new JMenu(\"Menu\");\n menu.setFont(menuFont);\n JMenuItem newgameItem = new JMenuItem(\"New Game\");\n newgameItem.setFont(menuFont);\n newgameItem.addActionListener(new NewGameListener());\n menu.add(newgameItem);\n JMenuItem scoresItem = new JMenuItem(\"High scores\");\n scoresItem.setFont(menuFont);\n scoresItem.addActionListener(new ScoresListener());\n menu.add(scoresItem);\n JMenuItem aboutItem = new JMenuItem(\"About\");\n aboutItem.setFont(menuFont);\n aboutItem.addActionListener(new AboutListener());\n menu.add(aboutItem);\n JMenuItem exitItem = new JMenuItem(\"Exit\");\n exitItem.setFont(menuFont);\n exitItem.addActionListener(new ExitListener());\n menu.add(exitItem);\n menuBar.add(menu);\n\n Border blackline = BorderFactory.createLineBorder(Color.black, 1);\n Border redline = BorderFactory.createLineBorder(Color.red, 5);\n Font infoFont = new Font(\"Serif\", Font.BOLD, 34);\n JButton reStart = new JButton(\" Start! \");\n JLabel blackCages = new JLabel(\"Black: \");\n JLabel whiteCages = new JLabel(\"White: \");\n blackCagesCounter = new JLabel(\"0\");\n whiteCagesCounter = new JLabel(\"0\");\n reStart.setFont(infoFont);\n reStart.setBackground(Color.WHITE);\n reStart.setBorder(redline);\n reStart.addActionListener(new ReStartListener());\n blackCages.setFont(infoFont);\n whiteCages.setFont(infoFont);\n blackCagesCounter.setFont(infoFont);\n whiteCagesCounter.setFont(infoFont);\n\n\n GridLayout fieldGrid = new GridLayout(8,8);\n\n ImageIcon background = new ImageIcon(\"resources/background.png\");\n infoPanel = new JPanel();\n gamePanel = new JPanel();\n fieldPanel = new JPanel();\n infoPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 30));\n infoPanel.add(blackCages);\n infoPanel.add(blackCagesCounter);\n infoPanel.add(new JLabel(\" \"));\n infoPanel.add(reStart);\n infoPanel.add(new JLabel(\" \"));\n infoPanel.add(whiteCages);\n infoPanel.add(whiteCagesCounter);\n gamePanel.setLayout(new FlowLayout(FlowLayout.CENTER, 60, 60));\n gamePanel.add(fieldPanel);\n gamePanel.setBackground(Color.LIGHT_GRAY);\n fieldPanel.setLayout(fieldGrid);\n fieldPanel.setBorder(blackline);\n\n fieldPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 5));\n\n field = new JButton[8][8];\n ImageIcon cageIcon = new ImageIcon(\"resources/voidcage1.png\");\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n field[i][j] = new JButton(cageIcon);\n field[i][j].setBorder(blackline);\n fieldPanel.add(field[i][j]);\n field[i][j].addActionListener(new FieldListener());\n }\n }\n\n // Display it all in a scrolling window and make the window appear\n frame = new JFrame(\"Reversi\"); // Создание окна с названием\n frame.setPreferredSize(new Dimension(700, 830));\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Деструктор окна (при нажатии на крестик)\n frame.add(infoPanel, BorderLayout.PAGE_START);\n frame.add(gamePanel, BorderLayout.CENTER);\n frame.setJMenuBar(menuBar);\n frame.pack();\n frame.setLocationRelativeTo(null);\n frame.setVisible(true); // Делает окно видимым\n }", "CanfieldGUI(String title, Game game) {\n super(title, true);\n _game = game;\n addLabel(\"Game Canfield\", new LayoutSpec(\"y\", 1, \"x\", 0.5));\n addMenuButton(\"Menu->Quit\", \"quit\");\n addMenuButton(\"Menu->Undo\", \"undo\");\n addMenuButton(\"Menu->New Game\", \"newgame\");\n addLabel(\"Score: 0\", \"Score\",\n new LayoutSpec(\"y\", 1, \"x\", 1));\n _display = new GameDisplay(game);\n add(_display, new LayoutSpec(\"y\", 2, \"width\", 2));\n _display.setMouseHandler(\"click\", this, \"mouseClicked\");\n _display.setMouseHandler(\"release\", this, \"mouseReleased\");\n _display.setMouseHandler(\"drag\", this, \"mouseDragged\");\n _display.setMouseHandler(\"press\", this, \"mousePressed\");\n display(true);\n }", "public GUI() {\n }", "private static void createAndShowGUI() {\n JFrame frame = new JFrame(\"Combo box editabel\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n //2. kreirati kontrole i pobacati kako nam kaže neki manager LayoutManager\n JComponent comboBoxPanel = new ComboBoxPanel2();\n comboBoxPanel.setOpaque(true);\n frame.setContentPane(comboBoxPanel);\n\n //3. prikazati prozor\n frame.pack();\n frame.setVisible(true);\n }", "public void createAndShowGUI(){\r\n\t\t//You want the jframe to close everything when it is closed\r\n\t\tjframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\r\n\t\tif(maximized){\r\n\t\t\tDimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\r\n\t\t\tsWidth = (int)screenSize.getWidth();\r\n\t\t\tsHeight = (int)screenSize.getHeight();\r\n\t\t\tjframe.setSize(sWidth, sHeight);\r\n\t\t\tjframe.setExtendedState(JFrame.MAXIMIZED_BOTH);\r\n\t\t\tjframe.setUndecorated(true);\r\n\t\t\tjframe.setResizable(true);\r\n\t\t\tjframe.setVisible(true);\r\n\t\t\tcWidth = sWidth;\r\n\t\t\tcHeight = sHeight;\r\n\t\t}else{\r\n\t\t\tjframe.setResizable(false);\r\n\t\t\t//Makes the jframe visible\r\n\t\t\tjframe.setVisible(true);\r\n\t\t\t//Sets the size of the jframe\r\n\t\t\tjframe.setSize(sWidth, sHeight);\r\n\t\t\t\r\n\t\t\t//I have no fucking idea why it needs this but it does\r\n\t\t\ttry{\r\n\t\t\t\tThread.sleep(100);\r\n\t\t\t}catch(Exception e){\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Set the content width\r\n\t\t\tcWidth = jframe.getContentPane().getWidth();\r\n\t\t\t//Set the content height\r\n\t\t\tcHeight = jframe.getContentPane().getHeight();\r\n\t\t}\r\n\r\n\t\t//Set up the game menu\r\n\t\tGameMenu gmenu = new GameMenu((Graphics2D)(jframe.getContentPane().getGraphics()),cWidth,cHeight, new Input(jframe));\r\n\t\t//Draw the main menu\r\n\t\tgmenu.drawMainMenu();\r\n\t}", "private void createAndShowGUI(){\r\n initComponents();\r\n openMazefile.addActionListener(this);\r\n solveMaze.addActionListener(this);\r\n clearSolution.addActionListener(this);\r\n setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\r\n pack();\r\n setVisible(true);\r\n }", "public WeaponCreatorUi(UiManager manager) {\n this.manager = manager;\n stage = new Stage();\n \n //initialize and load file selector\n weapons = Gdx.files.internal(\"weapon/\").list();\n weaponNames = new String[weapons.length];\n for(int i = 0 ; i < weapons.length; i++){\n weaponNames[i] = weapons[i].name();\n }\n \n \n \n Skin skin = new Skin(Gdx.files.internal(\"comic/skin/comic-ui.json\"));\n \n \n //ui widgets \n TextField nameField = new TextField(\"\", skin);\n SelectBox<String> appearenceSelection=new SelectBox<String>(skin);\n appearenceSelection.setItems(weaponNames);\n TextField attackField = new TextField(\"\", skin);\n TextField explotionField = new TextField(\"\", skin);\n TextField rangeField = new TextField(\"\", skin);\n TextButton saveButton = new TextButton(\"Save\", skin);\n \n //ui labels\n Label nameLabel = new Label(\"Name: \", skin);\n Label imageLabel = new Label(\"Image: \", skin);\n Label attackLabel = new Label(\"Attack: \", skin);\n Label explotionLabel = new Label(\"Explotion: \", skin);\n Label rangeLabel = new Label(\"Range: \", skin);\n \n //assign widget positions\n int widgetXpos = UiUtils.WIDHT/2 + 50;\n nameField.setPosition(widgetXpos, UiUtils.HEIGHT -200);\n appearenceSelection.setPosition(widgetXpos, UiUtils.HEIGHT -280);\n attackField.setPosition(widgetXpos, UiUtils.HEIGHT -360);\n explotionField.setPosition(widgetXpos, UiUtils.HEIGHT -440);\n rangeField.setPosition(widgetXpos, UiUtils.HEIGHT -520);\n saveButton.setPosition(UiUtils.WIDHT/2-50, UiUtils.HEIGHT -720);\n \n //asing label positions\n int labelXpos = UiUtils.WIDHT/2 - 100;\n nameLabel.setPosition(labelXpos, UiUtils.HEIGHT -200);\n imageLabel.setPosition(labelXpos, UiUtils.HEIGHT -280);\n attackLabel.setPosition(labelXpos, UiUtils.HEIGHT -360);\n explotionLabel.setPosition(labelXpos, UiUtils.HEIGHT -440);\n rangeLabel.setPosition(labelXpos, UiUtils.HEIGHT -520);\n \n //set widget sizes\n nameField.setSize(200, 50);\n appearenceSelection.setSize(200, 50);\n attackField.setSize(200, 50);\n explotionField.setSize(200, 50);\n rangeField.setSize(200, 50);\n nameLabel.setSize(200, 50);\n imageLabel.setSize(200, 50);\n attackLabel.setSize(200, 50);\n explotionLabel.setSize(200, 50);\n rangeLabel.setSize(200, 50);\n saveButton.setSize(100, 50);\n \n //add elements to stage\n stage.addActor(nameField);\n stage.addActor(appearenceSelection);\n stage.addActor(attackField);\n stage.addActor(explotionField);\n stage.addActor(rangeField);\n stage.addActor(nameLabel);\n stage.addActor(imageLabel);\n stage.addActor(attackLabel);\n stage.addActor(explotionLabel);\n stage.addActor(rangeLabel);\n stage.addActor(saveButton);\n \n //set default value\n nameField.setText(String.valueOf(name));\n attackField.setText(String.valueOf(attack));\n explotionField.setText(String.valueOf(explotion));\n rangeField.setText(String.valueOf(range));\n \n //event handling\n nameField.setTextFieldListener(new TextField.TextFieldListener() {\n @Override\n public void keyTyped(TextField textField, char key) {\n String currentText = textField.getText();\n WeaponCreatorUi.this.name = currentText; \n } \n });\n attackField.setTextFieldListener(new TextField.TextFieldListener() {\n @Override\n public void keyTyped(TextField textField, char key) {\n String currentText = textField.getText();\n if(UiUtils.isInt(currentText)){\n WeaponCreatorUi.this.attack = Integer.parseInt(currentText);\n }else{\n textField.setText(String.valueOf(WeaponCreatorUi.this.attack));\n }\n } \n });\n explotionField.setTextFieldListener(new TextField.TextFieldListener() {\n @Override\n public void keyTyped(TextField textField, char key) {\n String currentText = textField.getText();\n if(UiUtils.isInt(currentText)){\n WeaponCreatorUi.this.explotion = Integer.parseInt(currentText);\n }else{\n textField.setText(String.valueOf(WeaponCreatorUi.this.explotion));\n }\n } \n });\n rangeField.setTextFieldListener(new TextField.TextFieldListener() {\n @Override\n public void keyTyped(TextField textField, char key) {\n String currentText = textField.getText();\n if(UiUtils.isInt(currentText)){\n WeaponCreatorUi.this.range = Integer.parseInt(currentText);\n }else{\n textField.setText(String.valueOf(WeaponCreatorUi.this.range));\n }\n } \n });\n \n saveButton.addListener(new ChangeListener() {\n @Override\n public void changed(ChangeListener.ChangeEvent event, Actor actor) {\n WeaponCreatorUi.this.saveWeapon();\n WeaponCreatorUi.this.setUi(\"menu\");\n \n }\n });\n \n \n appearenceSelection.addListener(new ChangeListener() {\n @Override\n public void changed(ChangeListener.ChangeEvent event, Actor actor) {\n WeaponCreatorUi.this.appearance = ((SelectBox<String>)actor).getSelectedIndex();\n //System.out.println(\"Button Pressed\");\n }\n });\n \n //add back button\n TextButton backButton = new TextButton(\"Back\", skin);\n backButton.setSize(100, 50);\n backButton.setPosition(0, 0);\n \n \n stage.addActor(backButton);\n backButton.addListener(new ChangeListener() {\n @Override\n public void changed(ChangeListener.ChangeEvent event, Actor actor) {\n //TODO add logic of character saving\n WeaponCreatorUi.this.setUi(\"menu\");\n \n }\n });\n }", "public BonusGUI createBonusGUI() {\n\t\tBonusGUI gui = new BonusGUI(gameView.getMainPanel(), bonusController);\n\t\t\n\t\t//Give bonus controller the reference to the bonus GUI\n\t\tbonusController.setBonusGUIView(gui);\n\t\treturn gui;\n\t}", "private static void createAndShowGUI() {\n\t\t//creating the GUI\n\t\tPhotoViewer myViewer = new PhotoViewer();\n\n\t\t//setting the title\n\t\tmyViewer.setTitle(\"Cameron Chiaramonte (ccc7sej)\");\n\n\t\t//making sure it will close when the x is clicked\n\t\tmyViewer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\t//calling the method to add the components to the pane and then making it visible\n\t\tmyViewer.addComponentsToPane(myViewer.getContentPane());\n\t\tmyViewer.pack();\n\t\tmyViewer.setVisible(true);\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic void initGui() {\n\t\tthis.viewportTexture = new DynamicTexture(256, 256);\n\t\tthis.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation(\"background\", this.viewportTexture);\n\t\tCalendar var1 = Calendar.getInstance();\n\t\tvar1.setTime(new Date());\n\n\t\tif (var1.get(2) + 1 == 11 && var1.get(5) == 9) {\n\t\t\tthis.splashText = \"Happy birthday, ez!\";\n\t\t} else if (var1.get(2) + 1 == 6 && var1.get(5) == 1) {\n\t\t\tthis.splashText = \"Happy birthday, Notch!\";\n\t\t} else if (var1.get(2) + 1 == 12 && var1.get(5) == 24) {\n\t\t\tthis.splashText = \"Merry X-mas!\";\n\t\t} else if (var1.get(2) + 1 == 1 && var1.get(5) == 1) {\n\t\t\tthis.splashText = \"Happy new year!\";\n\t\t} else if (var1.get(2) + 1 == 10 && var1.get(5) == 31) {\n\t\t\tthis.splashText = \"OOoooOOOoooo! Spooky!\";\n\t\t} else {\n\t\t\tthis.splashText = \"\";\n\t\t}\n\n\t\tboolean var2 = true;\n\t\tint var3 = this.height / 4 + 48;\n\n\t\tthis.addSingleplayerMultiplayerButtons();\n\n\t\tthis.buttonList.add(new GuiButton(0, this.width - 120, 3, 60, 20, I18n.format(\"menu.options\", new Object[0])));\n\t\tthis.buttonList.add(new GuiButton(4, this.width - 54, 3, 50, 20, I18n.format(\"menu.quit\", new Object[0])));\n\n\t\t// Remove annoying language button\n\t\t// this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124,\n\t\t// var3 + 72 + 12));\n\n\t\tObject var4 = this.field_104025_t;\n\n\t\tsynchronized (this.field_104025_t) {\n\t\t\tthis.field_92023_s = this.fontRendererObj.getStringWidth(this.field_92025_p);\n\t\t\tthis.field_92024_r = this.fontRendererObj.getStringWidth(this.field_146972_A);\n\t\t\tint var5 = Math.max(this.field_92023_s, this.field_92024_r);\n\t\t\tthis.field_92022_t = (this.width - var5) / 2;\n\t\t\tthis.field_92021_u = ((GuiButton) this.buttonList.get(0)).yPosition - 24;\n\t\t\tthis.field_92020_v = this.field_92022_t + var5;\n\t\t\tthis.field_92019_w = this.field_92021_u + 24;\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\n private void create() {\n components.clear();\n\n if (content != null) {\n content.clearChildren();\n }\n else {\n content = new Container();\n content.setInsets(INSETS);\n }\n\n GuiComponent guiComponent = (GuiComponent) getReflectedItem().getValue();\n\n // let the user choose which type of backgroundComponent they want.\n Label label = content.addChild(new Label(\"Type\"), 0, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n Container backgroundTypeContainer = content.addChild(new Container(), 0, 1);\n\n ColorRGBA oldColor = BackgroundUtils.getBackgroundColor(guiComponent);\n\n Button colorOnlyBgButton = backgroundTypeContainer.addChild(new Button(\"Color Only\"), 0, 0);\n colorOnlyBgButton.addClickCommands(source -> {\n if (!(guiComponent instanceof QuadBackgroundComponent)) {\n setValue(new QuadBackgroundComponent(oldColor));\n create();\n }\n });\n\n Button colorAndImageBgButton = backgroundTypeContainer.addChild(new Button(\"Color and Image\"), 0, 1);\n colorAndImageBgButton.addClickCommands(source -> {\n if (!(guiComponent instanceof TbtQuadBackgroundComponent)) {\n setValue(BackgroundComponents.gradient(oldColor));\n create();\n }\n });\n\n if (guiComponent instanceof QuadBackgroundComponent) {\n\n try {\n\n Method getter = QuadBackgroundComponent.class.getDeclaredMethod(\"getColor\");\n Method setter = QuadBackgroundComponent.class.getDeclaredMethod(\"setColor\", ColorRGBA.class);\n\n label = content.addChild(new Label(\"Color\"), 1, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(guiComponent, getter, setter);\n content.addChild(bgColorComponent.getPanel(), 1, 1);\n components.add(bgColorComponent);\n\n // margin\n getter = QuadBackgroundComponent.class.getDeclaredMethod(\"getMargin\");\n setter = QuadBackgroundComponent.class.getDeclaredMethod(\"setMargin\", Vector2f.class);\n\n label = content.addChild(new Label(\"Margin\"), 2, 0);\n Vector2fComponent marginComponent = new Vector2fComponent(guiComponent, getter, setter);\n content.addChild(marginComponent.getPanel(), 2, 1);\n components.add(marginComponent);\n\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n }\n\n }\n else if (guiComponent instanceof TbtQuadBackgroundComponent) {\n\n TbtQuadBackgroundComponent backgroundComponent = (TbtQuadBackgroundComponent) guiComponent;\n\n try {\n Method getter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"getColor\");\n Method setter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"setColor\", ColorRGBA.class);\n\n label = content.addChild(new Label(\"Color\"), 1, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(guiComponent, getter, setter);\n content.addChild(bgColorComponent.getPanel(), 1, 1);\n components.add(bgColorComponent);\n\n label = content.addChild(new Label(\"Image\"), 2, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n Button browseImageButton = content.addChild(new Button(\"Select Background Image...\"), 2, 1);\n browseImageButton.setTextVAlignment(VAlignment.Center);\n browseImageButton.addClickCommands(source -> {\n\n JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n jfc.setDialogTitle(\"Select a Background Image...\");\n jfc.setMultiSelectionEnabled(false);\n jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n jfc.setAcceptAllFileFilterUsed(false);\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"PNG Images\", \"png\");\n jfc.addChoosableFileFilter(filter);\n int returnValue = jfc.showOpenDialog(null);\n\n if (returnValue == JFileChooser.APPROVE_OPTION) {\n\n File file = jfc.getSelectedFile();\n\n\n try {\n\n byte[] imageData = Files.readAllBytes(file.toPath());\n byte[] stringData = Base64.getEncoder().encode(imageData);\n\n String imageString = new String(stringData);\n\n // PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n // panelBackground.setBase64Image(imageString);\n\n Texture texture = new TextureUtils().fromBase64(imageString);\n\n backgroundComponent.setTexture(texture);\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n });\n\n // margin\n getter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"getMargin\");\n setter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"setMargin\", Vector2f.class);\n\n label = content.addChild(new Label(\"Margin\"), 3, 0);\n Vector2fComponent marginComponent = new Vector2fComponent(guiComponent, getter, setter);\n content.addChild(marginComponent.getPanel(), 3, 1);\n components.add(marginComponent);\n\n\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n }\n\n }\n\n//\n// this.content = new RollupPanel(\"\", contentContainer, null);\n// this.content.setOpen(false);\n//\n// // background Image\n// Container bgImageContainer = contentContainer.addChild(new Container(new SpringGridLayout(Axis.Y, Axis.X, FillMode.Last, FillMode.Last)), 0, 0);\n// Label bgImageLabel = bgImageContainer.addChild(new Label(\"Background Image\"), 0, 0);\n// bgImageLabel.setTextVAlignment(VAlignment.Center);\n// bgImageLabel.setInsets(new Insets3f(0.0F, 2.0F, 0.0F, 5.0F));\n// Button browseImageButton = bgImageContainer.addChild(new Button(\"Browse...\"), 0, 1);\n// Button removeImageButton = bgImageContainer.addChild(new Button(\"Remove\"), 0, 2);\n// bgImageContainer.addChild(new Container(), 0, 3);\n//\n// browseImageButton.addClickCommands(source -> {\n//\n// JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n// jfc.setDialogTitle(\"Select a Background Image...\");\n// jfc.setMultiSelectionEnabled(false);\n// jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n// jfc.setAcceptAllFileFilterUsed(false);\n// FileNameExtensionFilter filter = new FileNameExtensionFilter(\"PNG Images\", \"png\");\n// jfc.addChoosableFileFilter(filter);\n// int returnValue = jfc.showOpenDialog(null);\n//\n// if (returnValue == JFileChooser.APPROVE_OPTION) {\n//\n// File file = jfc.getSelectedFile();\n//\n// try {\n// byte[] imageData = Files.readAllBytes(file.toPath());\n// byte[] stringData = Base64.getEncoder().encode(imageData);\n//\n// String imageString = new String(stringData);\n//\n// PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n// panelBackground.setBase64Image(imageString);\n//\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// }\n//\n// });\n//\n// removeImageButton.addClickCommands(source -> {\n// PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n// panelBackground.setBase64Image(\"\");\n// });\n//\n//\n// try {\n//\n// // color\n// Method get = PanelBackground.class.getMethod(\"getColor\");\n// Method set = PanelBackground.class.getMethod(\"setColor\", ColorRGBA.class);\n//\n// ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(getReflectedProperty().getValue(), get, set);\n// bgColorComponent.setPropertyName(\"Color\");\n// contentContainer.addChild(bgColorComponent.getPanel());\n// components.add(bgColorComponent);\n//\n// // insetTop\n// get = PanelBackground.class.getMethod(\"getInsetTop\");\n// set = PanelBackground.class.getMethod(\"setInsetTop\", int.class);\n//\n// IntComponent insetTopComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetTopComponent.setPropertyName(\"Inset Top\");\n// contentContainer.addChild(insetTopComponent.getPanel());\n// components.add(insetTopComponent);\n//\n// // insetLeft\n// get = PanelBackground.class.getMethod(\"getInsetLeft\");\n// set = PanelBackground.class.getMethod(\"setInsetLeft\", int.class);\n//\n// IntComponent insetLeftComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetLeftComponent.setPropertyName(\"Inset Left\");\n// contentContainer.addChild(insetLeftComponent.getPanel());\n// components.add(insetLeftComponent);\n//\n// // insetBottom\n// get = PanelBackground.class.getMethod(\"getInsetBottom\");\n// set = PanelBackground.class.getMethod(\"setInsetBottom\", int.class);\n//\n// IntComponent insetBottomComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetBottomComponent.setPropertyName(\"Inset Bottom\");\n// contentContainer.addChild(insetBottomComponent.getPanel());\n// components.add(insetBottomComponent);\n//\n// // insetRight\n// get = PanelBackground.class.getMethod(\"getInsetRight\");\n// set = PanelBackground.class.getMethod(\"setInsetRight\", int.class);\n//\n// IntComponent insetRightComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetRightComponent.setPropertyName(\"Inset Right\");\n// contentContainer.addChild(insetRightComponent.getPanel());\n// components.add(insetRightComponent);\n//\n// // zOffset\n// get = PanelBackground.class.getMethod(\"getzOffset\");\n// set = PanelBackground.class.getMethod(\"setzOffset\", float.class);\n//\n// FloatComponent zOffsetComponent = new FloatComponent(getReflectedProperty().getValue(), get, set);\n// zOffsetComponent.setPropertyName(\"Z-Offset\");\n// contentContainer.addChild(zOffsetComponent.getPanel());\n// components.add(zOffsetComponent);\n//\n// } catch (NoSuchMethodException e) {\n// e.printStackTrace();\n// }\n\n\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n btnStart = new javax.swing.JButton();\n lblScore1 = new javax.swing.JLabel();\n spnTurns = new javax.swing.JSpinner();\n radTwoPlayers = new javax.swing.JRadioButton();\n radThreePlayers = new javax.swing.JRadioButton();\n radFourPlayers = new javax.swing.JRadioButton();\n tbtnPlayer1 = new javax.swing.JToggleButton();\n tbtnPlayer2 = new javax.swing.JToggleButton();\n tbtnPlayer3 = new javax.swing.JToggleButton();\n tbtnPlayer4 = new javax.swing.JToggleButton();\n txtMessage = new javax.swing.JTextField();\n lblScore2 = new javax.swing.JLabel();\n lblScore3 = new javax.swing.JLabel();\n lblScore4 = new javax.swing.JLabel();\n pnBoard = new AbalonePaintPanel();\n lblTurn = new javax.swing.JLabel();\n pnlPlayer1 = new javax.swing.JPanel();\n pnlPlayer2 = new javax.swing.JPanel();\n pnlPlayer3 = new javax.swing.JPanel();\n pnlPlayer4 = new javax.swing.JPanel();\n spnTime = new javax.swing.JSpinner();\n lblTurns = new javax.swing.JLabel();\n lblTime = new javax.swing.JLabel();\n mbMenuBar = new javax.swing.JMenuBar();\n mnFile = new javax.swing.JMenu();\n miOpen = new javax.swing.JMenuItem();\n miSaveAs = new javax.swing.JMenuItem();\n miExit = new javax.swing.JMenuItem();\n mnHelp = new javax.swing.JMenu();\n miHelp = new javax.swing.JMenuItem();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Abalone\");\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosing(java.awt.event.WindowEvent evt) {\n formWindowClosing(evt);\n }\n public void windowOpened(java.awt.event.WindowEvent evt) {\n formWindowOpened(evt);\n }\n });\n\n btnStart.setText(\"Start\");\n btnStart.setToolTipText(\"Start Playing!!\");\n btnStart.setBorder(null);\n btnStart.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnStartActionPerformed(evt);\n }\n });\n\n lblScore1.setBackground(new java.awt.Color(0, 0, 255));\n lblScore1.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n lblScore1.setForeground(new java.awt.Color(0, 0, 255));\n lblScore1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lblScore1.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n spnTurns.setModel(new javax.swing.SpinnerNumberModel(50, 20, 150, 10));\n spnTurns.setToolTipText(\"Number of Turns\");\n spnTurns.setEditor(new javax.swing.JSpinner.NumberEditor(spnTurns, \"\"));\n spnTurns.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n spnTurnsStateChanged(evt);\n }\n });\n\n radTwoPlayers.setSelected(true);\n radTwoPlayers.setText(\"2 Players\");\n radTwoPlayers.setToolTipText(\"2 Players Mode\");\n radTwoPlayers.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n radTwoPlayersActionPerformed(evt);\n }\n });\n\n radThreePlayers.setText(\"3 Players\");\n radThreePlayers.setToolTipText(\"3 Players Mode\");\n radThreePlayers.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n radThreePlayersActionPerformed(evt);\n }\n });\n\n radFourPlayers.setText(\"4 Players\");\n radFourPlayers.setToolTipText(\"4 Players Mode\");\n radFourPlayers.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n radFourPlayersActionPerformed(evt);\n }\n });\n\n tbtnPlayer1.setBackground(new java.awt.Color(0, 0, 255));\n tbtnPlayer1.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n tbtnPlayer1.setText(\"Player 1\");\n tbtnPlayer1.setToolTipText(\"Toggle to Computer\");\n tbtnPlayer1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tbtnPlayer1MouseClicked(evt);\n }\n });\n tbtnPlayer1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tbtnPlayer1ActionPerformed(evt);\n }\n });\n\n tbtnPlayer2.setBackground(new java.awt.Color(255, 0, 0));\n tbtnPlayer2.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n tbtnPlayer2.setText(\"Player 2\");\n tbtnPlayer2.setToolTipText(\"Toggle to Computer\");\n tbtnPlayer2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tbtnPlayer2MouseClicked(evt);\n }\n });\n tbtnPlayer2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tbtnPlayer2ActionPerformed(evt);\n }\n });\n\n tbtnPlayer3.setBackground(new java.awt.Color(0, 255, 0));\n tbtnPlayer3.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n tbtnPlayer3.setText(\"Player 3\");\n tbtnPlayer3.setToolTipText(\"Toggle to Computer\");\n tbtnPlayer3.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tbtnPlayer3MouseClicked(evt);\n }\n });\n tbtnPlayer3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tbtnPlayer3ActionPerformed(evt);\n }\n });\n\n tbtnPlayer4.setBackground(new java.awt.Color(255, 165, 0));\n tbtnPlayer4.setFont(new java.awt.Font(\"Tahoma\", 1, 11)); // NOI18N\n tbtnPlayer4.setText(\"Player 4\");\n tbtnPlayer4.setToolTipText(\"Toggle to Computer\");\n tbtnPlayer4.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tbtnPlayer4MouseClicked(evt);\n }\n });\n tbtnPlayer4.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n tbtnPlayer4ActionPerformed(evt);\n }\n });\n\n txtMessage.setEditable(false);\n txtMessage.setToolTipText(\"Messages\");\n\n lblScore2.setBackground(new java.awt.Color(255, 0, 0));\n lblScore2.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n lblScore2.setForeground(new java.awt.Color(255, 0, 0));\n lblScore2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lblScore2.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n lblScore3.setBackground(new java.awt.Color(0, 200, 0));\n lblScore3.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n lblScore3.setForeground(new java.awt.Color(0, 170, 0));\n lblScore3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lblScore3.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n lblScore4.setBackground(new java.awt.Color(255, 165, 0));\n lblScore4.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n lblScore4.setForeground(new java.awt.Color(255, 165, 0));\n lblScore4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n lblScore4.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n pnBoard.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));\n pnBoard.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n pnBoard.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n pnBoardMouseDragged(evt);\n }\n });\n pnBoard.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n pnBoardMousePressed(evt);\n }\n public void mouseReleased(java.awt.event.MouseEvent evt) {\n pnBoardMouseReleased(evt);\n }\n });\n\n javax.swing.GroupLayout pnBoardLayout = new javax.swing.GroupLayout(pnBoard);\n pnBoard.setLayout(pnBoardLayout);\n pnBoardLayout.setHorizontalGroup(\n pnBoardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n pnBoardLayout.setVerticalGroup(\n pnBoardLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 523, Short.MAX_VALUE)\n );\n\n lblTurn.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n lblTurn.setText(\"Turn:\");\n\n pnlPlayer1.setBackground(new java.awt.Color(200, 200, 200));\n\n javax.swing.GroupLayout pnlPlayer1Layout = new javax.swing.GroupLayout(pnlPlayer1);\n pnlPlayer1.setLayout(pnlPlayer1Layout);\n pnlPlayer1Layout.setHorizontalGroup(\n pnlPlayer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 44, Short.MAX_VALUE)\n );\n pnlPlayer1Layout.setVerticalGroup(\n pnlPlayer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n\n pnlPlayer2.setBackground(new java.awt.Color(200, 200, 200));\n\n javax.swing.GroupLayout pnlPlayer2Layout = new javax.swing.GroupLayout(pnlPlayer2);\n pnlPlayer2.setLayout(pnlPlayer2Layout);\n pnlPlayer2Layout.setHorizontalGroup(\n pnlPlayer2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 44, Short.MAX_VALUE)\n );\n pnlPlayer2Layout.setVerticalGroup(\n pnlPlayer2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n\n pnlPlayer3.setBackground(new java.awt.Color(200, 200, 200));\n\n javax.swing.GroupLayout pnlPlayer3Layout = new javax.swing.GroupLayout(pnlPlayer3);\n pnlPlayer3.setLayout(pnlPlayer3Layout);\n pnlPlayer3Layout.setHorizontalGroup(\n pnlPlayer3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 44, Short.MAX_VALUE)\n );\n pnlPlayer3Layout.setVerticalGroup(\n pnlPlayer3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n\n pnlPlayer4.setBackground(new java.awt.Color(200, 200, 200));\n\n javax.swing.GroupLayout pnlPlayer4Layout = new javax.swing.GroupLayout(pnlPlayer4);\n pnlPlayer4.setLayout(pnlPlayer4Layout);\n pnlPlayer4Layout.setHorizontalGroup(\n pnlPlayer4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 44, Short.MAX_VALUE)\n );\n pnlPlayer4Layout.setVerticalGroup(\n pnlPlayer4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 0, Short.MAX_VALUE)\n );\n\n spnTime.setModel(new javax.swing.SpinnerNumberModel(300, 60, 1800, 60));\n spnTime.setToolTipText(\"Time Limit\");\n spnTime.setEditor(new javax.swing.JSpinner.NumberEditor(spnTime, \"\"));\n spnTime.addChangeListener(new javax.swing.event.ChangeListener() {\n public void stateChanged(javax.swing.event.ChangeEvent evt) {\n spnTimeStateChanged(evt);\n }\n });\n\n lblTurns.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n lblTurns.setText(\"Turns:\");\n\n lblTime.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n lblTime.setText(\"Time:\");\n\n mnFile.setText(\"File\");\n\n miOpen.setText(\"Open...\");\n miOpen.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n miOpenActionPerformed(evt);\n }\n });\n mnFile.add(miOpen);\n\n miSaveAs.setText(\"Save As...\");\n miSaveAs.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n miSaveAsActionPerformed(evt);\n }\n });\n mnFile.add(miSaveAs);\n\n miExit.setText(\"Exit\");\n miExit.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n miExitActionPerformed(evt);\n }\n });\n mnFile.add(miExit);\n\n mbMenuBar.add(mnFile);\n\n mnHelp.setText(\"Help\");\n\n miHelp.setText(\"Help\");\n miHelp.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n miHelpActionPerformed(evt);\n }\n });\n mnHelp.add(miHelp);\n\n mbMenuBar.add(mnHelp);\n\n setJMenuBar(mbMenuBar);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnStart, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(txtMessage))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(lblScore1, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(lblScore2, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(lblScore3, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(lblScore4, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(30, 30, 30)\n .addComponent(radTwoPlayers)\n .addGap(18, 18, 18)\n .addComponent(radThreePlayers)\n .addGap(18, 18, 18)\n .addComponent(radFourPlayers))\n .addGroup(layout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(lblTurns, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(spnTurns, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(lblTime, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(8, 8, 8)\n .addComponent(spnTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(lblTurn, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(11, 11, 11)\n .addComponent(tbtnPlayer1, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(pnlPlayer1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(6, 6, 6)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(tbtnPlayer2, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(pnlPlayer2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(tbtnPlayer3, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(pnlPlayer3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(pnlPlayer4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(tbtnPlayer4, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(pnBoard, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGap(11, 11, 11))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(tbtnPlayer4)\n .addComponent(tbtnPlayer3)\n .addComponent(tbtnPlayer2)\n .addComponent(tbtnPlayer1)\n .addComponent(radFourPlayers)\n .addComponent(radThreePlayers)\n .addComponent(radTwoPlayers))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(pnlPlayer2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(lblTurn)\n .addComponent(spnTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(spnTurns, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblTurns)\n .addComponent(lblTime))\n .addComponent(pnlPlayer1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(pnlPlayer4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(pnlPlayer3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(lblScore3, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(lblScore2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 33, Short.MAX_VALUE)\n .addComponent(lblScore1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addComponent(lblScore4, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(pnBoard, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(11, 11, 11)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnStart, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtMessage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n\n txtMessage.getAccessibleContext().setAccessibleName(\"\");\n\n pack();\n }", "public Prob4GUI() {\n initComponents();\n }", "private static void createAndShowGUI() {\n\t\tJFrame.setDefaultLookAndFeelDecorated(true);\n\n\t\tLevelEditor le = new LevelEditor();\n\t}", "public GUI() {\n initComponents();\n }", "public gui() {\n initComponents();\n }", "public gui() {\n initComponents();\n }", "public SnakeUI() {\r\n setFrame(); \r\n setKeyListener();\r\n setTimer();\r\n startGame();\r\n this.setVisible(true);\r\n }", "public ConverterGUI() {\n initComponents();\n }", "private void createUI() {\n\t\tthis.rootPane = new TetrisRootPane(true);\n\t\tthis.controller = new TetrisController(this, rootPane, getWorkingDirectory());\n\t\tthis.listener = new TetrisActionListener(controller, this, rootPane);\n\t\t\n\t\trootPane.setActionListener(listener);\n\t\trootPane.setGameComponents(controller.getGameComponent(), controller.getPreviewComponent());\n\t\trootPane.initialize();\n\t\t\n\t\tPanelBorder border = controller.getPlayer().getPanel().getPanelBorder(\"Tetris v\" + controller.getVersion());\n\t\tborder.setRoundedCorners(true);\n\t\tJPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));\n\t\tpanel.setBackground(getBackgroundColor(border.getLineColor()));\n\t\tpanel.setBorder(border);\n\t\tpanel.setPreferredSize(new Dimension(564, 551));\n\t\tpanel.add(rootPane);\n\t\trootPane.addPanelBorder(border, panel);\n\t\t\n\t\tthis.setContentPane(panel);\n\t\tthis.setSize(564, 550);\n\t\t\n\t\tcontroller.initializeUI();\n\t}", "public static void createGUI() {\n\t\tSimpleGUI gui = new SimpleGUI();\n\t\tgui.setVisible(true);\n\t}", "public GUI() {\n initComponents();\n }", "public GUI() {\n initComponents();\n }", "@Override\n\tpublic void create () {\n\t\tgempiresAssetHandler = new GempiresAssetHandler(this);\n\t\tbatch = new SpriteBatch();\n\t\tcastle = new CastleScreen(this);\n\t\tsetScreen(new MainMenuScreen(this));\n\t}", "public exerciseAddGUI() {\n initComponents();\n }", "public static void newGame() throws IOException {\n\t\tmancalaFrame.setContentPane( new BoardGraphicsLabel() ); // bottom level board\t\r\n\t\tmancalaFrame.add( new PitsGraphicsPanel() ); // add pits jbuttons from custom layered pane\r\n\t\t\t\t\r\n\t\t// create the top layer glass pane for repainting stones and labels\r\n\t\t// glass pane allows buttons to be pushed with components on top\r\n\t\tstonePaintGlassPane = new StonePaintGlassPane( mancalaFrame.getContentPane() );\r\n\t\t\r\n\t\tmancalaFrame.setGlassPane( stonePaintGlassPane );\r\n\t\t\t\t\r\n\t\t\t\t// grid bag layout, will be used to place pit buttons in proper location\r\n\t\t\t\t// in Class PitsGraphicsPanel\r\n\t\tmancalaFrame.setLayout( new GridBagLayout() );\r\n\t\t\t\t// set true to glassPane\r\n\t\tstonePaintGlassPane.setVisible(true);\r\n\t\t\t\t\r\n\t\t\t\t// keep frame one size so we don't have to calculate resizing\r\n\t\t\t\t// sorry for the laziness\r\n\t\tmancalaFrame.setResizable(false);\r\n\t\tmancalaFrame.pack(); // set all proper sizes to prefered size\r\n\t\tmancalaFrame.setVisible(true); // set visible\r\n\t}", "private void startNewGame(){\n if (selectedPiece!=null)\n selectedPiece.setBackground(getDefaultColor(selectedPiece));\n selectedPiece = null;\n setAllToDefaultColor();\n setDefulatMessage();\n board = new ChessBoard(1, false);\n for(int row = 0 ; row < ROWS; row++){\n for(int col = 0; col < COLS ; col++){\n setButtonIcon(row,col);\n }\n }\n }", "public void createAndShowGUI() {\n JFrame.setDefaultLookAndFeelDecorated(true);\n\n //Create and set up the window.\n\tif(open==0)\n\t\tframe = new JFrame(\"Open a file\");\n\telse if(open ==1)\n\t\tframe = new JFrame(\"Save file as\");\n //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n //Create and set up the content pane.\n JComponent newContentPane =this ;\n newContentPane.setOpaque(true); //content panes must be opaque\n frame.setContentPane(newContentPane);\n\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n // frame.setSize(500,500);\n//\tvalidate();\n }", "private static void createAndShowGUI() {\n //Create and set up the window.\n //JFrame frame = new JFrame(\"Basics of Color\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n \n //Add content to the window.\n frame.add(new ColorBasics(), BorderLayout.CENTER);\n Menu menu = new Menu();\n frame.setJMenuBar(menu.createMenuBar());\n \n //Display the window.\n frame.pack();\n frame.setVisible(true);\n frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);\n }", "public Gui() {\n\t\tsuper();\n\t\tinitGUI();\n\t}", "private void buildGui() {\n nifty = screen.getNifty();\n nifty.setIgnoreKeyboardEvents(true);\n nifty.loadStyleFile(\"nifty-default-styles.xml\");\n nifty.loadControlFile(\"nifty-default-controls.xml\");\n nifty.addScreen(\"Option_Screen\", new ScreenBuilder(\"Options_Screen\") {\n {\n controller((ScreenController) app);\n layer(new LayerBuilder(\"background\") {\n {\n childLayoutCenter();;\n font(\"Interface/Fonts/zombie.fnt\");\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n childLayoutOverlay();\n font(\"Interface/Fonts/zombie.fnt\");\n\n panel(new PanelBuilder(\"Switch_Options\") {\n {\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n interactOnClick(\"goTo(Display_Settings)\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Graphics_Settings\", new ScreenBuilder(\"Graphics_Extension\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Display_Settings)\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n panel(new PanelBuilder(\"Post_Water_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"15%\");\n control(new LabelBuilder(\"\", \"Post Water\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Post_Water_Button\") {\n {\n marginLeft(\"110%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Reflections_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Reflections\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Reflections_Button\") {\n {\n marginLeft(\"45%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Ripples_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Ripples\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Ripples_Button\") {\n {\n marginLeft(\"75%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Specular_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Specular\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Specular_Button\") {\n {\n marginLeft(\"59%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Water_Foam_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Water Foam\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Water_Foam_Button\") {\n {\n marginLeft(\"93%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Sky_Dome_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Sky Dome\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Sky_Dome_Button\") {\n {\n marginLeft(\"128%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Star_Motion_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Star Motion\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Star_Motion_Button\") {\n {\n marginLeft(\"106%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Cloud_Motion_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Cloud Motion\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n color(\"#ff0000\");\n }\n });\n control(new CheckboxBuilder(\"Cloud_Motion_Button\") {\n {\n marginLeft(\"87%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Bloom_Light_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Bloom Lighting\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new CheckboxBuilder(\"Bloom_Light_Button\") {\n {\n marginLeft(\"70%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Light_Scatter_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"5%\");\n control(new LabelBuilder(\"\", \"Light Scatter\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new CheckboxBuilder(\"Light_Scatter_Button\") {\n {\n marginLeft(\"90%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutHorizontal();\n marginLeft(\"43%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"applySettings()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Display_Screen\", new ScreenBuilder(\"Display_Settings\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();;\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Sound_Settings)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n childLayoutVertical();\n panel(new PanelBuilder(\"Resolution_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"40%\");\n marginTop(\"15%\");\n control(new LabelBuilder(\"\", \"Set Resolution\") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new ListBoxBuilder(\"Resolution_Opts\") {\n {\n marginLeft(\"4%\");\n marginBottom(\"10%\");\n displayItems(1);\n showVerticalScrollbar();\n hideHorizontalScrollbar();\n selectionModeSingle();\n width(\"10%\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"45%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"displayApply()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n }\n }.build(nifty));\n nifty.addScreen(\"Sound Settings\", new ScreenBuilder(\"#Sound_Settings\") {\n {\n controller(settingsControl);\n layer(new LayerBuilder(\"background\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutCenter();;\n backgroundImage(\"Backgrounds/ZOMBIE1.jpg\");\n visibleToMouse(true);\n }\n });\n layer(new LayerBuilder(\"foreground\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutOverlay();\n panel(new PanelBuilder(\"Settings\") {\n {\n font(\"Interface/Fonts/zombie.fnt\");\n childLayoutVertical();\n control(new ButtonBuilder(\"\", \"Display Settings\") {\n {\n marginTop(\"42%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Display_Settings)\");\n }\n });\n /*control(new ButtonBuilder(\"\", \"Graphics Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Graphics_Extension)\");\n }\n });*/\n control(new ButtonBuilder(\"\", \"Sound Settings\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new ButtonBuilder(\"\", \"Leaderboard\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(Leader_Board)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Logout\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"goTo(#Login_Screen)\");\n }\n });\n control(new ButtonBuilder(\"\", \"Quit Game\") {\n {\n marginTop(\"2%\");\n marginLeft(\"5%\");\n height(\"50px\");\n width(\"150px\");\n align(ElementBuilder.Align.Left);\n font(\"Interface/Fonts/zombie.fnt\");\n interactOnClick(\"quitGame()\");\n }\n });\n }\n });\n }\n });\n layer(new LayerBuilder(\"Settings\") {\n {\n childLayoutVertical();\n panel(new PanelBuilder(\"#Master_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"35%\");\n control(new LabelBuilder(\"\", \"Master Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Master_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Ambient_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Ambient Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Ambient_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Combat_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Combat Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Combat_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Dialog_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Dialog Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Dialog_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"#Footsteps_Volume_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"30%\");\n marginTop(\"8%\");\n control(new LabelBuilder(\"\", \"Footsteps Volume : \") {\n {\n color(\"#ff0000\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n control(new SliderBuilder(\"#Footsteps_Volume\", false) {\n {\n marginLeft(\"20px\");\n min(0);\n max(100);\n width(\"25%\");\n }\n });\n }\n });\n panel(new PanelBuilder(\"Apply_Panel\") {\n {\n childLayoutHorizontal();\n marginLeft(\"45%\");\n marginTop(\"5%\");\n control(new ButtonBuilder(\"#Apply_Button\", \"Apply Settings\") {\n {\n interactOnClick(\"soundApply()\");\n font(\"Interface/Fonts/zombie.fnt\");\n }\n });\n }\n });\n }\n });\n\n }\n }.build(nifty));\n }", "private void btnCreateHeroActionPerformed() {// GEN-FIRST:event_btnCreateHeroActionPerformed\r\n\t\tdispose();\r\n\t\tHero h = new Hero(txtCreateName.getText());\r\n\t\tnew MainForm().setVisible(true);\r\n\t\tMainForm.setHero(h);\r\n\t\tMainForm.makeOpponents();\r\n\t\th = null;\r\n\t}", "public GUI() {\n this.setSize(1500,1000);\n this.setResizable(false);\n this.setTitle(\"Warriors Jeu\");\n this.setLocation(10,10);\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n // affichage de la barre\n this.setJMenuBar(this.BarreDeMenu());\n this.setContentPane(this.ZoneTravail()); \n \n backPanel.setPreferredSize(new Dimension(1500, 1000));\n this.add(backPanel);\n \n avatarPanel.setPreferredSize(new Dimension(200,150));\n this.add(avatarPanel);\n \n \n //appel du plateau (class Plateau)--en test pour l'instant--\n // this.setContentPane(new Plateau());\n \n \n // doit être à la fin sinon on affiche la fenêtre avant que la barre ne lui soit associée...\n this.setVisible(true);\n \n }", "public ModPhysicsGUI() {\n initComponents();\n }", "public History_GUI(){\n super();\n InitializeComponents();\n ConfigureWin();\n\n }", "private Scene createMainMenuScene() {\n VBox root = new VBox();\n root.setId(\"pane\");\n root.setAlignment(Pos.CENTER);\n root.setSpacing(BUTTON_DISTANCE);\n\n Label lTitle = new Label(\"2048 Fx\");\n lTitle.setId(\"title-label\");\n root.getChildren().add(lTitle);\n\n Button bNewGame = new Button(\"New game\");\n bNewGame.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n Game.board.init();\n }\n });\n bNewGame.setId(\"c16\");\n root.getChildren().add(bNewGame);\n\n Button bLoadGame = new Button(\"Load game\");\n bLoadGame.setId(\"c256\");\n bLoadGame.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Load saving\");\n File directory = new File(\"./savegames\");\n if (!directory.exists()) {\n directory = new File(\"./\");\n }\n fileChooser.setInitialDirectory(directory);\n FileChooser.ExtensionFilter extFilter =\n new FileChooser.ExtensionFilter(\"Saved 2048 games\", \"*.saving\");\n fileChooser.getExtensionFilters().add(extFilter);\n File file = fileChooser.showOpenDialog(Game.stage);\n if (file != null) {\n Game.board.replay(file);\n }\n }\n });\n root.getChildren().add(bLoadGame);\n\n Button bSettings = new Button(\"Settings\");\n bSettings.setId(\"c4096\");\n bSettings.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n settingsMenu();\n }\n });\n root.getChildren().add(bSettings);\n\n Button bGenerate = new Button(\"Also\");\n bGenerate.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n\tGame.statBoard.statMenu();\n }\n });\n bGenerate.setId(\"c1024\");\n root.getChildren().add(bGenerate);\n\n Button bQuit = new Button(\"Quit\");\n bQuit.setId(\"c65536\");\n bQuit.setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent event) {\n FileHandler.saveSettings(Game.settings);\n Game.stage.close();\n }\n });\n root.getChildren().add(bQuit);\n Scene menuScene = new Scene(root, Game.WINDOW_SIZE_X, Game.WINDOW_SIZE_Y);\n menuScene.getStylesheets().\n addAll(this.getClass().getResource(\"menu.css\").toExternalForm());\n return menuScene;\n }", "protected void createContents() {\n\t\tshlFaststone = new Shell();\n\t\tshlFaststone.setImage(SWTResourceManager.getImage(Edit.class, \"/image/all1.png\"));\n\t\tshlFaststone.setToolTipText(\"\");\n\t\tshlFaststone.setSize(944, 479);\n\t\tshlFaststone.setText(\"kaca\");\n\t\tshlFaststone.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tComposite composite = new Composite(shlFaststone, SWT.NONE);\n\t\tcomposite.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tSashForm sashForm = new SashForm(composite, SWT.VERTICAL);\n\t\t//\n\t\tMenu menu = new Menu(shlFaststone, SWT.BAR);\n\t\tshlFaststone.setMenuBar(menu);\n\t\tMenuItem menuItem = new MenuItem(menu, SWT.CASCADE);\n\t\tmenuItem.setSelection(true);\n\t\tmenuItem.setText(\"\\u6587\\u4EF6\");\n\t\t\n\t\tMenu menu_1 = new Menu(menuItem);\n\t\tmenuItem.setMenu(menu_1);\n\t\t\n\t\tfinal Canvas down=new Canvas(shlFaststone,SWT.NONE|SWT.BORDER|SWT.DOUBLE_BUFFERED);\n\t\t\n\t\tComposite composite_4 = new Composite(sashForm, SWT.BORDER);\n\t\tcomposite_4.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tSashForm sashForm_3 = new SashForm(composite_4, SWT.NONE);\n\t\tformToolkit.adapt(sashForm_3);\n\t\tformToolkit.paintBordersFor(sashForm_3);\n\t\t\n\t\tToolBar toolBar = new ToolBar(sashForm_3, SWT.BORDER | SWT.FLAT | SWT.WRAP | SWT.RIGHT);\n\t\ttoolBar.setToolTipText(\"\");\n\t\t\n\t\tToolItem toolItem_6 = new ToolItem(toolBar, SWT.NONE);\n\t\ttoolItem_6.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tmntmNewItem_2.notifyListeners(SWT.Selection,event1);\n\n\t\t\t}\n\t\t});\n\t\ttoolItem_6.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6253\\u5F00.jpg\"));\n\t\ttoolItem_6.setText(\"\\u6253\\u5F00\");\n\t\t\n\t\tToolItem tltmNewItem = new ToolItem(toolBar, SWT.NONE);\n\t\t\n\t\t\n\t\ttltmNewItem.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\n\n\t\t\t}\n\t\t});\n\t\t//\n\t\t\n\t\ttltmNewItem.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u53E6\\u5B58\\u4E3A.jpg\"));\n\t\ttltmNewItem.setText(\"\\u53E6\\u5B58\\u4E3A\");\n\t\t//关闭\n\t\tToolItem tltmNewItem_4 = new ToolItem(toolBar, SWT.NONE);\n\t\ttltmNewItem_4.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tmntmNewItem_5.notifyListeners(SWT.Selection, event2);\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\ttltmNewItem_4.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7ED3\\u675F.jpg\"));\n\t\ttltmNewItem_4.setText(\"\\u5173\\u95ED\");\n\t\t\n\t\t\n\t\t\n\t\tToolItem tltmNewItem_1 = new ToolItem(toolBar, SWT.NONE);\n\t\ttltmNewItem_1.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t//缩放\n\t\t\n\t\t\n\t\ttltmNewItem_1.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u653E\\u5927.jpg\"));\n\t\t\n\t\t//工具栏:放大\n\t\t\n\t\ttltmNewItem_1.setText(\"\\u653E\\u5927\");\n\t\t\n\t\tToolItem tltmNewItem_2 = new ToolItem(toolBar, SWT.NONE);\n\t\t\n\t\t//工具栏:缩小\n\t\ttltmNewItem_2.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t}\n\t\t});\n\t\t\n\t\ttltmNewItem_2.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F29\\u5C0F.jpg\"));\n\t\ttltmNewItem_2.setText(\"\\u7F29\\u5C0F\");\n\t\tToolItem toolItem_5 = new ToolItem(toolBar, SWT.NONE);\n\t\ttoolItem_5.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tmntmNewItem_5.notifyListeners(SWT.Selection, event2);\n\n\t\t\t}\n\t\t});\n\t\ttoolItem_5.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7ED3\\u675F.jpg\"));\n\t\ttoolItem_5.setText(\"\\u9000\\u51FA\");\n\t\t\n\t\tToolBar toolBar_1 = new ToolBar(sashForm_3, SWT.BORDER | SWT.FLAT | SWT.RIGHT);\n\t\tformToolkit.adapt(toolBar_1);\n\t\tformToolkit.paintBordersFor(toolBar_1);\n\t\t\n\t\tToolItem toolItem_7 = new ToolItem(toolBar_1, SWT.NONE);\n\t\t\n\t\t//工具栏:标题\n\t\ttoolItem_7.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t}\n\t\t});\n\t\t//\n\t\t\n\t\ttoolItem_7.setText(\"\\u6807\\u9898\");\n\t\ttoolItem_7.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6807\\u9898.jpg\"));\n\t\t\n\t\tToolItem toolItem_1 = new ToolItem(toolBar_1, SWT.NONE);\n\t\t\n\t\t//工具栏:调整大小\n\t\ttoolItem_1.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t}\n\t\t});\n\t\t//\n\t\t\n\t\ttoolItem_1.setText(\"\\u8C03\\u6574\\u5927\\u5C0F\");\n\t\ttoolItem_1.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u8C03\\u6574\\u5927\\u5C0F.jpg\"));\n\t\t\n\t\tToolBar toolBar_2 = new ToolBar(sashForm_3, SWT.BORDER | SWT.FLAT | SWT.RIGHT);\n\t\ttoolBar_2.setBackground(SWTResourceManager.getColor(SWT.COLOR_GRAY));\n\t\tformToolkit.adapt(toolBar_2);\n\t\tformToolkit.paintBordersFor(toolBar_2);\n\t\t\n\t\tToolItem toolItem_2 = new ToolItem(toolBar_2, SWT.NONE);\n\t\t\n\t\t//工具栏:裁剪\n\t\ttoolItem_2.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t}\n\t\t});\n\t\t//\n\t\t\n\t\ttoolItem_2.setText(\"\\u88C1\\u526A\");\n\t\ttoolItem_2.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u88C1\\u526A.jpg\"));\n\t\t\n\t\tToolItem toolItem_3 = new ToolItem(toolBar_2, SWT.NONE);\n\t\t\n\t\t//工具栏:剪切\n\t\ttoolItem_3.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t}\n\t\t});\n\t\t//\n\t\t\n\t\ttoolItem_3.setText(\"\\u526A\\u5207\");\n\t\ttoolItem_3.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u526A\\u5207.jpg\"));\n\t\t\n\t\tToolItem toolItem_4 = new ToolItem(toolBar_2, SWT.NONE);\n\t\t\n\n\t\t//工具栏:粘贴\n\t\ttoolItem_4.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t\tcomposite_3.layout();\n\t\t\t\tFile f=new File(\"src/picture/beauty.jpg\");\n\t\t\t\tImageData imageData;\n\t\t\t\ttry {\n\t\t\t\t\timageData = new ImageData( new FileInputStream( f));\n\t\t\t\t\tImage image=new Image(shlFaststone.getDisplay(),imageData);\n\t\t\t\t\tButton lblNewLabel_3 = null;\n\t\t\t\t\tlblNewLabel_3.setImage(image);\n\t\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tcomposite_3.layout();\n\t\t\t}\n\t\t});\n\t\t//omposite;\n\t\t//\n\t\t\n\t\ttoolItem_4.setText(\"\\u590D\\u5236\");\n\t\ttoolItem_4.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u590D\\u5236.jpg\"));\n\t\t\n\t\tToolItem tltmNewItem_3 = new ToolItem(toolBar_2, SWT.NONE);\n\t\ttltmNewItem_3.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u7C98\\u8D34.jpg\"));\n\t\ttltmNewItem_3.setText(\"\\u7C98\\u8D34\");\n\t\tsashForm_3.setWeights(new int[] {486, 165, 267});\n\t\t\n\t\tComposite composite_1 = new Composite(sashForm, SWT.NONE);\n\t\tformToolkit.adapt(composite_1);\n\t\tformToolkit.paintBordersFor(composite_1);\n\t\tcomposite_1.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tSashForm sashForm_1 = new SashForm(composite_1, SWT.VERTICAL);\n\t\tformToolkit.adapt(sashForm_1);\n\t\tformToolkit.paintBordersFor(sashForm_1);\n\t\t\n\t\tComposite composite_2 = new Composite(sashForm_1, SWT.NONE);\n\t\tformToolkit.adapt(composite_2);\n\t\tformToolkit.paintBordersFor(composite_2);\n\t\tcomposite_2.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tTabFolder tabFolder = new TabFolder(composite_2, SWT.NONE);\n\t\ttabFolder.setTouchEnabled(true);\n\t\tformToolkit.adapt(tabFolder);\n\t\tformToolkit.paintBordersFor(tabFolder);\n\t\t\n\t\tTabItem tbtmNewItem = new TabItem(tabFolder, SWT.NONE);\n\t\ttbtmNewItem.setText(\"\\u65B0\\u5EFA\\u4E00\");\n\t\t\n\t\tTabItem tbtmNewItem_1 = new TabItem(tabFolder, SWT.NONE);\n\t\ttbtmNewItem_1.setText(\"\\u65B0\\u5EFA\\u4E8C\");\n\t\t\n\t\tTabItem tbtmNewItem_2 = new TabItem(tabFolder, SWT.NONE);\n\t\ttbtmNewItem_2.setText(\"\\u65B0\\u5EFA\\u4E09\");\n\t\t\n\t\tButton button = new Button(tabFolder, SWT.CHECK);\n\t\tbutton.setText(\"Check Button\");\n\t\t\n\t\tcomposite_3 = new Composite(sashForm_1, SWT.H_SCROLL | SWT.V_SCROLL);\n\t\t\n\t\tformToolkit.adapt(composite_3);\n\t\tformToolkit.paintBordersFor(composite_3);\n\t\tcomposite_3.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tLabel lblNewLabel_3 = new Label(composite_3, SWT.NONE);\n\t\tformToolkit.adapt(lblNewLabel_3, true, true);\n\t\tlblNewLabel_3.setText(\"\");\n\t\tsashForm_1.setWeights(new int[] {19, 323});\n\t\t\n\t\tComposite composite_5 = new Composite(sashForm, SWT.NONE);\n\t\tcomposite_5.setToolTipText(\"\");\n\t\tcomposite_5.setLayout(new FillLayout(SWT.HORIZONTAL));\n\t\t\n\t\tSashForm sashForm_2 = new SashForm(composite_5, SWT.NONE);\n\t\tformToolkit.adapt(sashForm_2);\n\t\tformToolkit.paintBordersFor(sashForm_2);\n\t\t\n\t\tLabel lblNewLabel = new Label(sashForm_2, SWT.BORDER | SWT.CENTER);\n\t\tformToolkit.adapt(lblNewLabel, true, true);\n\t\tlblNewLabel.setText(\"1/1\");\n\t\t\n\t\tLabel lblNewLabel_2 = new Label(sashForm_2, SWT.BORDER | SWT.CENTER);\n\t\tformToolkit.adapt(lblNewLabel_2, true, true);\n\t\tlblNewLabel_2.setText(\"\\u5927\\u5C0F\\uFF1A1366*728\");\n\t\t\n\t\tLabel lblNewLabel_1 = new Label(sashForm_2, SWT.CENTER);\n\t\tformToolkit.adapt(lblNewLabel_1, true, true);\n\t\tlblNewLabel_1.setText(\"\\u7F29\\u653E\\uFF1A100%\");\n\t\t\n\t\tLabel label = new Label(sashForm_2, SWT.NONE);\n\t\tlabel.setAlignment(SWT.RIGHT);\n\t\tformToolkit.adapt(label, true, true);\n\t\tlabel.setText(\"\\u5494\\u5693\\u5DE5\\u4F5C\\u5BA4\\u7248\\u6743\\u6240\\u6709\");\n\t\tsashForm_2.setWeights(new int[] {127, 141, 161, 490});\n\t\tsashForm.setWeights(new int[] {50, 346, 22});\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tMenuItem mntmNewItem = new MenuItem(menu_1, SWT.NONE);\n\t\tmntmNewItem.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6587\\u4EF6\\u5B50\\u56FE\\u6807/\\u6587\\u4EF6.\\u65B0\\u5EFA.jpg\"));\n\t\tmntmNewItem.setText(\"\\u65B0\\u5EFA\");\n\t\t\n\t\tmntmNewItem_2 = new MenuItem(menu_1, SWT.NONE);\n\t\tmntmNewItem_2.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\n\t\t\t\t//Label lblNewLabel_3 = new Label(composite_1, SWT.NONE);\n\t\t\t\t//Canvas c=new Canvas(shlFaststone,SWT.BALLOON);\n\t\t\t\t\n\t\t\t\tFileDialog dialog = new FileDialog(shlFaststone,SWT.OPEN); \n\t\t\t\tdialog.setFilterPath(System.getProperty(\"user_home\"));//设置初始路径\n\t\t\t\tdialog.setFilterNames(new String[] {\"文本文档(*txt)\",\"所有文档\"}); \n\t\t\t\tdialog.setFilterExtensions(new String[]{\"*.exe\",\"*.xls\",\"*.*\"});\n\t\t\t\tString path=dialog.open();\n\t\t\t\tString s=null;\n\t\t\t\tFile f=null;\n\t\t\t\tif(path==null||\"\".equals(path)) {\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\ttry{\n\t\t\t f=new File(path);\n\t\t\t\tbyte[] bs=Fileutil.readFile(f);\n\t\t\t s=new String(bs,\"UTF-8\");\n\t\t\t\t}catch (Exception e1) {\n\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\tMessageDialog.openError(shlFaststone, \"出错了\", \"打开\"+path+\"出错了\");\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t \n\t\t\t\ttext = new Text(composite_4, SWT.BORDER | SWT.WRAP\n\t\t\t\t\t\t| SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL\n\t\t\t\t\t\t| SWT.MULTI);\n\t\t\t\ttext.setText(s);\n\t\t\t\tcomposite_1.layout();\n\t\t\t\tshlFaststone.setText(shlFaststone.getText()+\"\\t\"+f.getName());\n\t\t\t\t\t\n\t\t\t\tFile f1=new File(path);\n\t\t\t\tImageData imageData;\n\t\t\t\ttry {\n\t\t\t\t\timageData = new ImageData( new FileInputStream( f1));\n\t\t\t\t\tImage image=new Image(shlFaststone.getDisplay(),imageData);\n\t\t\t\t\tlblNewLabel_3.setImage(image);\n\t\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t});\n\t\tmntmNewItem_2.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6587\\u4EF6\\u5B50\\u56FE\\u6807/\\u6587\\u4EF6.\\u6253\\u5F00.jpg\"));\n\t\tmntmNewItem_2.setText(\"\\u6253\\u5F00\");\n\t\t\n\t\tMenuItem mntmNewItem_1 = new MenuItem(menu_1, SWT.NONE);\n\t\tmntmNewItem_1.setText(\"\\u4ECE\\u526A\\u8D34\\u677F\\u5BFC\\u5165\");\n\t\t\n\t\tMenuItem mntmNewItem_3 = new MenuItem(menu_1, SWT.NONE);\n\t\tmntmNewItem_3.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6587\\u4EF6\\u5B50\\u56FE\\u6807/\\u6587\\u4EF6.\\u53E6\\u5B58\\u4E3A.jpg\"));\n\t\tmntmNewItem_3.setText(\"\\u53E6\\u5B58\\u4E3A\");\n\t\t\n\t\t mntmNewItem_5 = new MenuItem(menu_1, SWT.NONE);\n\t\tmntmNewItem_5.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t boolean result=MessageDialog.openConfirm(shlFaststone,\"退出\",\"是否确认退出\");\n\t\t\t\t if(result) {\n\t\t\t\t\t System.exit(0);\n\t\t\t\t }\n\n\t\t\t}\n\t\t});\n\t\tmntmNewItem_5.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6587\\u4EF6\\u5B50\\u56FE\\u6807/\\u6587\\u4EF6.\\u4FDD\\u5B58.jpg\"));\n\t\tmntmNewItem_5.setText(\"\\u5173\\u95ED\");\n\t\tevent2=new Event();\n\t\tevent2.widget=mntmNewItem_5;\n\n\t\t\n\t\tMenuItem mntmNewSubmenu = new MenuItem(menu, SWT.CASCADE);\n\t\tmntmNewSubmenu.setText(\"\\u6355\\u6349\");\n\t\t\n\t\tMenu menu_2 = new Menu(mntmNewSubmenu);\n\t\tmntmNewSubmenu.setMenu(menu_2);\n\t\t\n\t\tMenuItem mntmNewItem_6 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_6.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349\\u6D3B\\u52A8\\u7A97\\u53E3.jpg\"));\n\t\tmntmNewItem_6.setText(\"\\u6355\\u6349\\u6D3B\\u52A8\\u7A97\\u53E3\");\n\t\t\n\t\tMenuItem mntmNewItem_7 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_7.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.\\u6355\\u6349\\u7A97\\u53E3\\u6216\\u5BF9\\u8C61.jpg\"));\n\t\tmntmNewItem_7.setText(\"\\u6355\\u6349\\u7A97\\u53E3\\u5BF9\\u8C61\");\n\t\t\n\t\tMenuItem mntmNewItem_8 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_8.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.jpg\"));\n\t\tmntmNewItem_8.setText(\"\\u6355\\u6349\\u77E9\\u5F62\\u533A\\u57DF\");\n\t\t\n\t\tMenuItem mntmNewItem_9 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_9.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.\\u624B\\u7ED8\\u533A\\u57DF.jpg\"));\n\t\tmntmNewItem_9.setText(\"\\u6355\\u6349\\u624B\\u7ED8\\u533A\\u57DF\");\n\t\t\n\t\tMenuItem mntmNewItem_10 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_10.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.\\u6574\\u4E2A\\u5C4F\\u5E55.jpg\"));\n\t\tmntmNewItem_10.setText(\"\\u6355\\u6349\\u6574\\u4E2A\\u5C4F\\u5E55\");\n\t\t\n\t\tMenuItem mntmNewItem_11 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_11.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349\\u6EDA\\u52A8\\u7A97\\u53E3.jpg\"));\n\t\tmntmNewItem_11.setText(\"\\u6355\\u6349\\u6EDA\\u52A8\\u7A97\\u53E3\");\n\t\t\n\t\tMenuItem mntmNewItem_12 = new MenuItem(menu_2, SWT.NONE);\n\t\tmntmNewItem_12.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.\\u56FA\\u5B9A\\u5927\\u5C0F\\u533A\\u57DF.jpg\"));\n\t\tmntmNewItem_12.setText(\"\\u6355\\u6349\\u56FA\\u5B9A\\u5927\\u5C0F\\u533A\\u57DF\");\n\t\t\n\t\tMenuItem menuItem_1 = new MenuItem(menu_2, SWT.NONE);\n\t\tmenuItem_1.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u6355\\u6349/\\u6355\\u6349.\\u91CD\\u590D\\u4E0A\\u6B21\\u6355\\u6349.jpg\"));\n\t\tmenuItem_1.setText(\"\\u91CD\\u590D\\u4E0A\\u6B21\\u6355\\u6349\");\n\t\t\n\t\tMenuItem menuItem_2 = new MenuItem(menu, SWT.CASCADE);\n\t\tmenuItem_2.setText(\"\\u7F16\\u8F91\");\n\t\t\n\t\tMenu menu_3 = new Menu(menuItem_2);\n\t\tmenuItem_2.setMenu(menu_3);\n\t\t\n\t\tMenuItem mntmNewItem_14 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_14.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u5DE6\\u64A4\\u9500.jpg\"));\n\t\tmntmNewItem_14.setText(\"\\u64A4\\u9500\");\n\t\t\n\t\tMenuItem mntmNewItem_13 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_13.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u53F3\\u64A4\\u9500.jpg\"));\n\t\tmntmNewItem_13.setText(\"\\u91CD\\u505A\");\n\t\t\n\t\tMenuItem mntmNewItem_15 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_15.setText(\"\\u9009\\u62E9\\u5168\\u90E8\");\n\t\t\n\t\tMenuItem mntmNewItem_16 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_16.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u7F16\\u8F91.\\u88C1\\u526A.jpg\"));\n\t\tmntmNewItem_16.setText(\"\\u88C1\\u526A\");\n\t\t\n\t\tMenuItem mntmNewItem_17 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_17.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u526A\\u5207.jpg\"));\n\t\tmntmNewItem_17.setText(\"\\u526A\\u5207\");\n\t\t\n\t\tMenuItem mntmNewItem_18 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_18.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u590D\\u5236.jpg\"));\n\t\tmntmNewItem_18.setText(\"\\u590D\\u5236\");\n\t\t\n\t\tMenuItem menuItem_4 = new MenuItem(menu_3, SWT.NONE);\n\t\tmenuItem_4.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u7C98\\u8D34.jpg\"));\n\t\tmenuItem_4.setText(\"\\u7C98\\u8D34\");\n\t\t\n\t\tMenuItem mntmNewItem_19 = new MenuItem(menu_3, SWT.NONE);\n\t\tmntmNewItem_19.setText(\"\\u5220\\u9664\");\n\t\t\n\t\tMenuItem menuItem_3 = new MenuItem(menu, SWT.CASCADE);\n\t\tmenuItem_3.setText(\"\\u7279\\u6548\");\n\t\t\n\t\tMenu menu_4 = new Menu(menuItem_3);\n\t\tmenuItem_3.setMenu(menu_4);\n\t\t\n\t\tMenuItem mntmNewItem_20 = new MenuItem(menu_4, SWT.NONE);\n\t\tmntmNewItem_20.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7279\\u6548.\\u6C34\\u5370.jpg\"));\n\t\tmntmNewItem_20.setText(\"\\u6C34\\u5370\");\n\t\t\n\t\tPanelPic ppn = new PanelPic();\n\t\tMenuItem mntmNewItem_21 = new MenuItem(menu_4, SWT.NONE);\n\t\tmntmNewItem_21.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\tflag[0]=true;\n\t\t\t\tflag[1]=false;\n\n\t\t\t}\n\n\t\t});\n\t\t\n\t\tdown.addMouseListener(new MouseAdapter(){\n\t\t\tpublic void mouseDown(MouseEvent e)\n\t\t\t{\n\t\t\t\tmouseDown=true;\n\t\t\t\tpt=new Point(e.x,e.y);\n\t\t\t\tif(flag[1])\n\t\t\t\t{\n\t\t\t\t\trect=new Composite(down,SWT.BORDER);\n\t\t\t\t\trect.setLocation(e.x, e.y);\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic void mouseUp(MouseEvent e)\n\t\t\t{\n\t\t\t\tmouseDown=false;\n\t\t\t\tif(flag[1]&&dirty)\n\t\t\t\t{\n\t\t\t\t\trexx[n-1]=rect.getBounds();\n\t\t\t\t\trect.dispose();\n\t\t\t\t\tdown.redraw();\n\t\t\t\t\tdirty=false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tdown.addMouseMoveListener(new MouseMoveListener(){\n\t\t\t@Override\n\t\t\tpublic void mouseMove(MouseEvent e) {\n if(mouseDown)\n {\n \t dirty=true;\n\t\t\t\tif(flag[0])\n\t\t\t {\n \t GC gc=new GC(down);\n gc.drawLine(pt.x, pt.y, e.x, e.y);\n list.add(new int[]{pt.x,pt.y,e.x,e.y});\n pt.x=e.x;pt.y=e.y;\n\t\t\t }\n else if(flag[1])\n {\n \t if(rect!=null)\n \t rect.setSize(rect.getSize().x+e.x-pt.x, rect.getSize().y+e.y-pt.y);\n// \t down.redraw();\n \t pt.x=e.x;pt.y=e.y;\n }\n }\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tdown.addPaintListener(new PaintListener(){\n\t\t\t@Override\n\t\t\tpublic void paintControl(PaintEvent e) {\n\t\t\t\tfor(int i=0;i<list.size();i++)\n\t\t\t\t{\n\t\t\t\t\tint a[]=list.get(i);\n\t\t\t\t\te.gc.drawLine(a[0], a[1], a[2], a[3]);\n\t\t\t\t}\n\t\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\t{\n\t\t\t\t\tif(rexx[i]!=null)\n\t\t\t\t\t\te.gc.drawRectangle(rexx[i]);\n\t\t\t\t}\n\t\t\t}});\n\n\t\t\n\t\tmntmNewItem_21.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7279\\u6548.\\u6587\\u5B57.jpg\"));\n\t\tmntmNewItem_21.setText(\"\\u753B\\u7B14\");\n\t\t\n\t\tMenuItem mntmNewSubmenu_1 = new MenuItem(menu, SWT.CASCADE);\n\t\tmntmNewSubmenu_1.setText(\"\\u67E5\\u770B\");\n\t\t\n\t\tMenu menu_5 = new Menu(mntmNewSubmenu_1);\n\t\tmntmNewSubmenu_1.setMenu(menu_5);\n\t\t\n\t\tMenuItem mntmNewItem_24 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_24.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u67E5\\u770B.\\u653E\\u5927.jpg\"));\n\t\tmntmNewItem_24.setText(\"\\u653E\\u5927\");\n\t\t\n\t\tMenuItem mntmNewItem_25 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_25.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u67E5\\u770B.\\u7F29\\u5C0F.jpg\"));\n\t\tmntmNewItem_25.setText(\"\\u7F29\\u5C0F\");\n\t\t\n\t\tMenuItem mntmNewItem_26 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_26.setText(\"\\u5B9E\\u9645\\u5C3A\\u5BF8\\uFF08100%\\uFF09\");\n\t\t\n\t\tMenuItem mntmNewItem_27 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_27.setText(\"\\u9002\\u5408\\u7A97\\u53E3\");\n\t\t\n\t\tMenuItem mntmNewItem_28 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_28.setText(\"100%\");\n\t\t\n\t\tMenuItem mntmNewItem_29 = new MenuItem(menu_5, SWT.NONE);\n\t\tmntmNewItem_29.setText(\"200%\");\n\t\t\n\t\tMenuItem mntmNewSubmenu_2 = new MenuItem(menu, SWT.CASCADE);\n\t\tmntmNewSubmenu_2.setText(\"\\u8BBE\\u7F6E\");\n\t\t\n\t\tMenu menu_6 = new Menu(mntmNewSubmenu_2);\n\t\tmntmNewSubmenu_2.setMenu(menu_6);\n\t\t\n\t\tMenuItem menuItem_5 = new MenuItem(menu, SWT.CASCADE);\n\t\tmenuItem_5.setText(\"\\u5E2E\\u52A9\");\n\t\t\n\t\tMenu menu_7 = new Menu(menuItem_5);\n\t\tmenuItem_5.setMenu(menu_7);\n\t\t\n\t\tMenuItem menuItem_6 = new MenuItem(menu_7, SWT.NONE);\n\t\tmenuItem_6.setText(\"\\u7248\\u672C\");\n\t\t\n\t\tMenuItem mntmNewItem_23 = new MenuItem(menu, SWT.NONE);\n\t\tmntmNewItem_23.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u5DE6\\u64A4\\u9500.jpg\"));\n\t\t\n\t\tMenuItem mntmNewItem_30 = new MenuItem(menu, SWT.NONE);\n\t\tmntmNewItem_30.setImage(SWTResourceManager.getImage(Edit.class, \"/\\u622A\\u56FE\\u5DE5\\u5177/\\u56FE\\u7247\\u8D44\\u6E90/\\u7F16\\u8F91\\u5B50\\u56FE\\u6807/\\u53F3\\u64A4\\u9500.jpg\"));\n\n\t}", "public static void createGUI(GUIbrain draw) {\n JFrame window = new JFrame(\"BrainToC\");\n window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n window.setPreferredSize(new Dimension(500,520));\n window.getContentPane().add(draw);\n window.setGlassPane(draw);\n //window.setLocationRelativeTo(null);\n window.setResizable(false);\n window.pack();\n window.setVisible(true);\n draw.setFocusable(true);\n draw.setVisible(true);\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n \n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n playButton = new javax.swing.JButton();\n sairButton = new javax.swing.JButton();\n creditosButton = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"SquareRPG\");\n setLocationByPlatform(true);\n setMaximumSize(new java.awt.Dimension(1280, 740));\n setMinimumSize(new java.awt.Dimension(1280, 740));\n setResizable(false);\n getContentPane().setLayout(null);\n\n playButton.setText(\"JOGAR\");\n playButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n playButtonActionPerformed(evt);\n }\n });\n getContentPane().add(playButton);\n playButton.setBounds(470, 350, 340, 50);\n\n sairButton.setText(\"SAIR\");\n sairButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n sairButtonActionPerformed(evt);\n }\n });\n getContentPane().add(sairButton);\n sairButton.setBounds(470, 620, 340, 50);\n\n creditosButton.setText(\"CRÉDITOS\");\n getContentPane().add(creditosButton);\n creditosButton.setBounds(470, 440, 340, 50);\n\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/logo.png\"))); // NOI18N\n getContentPane().add(jLabel1);\n jLabel1.setBounds(410, 130, 440, 90);\n\n jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/imagens/menuBackground.jpg\"))); // NOI18N\n jLabel2.setMaximumSize(new java.awt.Dimension(1280, 700));\n jLabel2.setMinimumSize(new java.awt.Dimension(1280, 700));\n getContentPane().add(jLabel2);\n jLabel2.setBounds(0, 0, 1280, 720);\n\n pack();\n setLocationRelativeTo(null);\n }", "public Theme(boolean creative){\n // make the GUI GORGEOUS!!!!! (for creativity points)\n if(creative){\n topField = new JLabel(new ImageIcon(getClass().getResource(\"/logo.jpg\")));\n \n statusField = new JLabel(new ImageIcon(getClass().getResource(\"/gravel.jpg\")));\n statusField.setForeground(new Color(0xE7C526));\n \n blankSquare = new ImageIcon(getClass().getResource(\"/grass.jpg\"));\n playerSquare = new ImageIcon(getClass().getResource(\"/cowSquare.jpg\"));\n opponentSquare = new ImageIcon(getClass().getResource(\"/opponentSquare.jpg\"));\n }\n \n // make the Gui strictly adhere to the assignment guidelines\n else{\n topField = new JLabel(\"Tic Tac Toe\");\n topField.setOpaque(true);\n topField.setBackground(Color.WHITE);\n topField.setFont(new Font(\"Dialog\", 1, 80));\n topField.setHorizontalAlignment(JLabel.CENTER);\n\n statusField = new JLabel();\n statusField.setOpaque(true);\n statusField.setBackground(Color.WHITE);\n statusField.setHorizontalAlignment(JLabel.CENTER);\n \n blankSquare = new ImageIcon(getClass().getResource(\"/blank.png\"));\n playerSquare = new ImageIcon(getClass().getResource(\"/boringPlayer.png\"));\n opponentSquare = new ImageIcon(getClass().getResource(\"/boringOpponent.png\"));\n }\n }" ]
[ "0.6984784", "0.667116", "0.66189057", "0.6545113", "0.6513546", "0.64383155", "0.6435154", "0.64002055", "0.6395499", "0.6386384", "0.6368835", "0.6347641", "0.6345228", "0.6340357", "0.63291705", "0.6315935", "0.6288399", "0.62700695", "0.62653", "0.62515795", "0.62417835", "0.62278813", "0.6219409", "0.621816", "0.61766684", "0.617289", "0.61661935", "0.6157359", "0.61565834", "0.61445767", "0.61426437", "0.6124246", "0.6089551", "0.60808796", "0.6077634", "0.60766375", "0.606317", "0.605536", "0.605239", "0.6051236", "0.6046957", "0.60296816", "0.6023646", "0.6015988", "0.6013732", "0.60112375", "0.5999906", "0.59940785", "0.59851974", "0.5981139", "0.59798634", "0.5977751", "0.5975717", "0.5975717", "0.59728783", "0.59718275", "0.5961202", "0.59604794", "0.5959057", "0.59521395", "0.59516853", "0.59505486", "0.59460187", "0.5937313", "0.59370404", "0.5931737", "0.59310406", "0.5927952", "0.5923368", "0.5919893", "0.5915248", "0.5913863", "0.5906424", "0.59051704", "0.59046465", "0.59046465", "0.59030724", "0.59007347", "0.5898454", "0.5894015", "0.58939236", "0.58939236", "0.58936787", "0.58917046", "0.5887237", "0.58791095", "0.5878215", "0.5874196", "0.5873128", "0.5868116", "0.58678854", "0.5865296", "0.5864328", "0.5863475", "0.5862595", "0.58536404", "0.5847208", "0.5846938", "0.5831401", "0.58274996" ]
0.7169308
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { rsAnchorGroup = new javax.swing.ButtonGroup(); sheetPanel = new javax.swing.JPanel(); spriteSheetScrollPane = new javax.swing.JScrollPane(); jPanel1 = new javax.swing.JPanel(); selectNoneButton = new javax.swing.JButton(); selectAllButton = new javax.swing.JButton(); findSpritesButton = new javax.swing.JButton(); openButton = new javax.swing.JButton(); reshapeButton = new javax.swing.JButton(); closeButton = new javax.swing.JButton(); mergeButton = new javax.swing.JButton(); connLabel = new javax.swing.JLabel(); connSelector = new javax.swing.JComboBox(); storeClipsButton = new javax.swing.JButton(); filterLabel = new javax.swing.JLabel(); filterSelector = new javax.swing.JComboBox(); jPanel2 = new javax.swing.JPanel(); trRadioButton = new javax.swing.JRadioButton(); tlRadioButton = new javax.swing.JRadioButton(); clRadioButton = new javax.swing.JRadioButton(); crRadioButton = new javax.swing.JRadioButton(); tcRadioButton = new javax.swing.JRadioButton(); brRadioButton = new javax.swing.JRadioButton(); blRadioButton = new javax.swing.JRadioButton(); bcRadioButton = new javax.swing.JRadioButton(); ccRadioButton = new javax.swing.JRadioButton(); storedPanel = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); clippedList = new javax.swing.JList(); removeButton = new javax.swing.JButton(); saveToButton = new javax.swing.JButton(); spriteDetailer = new com.fluffynukeit.SpriteClipper.GUI.SpriteDetailer(); packButton = new javax.swing.JButton(); packerLabel = new javax.swing.JLabel(); packerSelector = new javax.swing.JComboBox(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Sprite Clipper"); setBounds(new java.awt.Rectangle(0, 0, 800, 600)); setFocusable(false); setName("mainFrame"); // NOI18N sheetPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Sprite Sheet")); sheetPanel.setFocusable(false); spriteSheetScrollPane.setFocusable(false); jPanel1.setFocusable(false); selectNoneButton.setText("None"); selectNoneButton.setToolTipText("<html><div align=\"center\">Deselects all found sprites. (Ctrl+N)</div></html>"); selectNoneButton.setEnabled(false); selectNoneButton.setFocusable(false); selectNoneButton.setName("findSpritesButton"); // NOI18N selectNoneButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selectNoneButtonActionPerformed(evt); } }); selectAllButton.setText("All"); selectAllButton.setToolTipText("<html><div align=\"center\">Selects all found sprites. (Ctrl+A)</div></html>"); selectAllButton.setEnabled(false); selectAllButton.setFocusable(false); selectAllButton.setName("findSpritesButton"); // NOI18N selectAllButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selectAllButtonActionPerformed(evt); } }); findSpritesButton.setFont(new java.awt.Font("DejaVu Sans", 0, 14)); findSpritesButton.setText("<html><div align=\"center\">Find<br>Sprites!</div></html>"); findSpritesButton.setToolTipText("<html><div align=\"center\">Identifies sprites in the sprite sheet using selected <br> background filter and connectedness criterion. (Ctrl+F)</div></html>"); findSpritesButton.setEnabled(false); findSpritesButton.setFocusable(false); findSpritesButton.setName("findSpritesButton"); // NOI18N findSpritesButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { findSpritesButtonActionPerformed(evt); } }); openButton.setText("Open"); openButton.setToolTipText("<html><div align=\"center\">Opens a sprite sheet. (Ctrl+O)</div></html>"); openButton.setFocusable(false); openButton.setName("openButton"); // NOI18N openButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { openButtonActionPerformed(evt); } }); reshapeButton.setText("Reshape"); reshapeButton.setToolTipText("<html><div align=\"center\">Select multiple sprites on the sheet, an anchor point, then press reshape.<br>The bounds of all selected clips will be expanded to the same size. (Ctrl+R)</div></html>"); reshapeButton.setEnabled(false); reshapeButton.setFocusable(false); reshapeButton.setName("findSpritesButton"); // NOI18N reshapeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { reshapeButtonActionPerformed(evt); } }); closeButton.setText("Close"); closeButton.setToolTipText("<html><div align=\"center\">Closes the open sprite sheet. (Ctrl+W)</div></html>"); closeButton.setEnabled(false); closeButton.setFocusable(false); closeButton.setName("closeButton"); // NOI18N closeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { closeButtonActionPerformed(evt); } }); mergeButton.setText("Merge"); mergeButton.setToolTipText("<html><div align=\"center\">Combines multiple selected sprites. (Ctrl+M)</div></html>"); mergeButton.setEnabled(false); mergeButton.setFocusable(false); mergeButton.setName("findSpritesButton"); // NOI18N mergeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { mergeButtonActionPerformed(evt); } }); connLabel.setText("Connected criterion:"); connSelector.setModel(new DefaultComboBoxModel(spriteClipper.getAvailableFinders())); connSelector.setFocusable(false); connSelector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { connSelectorActionPerformed(evt); } }); storeClipsButton.setFont(new java.awt.Font("DejaVu Sans", 0, 14)); storeClipsButton.setText("Clip!"); storeClipsButton.setToolTipText("<html><div align=\"center\">Adds selected sprites to the clipped sprites. (Ctrl+C)</div></html>"); storeClipsButton.setEnabled(false); storeClipsButton.setFocusable(false); storeClipsButton.setName("findSpritesButton"); // NOI18N storeClipsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { storeClipsButtonActionPerformed(evt); } }); filterLabel.setText("Background is..."); filterSelector.setModel(new DefaultComboBoxModel(spriteClipper.getAvailableFilters())); filterSelector.setFocusable(false); filterSelector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { filterSelectorActionPerformed(evt); } }); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("RS Anchor")); jPanel2.setFocusable(false); trRadioButton.setEnabled(false); trRadioButton.setFocusable(false); tlRadioButton.setEnabled(false); tlRadioButton.setFocusable(false); clRadioButton.setEnabled(false); clRadioButton.setFocusable(false); crRadioButton.setEnabled(false); crRadioButton.setFocusable(false); tcRadioButton.setEnabled(false); tcRadioButton.setFocusable(false); brRadioButton.setEnabled(false); brRadioButton.setFocusable(false); blRadioButton.setEnabled(false); blRadioButton.setFocusable(false); bcRadioButton.setEnabled(false); bcRadioButton.setFocusable(false); ccRadioButton.setEnabled(false); ccRadioButton.setFocusable(false); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup() .addComponent(clRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ccRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(crRadioButton)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup() .addComponent(tlRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tcRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(trRadioButton))) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(blRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(bcRadioButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(brRadioButton))) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(tlRadioButton) .addComponent(tcRadioButton) .addComponent(trRadioButton)) .addGap(6, 6, 6) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(clRadioButton) .addComponent(crRadioButton) .addComponent(ccRadioButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(bcRadioButton) .addComponent(blRadioButton) .addComponent(brRadioButton))) ); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(openButton) .addGap(8, 8, 8) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(filterLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE) .addComponent(filterSelector, 0, 145, Short.MAX_VALUE) .addComponent(connLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE))) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(closeButton) .addGap(8, 8, 8) .addComponent(connSelector, 0, 145, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(findSpritesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(selectNoneButton, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(reshapeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(selectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(mergeButton, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(storeClipsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(24, 24, 24)) ); jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {mergeButton, reshapeButton, selectAllButton, selectNoneButton}); jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {closeButton, openButton}); jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {findSpritesButton, storeClipsButton}); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(selectAllButton, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE) .addComponent(mergeButton, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(selectNoneButton, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE) .addComponent(reshapeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(filterLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(openButton) .addComponent(filterSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(connLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(closeButton) .addComponent(connSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(findSpritesButton, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE) .addContainerGap()) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(storeClipsButton, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)) .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {mergeButton, reshapeButton, selectAllButton, selectNoneButton}); jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {closeButton, openButton}); javax.swing.GroupLayout sheetPanelLayout = new javax.swing.GroupLayout(sheetPanel); sheetPanel.setLayout(sheetPanelLayout); sheetPanelLayout.setHorizontalGroup( sheetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(sheetPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addComponent(spriteSheetScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 674, Short.MAX_VALUE) ); sheetPanelLayout.setVerticalGroup( sheetPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sheetPanelLayout.createSequentialGroup() .addComponent(spriteSheetScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)) ); storedPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Clipped Sprites")); storedPanel.setFocusable(false); clippedList.setModel(new DefaultListModel()); clippedList.setCellRenderer(new ClipCellRenderer()); clippedList.setFocusable(false); clippedList.setLayoutOrientation(javax.swing.JList.HORIZONTAL_WRAP); clippedList.setVisibleRowCount(-1); jScrollPane2.setViewportView(clippedList); removeButton.setText("Remove"); removeButton.setToolTipText("<html><div align=\"center\">Removes the selected clipped sprites. (Delete)</div></html>"); removeButton.setEnabled(false); removeButton.setFocusable(false); removeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { removeButtonActionPerformed(evt); } }); saveToButton.setText("Save To..."); saveToButton.setToolTipText("<html><div align=\"center\">Saves all selected clipped sprites to a directory. (Ctrl+S)</div></html>"); saveToButton.setEnabled(false); saveToButton.setFocusable(false); saveToButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveToButtonActionPerformed(evt); } }); spriteDetailer.setFocusable(false); packButton.setText("Pack..."); packButton.setToolTipText("<html><div align=\"center\">Packs the selected sprite clips into a new, dense sheet using the<br>selected packing method, and writes definition text file. (Ctrl+P)</div></html>"); packButton.setEnabled(false); packButton.setFocusable(false); packButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { packButtonActionPerformed(evt); } }); packerLabel.setText("Packing method:"); packerSelector.setModel(new DefaultComboBoxModel(spriteClipper.getAvailablePackers())); packerSelector.setFocusable(false); packerSelector.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { packerSelectorActionPerformed(evt); } }); javax.swing.GroupLayout storedPanelLayout = new javax.swing.GroupLayout(storedPanel); storedPanel.setLayout(storedPanelLayout); storedPanelLayout.setHorizontalGroup( storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, storedPanelLayout.createSequentialGroup() .addComponent(packerSelector, 0, 156, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(packButton)) .addGroup(storedPanelLayout.createSequentialGroup() .addComponent(packerLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .addGroup(storedPanelLayout.createSequentialGroup() .addComponent(saveToButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 72, Short.MAX_VALUE) .addComponent(removeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(spriteDetailer, javax.swing.GroupLayout.DEFAULT_SIZE, 216, Short.MAX_VALUE) ); storedPanelLayout.setVerticalGroup( storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(storedPanelLayout.createSequentialGroup() .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(spriteDetailer, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(saveToButton) .addComponent(removeButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(packerLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(storedPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(packerSelector, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(packButton))) ); storedPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {removeButton, saveToButton}); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(sheetPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(storedPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(sheetPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(storedPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public kunde() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public FrmMenu() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "public Ablak() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.7321245", "0.7292375", "0.7292375", "0.7292375", "0.7286756", "0.7250393", "0.7215278", "0.7208825", "0.7197639", "0.71918", "0.7185626", "0.716065", "0.71489197", "0.7094757", "0.7081307", "0.7057363", "0.69892997", "0.6978972", "0.6956389", "0.69543713", "0.69465107", "0.6943616", "0.69370526", "0.69335246", "0.6928895", "0.69262075", "0.69259804", "0.69132626", "0.69122165", "0.68949795", "0.6893638", "0.689148", "0.68909764", "0.6890215", "0.6884557", "0.688259", "0.68825203", "0.6878597", "0.6876452", "0.6876008", "0.6872711", "0.68606186", "0.6857626", "0.6856689", "0.6856538", "0.68560165", "0.6854488", "0.6853594", "0.6853594", "0.6844268", "0.68379426", "0.68377364", "0.6829578", "0.6829284", "0.6827213", "0.6825348", "0.6823862", "0.68184686", "0.68176556", "0.6810581", "0.6809514", "0.6809368", "0.68090004", "0.68081117", "0.680376", "0.67957234", "0.6795017", "0.6793054", "0.679084", "0.6790513", "0.6789456", "0.67890406", "0.6783252", "0.6767314", "0.6766593", "0.67663574", "0.67581284", "0.67565966", "0.67531246", "0.6752959", "0.67438525", "0.67397165", "0.6738271", "0.67369807", "0.67342347", "0.6728663", "0.67280626", "0.6720753", "0.6717359", "0.6715002", "0.671486", "0.67094135", "0.670803", "0.67050165", "0.67018557", "0.67018354", "0.67003953", "0.6698949", "0.6695529", "0.6692286", "0.6691619" ]
0.0
-1
Scanner sc = new Scanner(System.in);
public static void main(String[] args) { String s = ""; try { File file = new File("C:\\Users\\DELL\\Desktop\\bridgelabz\\example\\sample.txt"); Scanner sc = new Scanner(file); while (sc.hasNextLine()) { s = sc.nextLine(); } System.out.println(s); String[] splt = s.split(""); for (int i = 0; i < splt.length; i++) { System.out.println(splt[i]); } } catch(Exception e) { System.out.println("Not Found"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n\n\n\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t}", "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String str = sc.nextLine();\n System.out.println(str);\n }", "public Ch12Ex1to9()\n {\n scan = new Scanner( System.in );\n }", "public static void main(String args[])\n {\n Scanner in=new Scanner(System.in);\n String str=in.nextLine();\n System.out.println(str);\n }", "public static void main(String[] args) {\n\t\tScanner in = new Scanner(System.in);\n\n\t}", "public MyInput() {\r\n\t\tthis.scanner = new Scanner(System.in);\r\n\t}", "public static void main(String[] args) \n {\n Scanner sc = new Scanner(System.in); \n \n // String input\n System.out.print(\"What's your name? \"); \n String name = sc.nextLine(); \n \n // Print the values to check if input was correctly obtained. \n System.out.println(\"Name: \" + name); \n\n // Close the Scanner\n sc.close();\n }", "public Game() {\n\t\tsc = new Scanner(System.in);\n\t}", "public Menu() {\n scanner = new Scanner(System.in);\n }", "public void inputScanner(){\n\t\t Scanner sc=new Scanner(System.in); \n\t \n\t\t System.out.println(\"Enter your rollno\"); \n\t\t int rollno=sc.nextInt(); \n\t\t System.out.println(\"Enter your name\"); \n\t\t String name=sc.next(); \n\t\t System.out.println(\"Enter your fee\"); \n\t\t double fee=sc.nextDouble(); \n\t\t System.out.println(\"Rollno:\"+rollno+\" name:\"+name+\" fee:\"+fee); \n\t\t sc.close(); \n\t}", "public static void main(String[] args) {\nScanner sc= new Scanner(System.in);\nString name=sc.nextLine();\n\t\tSystem.out.println(\"hello\\n\"+name);\n\t\t\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n\n // String input\n String first = sc.nextLine();\n System.out.println(first);\n\n }", "public static void init() {\n\t\tscanner = new Scanner(System.in);\n\t\treturn;\n\t}", "String consoleInput();", "public Ui() {\n this.scanner = new Scanner(System.in);\n }", "public Ui() {\n this.scanner = new Scanner(System.in);\n }", "public InputReader() {\n reader = new Scanner(System.in);\n }", "private static String getUserInput(String prompt){ \r\n Scanner in = new Scanner(System.in);\r\n System.out.print(prompt);\r\n return in.nextLine();\r\n }", "String readInput() {\n Scanner scanner = new Scanner(System.in);\n return scanner.nextLine();\n }", "@Test\n\tpublic void one()\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"enter the value of a\");\n\t\tint a = sc.nextInt();\n\t\tSystem.out.println(\"value of a is: \" +a);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tInputStream input = System.in;\n\t\tScanner scanner = new Scanner(input);\n\t\t// nextLine()을 실행하기 전에 \n\t\t// 무엇을 해야할지 알려주는 메시지를 먼저 출력 하라.\n\t\t// 이를 'prompt(프롬프트)' 라고 한다\n\t\tSystem.out.println(\"문자열을 입력후 Enter....\");\n\t\tString strInput = scanner.nextLine();\n\t\tSystem.out.println(strInput);\n\n\t}", "private ConsoleScanner() {}", "public static void main(String[] args) {\n\t\t\n\t\tScanner sc=new Scanner(System.in);\n\t\twhile(sc.hasNextLine()){\n\t\t\tString str=sc.nextLine();\n\t\t\t\n\t\t\t\n\t\t}\n\n\t}", "public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n String str=sc.next();\n String str1=sc.next();\n String str2=sc.next();\n String str3=sc.next();\n System.out.println(str);\n System.out.println(str1);\n System.out.println(str2);\n System.out.println(str3);\n\n\n }", "public static void main(String[] args) {\n\t\tString s = \"We're learning about Scanner\";\n\t\tSystem.out.println(s);\n\t\tScanner sc = new Scanner(System.in);\n//\t\tint m = sc.nextInt();\n//\t\tint n = sc.nextInt();\n//\t\tSystem.out.println(\"The Value of m is: \"+m);\n//\t\tSystem.out.println(\"The Value of n is: \"+n);\n//\t\tdouble d = sc.nextDouble();\n//\t\tString name = sc.next();//Gives us one Word\n//\t\tSystem.out.println(\"Name is: \" + name);\n\t\t\n//\t\tString fullName = sc.nextLine();\n//\t\tSystem.out.println(\"Full Name is: \" + fullName);\n\t\t\n\t\tString intInput = sc.nextLine();\n\t\tint n = Integer.parseInt(intInput);\n\t\tSystem.out.println(n);\n\t}", "public String weiterSpielen(){\n Scanner keyboard = new Scanner(System.in);\n return keyboard.nextLine();\n }", "public static String getStringInput() {\n Scanner in = new Scanner(System.in);\n return in.next();\n }", "public static void main (String[] args) {\n Scanner s = new Scanner(System.in);\n System.out.print(SimpleSymbols(s.nextLine())); \n }", "public static void main (String[] args) {\n Scanner s = new Scanner(System.in);\n System.out.print(SimpleSymbols(s.nextLine())); \n }", "private String getUserInput(Scanner sc) {\n\t\t\n\t\tif (sc == null) {\n\t\t\treturn null;\n\t\t}\n\n\t System.out.print(\"\\nctransfer > \");\n\t return sc.nextLine();\n\t}", "public static String inputCommand() {\n String command;\n Scanner in = new Scanner(System.in);\n\n command = in.nextLine();\n\n return command;\n }", "public static void main(String[] args) {\n\t\tScanner keyboard = new Scanner(System.in);\n\t\t\n\t\tkeyboard.close();\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tString hello = sc.nextLine();\n\t\tSystem.out.println(hello);\n\n\n\t}", "public static String GetInput() {\r\n\t\t// Scanner is created and a value is set for input\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tString input = in.nextLine();\r\n\t\treturn input;\r\n\r\n\t}", "private void getInput() {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter a number\");\r\n\t\tn=scan.nextInt();\r\n\r\n\t}", "public static void main (String[] args) throws java.lang.Exception\r\n\t{\n\t\tScanner sc=new Scanner(System.in);int f=0;\r\n\t\twhile(sc.hasNext()){\r\n\t\tint t=sc.nextInt();\r\n\t\t\r\n\t\tif(t==42) f=1;\r\n\t\tif(f==0) System.out.println(t);\r\n\t\t}\r\n\t}", "public static void main(String...args){\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tString s = scan.nextLine();\r\n//\t\tString str = s.replaceAll(\"\\\\s\", \"\"); // removing white space from string\r\n//\t\tSystem.out.println(str);\r\n\t\tchar[] ch = s.toCharArray();\r\n\t\tSet<Character> charSet = new HashSet<>();\r\n\t\tfor(char c: ch){\r\n\t\t\t\r\n\t\t\tcharSet.add(c);\t\r\n\t\t}\r\n\t\t\r\n//\t\tStringBuffer sb = new StringBuffer();\r\n\t\tfor(Character character : charSet){\r\n//\t\t\tsb.append(character);\r\n\t\t\tSystem.out.print(character);\r\n\t\t}\r\n//\t\tSystem.out.println(sb.toString());\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\twhile(sc.hasNext()) {\n\t\t\tString input = sc.nextLine();\n\t\t\tSystem.out.println(input);\n\t\t\tif(input == null || input==\"\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public WelcomeGame() {\r\n\t\tthis.input = new Scanner(System.in);\r\n\t}", "public void takeUserInput() {\n\t\t\r\n\t}", "public alphabetize()\n {\n word = new Scanner(System.in);\n }", "public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\t\n\t\tprocess(s);\n\t}", "public static int getInput() {\n Scanner in = new Scanner(System.in);\n\n return in.nextInt();\n }", "public static void main(String args[])throws IOException\n\t{\n\tScanner obj=new Scanner(System.in);\n\n\t//Entering a string\n\tSystem.out.println(\"\\nEnter a string !\");\n\tString s=obj.nextLine();\n\tSystem.out.println(\"you have entered \"+ s);\n\n\t//entering a word\n\tSystem.out.println(\"\\nEnter a word !\");\n\tString w=obj.next();\n\n\t//entering an integer\n\tSystem.out.println(\"\\nEnter an integer !\");\n\tint n=obj.nextInt();\n\n\t//entering a float\n\tSystem.out.println(\"\\nEnter a floating point number !\");\n\tfloat f=obj.nextFloat();\n\n\t//Printing the inputs\n\tSystem.out.println(\"\\nThe inputs are .....\");\n\tSystem.out.println(\"\\nWord : \"+w+\"\\nInteger : \"+n+\"\\nFloat : \"+f);\n\n\n}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSolution s = new Solution();\r\n\t}", "public static void getString()\n\t{\n\t\t\n\t\tScanner s=new Scanner(System.in);\n\t\t\n\t\t//Here Scanner is the class name, a is the name of object, \n\t\t//new keyword is used to allocate the memory and System.in is the input stream. \n\t\t\n\t\tSystem.out.println(\"Entered a string \");\n\t\tString inputString = s.nextLine();\n\t\tSystem.out.println(\"You entered a string \" + inputString );\n\t\tSystem.out.println();\n\t}", "private static void readInput() { input = sc.nextLine().toLowerCase().toCharArray(); }", "public TerminalGame()\n \t{\n \t\tsuper();\n \t\tbuilder = new StringBuilder();\n \t\tscanner = new Scanner(System.in);\n \t}", "public String userInputString() {\n Scanner scanner = new Scanner(System.in);\n return scanner.nextLine();\n }", "public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\n\t\tprocess(s);\n\n\t}", "public static void main(String[] args) {\n Scanner scn = new Scanner(System.in);\r\n System.out.println(\"Introduzca un entero: \");\r\n int a = scn.nextInt();\r\n System.out.println(\"El numero introducido es el: \" + a);\r\n String b = scn.nextLine();\r\n System.out.println(b);\r\n String c = scn.next();\r\n System.out.println(c);\r\n }", "public void intro(){Scanner teclado = new Scanner(System.in);\nSystem.out.println(\"Introduzca la unidad de medida a la que transformar \"\n + \"pies, cm o yardas\");\nSystem.out.println(\"o escriba salir si quiere volver al primer menu\");\nopcion=teclado.nextLine();}", "public static void setInputScanner(InputScanner scanner){\n inputScanner = scanner;\n }", "public static void main(String[] args) {\n\t\tScanner inpt = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Hello Word!!!\");\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.print(\"Enter the value of n : \");\r\n\t\tint n = sc.nextInt();\r\n\t\tSystem.out.println(\"Entered input is : \"+ n);\r\n\t}", "String getInput();", "static InputScanner getInputScanner() {\n return inputScanner;\n }", "public static void main(String[] args) {\n\t\t \n\t\tScanner scanner=new Scanner(System.in);\n\t\tUtility utility=new Utility();\n\t\n\t\tdouble c;\n\tSystem.out.println(\"enter the number\");\n\t\tc=scanner.nextInt();\n\n\t\tutility.newt(c);\n\t\tscanner.close();\n\t}", "public static void main(String[] args) {\n\r\n\t\tchar n;\r\n\t\tScanner teclado=new Scanner (System.in);\r\n\t\tSystem.out.println(\"Introduce un valor al caracter\");\r\n\t\t\r\n\t\tn = teclado.nextLine().charAt(0); // Asigno el valor leido por teclado a la variable n\r\n\t\tSystem.out.println(\"El valor de la variable es \" + n);\r\n\t\tteclado.close();\r\n\t}", "@SuppressWarnings(\"resource\")\n\tpublic static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\t//String str = \"Hello World\";\n\t\tScanner scanner = new Scanner(System.in); //create object;\n\t\tSystem.out.println(\"Enter an String input\");\n\t\tString userInput = scanner.nextLine();//iput\n\t\tSystem.out.println(userInput.toString());\n\t\n\t\t\n\t\t//System.out.println(\"First string upper case is \" + userInput.toUpperCase().charAt(0) + \" from \" + userInput);\n\t\t\n\t}", "public static String getString(){\n Scanner in = new Scanner(System.in); //scanner variable to take input\n return in.nextLine().trim();\n }", "public static String getInput() {\n\t\tScanner inputReader = new Scanner(System.in);\n\t\tString userInput;\n\t\tuserInput = inputReader.nextLine();\n\t\treturn userInput;\n\t}", "public Scanner(java.io.InputStream in) {\r\n this(new java.io.InputStreamReader(in));\r\n }", "void Input() {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter name of the book::\");\n Bname = scanner.nextLine();\n System.out.println(\"Enter price of the book::\");\n price = scanner.nextDouble();\n }", "public static void main(String[] args) {\n\n\t\tInputStreamReader rd= new InputStreamReader(System.in);\n\t\ttry {\n\t\t\tSystem.out.println(\"enter a number\");\n\t\t\tint value=rd.read();\n\t\t\tSystem.out.println(\"you entered:-\"+(char)value);\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}", "public static void main(String[] args) {\r\n Scanner sc = new Scanner(System.in);\r\n int count=1;\r\n String op;\r\n while(sc.hasNext()){\r\n\r\n for(int i=1;i<=count;i++){\r\n count++;\r\n op= sc.nextLine();\r\n StdOut.println(i+\" \"+op);\r\n }\r\n }\r\n }", "public static String inputStringFromKeyboard(String input){\n System.out.println(\"Input the String: \");\n //Scanner, save the inputted from keyboard\n Scanner scanner = new Scanner(System.in);\n //The value 'scanner' is assigned to 'input'\n input = scanner.next();\n return input;\n }", "OutputStream getStdin();", "String getUserInput();", "private static String scan(String text)\r\n\t{\r\n\t\tSystem.out.print(text);\r\n\t\treturn input.nextLine();\r\n\t}", "private static Scanner determineInputSource(String[] args) throws FileNotFoundException{\n if (args.length > 0) {\n //Reading from file\n return new Scanner(new File(args[0]));\n }\n else {\n //Reading from standard Input\n return new Scanner(System.in);\n }\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\t\n\t\t\n\t\tSystem.out.println(Character.getNumericValue('s'));\n\t\t//10 a\n\t\t//35 z\n\t\t//28 s\n\t\twhile(true) {\n\t\t\tString s = sc.nextLine();\n\t\t\tif(s.equals(\"halt\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tchar prev = ' ';\n\t\t\t\tfor(int i = 0; i<s.length(); i++) {\n\t\t\t\t\tchar c = s.charAt(i);\n\t\t\t\t\tint numericValue = Character.getNumericValue(c);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\n\t}", "public Scanner(java.io.InputStream in) {\n this(new java.io.InputStreamReader(in));\n }", "public Scanner(java.io.InputStream in) {\n this(new java.io.InputStreamReader(in));\n }", "public String userCommand(){\n return scanner.nextLine();\n }", "private static void scan() {\n\t\tt = la;\n\t\tla = Scanner.next();\n\t\tla.toString();\n\t\tsym = la.kind;\n\t}", "public static String readUserInput() {\n return in.nextLine();\n }", "public static void main(String[] args) {\n\t\t Scanner scan = new Scanner (System.in);\n\t\t \n\t\t System.out.println(\"tam isminizi giriniz\");\n\t String tamisim = scan.nextLine();\n\t \n \n System.out.println(\"Yasinizi giriniz\");\n int yas = scan.nextInt();\n System.out.println(yas);\n \n System.out.println(\"Isminizın ilk harfini girin\");\n char ilkHarf = scan.next().charAt(0);\n System.out.println(ilkHarf);\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\r\n\t\tchar a=sc.next().charAt(0);\r\n\t\t\r\n\t\tif(Character.isLowerCase(a))\r\n\t\t{\r\n\t\t\tSystem.out.println(Character.toUpperCase(a));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(Character.toLowerCase(a));\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n Processor proc1 = new Processor();\n proc1.start();\n System.out.println(\"Hit any key to stop.\");\n Scanner scanner = new Scanner(System.in);\n scanner.nextLine();\n proc1.shutdown();\n }", "public static void userName() {\n System.out.println(\"Please enter your name: \");\n String name = sc.nextLine(); \n System.out.println(\"Hello, \" + name);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tScanner s = new Scanner(System.in);\r\n\t String txt = s.next();\r\n\t //your code here\r\n\t System.out.println(txt.substring(0,2));\r\n\r\n\t}", "public static void main(String[]args){//inicio del main\r\n\r\n\tScanner in = new Scanner(System.in);// creacion del scanner\r\n\tSystem.out.println(\"Input Character\");//impresion del mensaje en consola\r\n\tchar C= in.next().charAt(0);//lectura del char\r\n\t\r\n\tSystem.out.println(\"The ASCII value of \" +C+ \" is : \"+(int) C);//casteo del caracter e impresion del resultado\r\n\t}", "public static void main(String[] args) {\n String s1=\"asd\";\r\n String s2=\"bilo\";\r\n //Scanner sc= new Scanner(System.in);\r\n\t\t if (s1==s2)\r\n\t\t\t System.out.println(\"text compared0\");\r\n\t\t else\r\n\t\t\t System.out.println(\"text not compared0\");\r\n\t\t\t \r\n\t}", "@Test\n public void testMain() {\n String simulatedUserInput = \"100AUD\" + System.getProperty(\"line.separator\")\n + \"1\" + System.getProperty(\"line.separator\");\n\n InputStream savedStandardInputStream = System.in;\n System.setIn(new ByteArrayInputStream(simulatedUserInput.getBytes()));\n\n mainFunction mainfunc = new mainFunction();\n\n try {\n mainfunc.start();\n } catch(Exception e) {\n System.out.println(\"Exception!\");\n }\n\n assertEquals(1,1);\n }", "private void start() {\n Scanner scanner = new Scanner(System.in);\n \n // While there is input, read line and parse it.\n String input = scanner.nextLine();\n TokenList parsedTokens = readTokens(input);\n }", "public static void main (String[] args) {\n Scanner s = new Scanner(System.in);\n System.out.print(AlphabetSoup(s.nextLine())); \n }", "public static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\tdo{\n\t\t\tSystem.out.println(\"out:\" + scan.nextLine());\n\t\t}while(true);\n\t}", "public Sintactico(java_cup.runtime.Scanner s) {super(s);}", "public static void main (String[] args) {\n Scanner s = new Scanner(System.in);\n System.out.print(TimeConvert(s.nextLine())); \n }", "public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in); \r\n\t\twhile(sc.hasNext()){\r\n\t\t\tint x=sc.nextInt();\r\n\t\t\tint y=sc.nextInt();\r\n\t\t\tint result=getResult(x,y);\r\n\t\t\tSystem.out.println(result);\r\n\t\t\t\r\n\t\t}\r\n\t}", "private static String getInput(String message, Scanner sc) {\n String result = \"\";\n while (result.equals(\"\")) {\n System.out.println(message);\n result = sc.nextLine();\n }\n return result;\n }", "public static void main (String[] args) {\n Scanner s = new Scanner(System.in);\r\n System.out.print(BinaryReversalMethod(s.nextLine()));\r\n s.close();\r\n }", "public static String inputString(String s)\n {\n if (s != null && s.length() > 0)\n {\n System.out.print(s);\n System.out.flush();\n }\n\n StringBuffer sb = new StringBuffer();\n try\n {\n InputStreamReader reader = new InputStreamReader(System.in);\n do\n {\n sb.append(new BufferedReader(reader).readLine());\n }\n while (System.in.available() > 0);\n\n return sb.toString();\n }\n catch (IOException e)\n {\n return null;\n }\n }", "public static void main(String[] args) \n\t{\n\t\tScanner src = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter the number: \");\n\t\tint n = src.nextInt();\n\t\tint temp;\n\t\tsrc.close();\n\t}", "@Override\n\tpublic String read() \n\t{\n\t\tString res = \"\";\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tif (scan.hasNextLine())\n\t\t\tres = scan.nextLine();\n\t\t\n\t\treturn res;\n\t\t\n\n\t}", "public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tString str=sc.nextLine();\n\t\tfindDuplicateChars(str);\n\t}", "public static void echoContents(Scanner in) {\n }", "public void input()\n\t{\n\t\t// this facilitates the output\n\t\tScanner sc = new Scanner(System.in) ; \n\t\tSystem.out.print(\"The Bike Number:- \") ;\n\t \tthis.bno = sc.nextInt() ; \t\n\t\tSystem.out.print(\"The Biker Name:- \") ; \n\t \tthis.name = new Scanner(System.in).nextLine() ; \t\n\t\tSystem.out.print(\"The Phone number:- \") ; \n\t \tthis.phno = sc.nextInt() ; \t\n\t\tSystem.out.print(\"The number of days:- \") ; \n\t \tthis.days = sc.nextInt() ; \t\n\t}", "public static void main(String[] args) {\n Scanner reader = new Scanner(System.in);\r\n System.out.print(\"Enter a number: \");\r\n\r\n // nextInt() reads the next integer from the keyboard\r\n int number = reader.nextInt();\r\n\r\n // println() prints the following line to the output screen\r\n System.out.println(\"You entered: \" + number);\r\n }" ]
[ "0.8116788", "0.7859288", "0.7456636", "0.7390904", "0.7370572", "0.726009", "0.7220934", "0.7188939", "0.71190596", "0.7016008", "0.6999161", "0.69791657", "0.6916052", "0.6864569", "0.6834009", "0.6791698", "0.6791698", "0.6768515", "0.6752971", "0.67184204", "0.6700116", "0.65829825", "0.6555058", "0.6553874", "0.6551043", "0.65498847", "0.6548082", "0.65361446", "0.6535826", "0.6535826", "0.65253425", "0.650796", "0.64449716", "0.6437405", "0.6432809", "0.642896", "0.6408177", "0.64072996", "0.64058506", "0.6399164", "0.63945127", "0.63922393", "0.6370302", "0.63515437", "0.6347729", "0.63446486", "0.63238317", "0.6319479", "0.62970144", "0.6270386", "0.62682694", "0.6267702", "0.62541574", "0.6195879", "0.61863095", "0.6162363", "0.615476", "0.6152649", "0.6150961", "0.61463344", "0.61223024", "0.6121463", "0.6096281", "0.60921764", "0.608096", "0.6044462", "0.60317606", "0.60316205", "0.60253906", "0.6021175", "0.601883", "0.60092723", "0.59872925", "0.598554", "0.598554", "0.5984968", "0.59776694", "0.59752107", "0.59682125", "0.59632605", "0.5954111", "0.5950918", "0.5946668", "0.5946313", "0.59412134", "0.5939339", "0.593904", "0.59350663", "0.59273505", "0.5926322", "0.5917193", "0.5912088", "0.59112525", "0.59073883", "0.5907037", "0.5906843", "0.5898045", "0.58952606", "0.5889736", "0.5887788", "0.5880382" ]
0.0
-1
Initialisation de la case zero
public CaseZero(List<Player> listPlayer){ this.index = 0; this.listePlayer = listPlayer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private final int initializeInt() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tprotected Integer zero() {\n\t\treturn 0;\r\n\t}", "abstract void assignZero();", "public Case() {}", "public final void setZero() {\n \t\n\t\tthis.m00 = 0.0F;\n\t\tthis.m01 = 0.0F;\n\t\tthis.m02 = 0.0F;\n\t\tthis.m10 = 0.0F;\n\t\tthis.m11 = 0.0F;\n\t\tthis.m12 = 0.0F;\n\t\tthis.m20 = 0.0F;\n\t\tthis.m21 = 0.0F;\n\t\tthis.m22 = 0.0F;\n }", "@Override\r\n\tprotected Integer deriveLower() {\r\n\t return 0;\r\n\t}", "public void zero();", "public static numero getZero()\n {\n return new numero(ZERO);\n }", "public void setZero() {\n\t\tset((byte) (get() | (1 << 7)));\n\t}", "private Zeroes() {\n // This space intentionally left blank.\n }", "MyChar() {\n\t\tmyChar = '0';\n\t}", "void setZeroStart();", "public void initialiser() {\n double inf = Double.POSITIVE_INFINITY;\n create_add(\"bagel\", 20, 8);\n create_add(\"burger\", 10, 10);\n create_add(\"smoothie\", 30, 5);\n create_add(\"café\", (int)inf, 2);\n }", "public static void c0_vl() {\n\t}", "public Int() {\n super(Expression.X_IS_UNDEFINED);\n this.value = 0;\n }", "public int initialiser()\n\t{\n\n\t\tint nombreE;\n\t\tint k = 0;\n\t\t//int max = randInt(2,10);\n\t\ttableauPeres_ = new Case[longueur_][longueur_];\n\t\tint i, j = 0;\n\t\tfor(i=0; i<longueur_; ++i)\n\t\t{\n\t\t\tfor(j=0; j<longueur_; ++j)\n\t\t\t{\n\t\t\t\ttableauPeres_[i][j] = new Case(i, j, 0);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Combien d'étoiles souhaitez vous pour chaque joueur ?\");\n\t\tnombreE = clavier.nextInt();\n\t\twhile (k < nombreE)\n\t\t{\n\t\t\taddEtoile(\"bleu\");\n\t\t\taddEtoile(\"rouge\");\n\t\t\t++k;\n\t\t}\n\t\treturn nombreE;\n\t}", "public Initialization()\r\n {\r\n C.cinit();\r\n init(\"2\",0);\r\n \r\n init(\"2\",1);\r\n \r\n init(\"4\",2);\r\n init(\"4\",3);\r\n init(\"4\",4);//ss\r\n init(\"6\",5);\r\n init(\"6\",6);\r\n init(\"6\",7); //ss\r\n init(\"8\",8);\r\n init(\"8\",9);\r\n init(\"8\",10);//ss4 7 10\r\n }", "public void zero() {\n fill(0);\n }", "public Int() {\n this(0);\n }", "public ZeroCountDataWriter() {\n\t\tsuper(DataWriterType.ZEROCNTType);\n\t}", "public void init() {\n\n\n verdiend = 133;\n\n verdeling = verdiend / 4;\n }", "@Override\n public Integer reduceInit() { return 0; }", "private void SetZN8 ( int Work )\n\t{\n\t\t_Zero = Work != 0 ? 1 : 0;\n\t\t_Negative = Work;\n\t}", "@Override\n public char getTypeCode() {\n return '0';\n }", "public Counter(int init){\n \tvalue = init;\n }", "protected void setNumbertoZero() {\n\t\tnumber = 0;\n\t}", "public void resetZero() {\n\t\tset((byte) (get() & ~(1 << 7)));\n\t}", "CompT zero();", "public void initialize() {\n if (coverage == 0 || coverage == 1) {\n pAttemptMovement = 1;\n pAttemptTransition = 1;\n } else {\n pAttemptTransition = 1.0f;\n pAttemptMovement = pmove * (1-coverage) / coverage;\n if (pAttemptMovement > 1.0f) {\n pAttemptTransition = 1 / pAttemptMovement;\n pAttemptMovement = 1.0f;\n }\n }\n // System.out.println(\"pAttemptMovement = \"+pAttemptMovement+\", pAttemptTransition = \"+pAttemptTransition);\n // accept - memoize the return values of exp for accept, because there are only a handful that get used\n map = new ExpMap(1024);\n }", "public int ZERO() {\n return getInt(setting.ZERO);\n }", "NullSt (int ln) { super (ln); }", "protected void initialize() {\n\t\televator.zeroEncoder();\n\t}", "public void styleforZero() {\r\n\t\t\r\n\t\tsuper.styleforZero();\r\n\t\t\r\n\t}", "public Log() { //Null constructor is adequate as all values start at zero\n\t}", "public void O000000o() {\r\n super.O000000o();\r\n this.O0000o0 = false;\r\n }", "public static void setZero() {\r\n\t\tint i = 0;\r\n\t\twhile(i < memSize / 4) {\r\n\t\t\tbank0[i] = \"000000000000000000000000\";\r\n\t\t\tbank1[i] = \"000000000000000000000000\";\r\n\t\t\tbank2[i] = \"000000000000000000000000\";\r\n\t\t\tbank3[i] = \"000000000000000000000000\";\r\n\t\t\ti++;\r\n\t\t}\r\n\t}", "public static int BIASED_ONE_OR_ZERO()\n\t{\n\t}", "public Counter() {\r\n value = 0;\r\n }", "public Counter()\n {\n this(0);\n }", "default A isZero() {\n return satisfiesNumberCondition(new NumberCondition<>(0, EQUAL_TO));\n }", "void init(char c);", "@Override\n\t\tpublic String getMessage() {\n\t\t\treturn \"zero \" + super.getMessage();\n\t\t}", "public static int getDefaultCaseType()\n {\n return defaults.case_type;\n }", "Field() {\n value = 0;\n }", "@Override\n\tpublic int getNumericCode() {\n\t\treturn 0;\n\t}", "private String feelZero(Integer i){\n if( i < 10 ){\n return \"0\"+i;\n }else{\n return Integer.toString(i);\n }\n }", "String getZeroString()\n {\n return \"\"+0;\n }", "@Override\n public int value() {\n return 0;\n }", "public void O0000O0o() {\r\n this.O00000oo = this.O00000oO;\r\n }", "private Default()\n {}", "@AnyLogicInternalCodegenAPI\n public int _InitInfected_DefaultValue_xjal() {\n final Main self = this;\n return \n1 \n;\n }", "public final void initialize() {\n initialize(0);\n }", "public void pgmInitialize() {\n\t\tzzsetdspfind();\n\t\tinzsr();\n\t\t// D e f i n i t i o n s\n\t\tstateVariable.setSflchg(\"0\");\n\t\tstateVariable.setSflrrn(0);\n\t\t// M a i n l i n e C o d e\n\t\tmainline0();\n\t\treturn;\n\t}", "public Pitonyak_09_02() {\r\n }", "@Test\r\n\tpublic void constructorTest() \r\n\t{\r\n\t\tassertEquals(0, scoreBehavior.score());\r\n\t}", "@Override\n\tpublic void initValue() {\n\t\t\n\t}", "public Binary() { \n\t_decNum = 0;\n\t_binNum = \"0\";\n }", "public void setCountToZero() {\r\n \r\n // set count to 0\r\n count = 0;\r\n }", "public void testGetDigitsNumberIsZero() {\n\t\tNumberConverter test = new NumberConverter(0);\n\t\tassertEquals(\"Should have returned ones digit as 0\",\n\t\t\t\ttest.getNthDigit(1), 0);\n\t\tassertEquals(\"Should have returned tens digit as 0\",\n\t\t\t\ttest.getNthDigit(2), 0);\n\t\tassertEquals(\"Should have returned hundreds digit as 0\",\n\t\t\t\ttest.getNthDigit(3), 0);\n\t}", "public Summalista()\r\n\t{\r\n\t\tthis.summa = 0;\r\n\t\tthis.alkiot = 0;\r\n\t}", "public void init() {\n\t\tinit(\"1,0 3,0 5,0 7,0 9,0 0,1 2,1 4,1 6,1 8,1 1,2 3,2 5,2 7,2 9,2 0,3 2,3 4,3 6,3 8,3\", \n\t\t\t \"1,6 3,6 5,6 7,6 9,6 0,7 2,7 4,7 6,7 8,7 1,8 3,8 5,8 7,8 9,8 0,9 2,9 4,9 6,9 8,9\"); \n }", "public void setInitialValue(int pipVal) {\r\n\t\tif (pipVal == 0) {\r\n\t\t\t// this is an ace\r\n\t\t\tthis.value = 11;\r\n\t\t} else if (pipVal >= 9) {\r\n\t\t\tthis.value = 10;\r\n\t\t} else {\r\n\t\t\tthis.value = pipVal + 1;\r\n\t\t}\r\n\t}", "public LessThanZeroException() {}", "DefaultConstructor(int a){}", "private TinyMT32 getZero() {\n TinyMT32 that = new TinyMT32(this);\n that.st0 = 0;\n that.st1 = 0;\n that.st2 = 0;\n that.st3 = 0;\n return that;\n }", "public AllDifferent()\n {\n this(0);\n }", "C02(int i){\n\t\t\n\t}", "private\tNum(int num) { value = num; }", "public MyInteger( )\n {\n this( 0 );\n }", "private CZ()\n {\n }", "String getZero_or_one();", "@Override\n public S isZero() {\n rule.addConstraint(new IsEqualAccordingToCompareToConstraint<>(zero()));\n return myself;\n }", "public MVCModelo(int capacidad)\n\t{\n\t\tllave = \"\";\n\t\tvalue = 0.0;\n\t}", "public final Integer A00() {\n char c;\n Integer num;\n if (this.A00 == null) {\n String str = this.A04;\n int hashCode = str.hashCode();\n if (hashCode == 3599307) {\n c = 2;\n } else if (hashCode == 697547724) {\n c = 0;\n } else if (hashCode == 1901043637) {\n c = 1;\n }\n c = 65535;\n if (c == 0) {\n num = Constants.ZERO;\n } else if (c == 1) {\n num = Constants.ONE;\n } else if (c != 2) {\n num = Constants.A0N;\n } else {\n num = Constants.A0C;\n }\n this.A00 = num;\n }\n return this.A00;\n }", "public Test05() {\n this(0);\n n2 = \"n2\";\n n4 = \"n4\";\n }", "static void jump_when_zero(String passed){\n\t\tif(Z)\n\t\t\tcomplete_jump_req(passed.substring(3));\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void setScoreZero() {\n this.points = 10000;\n }", "public A034318() {\n this(-1, 0, 13, 0, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 0);\n }", "public void initForCup(){\n hdBase = HD_BASED_ON_RANK;\n hdNoHdRankThreshold = -30;\n hdCorrection = 0; \n hdCeiling = 0;\n }", "@Override\n public void init()\n {\n out = mul(num(100.0/Math.log10(length)), log10(div(sum(truerange(), length), diff(highest(length), lowest(length)))));\n }", "protected Int() {}", "public FormatInteger zeroFill(){\n fillCharacter = ZERO_CHAR;\n return this;\n }", "public GenerateurImpl() {\n\t\tsuper();\n\t\tthis.value = 0;\n\t}", "@Override\r\n\tpublic double alapterulet() {\n\t\treturn 0;\r\n\t}", "public boolean isZero() {return false;}", "public static void init() {\n init(block -> IntStream.range(0, 16));\n }", "public void init()\n\t{\n\t\tint inN;\n\t\tdo{\n\t inN=getN();\n\t switch(inN)\n\t {\n\t case 1: problem1();break;\n\t case 2: problem2();break;\n\t case 3: problem3();break;\n\t default:\n\t }\n\t }while(inN != 0);\t\n\t}", "public OldSwedishCurrency()\r\n\t{\r\n\t\tthis(0, 0, 0);\r\n\t}", "public String O0000o0() {\r\n char c;\r\n int i = this.O00000oO;\r\n while (this.O00000oO < this.O00000o) {\r\n c = this.O00000o0[this.O00000oO];\r\n if ((c < 'A' || c > 'Z') && ((c < 'a' || c > 'z') && !Character.isLetter(c))) {\r\n break;\r\n }\r\n this.O00000oO++;\r\n }\r\n while (!O00000Oo()) {\r\n c = this.O00000o0[this.O00000oO];\r\n if (c < '0' || c > '9') {\r\n break;\r\n }\r\n this.O00000oO++;\r\n }\r\n return O000000o(i, this.O00000oO - i);\r\n }", "public Zeffit()\n {\n // TODO: initialize instance variable(s)\n }", "@Test\n public void testZeroA() {\n assertEquals(0, PiGenerator.powerMod(0, 5, 42));\n }", "public CancerRisk() { this(\"None\", 1.0); }", "public void setZeroMode(DcMotor.ZeroPowerBehavior mode) {\n leftFront.setZeroPowerBehavior(mode);\n leftRear.setZeroPowerBehavior(mode);\n rightFront.setZeroPowerBehavior(mode);\n rightRear.setZeroPowerBehavior(mode);\n }", "static void call_when_zero(String passed){\n\t\tif(Z)\n\t\t\tcomplete_call_req(passed.substring(3));\n\t}", "public int mo12720a() {\n return 0;\n }", "public void initForSwissCat(){\n hdBase = HD_BASED_ON_MMS;\n hdNoHdRankThreshold = 8;\n hdCorrection = 1; \n hdCeiling = 9;\n }", "public MarkovZero() {\n\t\tmyRandom = new Random();\n\t}", "public void zero()\n {\n encoderOffset = -getEncoder().getPosition();\n }", "private void initialize() {\n\t\tfor(String key: count_e_f.keySet()){\n\t\t\tcount_e_f.put(key, 0.0);\n\t\t}\n\t\t\n\t\tfor(Integer key: total_f.keySet()){\n\t\t\ttotal_f.put(key, 0.0);\n\t\t}\n\t\t\n\t\t//This code is not efficient.\n//\t\tfor(Entry<String, Integer> german : mainIBM.gerWordsIdx.entrySet()){\n//\t\t\tfor(Entry<String, Integer> english : mainIBM.engWordsIdx.entrySet()){\n//\t\t\t\tcount_e_f.put(english.getValue() + \"-\" + german.getValue(), 0.0);\n//\t\t\t}\n//\t\t\ttotal_f.put(german.getValue(), 0.0);\n//\t\t}\t\n\n\t}" ]
[ "0.66070014", "0.6597632", "0.6337283", "0.62080187", "0.62028366", "0.6199818", "0.61612785", "0.6153866", "0.6131067", "0.6083478", "0.6049052", "0.59878117", "0.5981126", "0.5942302", "0.5909666", "0.59056723", "0.5856427", "0.5849949", "0.5846553", "0.58392686", "0.58202165", "0.5762366", "0.57621545", "0.5747464", "0.57386494", "0.5738466", "0.57373905", "0.57337826", "0.5730769", "0.5724101", "0.5694741", "0.5687209", "0.56700313", "0.566974", "0.5658152", "0.5651414", "0.56470394", "0.5630726", "0.5613309", "0.56118906", "0.5610437", "0.5601071", "0.5593217", "0.55860364", "0.55834085", "0.5582088", "0.55770266", "0.5576005", "0.55756265", "0.5567878", "0.5565619", "0.5565353", "0.5544438", "0.55326486", "0.5531297", "0.55282056", "0.55248505", "0.5520291", "0.5517979", "0.55140465", "0.5501137", "0.54996973", "0.54987234", "0.54965", "0.5495223", "0.549327", "0.5492839", "0.5487025", "0.54820573", "0.54727066", "0.5465247", "0.5463104", "0.54616135", "0.5461112", "0.545724", "0.5449787", "0.54446805", "0.5439691", "0.5436589", "0.54359305", "0.54303926", "0.5423611", "0.54208237", "0.5417395", "0.54157233", "0.5413932", "0.54017055", "0.54001015", "0.539393", "0.53907216", "0.5388928", "0.5376868", "0.53748894", "0.5374742", "0.53715783", "0.5363872", "0.53544885", "0.534282", "0.5342652", "0.5341517" ]
0.5857538
16
TODO Autogenerated method stub
@Override public boolean canBeLeft() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public int consequence(int diceThrow) { return diceThrow; }
{ "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 Player getPlayer() { 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
TODO Autogenerated method stub
@Override public boolean isBusy() { return 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 setPlayer(Player player) { }
{ "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
Informe l'utilisateur des joueurs se trouvant sur cette case
public String getMessage(int i){ return this.listePlayer.get(i).toString()+" is in cell "+this.index+", "+this.listePlayer.get(i).toString() +" throws "+dice+", reaches cell " +this.consequence(this.diceGet()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void accionUsuario() {\n\t\t\r\n\t}", "private boolean correctUser() {\n // TODO mirar si l'usuari es unic a la base de dades\n return true;\n }", "@Override\n public void onClick(View v) {\n trasferisci_utente();\n\n // controlla se tutti i dati sono inseriti\n if (checkInput())\n {\n creaUser();\n NOME = username.getText().toString();\n CHIAVE = password.getText().toString();\n\n // controlla se l'utente USER con i dati inseriti negli edit_text è gia presente\n if (checkUser(persone, NOME, CHIAVE)) {\n\n errore_utente.setVisibility(View.GONE);\n\n // impedisce a due utenti di avere lo stesso username\n if(checkUsername(persone, NOME)) {\n\n errore_duplicato_username.setVisibility(View.GONE);\n\n persone.add(user);\n\n Intent showResult = new Intent(Registration.this, MainActivity.class);\n showResult.putExtra(PERSONA_PATH, persone);\n //showResult.putExtra(UTENTE_PATH, user);\n startActivity(showResult);\n } else {\n errore_duplicato_username.setVisibility(View.VISIBLE);\n }\n } else {\n errore_utente.setVisibility(View.VISIBLE);\n }\n }\n }", "public void effacerUtilisateur() {\r\n this.modele.effacerUtilisateur(this.modele);\r\n this.modele = new Utilisateurs();\r\n }", "private void serchUser() {\n if (!userNameTextField.getText().isEmpty() && !passwordPasswordField.getText().isEmpty()) {\n try {\n User user = UserController.searchUserByUserName(userNameTextField.getText());\n if (user != null) {\n if (passwordPasswordField.getText().equals(user.getPassword())) {\n closeFadeOut();\n Hi hi = new Hi();\n hi.setUser(user);\n hi.setVisible(true);\n dispose();\n } else {\n JOptionPane.showMessageDialog(this, \"Incorrect username or password !\");\n passwordPasswordField.setText(\"\");\n userNameTextField.requestFocus();\n userNameTextField.selectAll();\n }\n } else {\n JOptionPane.showMessageDialog(this, \"Incorrect username or password !\");\n passwordPasswordField.setText(\"\");\n userNameTextField.requestFocus();\n userNameTextField.selectAll();\n }\n\n } catch (ClassNotFoundException ex) {\n ex.printStackTrace();\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n } else {\n JOptionPane.showMessageDialog(this, \"Please enter username and password\");\n passwordPasswordField.setText(\"\");\n userNameTextField.requestFocus();\n userNameTextField.selectAll();\n }\n\n }", "private static int login(String username, String passe) {\n PreparedStatement stmt;\r\n try {\r\n stmt = c.prepareStatement(\"SELECT * FROM utilizador where nome = ? and passe = ?;\");\r\n stmt.setString(1, username);\r\n stmt.setString(2, passe);\r\n ResultSet rs = stmt.executeQuery();\r\n rs.next();\r\n utilizador_corrente = new Utilizador(username, passe, rs.getBoolean(4));\r\n cartao_cidadao = rs.getInt(1);\r\n if (rs.getBoolean(4))//tem direitos\r\n return 2;\r\n else if (!rs.getBoolean(4))//nao tem direitos\r\n return 1;\r\n stmt.close();\r\n } catch (SQLException e) {\r\n }\r\n return 0;\r\n }", "public void changerJoueur() {\r\n\t\t\r\n\t}", "private static boolean verificaUser(String username) {\n String user = null;\r\n try {\r\n PreparedStatement stmt = c.prepareStatement(\"SELECT * FROM utilizador where nome=?;\");\r\n stmt.setString(1, username);\r\n ResultSet rs = stmt.executeQuery();\r\n rs.next();\r\n user = rs.getString(\"nome\");\r\n if (user.equals(username)) {\r\n return true;\r\n }\r\n } catch (SQLException e) {\r\n System.out.println(e);\r\n }\r\n return false;\r\n }", "@Override\r\n\tpublic Utilisateur getUser(String nom) {\n\t\treturn null;\r\n\t}", "@Listen(\"onChange = #txtUsuario; onOK = #txtUsuario\")\r\n\tpublic void buscarPorLogin() {\r\n\t\tUsuario usuario = servicioUsuario.buscarPorLogin(txtUsuario.getValue());\r\n\t\tif (usuario != null)\r\n\t\t\tllenarCamposUser(usuario);\r\n\t\telse {\r\n\t\t\tmsj.mensajeAlerta(Mensaje.noHayRegistros);\r\n\t\t\tidUser = \"TODOS\";\r\n\t\t\ttxtUsuario.setValue(\"TODOS\");\r\n\t\t\tlblUsuario.setValue(\"TODOS\");\r\n\t\t\ttxtUsuario.setFocus(true);\r\n\t\t}\r\n\t}", "private boolean comprobarUsuario(String nombre, String contrasenia, String grupo) {\n\n return true;\n }", "public void choixduJeu() {\n afficheMessage(\"*- Choisissez le jeu auquel vous voulez jouer : \\n- R pour Recherche +/-\\n- M pour Mastermind\");\n choixJeu = Console.saisieListeDeChoix(\"R|M\");\n afficheMessage(\"*- Choisissez le mode de jeu auquel vous voulez jouer :\\n- C pour Challenger,\\n- U pour Duel\\n- D pour Defense\");\n choixModeJeu = Console.saisieListeDeChoix(\"C|U|D\");\n }", "private void controladorUser(Controlador controlador){\n this.contUserCrearProyecto = controlador.getUserCrearProyecto();\n inicioUser.setControlCrearProyecto(contUserCrearProyecto);\n \n this.contUserCrearColectivo = controlador.getUserCrearColectivo();\n inicioUser.setControlCrearColectivo(contUserCrearColectivo);\n\n this.contInformes = controlador.getInformes();\n inicioUser.setControlSolicitarInformes(contInformes); \n \n this.contFiltrar = controlador.getFiltrar();\n inicioUser.setControlFiltrar(contFiltrar);\n\n this.contLimpiar = controlador.getLimpiarFiltro();\n inicioUser.setControlLimpiarFiltro(contLimpiar);\n }", "@Override\n public void login(String nome, String email, int senha) {\n if (getNome() == nome && this.getEmail() == email && this.getSenha() == senha){\n System.out.println(\"Login efetuado com sucesso\");\n } else {\n System.out.println(\"0 - Sair\");\n System.out.println(\"Saiu do usuario\");\n }\n\n }", "@SuppressWarnings(\"deprecation\")\r\n\tprivate void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed\r\n \t//valeur de centre d'inetret\r\n \tString domaine = String.valueOf(jComboBox1.getSelectedItem());\r\n \tSystem.out.println(\"nom \"+jTextField2.getText().toString());\r\n \tSystem.out.println(\"prenom \"+jTextField1.getText());\r\n \tSystem.out.println(\"domaine \"+domaine);\r\n \tSystem.out.println(\"mdp \"+jPasswordField1.getText().toString());\r\n\r\n \t//créer l'utilisateur\r\n \tif(jTextField2.getText().equals(\"\")||jTextField1.getText().equals(\"\")||jPasswordField1.getText().equals(\"\"))\r\n \t{\r\n \t\r\n jLabel6.setText(\"Veuillez remplire tous les champs!!!\");\r\n\r\n \t}\r\n \telse\r\n \t{\r\n \t\tint i=0;\r\n \t\tUtilisateur user=new Utilisateur(jTextField2.getText().toString(),jTextField1.getText().toString(),domaine,jPasswordField1.getText().toString(),new ArrayList<file>());\r\n\r\n \t\tif(!users.getInfo().isEmpty()) {\r\n \t\twhile(i<users.getInfo().size())\r\n \t{\r\n \t\tSystem.out.println(\"user ----> \"+users.getInfo().get(i).getUser().getNom());\r\n \t\tSystem.out.println(\"user ----> \"+nomAgent);\r\n \t\tSystem.out.println(\"user ----> \"+mtpAgent);\r\n\r\n \t\t//vérification\r\n \t\tif(users.getInfo().get(i).getUser().getNom().equalsIgnoreCase(nomAgent)\r\n \t\t\t\t&&(users.getInfo().get(i).getUser().getMot_de_passe().equals(mtpAgent))\r\n \t\t\t\t)\r\n \t\t\t\t{\r\n \t\t\t\r\n \t\t\tSystem.out.println(\"utilisateur modifié trouvé \");\r\n \t\t\t//la modification\r\n\r\n \t\t\tusers.getInfo().get(i).setUser(user);\r\n \t\t\t\r\n \t\t\t/*users.getInfo().get(i).getUser().setNom(nomAgent);\r\n \t\tusers.getInfo().get(i).getUser().setPrenom(prenomAgent);\r\n \t\tusers.getInfo().get(i).getUser().setDomaine(domaineAgent);\r\n \t\tusers.getInfo().get(i).getUser().setMot_de_passe(jPasswordField1.getText());*/\r\n \t\t\tSystem.out.println(\"new name \"+users.getInfo().get(i).getUser().getNom());\r\n \t\t\tSystem.out.println(\"new prenom \"+user.getPrenom());\r\n \t\t\tSystem.out.println(\"new mtp \"+users.getInfo().get(i).getUser().getMot_de_passe());\r\n \t\t\tSystem.out.println(\"new domaine \"+users.getInfo().get(i).getUser().getDomaine());\r\n \t\t\tIndex.récuperation(user.getNom(), user.getPrenom(), user.getDomaine(), user.getMot_de_passe());\r\n \t\t\tIndex.affecterAgentInfo(users.getInfo().get(i),i);\r\n \t\t\t new Index();\r\n \t\t\t this.setVisible(false);\r\n \t\t\t this.dispose();\r\n\r\n \t\t\t\t}\r\n \t\ti++;\r\n \t}\r\n \t}\r\n \t\tif(!users.getMath().isEmpty()) {\r\n \t\twhile(i<users.getMath().size())\r\n \t{\r\n \t\tSystem.out.println(\"user ----> \"+users.getMath().get(i).getUser().getNom());\r\n \t\t//vérification\r\n \t\tif(users.getMath().get(i).getUser().getNom().equalsIgnoreCase(nomAgent)\r\n \t\t\t\t&&(users.getMath().get(i).getUser().getMot_de_passe().equals(mtpAgent))\r\n \t\t\t\t)\r\n \t\t\t\t{\r\n \t\t\t\r\n \t\t\tSystem.out.println(\"utilisateur modifié trouvé \");\r\n \t\t\t//la modification\r\n\r\n \t\t\tusers.getMath().get(i).setUser(user);\r\n \t\t\t\r\n \t\t\t/*users.getInfo().get(i).getUser().setNom(nomAgent);\r\n \t\tusers.getInfo().get(i).getUser().setPrenom(prenomAgent);\r\n \t\tusers.getInfo().get(i).getUser().setDomaine(domaineAgent);\r\n \t\tusers.getInfo().get(i).getUser().setMot_de_passe(jPasswordField1.getText());*/\r\n \t\t\tSystem.out.println(\"new name \"+users.getMath().get(i).getUser().getNom());\r\n \t\t\tSystem.out.println(\"new prenom \"+users.getMath().get(i).getUser().getPrenom());\r\n \t\t\tSystem.out.println(\"new mtp \"+users.getMath().get(i).getUser().getMot_de_passe());\r\n \t\t\tSystem.out.println(\"new domaine \"+users.getMath().get(i).getUser().getDomaine());\r\n \t\t\tIndex.récuperation(user.getNom(), user.getPrenom(), user.getDomaine(), user.getMot_de_passe());\r\n\r\n \t\t\tIndex.affecterAgentMath(users.getMath().get(i));\r\n \t\t\t new Index();\r\n \t\t\t this.setVisible(false);\r\n \t\t\t this.dispose();\r\n\r\n \t\t\t\t}\r\n \t\ti++;\r\n \t}\r\n \t}\r\n \t\t\r\n\r\n \t\t\r\n \t\t\r\n \t\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t}\r\n \t\t\r\n \r\n \t\r\n\r\n \t\r\n \t\r\n \t }", "private void valider() {\n\n\t\t/**\n\t\t * Renvoie un tableau de caractères qui sera transformé en chaine de caractère\n\t\t **/\n\n\t\tString passewordTraduit = new String(passeword.getPassword());\n\n\t\t/**\n\t\t * login.getText() récupère le contenu de la barre de saisie\n\t\t **/\n\t\t\n\t\tString user = login.getText();\n\t\tString passwd = passewordTraduit;\n\t\t/**\n\t\t *Permettra de savoir si la connexion à la BDD SQL c'est bien passée.\n\t\t */\n\t\tboolean reussite;\n\t\t/**\n\t\t * On va créer la BDD si elle n'existe pas\n\t\t */\n\t\t\n\t\treussite = Initialisation.getInstance().creerBDD(user, passwd);\n\t\t/**\n\t\t * On set le password et l'utilisateur pour que les paramètres de connexion soient les bons\n\t\t */\n\t\tInitialisation.getInstance().setPasswd(passwd);\n\t\tInitialisation.getInstance().setUser(user);\n\t\tModification.getInstance().setPasswd(passwd);\n\t\tModification.getInstance().setUser(user);\n\t\tif(reussite) {\n\t\t\t/**\n\t\t\t *Si tout c'est bien passé on regarde si l'utilisateur existe dans le fichier et dans le cas contraire on le crée.\n\t\t\t */\n\t\t\tif(personnesDejaInscrite.getInstance().getMaListDePersonneInscrite().get(user) == null) {\n\t\t\t\tpersonnesDejaInscrite.getInstance().getMaListDePersonneInscrite().put(user, new CompteAdministrateur(passwd));\n\t\t\t\tpersonnesDejaInscrite.getInstance().sauvegarder();\n\t\t\t}\n\t\t\tFenetreLogin.getInstance().dispose();\n\t\t\tFenetreFond.getInstance().changerFenetre(login.getText());\n\t\t\t/**\n\t\t\t *On remet les champs à nul pour que quand on se déconnecte on est pas le login et le mot de passe de l'utilisateur précédent.\n\t\t\t */\n\t\t\tlogin.setText(\"\");\n\t\t\tpasseword.setText(\"\");\n\t\t}\n\t\n\t}", "public void zmienDaneUzytkownika() throws SQLException {\n String noweImie = userEdycjaNoweImie.getText().trim();\n String noweNazwisko = userEdycjaNoweNazwisko.getText().trim();\n String nowyEmail = userEdycjaNoweAdresEmail.getText().trim();\n String nowyNumerKontaktowy = userEdycjaNowyNumerKontaktowy.getText().trim();\n\n Driver.editUser(noweImie, noweNazwisko, nowyNumerKontaktowy, nowyEmail);\n }", "public void subeUsuario() {\n\t\tEditText nicknameText = (EditText) findViewById(R.id.nicknameEditText);\n\t\tstrNickname = nicknameText.getText().toString().trim();\n\t\t\n\t\tif (strNickname.equals(\"\")) {\n\t\t\tToast.makeText(this, \"Nickname no puede estar vacío\",Toast.LENGTH_LONG).show();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tguardarPreferences();\n\t\t\n\t\t//lanzamos un uploadService\n\t\tIntent uploadService = new Intent(getApplicationContext(),UploadUserService.class);\n\t\t\n\t\tuploadService.putExtra(\"id\", userId);\n\t\tuploadService.putExtra(\"nickname\", strNickname);\n\t\tuploadService.putExtra(\"mail\", strEmail);\n\t\tuploadService.putExtra(\"dob\", dayOfBirth);\n\t\tuploadService.putExtra(\"pass\", strPassword);\n\t\tuploadService.putExtra(\"genero\", gender);\n\t\tuploadService.putExtra(\"avatar\", strAvatar);\n\t\t\n\t\tstartService(uploadService);\n\t}", "protected void assertUtilisateurActif() {\n\t\t assertTrue( ((DoliUserPage)_currentPage).isUtilisateurActif());\n\t\t}", "@Override\n\t/*Método que se va a utilizar cuando el usuario inicie sesión, para ver si los datos son o no correctos*/\n\tpublic String comprobarinicio(String nombreusuario, String clave) {\n\t\tDBConnection con = new DBConnection();\n\t\tString sql=\"Select * from usuarios where nombreusuario='\"+nombreusuario+\"'and clave='\"+clave+\"'\"; //búsqueda del usuario en la BD\n\t\tBoolean encontrado=false; //Booleano que indicará si el usuario está o no en la BD\n\t\ttry {\n\t\t\tStatement st = con.getConnection().createStatement(); \n\t\t\tResultSet rs = st.executeQuery(sql);\n\t\t\t/*De lo que devuelve la consulta, se va a coger el nombre de usuario y la clave (aunque no haya datos en ellos lo devuelve pero vacio)*/\n\t\t\twhile(rs.next()) {\n\t\t\tString nombre_usu= rs.getString(\"nombreusuario\");\n\t\t\tString pass= rs.getString(\"clave\");\n\t\t\t/*En caso de que los datos coincidan con los que se han pasado como parámetros desde el inicio de sesión, significará que los datos son correctos\n\t\t\t * y la variable encontrado cambia su valor para dejar constancia de que el usuario es correcto*/\n\t\t\tif(nombre_usu.equals(nombreusuario) && pass.equals(clave)) {\n\t\t\t\tencontrado=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tst.close();\n\t\t\t//En caso del valor de encontrado, se devolverá ok (si se encuentra) o not ok (\"si no se encuentra\")\n\t\t\tif(encontrado) {\n\t\t\t\treturn \"ok\";\n\t\t\t}else {\n\t\t\t\treturn \"not ok\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n return(e.getMessage());\n\t\t}finally {\n\t\t\tcon.desconectar();\n\t\t}\n\t\t\n\t\t\n\t}", "public Integer logIn(String u_name, String u_pw){\n //find entry with u_name = this.u_name\n //probably not so safe\n //getting user with index 0 because getUserFromUsername returns List\n User user = userDao.getUserFromUsername(u_name).get(0);\n //print at console\n LOGGER.info(\"User: \" + user);\n //returns integer 1 if user.get_pw equals to this.pw or 0 if not\n if (user.getU_Pw().equals(u_pw)){\n return user.getU_Id();\n }else{\n return 0;\n }\n }", "private boolean compararNombreUsuario () {\n\t\tlistaUsuarios = UsuarioDAO.readTodos(this.mainApp.getConnection());\n\t\tString nombre = this.campoTextoNombreUsuario.getText();\n\t\tfor (Usuario nombres : listaUsuarios) {\n\t\t\tif (nombres.getUsuario().equals(nombre)) {\n\t\t\t\treturn false;\n\t\t\t}//FIN IF\n\t\t}//FIN FOR\n\t\treturn true;\n\t}", "@Override\r\n\tpublic void modifierPrenom(int idUtilisateur, String nouveauPrenom) {\n\r\n\t}", "public static void tener_Usuario_activo() {\n\t\t\t\tdesktop.<DomTextField>find(\"//BrowserApplication//BrowserWindow//input[@id='username']\").typeKeys(\"ocastro\");\n\t\t\t\tdesktop.<DomTextField>find(\"//BrowserApplication//BrowserWindow//input[@id='password']\").setText(\"bogota2016\");\n\t\t\t\tdesktop.<DomButton>find(\"//BrowserApplication//BrowserWindow//input[@id='loginbtn']\").click();\n\t\t\t\t//end recording\n\t\t\t\tSerenity.takeScreenshot();\n\t}", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tUsuarioPojo user = null;\r\n\t\t\t\tUsuarioPersistencia up = new UsuarioPersistencia();\r\n\r\n\t\t\t\t//int id = up.obtenerIdEmple();\r\n\t\t\t\tString usuarioMail = txtUsuario.getText();\r\n\t\t\t\tString password = new String(pwdPass.getPassword()); // DNI de momento\r\n\t\t\t\tString passwordC = new String(pwdConfPass.getPassword());\r\n\t\t\t\tString apenom = txtApenom.getText();\r\n\t\t\t\tString dni = txtDni.getText();\r\n\t\t\t\tint numSS = Integer.parseInt(txtSegSoc.getText());\r\n\t\t\t\tString cuenta = txtCuenta.getText();\r\n\r\n\t\t\t\tif (password.equals(passwordC)) {\r\n\t\t\t\t\t// creamos un objeto usuario si coinciden las contraseñas\r\n\t\t\t\t\tuser = new UsuarioPojo(apenom, numSS, cuenta, dni, usuarioMail, password);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (user != null) {\r\n\t\t\t\t\t// insertaremos el usuario si coinciden las contraseñas\r\n\t\t\t\t\tup = new UsuarioPersistencia();\r\n\t\t\t\t\tint res = up.insertarUser(user);\r\n\r\n\t\t\t\t\tif (res == 1) { // se habrá registrado al usuario\r\n\t\t\t\t\t\tSystem.out.println(\"Insertado correctamente\");\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Registro insertado correctamente\",\r\n\t\t\t\t\t\t\t\t\"Resultado del Registro\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\t\tdispose(); // dispose cierra ventana actual, System.exit(0) sale del programa\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// mostramos msg si no coinciden las contraseñas, manteniendo el control en dreg\r\n\t\t\t\t\tSystem.out.println(\"No insertado\");\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Contraseñas introducidas no coinciden\", \"Error de contraseña\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\t// limpiamos campos de contraseña\r\n\t\t\t\t}\r\n\t\t\t}", "public String usuarioconectado() {\n\t\tString nome;\n\t\tObject principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n\n\t\tif (principal instanceof UserDetails) {\n\t\t\tnome = ((UserDetails) principal).getUsername();\n\t\t} else {\n\t\t\tnome = principal.toString();\n\t\t}\n\t\t// System.out.println(nome);\n\t\treturn nome;\n\t}", "private void verificacaoCaracterLogin(String palavra, List<Usuario> usuarios, boolean checarLogin) throws ServiceException{\n\n if(!palavra.matches(\"[a-zA-Z[0-9]]\")){\n throw new \n ServiceException(\"Login inválido!\");\n }\n \n if( !checarLogin )\n return ; \n \n for (Usuario usuario : usuarios) {\n if(palavra.matches(usuario.getLogin()))\n throw new \n ServiceException(\"Usuario existente!\");\n }\n\n }", "public static boolean login() {\n\t\t// DB\n\t\tString[] usr = { \"NICOLAS\", \"CELESTE\" };\n\t\tString[] pass = { \"cerveza\", \"fernet\" };\n\t\tString usrAuth = \"\";\n\t\tboolean auth = false;\n\t\tint intentos = 1;\n\n\t\tdo {\n\t\t\tJTextField usuario = new JTextField();\n\t\t\tJTextField password = new JPasswordField();\n\t\t\tObject[] ingresarUsuarioPassword = { \"Usuario: \", usuario, \"Password\", password };\n\t\t\tint ingresarLogin = JOptionPane.showConfirmDialog(null, ingresarUsuarioPassword,\n\t\t\t\t\t\"Ingrese credenciales de usuario\", JOptionPane.OK_CANCEL_OPTION);\n\t\t\tif (ingresarLogin == JOptionPane.OK_OPTION) {\n\t\t\t\t// Busca el usuario en un bucle For\n\t\t\t\tfor (int i = 0; i < usr.length; i++) {\n\t\t\t\t\t// Si encuentra el usuario, verifica si el usuario y la contraseña coinciden\n\t\t\t\t\tif (usr[i].equals(usuario.getText().toUpperCase()) && pass[i].equals(password.getText())) {\n\t\t\t\t\t\tusrAuth = usr[i];\n\t\t\t\t\t\tauth = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Si no coincide, muestra los intentos restantes y vuelve a pedir credenciales\n\t\t\t\tif (!auth) {\n\t\t\t\t\tif (intentos < 3) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\\n\" + (3 - intentos) + \" Intentos restantes\",\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\tintentos++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\\n\" + \"Se supero en numero de intentos\",\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\tintentos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Cierra si no se selecciona OK\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!auth & (intentos <= 3));\n\t\t// Si autentica, muestra mensaje de bienvenida\n\t\tif (auth)\n\t\t\tJOptionPane.showMessageDialog(null, \"Bienvenido \" + usrAuth, \"Bienvenido\", JOptionPane.INFORMATION_MESSAGE);\n\t\treturn auth;\n\t}", "public void login (String pUsuario, int pDificultad)\n {\n nombreUsuario = pUsuario;\n dificultad = pDificultad;\n\n iniciarPartida();\n }", "public void menu(){\n System.out.println(\"---------------------------Login------------------------------------\");\n \n System.out.println(\"Usuario:\");\n respuesta = scanner.nextLine();\n System.out.println(\"Contraseña:\");\n respuesta2 = scanner.nextLine();\n Usuario user = new Usuario();\n user.setNombre(respuesta);\n user.setPassword(respuesta2);\n idUser=modelo.validarUsuario(user);\n if(idUser<0){\n System.err.println(\"Usuario invalido\");\n \n }else{\n \n menuInterno();\n \n }\n//\n// menuInterno();\n// \n }", "private void B_InscrireActionPerformed(java.awt.event.ActionEvent evt) {\n \n String ident=T_Email.getText();\n String mdp1=String.valueOf(Ps_Mdp.getPassword());\n String mdp2=String.valueOf(Ps_ConfirmeMdp.getPassword());\n String prenom_uti=prenom.getText();\n String nom_uti=nom.getText();\n \n boolean ajout;\n \n if (mdp1.equals(mdp2)){\n System.out.println(\"Les deux mots de passe correspondent\");\n Bdd bdd = new Bdd();\n \n //On vérifie que l'utilisateur existe pas déjà\n boolean exists = bdd.liste_uti(ident);\n \n if(exists==true){ //alors on ajoute\n bdd.Inscription(ident,mdp1,prenom_uti,nom_uti);\n AffichageConnexion Aff = new AffichageConnexion();\n Aff.setLocationRelativeTo(null);\n Aff.setVisible(true);\n this.dispose();\n }\n else {\n System.out.println(\"existe déjà\");\n } \n }\n else \n System.out.println(\"mdp diff\");\n }", "public Utilisateur(String login, String pwd, String nom, String prenom) {\n\t\tsuper();\n\t\tthis.login = login;\n\t\tthis.pwd = pwd;\n\t\tthis.nom = nom;\n\t\tthis.prenom = prenom;\n\t}", "private boolean cekUser(String user){\n return user.equals(Preferences.getRegisteredUser(getBaseContext()));\n }", "public void ajouterRole(RoleUtilisateur ru);", "public void testModifierUtilisateur() {\n System.out.println(\"modifierUtilisateur\");\n Utilisateur putilisateur = null;\n boolean expResult = false;\n boolean result = Utilisateur.modifierUtilisateur(putilisateur);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public boolean verificarUsuario(){\n boolean estado = false;\n try{\n this.usuarioBean = (Dr_siseg_usuarioBean) this.manejoFacesContext.obtenerObjetoSession(\"usuario\");\n if(this.usuarioBean != null){\n estado = true;\n if (this.usuarioBean.getRoll().equals(\"GRP_SERVAGTMII_ADMIN\")){\n modoAdministrador=true;\n// this.usuarioRoll=\"ADMIN\";\n// this.disableBotonFinalizar=\"false\";\n// this.visibleImprimirComprobanteEncargado=\"true\";\n// this.visibleImprimirComprobanteEstudiante=\"true\";\n \n\n }else{\n if (this.usuarioBean.getRoll().equals(\"GRP_SERVAGTMII_PF1\")){\n modoAdministrador=true;\n// this.usuarioRoll=\"PF1\";\n// this.disableBotonFinalizar=\"true\";\n// this.visibleImprimirComprobanteEncargado=\"false\";\n// this.visibleImprimirComprobanteEstudiante=\"true\";\n \n }\n }\n\n }else{\n this.manejoFacesContext.redireccionarFlujoWeb(\"/WebAppSLATE/LogoutServlet\" );\n }\n }catch(Exception ex){\n this.manejoFacesContext.redireccionarFlujoWeb(\"/WebAppSLATE/LogoutServlet\" );\n // this.manejoFacesContext.redireccionarFlujoWeb(\"/WebAppMADEB/cr.ac.una.reg.info.contenido/moduloFuncionario/estudiante/e_editarDireccion.jspx\");\n }//\n return estado;\n }", "@Override\r\n\tpublic void analizarUsuario(String tipo) {\n\t\t\r\n\t\tswitch (tipo){\r\n\t\t\tcase \"Administrativo\":\r\n\t\t\t\tfor(IAsesoria ia : usuarios) {\r\n\t\t\t\t\tif(ia.getClass().getSimpleName().equals(tipo)) {\r\n\t\t\t\t\t\tia.analizarUsuario();\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\t\r\n\t\t\t\tbreak;\t\r\n\t\t\tcase \"Profesional\":\r\n\t\t\t\tfor(IAsesoria ia : usuarios) {\r\n\t\t\t\t\tif(ia.getClass().getSimpleName().equals(tipo)) {\r\n\t\t\t\t\t\tia.analizarUsuario();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"Cliente\":\r\n\t\t\t\tfor(IAsesoria ia : usuarios) {\r\n\t\t\t\t\tif(ia.getClass().getSimpleName().equals(tipo)) {\r\n\t\t\t\t\t\tia.analizarUsuario();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t}\r\n\r\n\r\n\t}", "private void login() {\n\t\t \tetUserName.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etUserName);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t \t\n\t\t \t // TextWatcher would let us check validation error on the fly\n\t\t \tetPass.addTextChangedListener(new TextWatcher() {\n\t\t public void afterTextChanged(Editable s) {\n\t\t Validation.hasText(etPass);\n\t\t }\n\t\t public void beforeTextChanged(CharSequence s, int start, int count, int after){}\n\t\t public void onTextChanged(CharSequence s, int start, int before, int count){}\n\t\t });\n\t\t }", "public java.lang.String getUsuario();", "private void loggedInUser() {\n\t\t\n\t}", "private void actualizaUsuario() {\n\t\t\n\t\tInteger edad=miCoordinador.validarEdad(campoEdad.getText().trim());\n\t\t\n\t\tif (edad!=null) {\n\t\t\t\n\t\t\tUsuarioVo miUsuarioVo=new UsuarioVo();\n\t\t\t//se asigna cada dato... el metodo trim() del final, permite eliminar espacios al inicio y al final, en caso de que se ingresen datos con espacio\n\t\t\tmiUsuarioVo.setDocumento(campoDocumento.getText().trim());\n\t\t\tmiUsuarioVo.setNombre(campoNombre.getText().trim());\n\t\t\tmiUsuarioVo.setEdad(Integer.parseInt(campoEdad.getText().trim()));\n\t\t\tmiUsuarioVo.setProfesion(campoProfesion.getText().trim());\n\t\t\tmiUsuarioVo.setTelefono(campoTelefono.getText().trim());\n\t\t\tmiUsuarioVo.setDireccion(campoDireccion.getText().trim());\n\t\t\t\n\t\t\tString actualiza=\"\";\n\t\t\t//se llama al metodo validarCampos(), este retorna true o false, dependiendo de eso ingresa a una de las opciones\n\t\t\tif (miCoordinador.validarCampos(miUsuarioVo)) {\n\t\t\t\t//si se retornó true es porque todo está correcto y se llama a actualizar\n\t\t\t\tactualiza=miCoordinador.actualizaUsuario(miUsuarioVo);//en registro se almacena ok o error, dependiendo de lo que retorne el metodo\n\t\t\t}else{\n\t\t\t\tactualiza=\"mas_datos\";//si validarCampos() retorna false, entonces se guarda la palabra mas_datos para indicar que hace falta diligenciar los campos obligatorios\n\t\t\t}\n\t\t\t\n\t\t\t//si el registro es exitoso muestra un mensaje en pantalla, sino, se valida si necesita mas datos o hay algun error\n\t\t\tif (actualiza.equals(\"ok\")) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \" Se ha Modificado Correctamente \",\"Confirmación\",JOptionPane.INFORMATION_MESSAGE);\t\t\t\n\t\t\t}else{\n\t\t\t\tif (actualiza.equals(\"mas_datos\")) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Debe Ingresar los campos obligatorios\",\"Faltan Datos\",JOptionPane.WARNING_MESSAGE);\t\t\t\n\t\t\t\t}else{\n\t\t JOptionPane.showMessageDialog(null, \"Error al Modificar\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t}\t\t\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\tJOptionPane.showMessageDialog(null, \"Debe ingresar una edad Valida!!!\",\"Advertencia\",JOptionPane.ERROR_MESSAGE);\n\t\t}\n\n\t\t\t\t\n\t}", "private void abrirVentanaChatPublica() {\n\t\tif (!listaUsuarios.isSelectionEmpty()) {\n\t\t\tMenuVentanaChat uiChat = this.seleccionarVentanaChat(listaUsuarios.getSelectedValue());\n\t\t} else\n\t\t\tJOptionPane.showMessageDialog(this, \"Seleccione un elemento de la lista\", \"Seleccionar Usuario\",\n\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\n\t}", "public void doLogin() {\r\n\t\tif(this.getUserName()!=null && this.getPassword()!=null) {\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"Select idUser,nom,prenom,userName,type,tel from t_user where userName=? and pass=? and status=?\");\r\n\t\t\t\tps.setString(1, this.getUserName());\r\n\t\t\t\tps.setString(2, this.getPassword());\r\n\t\t\t\tif(rs.next()) {\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"idUser\", rs.getInt(\"idUser\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"nom\", rs.getString(\"nom\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"prenom\", rs.getString(\"prenom\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"userName\", rs.getString(\"userName\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"type\", rs.getString(\"type\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"tel\", rs.getString(\"tel\"));\r\n\t\t\t\t\tFacesContext.getCurrentInstance().getExternalContext().redirect(\"view/welcome.xhtml\");\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tnew Message().error(\"echec de connexion\");\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tnew Message().warnig(\"Nom d'utilisateur ou mot de passe incorrecte\");\r\n\t\t}\r\n\t}", "public boolean logInDatosCorrectos(){\n if (txtNombreUsuario.getText().equals(\"\") || txtContraseña.getText().equals(\"\")){\n return false;\n }\n return true;\n }", "public void isAllowed(String user) {\n \r\n }", "public void setUsuario(java.lang.String newUsuario);", "private void initValidarTipoUsuarioChatLeidos(String tipoUsuario) {\n switch (tipoUsuario) {\n case \"especialista\": /**/\n\n Log.d(TAG, \"especialista : \"\n + \"keyUser : \" + keyUser\n + \"Propuesta ; \" + idUsuarioPropuesta);\n // initLeerMensajesTipoUsuario(idUsuarioPropuesta, idGrupoChat, paisCodigo);\n initLeerMensajesTipoUsuario(idUsuarioPropuesta, idGrupoChat, paisCodigo);\n break;\n case \"cliente\":\n Log.d(TAG, \"cliente : \"\n + \"keyUser : \" + keyUser\n + \"Propuesta ; \" + idUsuarioPropuesta);\n\n //initLeerMensajesTipoUsuario(keyUser, idGrupoChat, paisCodigo);\n initLeerMensajesTipoUsuario(idUsuarioPropuesta, idGrupoChat, paisCodigo);\n //initLeerMensajesTipoUsuario(idUsuarioPropuesta, idGrupoChat, paisCodigo);\n break;\n }\n }", "public Edt(Utilisateur user) {\n super(\"Votre emploi du temps - \" + user.getNom().toUpperCase() + \" \" + user.getPrenom().toUpperCase());\n String droit=\" \";\n switch(user.getDroit())\n {\n case 1:\n droit+=\"ADMIN\";\n break;\n case 2:\n droit+=\"REFERENT\";\n break;\n case 3:\n droit+=\"ENSEIGNANT\";\n break;\n case 4:\n droit+=\"ETUDIANT\";\n break;\n }\n this.setTitle(\"Votre emploi du temps - \" + user.getNom().toUpperCase() + \" \" + user.getPrenom().toUpperCase()+droit);\n\n this.setSize(1415, 805); //Taille\n this.setLocationRelativeTo(null); //Centre\n this.setResizable(false);\n this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); //Stop run quand la dernière fenetre est fermé\n infoBase();\n this.logout.addActionListener(this);\n\n }", "@Override\n\tpublic void procesareMesajChat(MesajChat mesaj) {\n\t\tif(mesaj.getDestinatie(). isEmpty() || mesaj.getDestinatie().equals(\"@Everyoane\")) {\n\t\t\tif(this.next!=null)\n\t\t\t\tthis.next.procesareMesajChat(mesaj);\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//procesare mesaj privat\n\t\t\tSystem.out.println(String.format(\"Mesaj privat pentru %s = %s\",\n\t\t\t\t\tmesaj.getDestinatie(), mesaj.getContinut()));\n\t\t}\n\t}", "private void loginSuccess(String uname) {\n }", "@Override\n public void onClick(View view) {\n\n String nombre = etNombre.getText().toString();\n String password = etPassword.getText().toString();\n String nombreVolteado = \"\";\n\n //Mostrar el dato\n for (int i = nombre.length()-1; i>=0; i--){\n nombreVolteado += nombre.charAt(i);\n }\n\n if (password.equals(nombreVolteado)){\n tvCrearCuenta.setText(\"Correcto\");\n }else{\n tvCrearCuenta.setText(\"La contraseña debe ser el nombre de usuario volteado\");\n }\n\n //Segunda, mostrar dato al usuario, temporal\n Toast.makeText(getApplicationContext(), \"Su nombre es \" + nombre, Toast.LENGTH_SHORT).show();\n\n //Tercera, mostrar datos al desarrollador (Logcat)\n Log.i(\"PRUEBA\", \"El nombre de usuario es \" + nombre);\n\n }", "private static void privilegio(int tipo) {\n String nome;\r\n Scanner sc = new Scanner(System.in);\r\n if (tipo == 1)\r\n System.out.println(\"Qual o utilizador a quem quer dar privilégios de editor?\");\r\n else\r\n System.out.println(\"Qual o utilizador a quem quer dar privilégios de editor?\");\r\n nome = sc.nextLine();\r\n PreparedStatement stmt;\r\n if (verificaUser(nome)) {\r\n try {\r\n c.setAutoCommit(false);\r\n if (tipo == 1)\r\n stmt = c.prepareStatement(\"UPDATE utilizador SET utilizador_tipo = true WHERE nome=?\");\r\n else\r\n stmt = c.prepareStatement(\"UPDATE utilizador SET utilizador_tipo = false WHERE nome=?\");\r\n stmt.setString(1, nome);\r\n stmt.executeUpdate();\r\n\r\n stmt.close();\r\n c.commit();\r\n } catch (SQLException e) {\r\n System.out.println(e);\r\n }\r\n System.out.println(\"Privilégios atualizados\");\r\n } else {\r\n System.out.println(\"Utilizador não encontrado\");\r\n }\r\n }", "public String modificarUsuario() {\n\t\tString stringIdUsuario = session.getAttribute(\"id\").toString();\n\t\tInteger intIdUsuario = Integer.parseInt(stringIdUsuario);\n\t\t\n\t\tFacesContext con = FacesContext.getCurrentInstance();\n\t\tHttpServletRequest request = (HttpServletRequest) con.getExternalContext().getRequest();\n\t\tString cambioDeTexto = request.getParameter(\"myForm:texto\");\n\t\tString passwordViejo = request.getParameter(\"myForm:password\");\n\t\tString passwordNuevo = request.getParameter(\"myForm:passwordNuevo\");\n\t\tUsuario usuarioDb = usuarioService.buscarUsuarioPorId(intIdUsuario);\n\t\tif (usuarioDb != null) {\n\t\t\tif(usuarioService.validarNoCaracteresEspeciales(cambioDeTexto)==true) {\n\t\t\t\tString accion = \"Usuario \"+ usuarioDb.getEmail() + \" error al modificar texto.\";\n\t\t\t\tauditoriaService.registrarAuditoria(usuarioDb,accion);\n\t\t\t\terror =\"Campo texto no permitido\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror = usuarioService.usuarioModificaPasswordyTexto(cambioDeTexto, passwordViejo, passwordNuevo, intIdUsuario);\n\t\t\t}\n\t\t}\n\t\treturn \"home\";\n\t\t\n\t}", "private void btnAgregarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {\n String v_nombre=\" \";\n\n if(txtNombreAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Digite un nombre, por favor\", \"Informacion\");\n return;\n }\n v_nombre=txtNombreAU.getText(); \n //Valido la contrasenia\n if(txtContraseniaAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Es obligatorio ingresar una contraseña\", \"Informacion\");\n return;\n }\n if(!validarContraseniaUsuario(txtContraseniaAU.getText())){\n return;\n }\n String v_contrasenia=txtContraseniaAU.getText();\n //Valido nombre completo\n if(txtNombreCompletoAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Es obligatorio ingresar el nombre completo\", \"Informacion\");\n return;\n }\n String v_nombreCompleto=txtNombreCompletoAU.getText();\n \n //Valido que se escogio un valor para el cargo\n int v_cargo=0;\n //10 = Administrador, 20=Funcionario\n if(rbtnAdministradorAU.isSelected()){\n v_cargo=10;\n }else if(rbtnFuncionarioAU.isSelected()){\n v_cargo=20;\n }else{\n Utilidades.mensajeInformacion(\"Escoga un cargo\", \"Informacion\");\n return;\n }\n \n //Creo y agreggo un usuario dependiendo del cargo escogido (Administrador o funcionario)\n try{\n boolean agregado=false;\n if(v_cargo==10){\n Administrador nuevoUsuario=new Administrador(v_nombre, v_contrasenia, v_nombreCompleto, null);\n agregado = administrador.agregarUsuario(nuevoUsuario);\n\n } \n if(v_cargo==20){\n Funcionario nuevoUsuario=new Funcionario(v_nombre, v_contrasenia, v_nombreCompleto, null);\n agregado = administrador.agregarUsuario(nuevoUsuario);\n }\n\n\n if(agregado){\n Utilidades.mensajeExito(\"Se agrego el Usuario\", \"Agregacion Exitosa\");\n limpiarCamposAgregarUsuario();\n }else{\n Utilidades.mensajeError(\"El Usuario a agregar ya existe\", \"Error\");\n }\n\n }catch (IOException ex) {\n Logger.getLogger(Funcionario.class.getName()).log(Level.SEVERE, null, ex);\n Utilidades.mensajeAdvertencia(\"Se ha interrumpido la conexion con el servidor\", \"Error\");\n }\n \n }", "public void altaUsuario();", "private int userLoing() {\n\t\t\n\t\tScanner scan2 = new Scanner(System.in);\n\t\tSystem.out.println(\"\\nPour vous rappler, pour quitter il faut entrer q ou quit pour quitter \\navant de commencer de saisir de mot de passe.\\n\"+\n\t\t\t\t\n\t\t\t\t\"--------------------------------------------------------------------------------------\");\n\t\tboolean correct = true; //To check the confirmation of the password\n\t\t\n\t\t\n\t\t//to get the user's name\n\t\tString nom;\n\t\tdo {\n\t\t System.out.print(\"Entrez un nom d'une longueur qui > 4: \");\n\t\t nom = scan2.nextLine();\n\t\t} while ((nom.length() < 4) && !(nom.equalsIgnoreCase(\"q\")) && !(nom.equalsIgnoreCase(\"quit\")));\n\t\t\n\t\tif(nom.equalsIgnoreCase(\"q\") || nom.equalsIgnoreCase(\"quit\")) {\n\t\t\tSystem.out.println(\"\\n-----------------------------------------------------\\nVous avez été dérigé vers le meun principal!\\n-----------------------------------------------------\");\n\t\t\tcorrect = true;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t\n\t\t\t//for the password and the confirmation\n\t\t\t\n\t\t\twhile(correct) {\n\t\t\t\tint mdp;\n\t\t\t\tdo {\n\t\t\t\t System.out.print(\"Entrez un mot de passe qui contient au moins 6 chiffres SVP: \");\n\t\t\t\t while (!scan2.hasNextInt()) {\n\t\t\t\t\t System.err.print(\"Entrez un mot de passe qui contient au moins 6 chiffres SVP: \");\n\t\t\t\t scan2.next();\n\t\t\t\t }\n\t\t\t\t mdp = scan2.nextInt();\n\t\t\t\t} while (Integer.toString(mdp).length() < 6);\n\t\t\t\t\n\t\t\t\tint mdp2;\n\t\t\t\tdo {\n\t\t\t\t System.out.print(\"Confirmez vôtre mot de passe SVP : \");\n\t\t\t\t while (!scan2.hasNextInt()) {\n\t\t\t\t\t System.err.print(\"Confirmez vôtre mot de passe : \");\n\t\t\t\t scan2.next(); \n\t\t\t\t }\n\t\t\t\t mdp2 = scan2.nextInt();\n\t\t\t\t} while (Integer.toString(mdp2).length() < 6);\n\t\t\t\t\n\t\t\t\tcorrect = mdp == mdp2 ? false: true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tint res = !correct? 1 : 0;\n\t\treturn res;\n\t\t\n\t}", "@Override\r\n\tpublic List loginusername(String un) {\n\t\treturn homedao.loginusername(un);\r\n\t}", "private void affPremierJoueur(String nomPJoueur) {\r\n\t\tAlert alert = new Alert(AlertType.INFORMATION);\r\n\t\talert.setTitle(\"Premier joueur\");\r\n\t\talert.setHeaderText(null);\r\n\t\talert.setContentText(nomPJoueur + \" est le premier joueur a jouer\");\r\n\t\talert.showAndWait();\r\n\t}", "public void testGetNomUtilisateur() {\n System.out.println(\"getNomUtilisateur\");\n Utilisateur instance = null;\n String expResult = \"\";\n String result = instance.getNomUtilisateur();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public void setLoggedUser(PersAdministrativo usuario){\n this.usuario = usuario;\n }", "public Usuarios(String Cedula){ //método que retorna atributos asociados con la cedula que recibamos\n conexion = base.GetConnection();\n PreparedStatement select;\n try {\n select = conexion.prepareStatement(\"select * from usuarios where Cedula = ?\");\n select.setString(1, Cedula);\n boolean consulta = select.execute();\n if(consulta){\n ResultSet resultado = select.getResultSet();\n if(resultado.next()){\n this.Cedula= resultado.getString(1);\n this.Nombres= resultado.getString(2);\n \n this.Sexo= resultado.getString(3);\n this.Edad= resultado.getInt(4);\n this.Direccion= resultado.getString(5);\n this.Ciudad=resultado.getString(6);\n this.Contrasena=resultado.getString(7);\n this.Estrato=resultado.getInt(8);\n this.Rol=resultado.getString(9);\n }\n resultado.close();\n }\n conexion.close();\n } catch (SQLException ex) {\n System.err.println(\"Ocurrió un error: \"+ex.getMessage().toString());\n }\n}", "java.lang.String getUser();", "@Override\n\tpublic void emprestimo(Livros livro, Usuarios usuario) {\n\t\t\n\t}", "@Override\n\tpublic void loginUser() {\n\t\t\n\t}", "public ActionUtilisateur choisirUneAction() ;", "private void exibirSenha() {\n if (exibeSenha) {\n txtSenha.setTransformationMethod(PasswordTransformationMethod.getInstance());\n exibeSenha = false;\n } else {\n txtSenha.setTransformationMethod(HideReturnsTransformationMethod.getInstance());\n exibeSenha = true;\n }\n }", "public void editUser(userBean utilisateur){\r\n\t\ttry {\r\n\t\t//La requ�te sql qui permet de modifier un enregistrement\r\n\t\t\tString sql = \"UPDATE utilisateur set nom=? ,prenom=? where id=?;\";\r\n\t\t//toujours en fait appelle a la methode PrepareStatement\r\n\t\t//pour pr�parer la requ�te sql et permettre de remplacer les '?' par \r\n\t\t//Les variables correspondantes\r\n\t\t\tPreparedStatement ps = conn.prepareStatement(sql);\r\n\t\t\t\tps.setString(1, utilisateur.getNom());\r\n\t\t\t\tps.setString(2, utilisateur.getPrenom());\r\n\t\t\t\tps.setInt(3, utilisateur.getID());\r\n\t\t\t// ex�cuter la requ�te \r\n\t\t\t\tps.executeUpdate();\r\n\t\t\t//g�rer les exceptions\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void onClick(View v) {\n\t\tswitch (v.getId()) {\n\t\tcase R.id.zhuce:\n\t\t\tString pass_et = et.getText().toString().trim();\n\t\t\tString pass_one=et_one.getText().toString().trim();\n\t\t\tString pass_two=et_two.getText().toString().trim();\n\t\t\tif(StringUtils.isEmpty(pass_et)||StringUtils.isEmpty(pass_one)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!(pass_et.equals(pass_one))){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetUserInformation(App.getContext().getLoginInfo().data.uid, pass_two, pass_one);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "public String validarUsuario(){\n String resultado = null;\r\n IUsuarioDAO usuarioDAO = new UsuarioDAOImp();\r\n Usuario usuario = usuarioDAO.validarUsuario(nombreUsuario, password);\r\n \r\n if(usuario!=null){\r\n \r\n FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Usuario válido\", \"Usuario válido\");\r\n FacesContext.getCurrentInstance().addMessage(null, facesMessage);\r\n \r\n FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(\"usuarioValidado\", usuario);\r\n \r\n if(usuario.getTipoUsuario().equals(\"admin\"))\r\n resultado = \"admin?faces-redirect=true\";\r\n else\r\n {\r\n if(usuario.getTipoUsuario().equals(\"final\"))\r\n resultado = \"final?faces-redirect=true\";\r\n else\r\n {\r\n if(usuario.getTipoUsuario().equals(\"supervisor\"))\r\n resultado= \"menu\";\r\n else\r\n resultado = \"login\";\r\n \r\n }\r\n \r\n }\r\n \r\n \r\n }else{\r\n FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, \"Credenciales Inválidas\", \"Credenciales Inválidas\");\r\n FacesContext.getCurrentInstance().addMessage(null, facesMessage);\r\n }\r\n return resultado;\r\n }", "final String loginAsAutoUser() {\r\n \treturn loginAsAutoUser(false);\r\n }", "public void damePersonaje(String personaje){\n this.personaje=personaje;\n\n\n\n }", "public String verUsuarios() {\n\t\tString stringIdRol = session.getAttribute(\"rol\").toString();\n\t\tInteger idRol = Integer.parseInt(stringIdRol);\n\n\t\tif (idRol == 1) {\n\t\t\treturn \"TodosLosUsuarios\";\n\t\t}\n\n\t\treturn \"home\";\n\t}", "private boolean isLoginUnique(int currentUserId){\n\t\tUser user = Main.getMMUser().getUserForLogin(userLoginField.getText());\n\t\tif (user == null) return true;\n\t\telse {\n\t\t\tif (user.getId() == currentUserId) return true;\n\t\t}\t\n\t\tlackUserLoginLabel.setText(\"taki login istnieje w bazie\");\n\t\tlackUserLoginLabel.setVisible(true);\n\t\treturn false;\n\t}", "private void loguearUsuario() {\n\n final FirebaseAuth auth = FirebaseAuth.getInstance();\n FirebaseUser user = auth.getCurrentUser();\n // consigue el usuario\n final String email = editTextEmail.getText().toString().trim();\n String password = editTextPassword.getText().toString().trim();\n\n\n if (TextUtils.isEmpty(email)) {\n Toast.makeText(this, \"Se debe ingresar un email\", Toast.LENGTH_LONG).show();\n return;\n }\n if (TextUtils.isEmpty(password)) {\n Toast.makeText(this, \"Falta ingresar la contraseña\", Toast.LENGTH_LONG).show();\n return;\n }\n\n progressDialog.setMessage(\"Realizando consulta en linea...\");\n progressDialog.show();\n\n firebaseAuth.signInWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n // la misma funcion que en el caso anterior pero para poder ingresar\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) { //el oncomplete es para tener la comprobacion sea del campo del login o el singup\n\n if (task.isSuccessful()) {\n // si el usuario se encontraba creado entonces la tarea es exitosa\n\n int pos = email.indexOf(\"@\");\n userstring = email.substring(0, pos); //consigue el nombre del usuario\n Toast.makeText(Login.this, \"Bienvenido: \" + editTextEmail.getText(), Toast.LENGTH_LONG).show(); // consigue el email que habia sido asignado a la variable TextEmail\n Intent intencion = new Intent(getApplication(), UserView.class); // nueva actividad\n intencion.putExtra(\"user\", email); // le pasa como dato al usuario ingresado a la proxima actividad\n startActivity(intencion); //hay que hacer el get del usuario en la parte principal\n // userapasar = user;\n loged = true;\n\n } else {\n loged = false;\n\n if (task.getException() instanceof FirebaseAuthUserCollisionException) {//si se presenta una colisiÛn\n\n Toast.makeText(Login.this, \"Procesando\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(Login.this, \"\", Toast.LENGTH_LONG).show();\n }\n }\n progressDialog.dismiss();\n }\n });\n }", "public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n \r\n }", "private void logIn() {\n char[] password = jPasswordField1.getPassword();\n String userCode = jTextField1.getText();\n\n String txtpassword = \"\";\n for (char pw : password) {\n txtpassword += pw;\n }\n if (\"\".equals(txtpassword)) {\n JOptionPane.showMessageDialog(this, textBundle.getTextBundle().getString(\"enterPassword\"), \"No Password\", JOptionPane.WARNING_MESSAGE);\n } else if (txtpassword.equals(userData.get(0).toString())) {\n jPasswordField2.setEnabled(true);\n jPasswordField3.setEnabled(true);\n jPasswordField2.setEditable(true);\n jPasswordField3.setEditable(true);\n jPasswordField2.grabFocus();\n }\n }", "String getUser();", "String getUser();", "public abstract Setusuario buscarUsuario(String nomUsuario);", "public boolean checkUsername(String user) {\n\n }", "public abstract String getUser();", "@Override\n\tpublic Boolean vota(String listaElettorale) {\n\t\t//definisco utente registato in questo momento\n\t\tString userVotante = autenticazioneServizio.getUsername();\n\t\tVoto voto = new Voto(userVotante, listaElettorale);\n\t\taggiungiVoto(voto);\n\t\t//controlla se l'user ha già votato\n\t\taggiungiVoto(voto);\n\t\treturn true;\n//\t\tif (verificaVotoValido(userVotante)) {\n//\t\t\t//vota\n//\t\t\taggiungiVoto(voto);\n//\t\t\t\n//\t\t\treturn true;\n//\t\t} else {\n//\t\t\treturn false;\n//\t\t}\n\t}", "public int getIdUser(String nom) {\n SQLiteDatabase db = this.getReadableDatabase(); // On veut lire dans la BD\n int id = -1;\n String selectQuery = \"SELECT * FROM \" + TABLE_USER;\n Log.e(DB_NAME, selectQuery);\n Cursor cursor = db.rawQuery(selectQuery, null);\n if (cursor != null && cursor.getCount()>0) {\n cursor.moveToFirst();\n do {\n if (cursor.getString(1).equals(nom) && cursor.getString(1)!= null) {\n id = cursor.getInt(0);\n }\n } while (cursor.moveToNext());\n }\n db.close(); // Fermer la connexion\n return id;\n }", "@Override\n\tpublic void input() {\n\t\tUser u =new User();\n\t\tif(list.size() <= MAX_USER) {\n\t\tSystem.out.print(\"이름 입력 : \");\n\t\tu.setName(sc.next());\n\t\tSystem.out.print(\"나이 입력 : \");\n\t\tu.setAge(sc.nextInt());\n\t\tSystem.out.print(\"주소 입력 : \");\n\t\tu.setAddr(sc.next());\n\t\tlist.add(u);\n\t\t\n\t\t}else if(list.size() > MAX_USER) {\n\t\t\tSystem.out.println(\"최대 등록 인원은 10명입니다.\");\n\t\t}\n\t}", "public void choicePersonage() {\n\t\tSystem.out.println(\"souhaitez-vous créer un guerrier ou un magicien ?\");\n\t\tchoice = sc.nextLine().toLowerCase();\t\t\t\n\t\tSystem.out.println(\"Vous avez saisi : \" + choice);\n\t\tif(!(choice.equals(MAGICIEN) || choice.equals(GUERRIER))) {\n\t\t\tchoicePersonage();\n\t\t}\n\t\tsaisieInfoPersonage(choice);\n\t}", "public boolean existUser(String campo1, String campo2);", "public void setUser_name(String user_name);", "@Override\n\tpublic boolean editUtente(String username) {\n\t\tUtente user = (Utente)getUtente(username);\n\t\tif(userExists(user)) {\n\t\t\tuser.setGiudice(true);\n\t\t\tDB db = getDB();\n\t\t\tMap<Long, UtenteBase> users = db.getTreeMap(\"users\");\n\t\t\tlong hash = (long) user.getUsername().hashCode();\n\t\t\tusers.put(hash, user);\n\t\t\tdb.commit();\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\n\t}", "public void logins(){\n \n \n \n String username=txtUser.getText();\n String password=txtPass.getText();\n String sql;\n\n \n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n conn = (Connection) DriverManager.getConnection(\"jdbc:mysql://\"+host+\"/\"+db+\"?user=\"+user+\"&password=\"+pass);\n sql =\"Select * from user WHERE username ='\" +txtUser.getText() + \"'\";\n PreparedStatement st = (PreparedStatement) conn.prepareStatement(sql);\n ResultSet rs =st.executeQuery(); \n if(rs.next()) {\n String pasas = rs.getString(\"password\");\n if(password.equals(pasas)){\n JOptionPane.showMessageDialog(this, \"Login Berhasil\");\n \n Home tampil=new Home();\n tampil.setVisible(true);\n dispose();\n \n }else{\n JOptionPane.showMessageDialog(this, \"Username tidak terdaftar\");\n txtUser.requestFocus();\n }\n }else{\n JOptionPane.showMessageDialog(this, \"Username tidak terdaftar\");\n txtUser.requestFocus();\n }\n }catch (Exception e) {\n JOptionPane.showMessageDialog(this,e.getMessage());\n }\n \n }", "public boolean askForUsername()\r\n\t{\r\n\t\tboolean nameEntered = true;\r\n\r\n\t\tTextInputDialog dialog = new TextInputDialog();\r\n\t\tdialog.setTitle(\"Nom d'utilisateur\");\r\n\t\tdialog.setHeaderText(null);\r\n\t\tdialog.setContentText(\"Entrer un nom d'utilisateur:\");\r\n\t\tOptional<String> result = dialog.showAndWait();\r\n\t\tif (result.isPresent())\r\n\t\t{\r\n\t\t\ttextFieldNomUtilisateur.setText(result.get());\r\n\t\t} else\r\n\t\t{\r\n\t\t\tnameEntered = false;\r\n\t\t}\r\n\r\n\t\treturn nameEntered;\r\n\t}", "public java.lang.String getUser(){\r\n return localUser;\r\n }", "public java.lang.String getUser(){\r\n return localUser;\r\n }", "public java.lang.String getUser(){\r\n return localUser;\r\n }", "private void checkUser() {\n\t\tloginUser = mySessionInfo.getCurrentUser();\n\t}", "@Then(\"^o usuario sera direcionado para tela de login$\")\n\tpublic void verificaSeTelaLogin() throws Throwable {\n\t\tAssert.assertTrue(menu.verificaTextoNaTela(\"ACESSAR\"));\n\t\t\n\t\t// finaliza gravação\n\t\tgravaTest.finishRecorder();\n\t\t\n\t\t// fecha driver\n\t\tgetDriver().quit();\n\n\t}", "public void verificarRol() throws IOException {\n\t\tif (FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(\"email\") != null) {\n\t\t\tObject rol = FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(\"rol\");\n\n\t\t\tif ((Integer) rol != 1) {\n\t\t\t\tFacesContext.getCurrentInstance().getExternalContext().redirect(\"home.xhtml\");\n\t\t\t} else {\n\t\t\t\t// System.out.println(\"sin permisos\");\n\t\t\t}\n\t\t}\n\t}", "private int userAlreadyPresent() {\n System.out.printf(\"%s%n%s%n%s%n%s%n\", Notifications.getMessage(\"ERR_USER_ALREADY_PRESENT\"), Notifications.getMessage(\"SEPARATOR\"), Notifications.getMessage(\"PROMPT_PRESENT_USER_MULTIPLE_CHOICE\"), Notifications.getMessage(\"SEPARATOR\"));\n\n switch(insertInteger(1, 3)) {\n case 1:\n System.out.printf(\"%s %s%n\", Notifications.getMessage(\"MSG_EXIT_WITHOUT_SAVING\"), Notifications.getMessage(\"MSG_MOVE_TO_LOGIN\"));\n return -1;\n case 2:\n System.out.println(Notifications.getMessage(\"PROMPT_MODIFY_FIELDS\"));\n return 1;\n default:\n return 0;\n }\n }", "@Override\r\n\tpublic boolean createUser(Utilisateur u) {\n\t\treturn false;\r\n\t}", "private void actualitzaPasswd(String nou){\n user.setPasswd(nou);\n try{\n helperU.actualitzar(user, false);\n \n info(\"Contrasenya actualitzada!\");\n }catch(Exception ex){\n avis(\"Error al actualitzar la contrasenya!\");\n }\n }", "private UserPrefernce(){\r\n\t\t\r\n\t}", "public void setUsuarioInsercion(String p) { this.usuarioInsercion = p; }" ]
[ "0.65321577", "0.6416484", "0.6382367", "0.6261694", "0.6257801", "0.61809057", "0.6063848", "0.6042494", "0.6007278", "0.6005662", "0.6003697", "0.59868973", "0.5976392", "0.5970561", "0.59679383", "0.59260356", "0.5899063", "0.5861863", "0.5851763", "0.5835986", "0.58323216", "0.58305895", "0.58134675", "0.5812626", "0.5811363", "0.5806592", "0.5797269", "0.5786345", "0.5780178", "0.57657504", "0.57642186", "0.57591087", "0.57530385", "0.5746242", "0.57309955", "0.57295364", "0.57281715", "0.57235366", "0.5711262", "0.5706131", "0.5696059", "0.5690395", "0.56814986", "0.568056", "0.56804574", "0.5651202", "0.5649357", "0.56487155", "0.56329334", "0.5631302", "0.5621967", "0.56212205", "0.56088054", "0.55959916", "0.5580894", "0.5579885", "0.5570038", "0.55662", "0.5561986", "0.55610824", "0.55563116", "0.55556715", "0.5554706", "0.5551664", "0.55501306", "0.55439895", "0.5542695", "0.55425334", "0.55284864", "0.5522286", "0.55210495", "0.5520537", "0.5507425", "0.5505374", "0.5496957", "0.54935306", "0.54869646", "0.54869646", "0.5486519", "0.5481213", "0.54807717", "0.5480389", "0.54773206", "0.5476243", "0.54705435", "0.5465597", "0.546255", "0.5457735", "0.54571795", "0.54571074", "0.5453257", "0.5453257", "0.5453257", "0.5451592", "0.54514533", "0.5449633", "0.544482", "0.5438778", "0.54387116", "0.5438317", "0.54316473" ]
0.0
-1
end of run() NITE events
private void setSessionEvents(SessionManager sessionMan) // create session callback... { try { // session end sessionMan.getSessionEndEvent().addObserver( new IObserver<NullEventArgs>() { public void update(IObservable<NullEventArgs> observable, NullEventArgs args) { isRunning = false; } }); } catch (StatusException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void onEnd() {}", "protected abstract void trace_end_run();", "protected void end() {\n \t// theres nothing to end\n }", "protected void end() {\n \n \n }", "protected void end()\n\t{\n\t}", "protected void end() {\r\n }", "protected void end() {\r\n }", "protected void end() {\r\n }", "protected void end() {\r\n }", "protected void end() {\n\t}", "protected void end() {\n\t}", "protected void end() {\n\t}", "protected void end() {\n\t}", "protected void end() {\n\t}", "protected void end() {\n\t}", "protected void end() {\n\r\n\t}", "public void end() {\n\t\tsigue = false;\n\t}", "protected abstract void trace_end_loop();", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n }", "protected void end() {\n isFinished();\n }", "@Override\n public void end() {\n }", "@Override\n\t\tpublic void end() {\n\t\t\t\n\t\t}", "public abstract void end();", "public void end() {\n\n }", "@Override\n\tpublic void end() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void end() {\n\t\t\t\t\n\t\t\t}", "private void exit() {\n audrey.setExtractingSample(false);\n // If we just extracted argument samples, let the following event know that we're done with\n // arguments.\n instrumentationContext.setLookingForFirstStatement(false);\n }", "@Override\r\n\tprotected void end() {\r\n\t}", "@Override\r\n\t\t\tpublic void recognizerExit() {\n\r\n\t\t\t}", "protected void end()\n\t{\n\t\tstop();\n\t}", "@Override\n protected void end() {\n\n }", "@Override\n\tpublic void end() {\n\n\t}", "@Override\n\tpublic void end() {\n\n\t}", "@Override\r\n protected void end() {\r\n\r\n }", "@Override\n public void exit(EventObject event)\n {\n shutdown();\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tisExit=false;\n\t\t\t\t}", "void endTask();", "@Override\n public void run() {\n exit_int=0;\n }", "public void end();", "@Override\n\tprotected void onTermination() throws SimControlException {\n\t\t\n\t}", "@Override\r\n\tprotected void end() {\n\r\n\t}", "@Override\r\n\tprotected void end() {\n\r\n\t}", "protected abstract boolean end();", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autEndProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tprotected void end() {\n\t\t\n\t}", "protected void end() {\n \tRobotMap.feedMotor1.set(0);\n \tRobotMap.shootAgitator.set(0);\n }", "@Override\r\n\t\t\t\tpublic void autEndProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autEndProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "protected void endBatch() {\n \n }", "public void end() throws Exception;", "@Override\n\tprotected void end() {\n\t}", "@Override\n\tprotected void end() {\n\t}", "@Override\n\tprotected void end() {\n\t}", "@Override\n\tprotected void end() {\n\t}" ]
[ "0.69295365", "0.6870028", "0.68090487", "0.6759695", "0.67460966", "0.6745858", "0.6745858", "0.6745858", "0.6745858", "0.67318785", "0.67318785", "0.67318785", "0.67318785", "0.67318785", "0.67318785", "0.67278874", "0.6700703", "0.6684921", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6667145", "0.6646667", "0.6609466", "0.6581952", "0.6581776", "0.65777516", "0.6559824", "0.6550723", "0.6541327", "0.65373355", "0.6534697", "0.65278625", "0.6521508", "0.6516023", "0.6516023", "0.65072733", "0.6504277", "0.64853865", "0.6482853", "0.6482853", "0.6482853", "0.6482853", "0.6482853", "0.6482853", "0.6482853", "0.6482853", "0.6482853", "0.6482853", "0.6482853", "0.6482853", "0.6472032", "0.6466047", "0.6463588", "0.646355", "0.6461569", "0.64612573", "0.64612573", "0.64407235", "0.6439973", "0.6439973", "0.6439973", "0.6439973", "0.6439973", "0.64255625", "0.64225006", "0.64177036", "0.64177036", "0.64106464", "0.6410523", "0.63934076", "0.63934076", "0.63934076", "0.63934076" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Employee emp1 = new Employee(); Employee emp2 = new Employee(); emp1.empName = "Rob"; emp1.empid = 200; emp1.empsalary = 12345; emp1.displayEmployeebonus(); emp2.empName = "Rob"; emp2.empid = 300; emp2.empsalary = 98765; emp2.displayEmployeebonus(); }
{ "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
varifies whether an assignment is valid.
private void checkAssignment(Assignment node) { String nodeName = node.name.name; boolean error = false; // check whether assignment would cause a loop if (node.value instanceof ConstantReference) { ConstantReference reference = ((ConstantReference) node.value); if (reference.name.equals(nodeName)) { node.setError("You can't assign a constant to itself."); error = true; } else { isCircularReference(reference); } } // if assignment is an operation, check the operation if (node.value instanceof Operation) { checkOperation((Operation) node.value); } // if no error has been found add it to symboltable. if (!error) { symboltable.put(nodeName, node.value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isAssignment() {\n\t\treturn true;\n\t}", "public boolean isPureAssignment() {\n return (commandElement() == null) && hasAssignments();\n }", "public static boolean assignment(FileInputStream f) {\n if(observer != null){\n observer.parser.setCurrentRule(\"assignment\", true);\n }\n \n CToken t = new CToken();\n t = getUsePeek(f);\n\n if (!t.token.equals(\"let\")) {\n return false;\n }\n CScanner.needToUsePeekedToken = false;\n\n if (!descriptor(f)) {\n System.err.format(\"Syntax Error: In rule Assignment unexpected token \\\"%s\\\" of type %s on line %d.\\n\", t.token, t.type, t.lineNum);\n System.exit(0); \n }\n if(observer != null){\n observer.parser.setCurrentRule(\"assignment\", true);\n }\n t = getUsePeek(f);\n\n if (!t.token.equals(\"=\")) {\n System.err.format(\"Syntax Error: In rule Assignment unexpected token \\\"%s\\\" of type %s on line %d.\\n\", t.token, t.type, t.lineNum);\n System.exit(0); \n }\n\n CScanner.needToUsePeekedToken = false;\n \n if (!expression(f)) {\n System.err.format(\"Syntax Error: In rule Assignment unexpected token \\\"%s\\\" of type %s on line %d.\\n\", t.token, t.type, t.lineNum);\n System.exit(0); \n }\n if(observer != null){\n observer.parser.setCurrentRule(\"assignment\", true);\n }\n if (CScanner.needToUsePeekedToken) {\n t = CScanner.peekedToken;\n } //we peeked before this call, so use it\n else {\n t = CScanner.getNextToken(f);\n if(observer != null){\n observer.parser.setCurrentToken(t);\n }\n } //get token\n\n if (!t.token.equals(\";\")) {\n System.err.format(\"Syntax Error: In rule Assignment unexpected token \\\"%s\\\" of type %s on line %d.\\n\", t.token, t.type, t.lineNum);\n System.exit(0); \n }\n if(observer != null){\n observer.parser.setCurrentRule(\"assignment\", false);\n }\n return true;\n }", "public boolean isAssigned() {\n boolean assigned;\n IDecisionVariable var = getVariable();\n if (null != var) {\n assigned = AssignmentState.UNDEFINED != var.getState();\n } else {\n assigned = false;\n }\n return assigned;\n }", "public boolean isValid() {\n // TODO: Question 2.2.\n \n return false;\n }", "public boolean isValid()\n\t{\n\t\treturn false;\n\t}", "protected boolean checkAssignable(ErrorList errlist)\n throws CompilerException\n {\n return true;\n }", "public boolean isValid(){\r\n\t\t\r\n\t\t// TODO\r\n\t\t\r\n\t\treturn true;\r\n\t}", "private boolean checkAssignments() {\n ArrayList headerNames = new ArrayList();\n boolean assigned = false;\n \n for(int i = 0; i < this.dataTable.getColumnCount(); i++) {\n Object columnName = this.dataTable.getColumnModel().getColumn(i).getHeaderValue();\n \n if(!columnName.toString().equals(\"Unassigned\")) {\n if(!headerNames.contains(columnName)) {\n headerNames.add(columnName);\n assigned = true;\n } else {\n JOptionPane.showMessageDialog(this, columnName.toString() + \" has been assigned more than once!\", \"Duplicate Assignment!\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n }\n }\n \n if(!assigned) {\n JOptionPane.showMessageDialog(this, \"You must assign at least one column!\", \"Nothing assigned!\", JOptionPane.ERROR_MESSAGE);\n return false;\n }\n \n return true;\n }", "public boolean IsAssignable(AST lhs)\n {\n return (lhs instanceof IdExpr ||\n lhs instanceof VarDcl ||\n lhs instanceof ListIndexExpr ||\n lhs instanceof StructCompSelectExpr);\n }", "public boolean isValid();", "public boolean isValid();", "public boolean isValid();", "public boolean isValid();", "public boolean isValid();", "public boolean isValid() {\n\t\treturn false;\n\t}", "public boolean isValid() {\n \t\treturn valid;\n \t}", "public boolean isLegalAssignment(int i, int j, int val) {\n\t\t// return true iff val is not assigned already to one of the units of (i,j)\n\t\treturn (!constraints[i][0].get(val) && !constraints[0][j].get(val)\n\t\t\t\t&& !constraints[N + 1][getBlockIndex(i, j)].get(val));\n\t}", "public boolean isValid(){\n\t\treturn true;\n\t}", "protected boolean isValid() {\n \t\treturn valid;\n \t}", "private boolean assignmentIsValid( String potentialMicrotaskKey, String workerID)\n\t{\n\t\t// retrieve the excluded workers\n\t\tHashSet<String> excludedWorkersForMicrotask = excludedWorkers.get( potentialMicrotaskKey );\n\n\t\t// if the excluded workers is empty and\n\t\t// contains the workerId\n\t\tif ( excludedWorkersForMicrotask != null && excludedWorkersForMicrotask.contains(workerID))\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public boolean isValid() {\n return true;\n }", "public boolean isValid() {\n return true;\n }", "boolean isValid();", "boolean isValid();", "boolean isValid();", "boolean isValid();", "boolean isValid();", "public boolean isValid() {\n return true;\n }", "public boolean isValid() {\n\t\treturn valid;\n\t}", "public boolean isValid() {\n\t\treturn(m_valid);\n\t}", "protected abstract boolean isValid();", "public boolean isValid(){\n\t\treturn valid;\n\t}", "public boolean isValid() {\n return (this.S>=0 && this.I>=0 && this.R>=0);\n }", "public boolean isDirectAssignment() {\r\n return GrouperUtil.booleanValue(this.directAssignmentString, false);\r\n }", "protected boolean isValid()\r\n {\r\n \treturn true;\r\n }", "boolean checkValidity();", "public boolean isValid() {\n //primary variables must have proper values to identify the Book with\n if (this.author == null || this.title == null || dop == 0) {\n return false;\n }\n return true;\n }", "boolean judgeValid()\r\n\t{\r\n\t\tif(loc.i>=0 && loc.i<80 && loc.j>=0 && loc.j<80 && des.i>=0 && des.i<80 && des.j>=0 && des.j<80)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t\t\r\n\t}", "public boolean isComplete(Variable[][] assignment) {\n\t\tfor (int row = 0; row < Sudoku.ROWS; row++) {\n\t\t\tfor (int col = 0; col < Sudoku.COLUMNS; col++) {\n\t\t\t\tif ((assignment[row][col].value == 0 && grid[row][col].value == 0))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean isValid()\n {\n return valid;\n }", "private boolean isInputValid() {\n return true;\n }", "protected abstract boolean isInputValid();", "public abstract boolean isValid();", "public abstract boolean isValid();", "public abstract boolean isValid();", "@Override\r\n\tpublic boolean isValid() {\n\t\treturn false;\r\n\t}", "Boolean getIsValid();", "public boolean valid() {\n return valid;\n }", "public boolean validRule( Rule r ){\n\t\tif( !super.validRule(r) ){\n\t\t\t// rule has failed restrictions of parent grammars\n\t\t\treturn false;\n\t\t}\n\t\t// 3. rhs is null\n\t\tif( r.rhs == null ) {\n\t\t\treturn true;\n\t\t}\n\t\t// 2. rhs is a terminal followed by a variable\n\t\telse if( r.rhs.size() == 2 && Grammar.isTerminal(r.rhs.get(0)) && \n\t\t\t\t\t\t\t\t \t Grammar.isVariable(r.rhs.get(1))) {\n\t\t\treturn true;\n\t\t}\n\t\t// 1. rhs is a single terminal\n\t\telse if( r.rhs.size() == 1 && Grammar.isTerminal(r.rhs.get(0))) {\n\t\t\treturn true;\n\t\t}\n\t\t// rule is not one of the 3 valid forms\n\t\treturn false;\n\t }", "public boolean isValid() {\n return !(mSourceMap.isEmpty() || mDestMap.isEmpty());\n }", "public boolean isValid() {\r\n\t\treturn isValid;\r\n\t}", "public boolean isValidRecord () {\n int sumError = latitudeError +\n longitudeError +\n depthError +\n temperatureMinError +\n temperatureMaxError +\n salinityMinError +\n salinityMaxError +\n oxygenMinError +\n oxygenMaxError +\n nitrateMinError +\n nitrateMaxError +\n phosphateMinError +\n phosphateMaxError +\n silicateMinError +\n silicateMaxError +\n chlorophyllMinError +\n chlorophyllMaxError;\n return (sumError == 0 ? true : false);\n }", "@Override\n\tpublic boolean isValid() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isValid() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isValid() {\n\t\treturn false;\n\t}", "public Assignment isValid(GameMap gameMap) {\n\t\t\tif( ship == null ) return null;\n\t\t\t\n\t\t\tif( enemy.getDockingStatus() != DockingStatus.Undocked) {\t\t\t\t\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\t\t\t\n\t\t\treturn this;\n\t\t}", "public boolean isValid()\n {\n return valid;\n }", "@Override\n\t\tpublic boolean isValid() {\n\t\t\treturn false;\n\t\t}", "public boolean isValid() {\n return valid;\n }", "public boolean isValid() {\n return valid;\n }", "public boolean isValid() {\n return valid;\n }", "public boolean isFlowValid()\n\t{\n\t\t// TODO will need to implement this...\n\t\treturn true;\n\t}", "public boolean isValid() {\r\n/* */ try {\r\n/* 326 */ validate();\r\n/* 327 */ } catch (ValidationException vex) {\r\n/* 328 */ return false;\r\n/* */ } \r\n/* 330 */ return true;\r\n/* */ }", "private void checkModelAssignmentsValid(\n BooleanFormula constraint, List<BooleanFormula> pModelAssignments)\n throws SolverException, InterruptedException {\n // This can't work in Boolector with ufs as it always crashes with:\n // [btorslvfun] add_function_inequality_constraints: equality over non-array lambdas not\n // supported yet\n // TODO: only filter out UF formulas here, not all\n if (solver != Solvers.BOOLECTOR) {\n // CVC5 crashes here\n assertThatFormula(bmgr.and(pModelAssignments)).implies(constraint);\n }\n }", "private boolean isValid() {\n\t\treturn proposalTable != null && !proposalTable.isDisposed();\n\t}", "private boolean assertIdAndVarName() {\r\n\t\tfinal boolean isValidId = assertNotEmpty(cmpCfg.getId(),\r\n\t\t\t\tYValidationAspekt.VIEW_ID_NOT_SPECIFIED);\r\n\r\n\t\tfinal boolean isValidVar = assertNotEmpty(cmpCfg.getVariableName(),\r\n\t\t\t\tYValidationAspekt.VIEW_VAR_NOT_SPECIFIED);\r\n\r\n\t\tfinal boolean isValid = isValidId && isValidVar;\r\n\t\treturn isValid;\r\n\r\n\t}", "public boolean isValid() {\n\t\tif (E.a6.isZero())\n\t\t\treturn false;\n\t\tif (G.isZero())\n\t\t\treturn false;\n\t\tif ((G.y.mul(G.y).add(G.x.mul(G.y)))\n\t\t\t.compareTo(\n\t\t\t\t(G.x.mul(G.x).mul(G.x).add(E.a4.mul(G.x).mul(G.x).add(E.a6))))\n\t\t\t!= 0)\n\t\t\treturn false;\n\t\tif (!E.mul(r, G).isZero())\n\t\t\treturn false;\n\t\tif (!MOV_Condition(m, r))\n\t\t\treturn false;\n\t\treturn true;\n\t}", "public boolean isValidConfiguration(Assignment assignment) throws OperationNotSupportedException, FMReasoningException {\n\t\tthrow new OperationNotSupportedException(\"Reasoning Operation Not Supported\");\n\t}", "public boolean isValid() {\n\t\tString status = getField(Types.STATUS);\n\t\tif(status == null) return false;\n\t\treturn StringUtil.equalsIgnoreCase(status,\"A\") && !loc.isNull();\n\t}", "public Boolean valid() {\n\t\treturn this.getMeasuredBy()!=null && this.getMeasuredBy().valid();\n\t}", "boolean getValid();", "@Override\n public Boolean visitVariableAttribution(FormScriptGrammarParser.VariableAttributionContext ctx) {\n if (!declaredVariables.containsKey(ctx.VARIABLE().getText())) {\n // this is validated in UI/controlled by flow in the UI so should never happen, but it remains here just in case\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \": variable \" + ctx.VARIABLE().getText() + \" wasn't declared!\");\n// return false; //if we wanted to return the NOTOK/false result recursively, this would be here instead of the throw\n }\n DataType dataType = declaredVariables.get(ctx.VARIABLE().getText());\n boolean correctType = dataType.lexerValue().equals(ctx.value().start.getType());\n /*will verify if the attribution is actually semantically valid, e.g if\n the variable was defined as an INTEGER, it can't be assigned a DATE*/\n if (!correctType) {\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \":\" + ctx.getStart().getCharPositionInLine()\n + \": Invalid attribution type!\" + \" variable \" + ctx.VARIABLE().getText() + \" can't be assigned the value \" + ctx.value().getText());\n// return false; //if we wanted to return the NOTOK/false result recursively, this would be here instead of the throw\n }\n //verify if operators are valid in the context of the datatype\n String operator = ctx.COMPARISON_OPERATORS().getText();\n if (operator.equals(\"<\") || operator.equals(\">\")) {\n if (dataType.equals(DataType.BOOLEAN) || dataType.equals(DataType.DATE) || dataType.equals(DataType.FILE)) {\n throw new IllegalArgumentException(\"Semantic error at line: \" + ctx.getStart().getLine() + \":\" + ctx.getStart().getCharPositionInLine()\n + \": Invalid comparison type!\" + \" variable \" + ctx.VARIABLE().getText() + \" can't be compared with operator '\" + operator + \"'\");\n }\n }\n return true;\n }", "boolean check (Env env) {\n if (Env.find (env, varName) != null)\n return expr.check (env);\n else {\n System.err.println (\"Semantic error: Variable \\\"\" \n + varName + \"\\\" set but not declared\");\n expr.check (env);\n return false;\n }\n }", "private boolean isValidInput() {\n\t\treturn true;\n\t}", "public boolean wasValid() {\n return !wasInvalid();\n }", "public boolean isValid() {\n return valid;\n }", "boolean valid() {\n return true;\n }", "boolean valid() {\n return true;\n }", "boolean valid() {\n return true;\n }", "public boolean valid() {\n\t\treturn _analyzer.valid();\n\t}", "public boolean isValid()\n {\n synchronized (lock)\n {\n return valid;\n }\n }", "public Boolean isValid() {\n if (modApptTitle.getText().isEmpty() || modApptTitle.getText() == null) {\n return false;\n } else if (modApptDescript.getText().isEmpty() || modApptDescript.getText() == null) {\n return false;\n } else if (modApptLocale.getText().isEmpty() || modApptLocale.getText() == null) {\n return false;\n }\n return true;\n }", "public boolean isValid() {\n \t\treturn fValid;\n \t}", "public boolean isConsistent(Variable var, Variable[][] assignment) {\n\t\tfor (Constraint constraint : var.constraints) {\n\t\t\tif ( assignment[constraint.row][constraint.col].value == var.value\n\t\t\t\t\t|| grid[constraint.row][constraint.col].value == var.value) { \n\t\t\t\treturn false; \n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean valid() {\n boolean valid = true;\n\n if (!isAgencyLogoPathValid()) {\n valid = false;\n }\n if (!isMemFieldValid()) {\n valid = false;\n }\n if (!isLogNumFieldValid()) {\n valid = false;\n }\n\n return valid;\n }", "void checkValid();", "public boolean isValid()\r\n {\r\n \treturn this.vp.data != null;\r\n }", "public boolean isUnassigned() {\n return !assigned;\n }", "public boolean isValid() {\n return _id != null && !_id.isEmpty() &&\n _name != null && !_name.isEmpty() &&\n _created != null && !_created.isEmpty();\n }", "private boolean isValid() {\n // If start is greater or equal to end then it's invalid\n return !(start.compareTo(end) >= 0);\n }", "public boolean isCValueValid();", "public boolean isValid() {\n return isValid;\n }", "public boolean isValid() {\n return isValid;\n }", "private static void checkValidity(boolean valid) throws InvalidExpression\r\n {\r\n if(!valid)\r\n {\r\n throw new InvalidExpression(\"The expression entered is not valid\");\r\n }\r\n }", "public boolean Check() {\r\n if (this.ValidExpression != 0)\r\n System.out.println(\"Well the string is wrong or missing, master!\");\r\n else \r\n System.out.println(\"Nice String Bro!\"); \r\n return (this.ValidExpression != 0);\r\n }", "public boolean isDataValid() {\r\n return validData;\r\n }", "public boolean isInvalid() {\n\t\treturn invalid;\n\t}", "public boolean isValid() {\n\t\tif (isPlayer1() && currentPit < 7 && currentPit != 6) {\n\t\t\tif (board[currentPit] == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true; // check appropriate side of board, excluding scoring\n\t\t}\n\t\t// pit\n\t\telse if (!isPlayer1() && currentPit >= 7 && currentPit != 13) {\n\t\t\tif (board[currentPit] == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean isValid() throws InvalidStateException{\n if (this.homeTeam == null || this.visitingTeam == null){\n return false;\n }else{\n return true;\n }\n }" ]
[ "0.68622935", "0.6480059", "0.62896264", "0.62288094", "0.6208413", "0.6191428", "0.61874187", "0.61303174", "0.6114139", "0.6063006", "0.6023723", "0.6023723", "0.6023723", "0.6023723", "0.6023723", "0.6020997", "0.60202324", "0.60135245", "0.6002455", "0.60018337", "0.59984875", "0.5983745", "0.5983745", "0.5946326", "0.5946326", "0.5946326", "0.5946326", "0.5946326", "0.5945431", "0.59370387", "0.5908339", "0.5883645", "0.5875253", "0.5874368", "0.5864871", "0.58318865", "0.58267576", "0.58083296", "0.5802036", "0.5799803", "0.5790253", "0.57887846", "0.578783", "0.57864654", "0.57864654", "0.57864654", "0.5779953", "0.5778832", "0.5766446", "0.576623", "0.5754877", "0.5751139", "0.5750261", "0.57447106", "0.57447106", "0.57447106", "0.57438594", "0.57197547", "0.5696885", "0.56935275", "0.56935275", "0.56935275", "0.569093", "0.5675712", "0.56681883", "0.56538403", "0.56431544", "0.5641369", "0.5640703", "0.5635171", "0.56301224", "0.5624064", "0.56231195", "0.5617299", "0.56052077", "0.5602615", "0.56012726", "0.5580775", "0.5580775", "0.5580775", "0.55804104", "0.55766505", "0.5557086", "0.55511254", "0.5541753", "0.5531124", "0.5530452", "0.55246377", "0.5505529", "0.55023193", "0.54964596", "0.54959565", "0.54943293", "0.54943293", "0.54929215", "0.54857343", "0.5481453", "0.5479644", "0.5475455", "0.5472382" ]
0.5957654
23
checks whether reference is a circular reference
private boolean isCircularReference(ConstantReference node) { ArrayList<String> trail = new ArrayList<>(); trail.add(node.name); String previousName = node.name; boolean running = true; boolean isCircular = false; while ((symboltable.get(previousName) instanceof ConstantReference) && running) { ConstantReference newReference = (ConstantReference) symboltable.get(previousName); if (!trail.contains(newReference.name)) { trail.add(newReference.name); previousName = newReference.name; } else { node.setError("Circular reference detected."); running = false; isCircular = true; } } return isCircular; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isCircular();", "public boolean isCircular() {\n\t\treturn false;\n\n\t}", "boolean hasReference();", "boolean hasRef();", "public final boolean isReference() {\n \treturn !isPrimitive();\n }", "public boolean isReference() {\n return isReference;\n }", "public boolean isReference() {\n AnnotatedBase comp = m_item.getSchemaComponent();\n return comp instanceof IReference && ((IReference)comp).getRef() != null;\n }", "private boolean isReference()\n {\n return countAttributes(REFERENCE_ATTRS) > 0;\n }", "public final boolean isReferencedAtMostOnce() {\n return this.getReferences(false, true).size() == 0 && this.getReferences(true, false).size() <= 1;\r\n }", "public boolean hasReferences() {\n\t\treturn this.refCounter > 0;\n\t}", "public boolean canBeReferencedByIDREF() {\n/* 171 */ return false;\n/* */ }", "boolean isCircular(String s);", "protected boolean isReferenced() {\r\n return mReferenced || mUsers.size() > 0;\r\n }", "boolean hasHadithReferenceNo();", "@Test\r\n\tpublic void testThatCircularReferencesAdmitIt () {\r\n\t\tSheet sheet = new Sheet();\r\n\t\tsheet.put(\"A1\", \"=A1\");\r\n\t\tassertEquals(\"Detect circularity\", \"#Circular\", sheet.get(\"A1\"));\r\n\t}", "private boolean isValidAndNewReference(String ref) {\n Set<String> allRefs = getAllReferenceNames();\n if (allRefs.contains(ref)) {\n if (!ref.equals(currentReference)) {\n return true;\n }\n } else if (allRefs.contains(\"chr\" + ref)) {\n // Looks like a number. Let's try slapping on \"chr\" and see if it works.\n return isValidAndNewReference(\"chr\" + ref);\n } else {\n if (TrackController.getInstance().getTracks().size() > 0) {\n DialogUtils.displayMessage(String.format(\"<html>Reference <i>%s</i> not found in loaded tracks.</html>\", ref));\n }\n }\n return false;\n }", "private void checkCircular(AlfClass alfClass) throws CircularParentException {\r\n\t\tList<AlfClass> parents = getParents();\r\n\t\tfor (AlfClass ac : parents) {\r\n\t\t\tif (ac.equals(alfClass))\r\n\t\t\t\tthrow new CircularParentException();\r\n\t\t\tac.checkCircular(alfClass);\r\n\t\t}\r\n\t}", "public boolean hasAtLeastOneReference(Project project);", "@Override\n public final boolean isReferenceType() {\n return true;\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 isReferenced(String item) {\n\t\tif (varReferences.contains(item)) return true;\n\t\telse return false;\n\t}", "@Override\n boolean areNestedRefsProhibited() {\n return true;\n }", "public boolean doesGoToReferenceExist(String id)\n {\n IDNode node = (IDNode)idReferences.get(id); \n return node.isThereInternalLinkGoTo();\n }", "public boolean satisfyingReferences() {\n\t\tfor (DependencyElement refEl : references) {\n\t\t\tif (!refEl.after(this)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean isSetRef();", "boolean isZeroReference() {\n return refCount == 0;\n }", "boolean isWeakRelationship();", "public boolean isInnerClassReference() {\n return isInnerClassReference;\n }", "public boolean isReferencesEventPhase() {\n return getFlow().isReferencesEventPhase();\n }", "private boolean serializeReference(final Object object, final StringBuffer buffer)\n {\n Iterator<?> iterator;\n int index;\n boolean isReference;\n\n // Don't allow references for simple types because here PHP and\n // Java are VERY different and the best way it to simply disallow\n // References for these types\n if (object instanceof Number || object instanceof Boolean ||\n object instanceof String)\n {\n return false;\n }\n\n iterator = this.history.iterator();\n index = 0;\n isReference = false;\n while (iterator.hasNext())\n {\n if (iterator.next() == object)\n {\n buffer.append(\"R:\");\n buffer.append(index + 1);\n buffer.append(';');\n isReference = true;\n break;\n }\n index++;\n }\n return isReference;\n }", "private boolean hasCycle() {\n\t\tNode n = head;\n\t\tSet<Node> nodeSeen = new HashSet<>();\n\t\twhile (nodeSeen != null) {\n\t\t\tif (nodeSeen.contains(n)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tnodeSeen.add(n);\n\t\t\t}\n\t\t\tn = n.next;\n\t\t}\n\t\treturn false;\n\t}", "private boolean check_only_call_relatives(Element element){\n\t\tArrayList<Element> relatives = new ArrayList<Element>();\n\t\tfor(Element elem_called : element.getRefFromThis()){\n\t\t\t//if they are brothers\n\t\t\tif(element.getParentName() != null && elem_called.getParentName() != null && element.getParentName().equals(elem_called.getParentName())){\n\t\t\t\trelatives.add(elem_called);\n\t\t\t}\n\t\t\t//if they are son - father\n\t\t\tif(element.getParentName() != null && element.getParentName().equals(elem_called.getIdentifier())){\n\t\t\t\trelatives.add(elem_called);\n\t\t\t}\t\t\t\n\t\t}\n\t\tif (relatives.size() == element.getRefFromThis().size()){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public boolean isReferenceTo(PsiElement element) {\n if (isLocalScope(element)) {\n return false;\n }\n\n if (resolve() == element) {\n return true;\n }\n final String referencedName = myElement.getReferencedName();\n if (element instanceof PyFunction && Comparing.equal(referencedName, ((PyFunction)element).getName()) &&\n ((PyFunction)element).getContainingClass() != null && !PyNames.INIT.equals(referencedName)) {\n final PyExpression qualifier = myElement.getQualifier();\n if (qualifier != null) {\n final TypeEvalContext context = TypeEvalContext.fast();\n PyType qualifierType = qualifier.getType(context);\n if (qualifierType == null || qualifierType instanceof PyTypeReference) {\n return true;\n }\n }\n }\n return false;\n }", "void checkCircular(List<String> myList);", "public boolean refCountDown() {\n\t\treferenceCounter--;\n\t\treturn (referenceCounter > 0) ? true : false;\n\t}", "private boolean checkPreviousRefs(String ref) {\n\t\t// Prevent stack overflow, when an unlock happens from inside here:\n\t\tList<String> checked = (List<String>) threadLocalManager.get(TwoFactorAuthenticationImpl.class.getName());\n\t\tif (checked == null) {\n\t\t\tchecked = new ArrayList<String>();\n\t\t\tthreadLocalManager.set(TwoFactorAuthenticationImpl.class.getName(), checked);\n\t\t}\n\t\tif (checked.contains(ref)) {\n\t\t\treturn false; // This allows the required entity to load.\n\t\t}\n\t\ttry {\n\t\t\tchecked.add(ref);\n\t\t\treturn findSiteId(ref);\n\t\t} finally {\n\t\t\tif(!checked.isEmpty()) {\n\t\t\t\tchecked.remove(checked.size()-1);\n\t\t\t}\n\t\t}\n\t}", "public static boolean hasCycle( IntNode head ) {\r\n\t\r\n\t\tfor( IntNode cursor = head; cursor != null; cursor = cursor.link ) {\r\n\t\t\t// otherwise should return false if the list is acyclic\r\n\t\t\tif( cursor.link == null )\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\t// should return true if it is cyclic\r\n\t\treturn true;\r\n\t\t\r\n\t}", "static boolean hasCycle(Node head) {\n\t\t\n\t\tif(head == null) return false;\n\t\t\n\t\t//Using the concept of one pointer moving faster than another, since at some point both will meet \n\t\t//at the same point and close a cycle (if any).\n\t\tNode slowPointerNode = head;\n\t\tNode fastPointerNode = head.getNext();\n\t\t\n\t\twhile(fastPointerNode != null && fastPointerNode.getNext() != null) {\n\t\t\tif(slowPointerNode == fastPointerNode) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tslowPointerNode = slowPointerNode.getNext();\n\t\t\tfastPointerNode = fastPointerNode.getNext().getNext();\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean isObjectReference(Class<?> paramClass) {\n/* 196 */ if (paramClass == null) {\n/* 197 */ throw new IllegalArgumentException();\n/* */ }\n/* */ \n/* 200 */ return (paramClass.isInterface() && Object.class\n/* 201 */ .isAssignableFrom(paramClass));\n/* */ }", "@Requires(\"c != null\")\n private boolean pathIsTooDivergentFromReference( final Cigar c ) {\n for( final CigarElement ce : c.getCigarElements() ) {\n if( ce.getOperator().equals(CigarOperator.N) ) {\n return true;\n }\n }\n return false;\n }", "protected boolean hasTypeReference(NameReference reference) {\n\t\tNameReferenceKind kind = reference.getReferenceKind();\n\t\tif (kind == NameReferenceKind.NRK_GROUP) {\n\t\t\tNameReferenceGroup group = (NameReferenceGroup)reference;\n\t\t\tList<NameReference> subreferenceList = group.getSubReferenceList();\n\t\t\tif (subreferenceList == null) return false;\n\t\t\tfor (NameReference subreference : subreferenceList) {\n\t\t\t\tif (hasTypeReference(subreference)) return true;\n\t\t\t}\n\t\t\treturn false;\n\t\t} else if (kind == NameReferenceKind.NRK_TYPE) return true;\n\t\telse return false;\n\t}", "protected boolean hasTypeFieldOrMethodReference(NameReference reference) {\n\t\tNameReferenceKind kind = reference.getReferenceKind();\n\t\tif (kind == NameReferenceKind.NRK_GROUP) {\n\t\t\tNameReferenceGroup group = (NameReferenceGroup)reference;\n\t\t\tList<NameReference> subreferenceList = group.getSubReferenceList();\n\t\t\tif (subreferenceList == null) return false;\n\t\t\tfor (NameReference subreference : subreferenceList) {\n\t\t\t\tif (hasTypeFieldOrMethodReference(subreference)) return true;\n\t\t\t}\n\t\t\treturn false;\n\t\t} else if (kind == NameReferenceKind.NRK_TYPE) return true;\n\t\telse if (kind == NameReferenceKind.NRK_FIELD) return true;\n\t\telse if (kind == NameReferenceKind.NRK_METHOD) return true;\n\t\telse if (kind == NameReferenceKind.NRK_VARIABLE) return true;\n\t\telse return false;\n\t}", "public final boolean isDeepAttributeReference ()\r\n {\r\n return _value.hasXmlTreePath();\r\n }", "public final boolean isAcyclic() {\n return this.topologicalSort().size() == this.sizeNodes();\n }", "public boolean isSubclassOf(ClassReference other) {\n\t\t//TODO: Review this code thoroughly, it hasn't been looked at in a while\n\t\tif (this.equals(other) || this.equals(NULL) || other.equals(NULL)) {\n\t\t\treturn true;\n\t\t}\n\t\tboolean isPrimitive = (primitive != Primitive.REFERENCE && other.primitive != Primitive.REFERENCE);\n\t\tboolean isReference = (primitive == Primitive.REFERENCE && other.primitive == Primitive.REFERENCE);\n\t\tif (isPrimitive && isReference) {\n\t\t\treturn false;\n\t\t} else if (isPrimitive) {\n\t\t\tif (other.primitive == Primitive.INT && INT_TYPES.contains(primitive)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (isReference) {\n\t\t\tQueue<ClassReference> tests = new LinkedList<>();\n\t\t\ttests.add(this);\n\t\t\twhile (!tests.isEmpty()) {\n\t\t\t\tClassReference test = tests.poll();\n\t\t\t\tif (!test.equals(OBJECT)) {\n\t\t\t\t\tJavaClass testClass = ClassStore.findClass(test);\n\t\t\t\t\tif (testClass != null) {\n\t\t\t\t\t\tClassReference superType = testClass.superType;\n\t\t\t\t\t\tif (superType.equals(other)) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttests.add(superType);\n\t\t\t\t\t\tfor (ClassReference interfaceType : testClass.interfaces) {\n\t\t\t\t\t\t\tif (interfaceType.equals(other)) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttests.add(interfaceType);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "boolean isRecursive();", "boolean hasCycle() {\n if (head == null){\n return false;\n }\n Node slow = head;\n Node fast = head;\n while (slow != null && fast != null && fast.next != null){\n slow = slow.next;\n fast = fast.next.next;\n if (slow == fast){\n return true;\n }\n }\n return false;\n }", "boolean isCyclic() {\n\n // if we are processing the course currently that is a cyclic graph and we can't\n // do all the courses\n if (processed) {\n return false;\n }\n\n // if we already visited the course and no cycle was found then we can return\n if (visited) {\n return true;\n }\n //else we set the course and visited\n visited = true;\n\n //we then loop through all the prerequisites performing the same check\n for (Course preCourse : pre) {\n if (preCourse.isCyclic()) {\n return true;\n }\n }\n\n //if we arrive here then we have gone through all the combinations and there is no cyclic graph\n visited = false;\n processed = true;\n return false;\n }", "public boolean hasRefSeason() {\n return refSeasonBuilder_ != null || refSeason_ != null;\n }", "boolean hasRecursive();", "public boolean isReferencedByOthers(final Comment comment) {\n\t\treturn sql.fetchExists(COMMENTS,\n\t\t\t\tCOMMENTS.OTHER_COMMENT_ID.eq(comment.getCommentId()));\n\t}", "private void checkAndAddReferenceFrame(ReferenceFrame referenceFrame)\n {\n checkAndAddReferenceFrame(referenceFrame, referenceFrame.getNameBasedHashCode());\n }", "private static <T extends BaseVertex, E extends BaseEdge> void sanityCheckReferenceGraph(final BaseGraph<T,E> graph, final Haplotype refHaplotype) {\n if( graph.getReferenceSourceVertex() == null ) {\n throw new IllegalStateException(\"All reference graphs must have a reference source vertex.\");\n }\n if( graph.getReferenceSinkVertex() == null ) {\n throw new IllegalStateException(\"All reference graphs must have a reference sink vertex.\");\n }\n if( !Arrays.equals(graph.getReferenceBytes(graph.getReferenceSourceVertex(), graph.getReferenceSinkVertex(), true, true), refHaplotype.getBases()) ) {\n throw new IllegalStateException(\"Mismatch between the reference haplotype and the reference assembly graph path. for graph \" + graph +\n \" graph = \" + new String(graph.getReferenceBytes(graph.getReferenceSourceVertex(), graph.getReferenceSinkVertex(), true, true)) +\n \" haplotype = \" + new String(refHaplotype.getBases())\n );\n }\n }", "public boolean isReferenceToPrimaryKey() {\n\t\treturn referencedColumns.isEmpty();\n\t}", "private static void checkReferenceTypes(Component component)\n\t{\n\t\tList<ExternalReference> refs = component.getExternalReferences();\n\t\tif (refs != null)\n\t\t{\n\t\t\tfor (ExternalReference ref : refs)\n\t\t\t{\n\t\t\t\tif (ref.getType() == null)\n\t\t\t\t\tref.setType(ExternalReference.Type.OTHER);\n\t\t\t}\n\t\t}\n\t}", "private static boolean pathIsTooDivergentFromReference(final Cigar c) {\n return c.getCigarElements().stream().anyMatch(ce -> ce.getOperator() == CigarOperator.N);\n }", "private boolean isReferenceToLocal(@Nullable LighterASTNode operand, @NotNull LighterASTNode var) {\n return operand != null &&\n operand.getTokenType() == REFERENCE_EXPRESSION &&\n Objects.requireNonNull(tree.getParent(operand)).getTokenType() != METHOD_CALL_EXPRESSION &&\n findExpressionChild(tree, operand) == null && // non-qualified\n Objects.equals(getNameIdentifierText(tree, operand), getNameIdentifierText(tree, var));\n }", "boolean hasEnclosingInstance(ClassType encl);", "@Test\r\n\tpublic void testThatCircularReferenceDoesntCrash() {\r\n\t\tSheet sheet = new Sheet();\r\n\t\tsheet.put(\"A1\", \"=A1\");\r\n\t\tassertTrue(true);\r\n\t}", "private void checkNoCycles(List<JpsModule> component) {\n if (component.size() > 1) {\n StringBuilder message = new StringBuilder();\n message.append(\"Found circular module dependency: \")\n .append(component.size())\n .append(\" modules\");\n for (JpsModule module : component) {\n message.append(\" \").append(module.getName());\n }\n logger.error(message.toString());\n }\n }", "public void addReference() {\r\n mReferenced = true;\r\n }", "boolean isResolveByProxy();", "public boolean hasCycle(ListNode head) {\n ListNode p1 = head;\n ListNode p2 = head;\n while (p2 != null && p2.next != null) {\n \tp1 = p1.next;\n \tif (p2.next != null) {\n \t\tp2 = p2.next.next;\n \t}\n \tif (p1 == p2) {\n \t\treturn true;\n \t}\n }\n return false;\n }", "protected static boolean checkTypeReferences() {\n Map<Class<?>, LinkedList<Class<?>>> missingTypes = new HashMap<>();\n for (Map.Entry<String, ClassProperties> entry : classToClassProperties.entrySet()) {\n String className = entry.getKey();\n Class<?> c = lookupClass(className);\n Short n = entry.getValue().typeNum;\n if (marshalledTypeNum(n)) {\n Class<?> superclass = getValidSuperclass(c);\n if (superclass != null)\n checkClassPresent(c, superclass, missingTypes);\n LinkedList<Field> fields = getValidClassFields(c);\n for (Field f : fields) {\n Class<?> fieldType = getFieldType(f);\n checkClassPresent(c, fieldType, missingTypes);\n }\n }\n }\n if (missingTypes.size() > 0) {\n for (Map.Entry<Class<?>, LinkedList<Class<?>>> entry : missingTypes.entrySet()) {\n Class<?> c = entry.getKey();\n LinkedList<Class<?>> refs = entry.getValue();\n String s = \"\";\n for (Class<?> ref : refs) {\n if (s != \"\")\n s += \", \";\n s += \"'\" + getSimpleClassName(ref) + \"'\";\n }\n Log.error(\"Missing type '\" + getSimpleClassName(c) + \"' is referred to by type(s) \" + s);\n }\n Log.error(\"Aborting code generation due to missing types\");\n return false;\n }\n else\n return true;\n }", "public boolean hasCycle(ListNode head) {\n if(head == null || head.next == null){\n return false;\n }\n Set<ListNode> nodes = new HashSet<ListNode>();\n ListNode cur = head;\n while(cur != null){\n if(nodes.contains(cur)){\n return true;\n }\n nodes.add(cur);\n cur = cur.next;\n }\n return false;\n }", "private boolean containsCycle(TransactionId tid) {\n HashSet<TransactionId> visited = new HashSet<TransactionId>();\n LinkedList<TransactionId> queue = new LinkedList<TransactionId>();\n\n queue.add(tid);\n\n while (!(queue.isEmpty())) {\n TransactionId cur = queue.remove();\n if (visited.contains(cur)) {\n return true;\n }\n\n visited.add(cur);\n\n if (this.dependencyMap.containsKey(cur) && !(this.dependencyMap.get(cur).isEmpty())) {\n Iterator<TransactionId> it = this.dependencyMap.get(cur).iterator();\n while (it.hasNext()) {\n queue.add(it.next());\n }\n }\n }\n\n return false;\n }", "private static boolean assetHasLocalReference(MD5Key id) {\n \n \t\treturn getLocalReference(id) != null;\n \t}", "protected boolean isObject() {\n long mark = 0;\n try {\n mark = this.createMark();\n boolean bl = this.getObject() != null;\n return bl;\n }\n catch (MathLinkException e) {\n this.clearError();\n boolean bl = false;\n return bl;\n }\n finally {\n if (mark != 0) {\n this.seekMark(mark);\n this.destroyMark(mark);\n }\n }\n }", "public boolean hasRefSeason() {\n return refSeason_ != null;\n }", "Link getIsReuseOf();", "boolean hasDependencyRelation(int parentID, int childID){\n if (parentID < 0 || parentID >= size_)\n throw new IllegalArgumentException(\"the parent ID is out of range.\");\n if (childID < 0 || childID >= size_)\n throw new IllegalArgumentException(\"the child ID is out of range.\");\n\n return nodes_[childID].parent_ == parentID;\n }", "public boolean hasCycle(ListNode head) {\n if(head == null || head.next == null){\n return false;\n }\n\n ListNode p1 = head.next;\n ListNode p2 = head.next.next;\n while(p1 != null && p2 != null){\n if(p1 == p2){\n return true;\n }\n p1 = p1.next;\n p2 = p2.next;\n if(p2 != null){\n p2 = p2.next;\n }\n }\n return false;\n }", "private void checkReference()\r\n {\r\n if (myKeyRef.get() == null)\r\n {\r\n myValue = null;\r\n }\r\n }", "public void shouldNotGc() {\n reachabilityReferenceChain = new Reference(\n new SoftReference(\n new Reference(\n new WeakReference(\n new SoftReference(\n new PhantomReference(new Object(), referenceQueue))))));\n }", "public boolean hasRecursive() {\n return recursive_ != null;\n }", "public boolean isTree() {\n\t\tif (vertices.size() == 0 || vertices.size() == 1) return true;\n\t\tSet<String> visited = new HashSet<String>();\n\t\treturn !isCyclicUtil(vertices.iterator().next(), visited, null) && visited.size() == vertices.size();\n\t}", "public void setInheritRefs(boolean value) {\n inheritRefs = value;\n }", "public boolean IsTree() {\r\n\t\treturn this.IsConnected() && !this.IsCyclic();\r\n\t}", "public boolean containsGraph( final ProjectVersionRef ref )\n {\n return getConnectionInternal().containsProject( params, ref );\n }", "@DISPID(1611006000) //= 0x60060030. The runtime will prefer the VTID if present\n @VTID(75)\n boolean externalReferencesNodeInTree();", "public boolean makeReference(String referrerTitle, String refereeTitle) {\n\t\tPaper referrer = getPaper(referrerTitle);\n\t\tPaper referee = getPaper(refereeTitle);\n\n\t\t/** Check papers exist first */\n\t\tif (!isExistingPaper(refereeTitle)) {\n\t\t\tSystem.out.println(\"Paper \" + refereeTitle + \" not found.\");\n\t\t\treturn false;\n\t\t} else if (!isExistingPaper(referrerTitle)) {\n\t\t\tSystem.out.println(\"Paper \" + referrerTitle + \" not found.\");\n\t\t\treturn false;\n\t\t}\n\n\t\t/** Check for duplicate references */\n\t\tfor (Paper p : referrer.getReferences()) {\n\t\t\tif (p.equals(referee)) {\n\t\t\t\tSystem.out.println(\"Duplicate reference \" + referrerTitle\n\t\t\t\t\t\t+ \" -> \" + refereeTitle + \".\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/** Search for cycles, upwards and downwards */\n\t\tDepthFirstSearch<Paper> search = new DepthFirstSearch<Paper>();\n\n\t\tif (!search.dfs(referee, referee, DepthFirstSearch.SEARCH_IN_EDGES,\n\t\t\t\tDepthFirstSearch.NO_SEARCH_LIMIT, referrer)) {\n\t\t\tSystem.out.println(referrerTitle + \" -> \" + refereeTitle\n\t\t\t\t\t+ \" would create a cycle.\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!search.dfs(referee, referee, DepthFirstSearch.SEARCH_OUT_EDGES,\n\t\t\t\tDepthFirstSearch.NO_SEARCH_LIMIT, referrer)) {\n\t\t\tSystem.out.println(referrerTitle + \" -> \" + refereeTitle\n\t\t\t\t\t+ \" would create a cycle.\");\n\t\t\treturn false;\n\t\t}\n\n\t\t/** OK to make reference! */\n\t\treturn referrer.createReference(referee)\n\t\t\t\t&& referee.createCitation(referrer);\n\t}", "public final boolean tryOwn() {\n return own(this) == this;\n }", "public boolean isTree() {\r\n\t\tif (isConnected() && !isCyclic())\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "public boolean sanity()\n {\n A1List p1 = this.getFirst();\n A1List p2 = this.getFirst();\n while(true){\n p1 = p1.getNext();\n p2 = p2.getNext();\n if (p2 == null) break;\n p2 = p2.getNext();\n if (p2==null) break;\n if (p1 ==p2) return false;\n }\n\n // Checkign whether the sentinel nodes are correct or not.\n A1List curr = this.getFirst();\n if (curr ==null){\n if (this.next ==null){\n if (this.prev.prev != null) return false;\n }\n else if (this.prev ==null){\n if (this.next.next !=null) return false;\n }\n }\n else {\n curr = curr.prev;\n // curr shouldd become the head sentinel;\n if (curr.prev !=null ) return false;\n while (curr.getNext() !=null ){\n curr = curr.next;\n }\n // Now curr becomes the node before tail sentinel\n if (curr.next.next !=null) return false;\n }\n\n // Checking whether the prev of the next of a node points back to that node oe not.\n curr = this.getFirst();\n while(curr!=null){\n if (curr.next.prev != curr) return false;\n curr = curr.getNext();\n }\n\n\n return true;\n }", "public boolean isDeep() {\n return isDeep;\n }", "public boolean hasIgnoredReferences() {\n\t\treturn !ignoredReferences.isEmpty();\n\t}", "public static boolean hasCycle1(ListNode head) {\n Set<ListNode> visited = new HashSet<>();\n\n while (head != null) {\n if (visited.contains(head)) {\n return true;\n }\n visited.add(head);\n head = head.next;\n }\n\n return false;\n }", "boolean hasResolve();", "public boolean hasCycle(Node<T> first) {\n Iterator itOne = this.iterator();\n Iterator itTwo = this.iterator();\n try {\n while (true) {\n T one = (T) itOne.next();\n itTwo.next();\n T two = (T) itTwo.next();\n if (one.equals(two)) {\n return true;\n }\n }\n } catch (NullPointerException ex) {\n ex.printStackTrace();\n }\n return false;\n }", "public boolean IsCyclic() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tqueue.addLast(rootpair);\r\n\t\t\twhile (queue.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public static Boolean isCyclic(Graph g) {\n\n for (Vertex v : g) {\n v.seen = false;\n v.parent = null;\n }\n // Running a DFS to check for cycle\n for (Vertex v : g) {\n if (!v.seen) {\n if (isCyclicUtil(v, v.parent)) {\n return true;\n }\n }\n }\n return false;\n\n }", "private boolean hasCycle()\r\n {\r\n boolean passed = false;\r\n for(Field.RadioData dst=radioList; dst!=null; dst=dst.next)\r\n {\r\n if(dst==radioList && passed) return true;\r\n passed = true;\r\n }\r\n return false;\r\n }", "private static boolean isAcyclic(int index, BitSet onStack, BitSet visited,\n\t\t\tAutomaton automaton) {\n\n\t\tif (onStack.get(index)) {\n\t\t\treturn false; // found a cycle!\n\t\t}\n\n\t\tif (visited.get(index)) {\n\t\t\t// Ok, we've traversed this node before and it checked out OK.\n\t\t\treturn true;\n\t\t}\n\n\t\tvisited.set(index);\n\t\tonStack.set(index);\n\n\t\tAutomaton.State state = automaton.get(index);\n\t\tif (state instanceof Automaton.Term) {\n\t\t\tAutomaton.Term term = (Automaton.Term) state;\n\t\t\tif (term.contents != Automaton.K_VOID) {\n\t\t\t\tif (!isAcyclic(term.contents, onStack, visited, automaton)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (state instanceof Automaton.Collection) {\n\t\t\tAutomaton.Collection compound = (Automaton.Collection) state;\n\t\t\tint[] children = compound.children;\n\t\t\tfor (int i = 0; i != compound.length; ++i) {\n\t\t\t\tif (!isAcyclic(children[i], onStack, visited, automaton)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tonStack.set(index, false);\n\n\t\treturn true;\n\t}", "private boolean hasCycle1() {\n\t\tNode slow = head;\n\t\tNode fast = head;\n\t\t\n\t\twhile (fast != null && fast.next != null) {\n\t\t\tslow = slow.next;\n\t\t\tfast = fast.next.next;\n\t\t\tif(slow == fast) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasObject(){\n return _object != null;\n }", "private static boolean isCyclic(Node<Integer> graph) {\r\n\t\tif (graph == null || graph.adjNodes.size() == 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tStack<Node<Integer>> recursiveStack = new Stack<Node<Integer>>();\r\n\t\trecursiveStack.add(graph);\r\n\t\tgraph.isVisited = true;\r\n\r\n\t\twhile (!recursiveStack.isEmpty()) {\r\n\t\t\tNode<Integer> temp = recursiveStack.pop();\r\n\r\n\t\t\tfor (int i = 0; i < temp.adjNodes.size(); i++) {\r\n\t\t\t\tif (temp.adjNodes.get(i).isVisited) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\trecursiveStack.push(temp.adjNodes.get(i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isConversing ( ) {\n\t\treturn extract ( handle -> handle.isConversing ( ) );\n\t}", "public boolean isLinked(int axis) {\n if (axis == HORIZONTAL) {\n return horizontalMaster != null;\n }\n assert (axis == VERTICAL);\n return (verticalMaster != null);\n }", "boolean isInvoiceFullyLinkedWithGR(GoodsReceipt invoice) throws ServiceException {\n boolean isfullyLinkedWithGR = false;\n List invoiceList = accGoodsReceiptobj.isInvoiceNotLinkedWithAnyGR(invoice);\n boolean isAnyGRNIsInPendingState = (boolean) invoiceList.get(2);//Flag to identify whether any of GRN created from PI are in pending state?\n if (!invoice.isIsOpenInGR() && !isAnyGRNIsInPendingState) {\n isfullyLinkedWithGR = true;\n } else {\n /*------------ Check If GR->PI then in this case PI is linked with Full GRN or not?---------*/\n if (accGoodsReceiptobj.isLinkingOfGRInPI(invoice)) {//i.e GR->PI linking is available?\n isfullyLinkedWithGR = checkGRNtoInvoiceLinkingIsFullOrPartial(invoice, true);\n }\n \n }\n return isfullyLinkedWithGR;\n }", "private boolean isObjectABrick(GObject collider) {\n return collider != null;\n }" ]
[ "0.7245392", "0.7244165", "0.7137154", "0.6922349", "0.6797001", "0.67711484", "0.6728945", "0.6556256", "0.6494718", "0.6487357", "0.64802223", "0.644663", "0.6371065", "0.6299234", "0.6251143", "0.62431544", "0.62401026", "0.61586964", "0.6135155", "0.6024982", "0.6018778", "0.5983813", "0.597821", "0.59580135", "0.59375495", "0.59286535", "0.5917416", "0.5869114", "0.5841736", "0.58218914", "0.5813539", "0.5784992", "0.57824266", "0.57791495", "0.57475835", "0.5735423", "0.57309705", "0.5701427", "0.5659278", "0.5656962", "0.56523055", "0.5636984", "0.56083626", "0.56068116", "0.55827403", "0.5568885", "0.5547239", "0.5541642", "0.55388427", "0.55312246", "0.5506096", "0.5493134", "0.5487083", "0.54606754", "0.54506034", "0.54500246", "0.54174376", "0.5409304", "0.53988564", "0.5385629", "0.5354897", "0.5338671", "0.53232044", "0.53174436", "0.5311792", "0.5310595", "0.5308877", "0.5306647", "0.5296689", "0.52962935", "0.52935594", "0.52735656", "0.5269875", "0.5266787", "0.5254251", "0.5253848", "0.524988", "0.52370983", "0.52330416", "0.523246", "0.52303034", "0.52235985", "0.5220925", "0.521704", "0.5211863", "0.520403", "0.5191985", "0.517918", "0.51738477", "0.5169525", "0.5165871", "0.51655966", "0.5162993", "0.5160511", "0.51592135", "0.5158291", "0.5154317", "0.51535416", "0.5151401", "0.515087" ]
0.78703946
0
Check whether reference is used but never assigned
private void checkReference(ConstantReference node) { if (!symboltable.containsKey(node.name)) { node.setError(String.format("Constant %s used but not assigned", node.name)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasRef();", "boolean hasReference();", "boolean isZeroReference() {\n return refCount == 0;\n }", "private void checkReference()\r\n {\r\n if (myKeyRef.get() == null)\r\n {\r\n myValue = null;\r\n }\r\n }", "boolean isSetRef();", "private boolean isReference()\n {\n return countAttributes(REFERENCE_ATTRS) > 0;\n }", "public boolean canBeUsed(){\n\t\treturn !(this.isUsed);\n\t}", "public boolean isUnassigned() {\n return !assigned;\n }", "boolean hasHadithReferenceNo();", "public final boolean isReferencedAtMostOnce() {\n return this.getReferences(false, true).size() == 0 && this.getReferences(true, false).size() <= 1;\r\n }", "public boolean canBeReferencedByIDREF() {\n/* 171 */ return false;\n/* */ }", "public void shouldNotGc() {\n reachabilityReferenceChain = new Reference(\n new SoftReference(\n new Reference(\n new WeakReference(\n new SoftReference(\n new PhantomReference(new Object(), referenceQueue))))));\n }", "public boolean hasReferences() {\n\t\treturn this.refCounter > 0;\n\t}", "public final boolean isReference() {\n \treturn !isPrimitive();\n }", "boolean isUsed();", "boolean isUsed();", "synchronized boolean resetWasUsed() {\n\n boolean result = lastValue != currValue;\n\n lastValue = currValue;\n\n return result;\n }", "protected boolean isReferenced() {\r\n return mReferenced || mUsers.size() > 0;\r\n }", "boolean getRefuse();", "@Override\r\n public final boolean isUseless() {\r\n int i;\r\n Rule[] r;\r\n\r\n r = this.m_rules;\r\n for (i = (r.length - 1); i >= 0; i--) {\r\n if (!(r[i].isUseless()))\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public boolean isReference() {\n return isReference;\n }", "boolean known() {\n\t\t\treturn !varAddress && !varMask;\n\t\t}", "private void setRefuse(boolean value) {\n \n refuse_ = value;\n }", "protected boolean getUsed(){\n\t\treturn alreadyUsed;\n\t}", "private void clearRefuse() {\n \n refuse_ = false;\n }", "public boolean isUsed() {\n return used;\n }", "public void isDeceased(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "public boolean getRefuse() {\n return instance.getRefuse();\n }", "public boolean isDontCare(){\n return hasDontCare;\n }", "void setUnused(){\n assert this.used == true;\n\n //let the parent pointer remain\n this.hf = 0;\n this.used = false;\n\n }", "public boolean willNotBeResurrected() {\n return state == State.FRESH || state == State.ERROR;\n }", "public boolean refCountDown() {\n\t\treferenceCounter--;\n\t\treturn (referenceCounter > 0) ? true : false;\n\t}", "public boolean usedDefend() { return _usedDefend; }", "public SetOnceRef(Object ref, boolean allowNull) {\n this(ref, allowNull, true);\n }", "public void setUsed(){\n\t\talreadyUsed = true;\n\t}", "public void setUsed()\n\t{\n\t\tm_justReset = false;\n\t}", "public boolean isSetRoadwayRef()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(ROADWAYREF$16) != null;\r\n }\r\n }", "public boolean isSetReference_vendored_const() {\n\t\treturn EncodingUtils.testBit(__isset_bitfield, __REFERENCE_VENDORED_CONST_ISSET_ID);\n\t}", "public boolean hasIgnoredReferences() {\n\t\treturn !ignoredReferences.isEmpty();\n\t}", "public void setUsed() {\n used = true;\n }", "public boolean isUseable()\n {\n if (state == 0)\n {\n return true;\n }\n return false;\n }", "public void reassignIfNeeded() {\n\t}", "public SetOnceRef(boolean allowNull) {\n this(null, allowNull, false);\n }", "public boolean isUnused() {\n return this.binderySlotNumber == -9234;\n }", "@Override\n\tpublic boolean isUsed() {\n\t\treturn true;\n\t}", "public void testDefaultValue() {\n if(referenceDefault == null) {\n System.out.println(\"Default value of any reference variable is null!\");\n }\n }", "public boolean borrowed()\r\n\t{\n\t\treturn !(currentlyBorrowed == null);\r\n\t}", "Link getIsReuseOf();", "@Override\n protected boolean usesNoRefReads() {\n return true;\n }", "private boolean useWeakThreadLocals() {\n try {\n val property = System.getProperty(\"com.github.bingoohuang.mtcp.useWeakReferences\");\n if (property != null) { // undocumented manual override of WeakReference behavior\n return Boolean.parseBoolean(property);\n }\n\n return getClass().getClassLoader() != ClassLoader.getSystemClassLoader();\n } catch (SecurityException se) {\n return true;\n }\n }", "boolean isBeingUsed() {\n return usageCount > 0;\n }", "public boolean isBeingUsed()\n\t{\n\t\treturn usedBy != null;\n\t}", "default Optional<Boolean> isPubliclyReleasable() {\n return Optional.empty();\n }", "public final boolean tryOwn() {\n return own(this) == this;\n }", "public boolean isGarbage()\r\n\t\t{\r\n\t\t\treturn this.subscriberRef.get() == null;\r\n\t\t}", "boolean isOnlyAssignedInInitializer();", "boolean getPossiblyBad();", "boolean hasRetainFlag();", "public boolean isAssigned() {\n boolean assigned;\n IDecisionVariable var = getVariable();\n if (null != var) {\n assigned = AssignmentState.UNDEFINED != var.getState();\n } else {\n assigned = false;\n }\n return assigned;\n }", "public boolean getRefuse() {\n return refuse_;\n }", "public boolean hasBeenAcquired(){\r\n\t\treturn !(acquiredBy == null);\r\n\t}", "private boolean isValidAndNewReference(String ref) {\n Set<String> allRefs = getAllReferenceNames();\n if (allRefs.contains(ref)) {\n if (!ref.equals(currentReference)) {\n return true;\n }\n } else if (allRefs.contains(\"chr\" + ref)) {\n // Looks like a number. Let's try slapping on \"chr\" and see if it works.\n return isValidAndNewReference(\"chr\" + ref);\n } else {\n if (TrackController.getInstance().getTracks().size() > 0) {\n DialogUtils.displayMessage(String.format(\"<html>Reference <i>%s</i> not found in loaded tracks.</html>\", ref));\n }\n }\n return false;\n }", "private boolean isReferenceToLocal(@Nullable LighterASTNode operand, @NotNull LighterASTNode var) {\n return operand != null &&\n operand.getTokenType() == REFERENCE_EXPRESSION &&\n Objects.requireNonNull(tree.getParent(operand)).getTokenType() != METHOD_CALL_EXPRESSION &&\n findExpressionChild(tree, operand) == null && // non-qualified\n Objects.equals(getNameIdentifierText(tree, operand), getNameIdentifierText(tree, var));\n }", "public boolean isSetWasNotGiven()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(WASNOTGIVEN$4) != 0;\n }\n }", "static void setNotCopying(){isCopying=false;}", "private boolean isReferenced(String item) {\n\t\tif (varReferences.contains(item)) return true;\n\t\telse return false;\n\t}", "void verifyNoReferences(Node n) {\n if (returned.contains(n))\n Assert.UNREACHABLE(\"ERROR: returned set contains \"+n);\n if (thrown.contains(n))\n Assert.UNREACHABLE(\"ERROR: thrown set contains \"+n);\n if (false) {\n for (int i=0; i<this.params.length; ++i) {\n if (this.params[i] == n)\n Assert.UNREACHABLE(\"ERROR: param #\"+i+\" \"+n);\n }\n }\n for (Iterator i = nodeIterator(); i.hasNext(); ) {\n Node n2 = (Node) i.next();\n if (n2 instanceof UnknownTypeNode) continue;\n if (multiset_contains(n2.addedEdges, n)) {\n Assert.UNREACHABLE(\"ERROR: \"+n2+\" contains an edge to \"+n);\n }\n if (multiset_contains(n2.predecessors, n)) {\n Assert.UNREACHABLE(\"ERROR: \"+n2+\" contains predecessor \"+n);\n }\n if (multiset_contains(n2.accessPathEdges, n)) {\n Assert.UNREACHABLE(\"ERROR: \"+n2+\" contains access path edge to \"+n);\n }\n if (n2 instanceof FieldNode) {\n FieldNode fn = (FieldNode) n2;\n if (fn.field_predecessors != null &&\n fn.field_predecessors.contains(n)) {\n Assert.UNREACHABLE(\"ERROR: \"+fn+\" contains a field predecessor \"+n);\n }\n }\n }\n }", "@Test\n public void testIsNotUsed() {\n System.out.println(\"isNotUsed\");\n Setting s = Setting.factory();\n Setting s1 = Setting.factory();\n Setting s2 = Setting.factory();\n Setting s3 = Setting.getSetting(\"test1\");\n assertTrue(Setting.isNotUsed(\"junk\"));\n assertFalse(Setting.isNotUsed(s.getName()));\n\n }", "boolean isDummy() {\n return var == null;\n }", "public boolean method_2434() {\r\n return false;\r\n }", "boolean hasUknown();", "public boolean checkAvailability(int num_used) {\n return num_used != this.num_uses;\n }", "public boolean isIsAssigned() {\r\n return isAssigned;\r\n }", "public boolean method_4088() {\n return false;\n }", "public boolean containsByReference(ParameterReference ref);", "public Boolean getReused() {\n return reused;\n }", "public boolean isUsedByVerifier() {\r\n return usedByVerifier;\r\n }", "public boolean isOccupied() {\n return !(getLease() == null);\r\n }", "@Override\n\tpublic boolean erTom() {\n\t\treturn (bak == null);\n\t}", "public boolean isReleasable() { return isDone(); }", "public void softReference()\n {\n \t //====NOTE=====>>> RSN how SoftReference is created\n SoftReference<ReferenceExample> ex = new SoftReference<ReferenceExample>(new ReferenceExample(\"SoftRef\"));\n //====NOTE=====>>> RSN SUPER IMP : Note how to get hold of real object, by get() method\n System.out.println(\"Soft refrence :: \" + ex.get().getOrigin());\n \n int counter=0;\n while(counter<5)\n {\n counter++;\n System.gc();\n }\n \n System.out.println(\"SoftReference still Valid after 5 GC:\" + ex.get().getStatus() + \"Orig=\" + ex.get().getOrigin());\n }", "default boolean isPresent() {\n return get() != null;\n }", "default boolean isPresent() {\n return get() != null;\n }", "boolean hasPossiblyBad();", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkAbout() {\n\t\tboolean flag = oTest.checkAbout();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "public boolean isNulled() {\n \t\treturn nulled;\n \t}", "private void checkReferences(DataStage dataStage, boolean useSourceType, Object result) {\n final List<TargetInternalReference> references = new ArrayList<>();\n Helpers.collectAllTargetInternalReferences(result, references);\n Map<String, Boolean> cachedReferences = new HashMap<>();\n references.forEach(t -> {\n boolean reset = false;\n if (t.getReference() != null) {\n final Boolean fromCache = cachedReferences.get(t.getReference());\n if(fromCache !=null){\n if(fromCache){\n reset = true;\n }\n }\n else {\n TargetInstance reference = null;\n try {\n final List<String> typesOfReference = kgV3.getTypesOfInstance(t.getReference(), DataStage.IN_PROGRESS, false);\n if (typesOfReference != null) {\n final TranslatorModel<?, ?> referenceTranslatorModel = TranslatorModel.MODELS.stream().filter(m -> m.getV3translator() != null && m.getV3translator().semanticTypes().stream().anyMatch(typesOfReference::contains)).findFirst().orElse(null);\n if (referenceTranslatorModel != null) {\n final String referenceQueryId = typesOfReference.stream().map(type -> referenceTranslatorModel.getV3translator().getQueryIdByType(type)).findFirst().orElse(null);\n reference = translateTargetInstance(dataStage, useSourceType, t, reference, referenceTranslatorModel, referenceQueryId);\n }\n }\n reset = reference == null;\n cachedReferences.put(t.getReference(), reset);\n } catch (WebClientResponseException ignored) {\n logger.error(\"A web client exception occurred - ignoring\");\n }\n }\n }\n if (reset) {\n t.setReference(null);\n }\n });\n }", "@Override\n\tpublic void setIsUsed(boolean arg0) {\n\n\t}", "boolean isWeakRelationship();", "public boolean isSetComparesource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(COMPARESOURCE$2) != 0;\r\n }\r\n }", "public boolean isReferenceToPrimaryKey() {\n\t\treturn referencedColumns.isEmpty();\n\t}", "public boolean hasRefSeason() {\n return refSeasonBuilder_ != null || refSeason_ != null;\n }", "public boolean method_4093() {\n return false;\n }", "public boolean isAcquired() {\r\n return false;\r\n }", "public boolean isConstant()\n {\n return analysis.getRequiredBindings().isEmpty();\n }", "private void m146984b(C47008ac acVar) {\n if (this.f120643a == null) {\n this.f120643a = acVar;\n }\n if (this.f120644b == null) {\n this.f120644b = acVar;\n }\n }", "@Override\n boolean areNestedRefsProhibited() {\n return true;\n }", "boolean isNilExchange();", "public boolean isUsed()\n {\n return (_isUsed(\n getNativeSVGProxyHandle(),\n getHandle()) > 0 ? true : false);\n }", "abstract void checkWhetherVariable(SyntaxUnit use);" ]
[ "0.6952191", "0.69505227", "0.67305905", "0.67155707", "0.6664676", "0.66153336", "0.66096526", "0.6537659", "0.6428299", "0.63770616", "0.63577265", "0.6302729", "0.6250227", "0.6120879", "0.61195546", "0.61195546", "0.61180156", "0.60786486", "0.6067953", "0.60428864", "0.60187733", "0.59683573", "0.5927482", "0.5885626", "0.58553946", "0.58528286", "0.5831001", "0.5812672", "0.57973987", "0.5789594", "0.5776695", "0.5774338", "0.57573444", "0.57359964", "0.5735249", "0.5720812", "0.57075745", "0.57033056", "0.5698936", "0.5697383", "0.5692904", "0.5692845", "0.5683947", "0.56823707", "0.56818616", "0.5681791", "0.5650735", "0.5647924", "0.5646222", "0.5639587", "0.5634312", "0.5629215", "0.5585407", "0.55837804", "0.553732", "0.55184054", "0.5516691", "0.55158895", "0.549836", "0.5493269", "0.5477487", "0.5431571", "0.5425095", "0.5403211", "0.5401268", "0.53928864", "0.5377373", "0.53697246", "0.5362258", "0.5339673", "0.53247786", "0.5318041", "0.53153604", "0.5315162", "0.53148806", "0.5311453", "0.5302942", "0.52993095", "0.5299145", "0.529228", "0.5283842", "0.52779967", "0.52779967", "0.52774197", "0.5257728", "0.5256266", "0.525598", "0.5249802", "0.52363473", "0.52349037", "0.5229881", "0.52225906", "0.5218926", "0.52114236", "0.5207738", "0.52053124", "0.5203306", "0.5200575", "0.51993704", "0.51990944" ]
0.643583
8
creation des objets+initialisation des parametres
public static void main(String[] args) { Hero aventurier = new Hero(200, 100); Equipement epee = new Equipement("epee", 0); Monsters sorciere = new Monsters("witch", 180, 0); Monsters barbare = new Monsters("olaf", 160, 0);//Degat et point attaque sont à 0 car ils prendront les valeurs du random System.out.println("Bienvenue dans le dongeon"); System.out.println("Vous avez " + aventurier.getPointDeVie() + " Point de vie, " + aventurier.getFlasqueDeau() + " flasques pour combatre vos ennemies et une "); // i=room ;si pointdevie > room-->room+1 sinon game over(pas besoin de creer une classe) int i = 1; do { if (aventurier.getPointDeVie() > 0) ; { System.out.println("Room" + i); Monsters enemieActuel = barbare; //nbr aleatoire entre sorcier et monster Random random = new Random(); int nbrAl = random.nextInt(2 ); //si nbr=0 = sorcier sinon barbare if (nbrAl == 0) { enemieActuel = sorciere; //sinon barbare } else { enemieActuel = barbare; } //Si barbare faire le do while if (enemieActuel == barbare) { do { //Faire des degats aleatoire grace au random à l'aide de l'epee epee.setDegat((int) (5 + (Math.random() * 30)));//comme .set dega=0 on lui donne la valeur de math.random int degat = epee.getDegat(); //.get renvoi la valeur au int nommer degat barbare.setPointDeVie(barbare.getPointDeVie() - degat);//vie - degat System.out.println("Il reste au barbare " + barbare.getPointDeVie());//nouvelle valeur de point de vie //idem avec l'aventurier barbare.setPointAttaque((int) (5 + (Math.random() * 30))); int pointDattaque = barbare.getPointAttaque(); aventurier.setPointDeVie(aventurier.getPointDeVie() - pointDattaque); System.out.println("il vous reste " + aventurier.getPointDeVie()); // tant que les Pvie de l'aventurier >= 0 et idem barbare continuer le combat } while (aventurier.getPointDeVie() >= 0 && barbare.getPointDeVie() >= 0); //à la fin du combat si pvie de l'aventurier sont >0 et que i (room) egale 5 "gagné" if (aventurier.getPointDeVie() > 0 && i==5) { System.out.println("Bravo vous avez gagné ! =)"); //Si juste pvie de l'aventurier > 0 --->room suivante }else if (aventurier.getPointDeVie() > 0 ){ System.out.println("Bravo tu passes à la pièce suivante"); //on redonne les valeurs de depart pdeVie pour la nouvelle room aventurier.setPointDeVie(200); barbare.setPointDeVie(180); i+=1; } // sinon room = 6 pour envoyer le sout "game over" else { System.out.println("Game Over"); i = 6; } } //IDEM avec sorciere else { do { aventurier.setFlasqueDeau((int) (5 + (Math.random() * 30))); int degat = aventurier.getFlasqueDeau(); sorciere.setPointDeVie(sorciere.getPointDeVie() - degat); System.out.println("Il reste à la sorciere " + sorciere.getPointDeVie()); sorciere.setPointAttaque((int) (5 + (Math.random() * 30))); int pointDattaque = sorciere.getPointAttaque(); aventurier.setPointDeVie(aventurier.getPointDeVie() - pointDattaque); System.out.println("il vous reste " + aventurier.getPointDeVie()); } while (aventurier.getPointDeVie() >= 0 && sorciere.getPointDeVie() >= 0); if (aventurier.getPointDeVie() > 0 && i==5) { System.out.println("Bravo vous avez gagné ! =)"); }else if (aventurier.getPointDeVie() > 0 ){ System.out.println("Bravo tu passes à la pièce suivante"); aventurier.setPointDeVie(200); sorciere.setPointDeVie(160); i+=1; } else { System.out.println("Game Over"); i = 6; } } } } while (i <= 5 && aventurier.getPointDeVie() > 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TParametrosVOImpl() {\r\n }", "public Parameters() {\n\t}", "public void init(Object[] parameters) {\n\n\t}", "private void prepare()\n {\n Victoria victoria = new Victoria();\n addObject(victoria,190,146);\n Salir salir = new Salir();\n addObject(salir,200,533);\n Volver volver = new Volver();\n addObject(volver,198,401);\n }", "protected void initParametros ( int numParametros ) {\n if ( numParametros > 0 )\n parametros = new Parametro[ numParametros ];\n }", "public BaseParameters(){\r\n\t}", "public Final_parametre() {\r\n\t}", "public Propuestas() {}", "public CustomEntitiesTaskParameters() {}", "protected ParameterList(){\n //title = t;\n //cellWorld = cw;\n }", "public ProductoCreable newInstance(int codigo, String nombre){\r\n \r\n }", "public void crearAutomovil(){\r\n automovil = new Vehiculo();\r\n automovil.setMarca(\"BMW\");\r\n automovil.setModelo(2010);\r\n automovil.setPlaca(\"TWS435\");\r\n }", "public Pasien() {\r\n }", "public void init(){\n\t\tEmployee first = new Employee(\"Diego\", \"Gerente\", \"[email protected]\");\n\t\tHighSchool toAdd = new HighSchool(\"Santiago Apostol\", \"4656465\", \"cra 33a #44-56\", \"3145689879\", 30, 5000, \"Jose\", new Date(1, 3, 2001), 3, \"Servicios educativos\", \"451616\", 15, \"Piedrahita\", 45, 1200, 500);\n\t\ttoAdd.addEmployee(first);\n\t\tProduct pilot = new Product(\"jet\", \"A00358994\", 1.5, 5000);\n\t\tFood firstFood = new Food(\"Colombina\", \"454161\", \"cra 18\", \"454611313\", 565, 60000, \"Alberto\", new Date(1, 8, 2015), 6, \"Manufactura\", 4);\n\t\tfirstFood.addProduct(pilot);\n\t\ttheHolding = new Holding(\"Hertz\", \"15545\", \"cra 39a #30a-55\", \"3147886693\", 80, 500000, \"Daniel\", new Date(1, 2, 2015), 5);\n\t\ttheHolding.addSubordinate(toAdd);\n\t\ttheHolding.addSubordinate(firstFood);\n\t}", "public Postoj() {}", "public prueba()\r\n {\r\n }", "@Test\n public void Constructor_ObjectValues_InstanceCreated() {\n\t\ttry {\n Position position = make_PositionWithIntegerPoints(xCoordinate, yCoordinate, direction);\n Surface surface = make_SurfaceWithGivenDimensions(xDimension, yDimension);\n\t\t\tRover rover = make_RoverWithObjectValues(position, surface);\n\t\t}\n\t\tcatch (AssertionError assErr) {\n\t\t\t// Test passed.\n\t\t\treturn;\n\t\t}\n }", "private Instantiation(){}", "public ParameterizedInstantiateFactory() {\r\n super();\r\n }", "private void init()\n\t{\n\t\tsetModel(new Model(Id.model, this, null));\n\t\tsetEnviroment(new Enviroment(Id.enviroment, this, model()));\n\t\tsetVaccinationCenter(new VaccinationCenter(Id.vaccinationCenter, this, model()));\n\t\tsetCanteen(new Canteen(Id.canteen, this, vaccinationCenter()));\n\t\tsetRegistration(new Registration(Id.registration, this, vaccinationCenter()));\n\t\tsetExamination(new Examination(Id.examination, this, vaccinationCenter()));\n\t\tsetVaccination(new Vaccination(Id.vaccination, this, vaccinationCenter()));\n\t\tsetWaitingRoom(new WaitingRoom(Id.waitingRoom, this, vaccinationCenter()));\n\t\tsetSyringes(new Syringes(Id.syringes, this, vaccination()));\n\t}", "public static void init()\n\t{\n\t\t\n\t\tu.creerGalaxie(\"VoieLactee\", \"spirale\", 0);\n\t\tu.creerEtoile(\"Soleil\", 0, 'F', u.getGalaxie(\"VoieLactee\")); //1\n\t\tu.creerObjetFroid(\"Terre\", 150000 , 13000 , 365 , u.getObjet(1)); //2\n\n\t\tu.creerObjetFroid(\"Lune\", 200 , 5000 , 30 , u.getObjet(2)); //3\n\n\t\tu.creerObjetFroid(\"Mars\", 200000 , 11000 , 750 , u.getObjet(1)); //4\n\n\t\tu.creerObjetFroid(\"Phobos\", 150 , 500 , 40 , u.getObjet(4)); //5\n\n\t\tu.creerObjetFroid(\"Pluton\", 1200000 , 4000 , 900 , u.getObjet(1)); //6\n\n\t\tu.creerEtoile(\"Sirius\", 2, 'B', u.getGalaxie(\"VoieLactee\")); //7\n\n\t\tu.creerObjetFroid(\"BIG-1\", 1000 , 50000 , 333 , u.getObjet(7)); //8\n\n\t\tu.creerGalaxie(\"M31\", \"lenticulaire\", 900000);\n\t\tu.creerEtoile(\"XS67\", 8, 'F', u.getGalaxie(\"M31\")); //9\n\t\tu.creerObjetFroid(\"XP88\", 160000 , 40000 , 400 , u.getObjet(9)); //10\n\t}", "Variables createVariables();", "public void crearPersona(){\r\n persona = new Persona();\r\n persona.setNombre(\"Jose\");\r\n persona.setCedula(12345678);\r\n }", "public ObjectFactory() {\n\t}", "public Caso_de_uso () {\n }", "private void initObjects() {\n inputValidation = new InputValidation(activity);\n databaseHelper = new DatabaseHelper(activity);\n user = new User();\n }", "public ObjectFactory() {\r\n\t}", "public PowerMethodParameter() {\r\n\t\t\r\n\t\t//constructor fara parametru, utilizat in cazul in care utilizatorul nu introduce\r\n\t\t//fisierul sursa si nici fiesierul destinatie ca parametrii in linia de comanda\r\n\t\tSystem.out.println(\"****The constructor without parameters PowerMethodParameter has been called****\");\r\n\t\tSystem.out.println(\"You did not specify the input file and the output file\");\r\n\t\t\r\n\t}", "Compuesta createCompuesta();", "public static void instanciarCreencias() {\n\t\tfor(int i =0; i < GestorPartida.getContJugadores(); i++) {\n\t\t\t\n\t\t\tGestorPartida.jugadores[i].setCreencias(new Creencias(GestorPartida.jugadores, GestorPartida.objetoJugador, GestorPartida.objetoSala, i)); \n\t\t}\n\t}", "Compleja createCompleja();", "public InitialData(){}", "public void init() {\r\n\t\tlog.info(\"init()\");\r\n\t\tobjIncidencia = new IncidenciaSie();\r\n\t\tobjObsIncidencia = new ObservacionIncidenciaSie();\r\n\t\tobjCliente = new ClienteSie();\r\n\t\tobjTelefono = new TelefonoPersonaSie();\r\n\t}", "public AntrianPasien() {\r\n\r\n }", "public cola_de_un_banco(){// se crea nuestro metodo costructor \r\n primero=null;//se crea el tipo de indicaciones con valor a null\r\n ultimo=null;\r\n}", "public Parametros() {\r\n semilla = SEMILLA_DEFECTO;\r\n numeroPistas = NUMERO_PISTAS_DEFECTO;\r\n duracionSlot = DURACION_SLOT_DEFECTO;\r\n frecuencia = FRECUENCIA_DEFECTO;\r\n duracionMedia = DURACION_MEDIA_DEFECTO;\r\n duracionDesviacion = DURACION_DESVIACION_DEFECTO;\r\n duracionMinima = DURACION_MINIMA_DEFECTO;\r\n demoraMedia = DEMORA_MEDIA_DEFECTO;\r\n demoraDesviacion = DEMORA_DESVIACION_DEFECTO;\r\n }", "public StratmasParameterFactory() \n {\n this.typeMapping = createTypeMapping();\n }", "Constructor() {\r\n\t\t \r\n\t }", "public CampoModelo(String valor, String etiqueta, Integer longitud)\n/* 10: */ {\n/* 11:17 */ this.valor = valor;\n/* 12:18 */ this.etiqueta = etiqueta;\n/* 13:19 */ this.longitud = longitud;\n/* 14: */ }", "private Params()\n {\n }", "public ValorVariavel() {\r\n }", "CreationData creationData();", "public Producto() {\r\n }", "Param createParam();", "Param createParam();", "Param createParam();", "public Alojamiento() {\r\n\t}", "public CrearQuedadaVista() {\n }", "FromValues createFromValues();", "public DefaultExecuterParameters() {\n\t\tnumAuthorsAtStart = 5;\n\t\tnumPublicationsAtStart = 20;\n\t\tnumCreationAuthors = 0;\n\t\tnumCreationYears = 10;\n\n\t\tyearInformation = new DefaultYearInformation();\n\t\tpublicationParameters = new DefaultPublicationParameters();\n\t\tpublicationParameters.setYearInformation(yearInformation);\n\t\tauthorParameters = new DefaultAuthorParameters();\n\t\ttopicParameters = new DefaultTopicParameters();\n\t}", "private void init() {\n FieldWrapper id = new FieldWrapper();\n id.fieldDescription = new HashMap<String, Object>();\n id.fieldDescription.put(\"fullName\", \"Id\");\n id.fieldDescription.put(\"type\", \"Text\");\n\n FieldWrapper name = new FieldWrapper();\n name.fieldDescription = new HashMap<String, Object>();\n name.fieldDescription.put(\"fullName\", \"Name\");\n\n FieldWrapper createdBy = new FieldWrapper();\n createdBy.fieldDescription = new HashMap<String, Object>();\n createdBy.fieldDescription.put(\"fullName\", \"CreatedBy\");\n createdBy.fieldDescription.put(\"type\", \"Lookup\");\n\n FieldWrapper lastModifiedBy = new FieldWrapper();\n lastModifiedBy.fieldDescription = new HashMap<String, Object>();\n lastModifiedBy.fieldDescription.put(\"fullName\", \"LastModifiedBy\");\n lastModifiedBy.fieldDescription.put(\"type\", \"Lookup\");\n\n FieldWrapper owner = new FieldWrapper();\n owner.fieldDescription = new HashMap<String, Object>();\n owner.fieldDescription.put(\"fullName\", \"Owner\");\n owner.fieldDescription.put(\"type\", \"Lookup\");\n\n fieldDescribe = new HashMap<String, FieldWrapper>();\n\n fieldDescribe.put((String) id.fieldDescription.get(\"fullName\"), id);\n fieldDescribe.put((String) name.fieldDescription.get(\"fullName\"), name);\n fieldDescribe.put((String) createdBy.fieldDescription.get(\"fullName\"), createdBy);\n fieldDescribe.put((String) lastModifiedBy.fieldDescription.get(\"fullName\"), lastModifiedBy);\n fieldDescribe.put((String) owner.fieldDescription.get(\"fullName\"), owner);\n }", "public ModuleParams()\n\t{\n\t}", "public Employee(String nama, int usia) {\r\n // Constructor digunakan untuk inisialisasi value, yang di inisiate saat melakukan instantiation\r\n this.nama = nama;\r\n this.usia = usia;\r\n }", "public Valvula(){}", "public Plato(){\n\t\t\n\t}", "private ConfigurationObject createParam(int num, String type, String value) throws Exception {\r\n ConfigurationObject param = new DefaultConfigurationObject(\"param\" + num);\r\n param.setPropertyValue(PROPERTY_TYPE, type);\r\n param.setPropertyValue(PROPERTY_VALUE, value);\r\n\r\n return param;\r\n }", "public CreateData() {\n\t\t\n\t\t// TODO Auto-generated constructor stub\n\t}", "public ObjectFactory() {\n super(grammarInfo);\n }", "private void __sep__Constructors__() {}", "@Override\n\tpublic void initParameters() {\n\t\ttransferDbData = new TransferDbData();\n\t}", "private void crearObjetos() {\n // crea los botones\n this.btnOK = new CCButton(this.OK);\n this.btnOK.setActionCommand(\"ok\");\n this.btnOK.setToolTipText(\"Confirmar la Operación\");\n \n this.btnCancel = new CCButton(this.CANCEL);\n this.btnCancel.setActionCommand(\"cancel\");\n this.btnCancel.setToolTipText(\"Cancelar la Operación\");\n \n // Agregar los eventos a los botones\n this.btnOK.addActionListener(this);\n this.btnCancel.addActionListener(this);\n }", "protected void parametersInstantiation_EM() {\n }", "public static void initialisations() {\n\t\tit = 0;\r\n\t\tbc = 1;\r\n\r\n\t\t// pile des reprises pour compilation des branchements en avant\r\n\t\tpileRep = new TPileRep(); \r\n\t\t// programme objet = code Mapile de l'unite en cours de compilation\r\n\t\tpo = new ProgObjet();\r\n\t\t// COMPILATION SEPAREE: desripteur de l'unite en cours de compilation\r\n\t\tdesc = new Descripteur();\r\n\r\n\t\t// initialisation necessaire aux attributs lexicaux\r\n\t\tUtilLex.initialisation();\r\n\r\n\t\t// initialisation du type de l'expression courante\r\n\t\ttCour = NEUTRE;\r\n\r\n\t\t//Initialisation de la variable qui compte le nombre de param�tres de chaque proc�dure \r\n\t\tnbParamProc = 0;\r\n\r\n\t\t//Initialisation de la variable qui compte le nombre de variables d�clar�es\r\n\t\tnbVar++;\r\n\r\n\t\t//Initialisation vTmp\r\n\t\tvTmp = 0;\r\n\t\t\r\n\t\tdesc.setUnite(\"programme\");\r\n\t\t\r\n\t}", "public void create(){}", "public static void main(String[] args) {\n /**\n * Construction par defaut\n */\n Personne p = new Personne();\n System.out.println(p.toString());\n /**\n * Construction avec comme parametre nom et prenom\n */\n Personne p1 = new Personne(\"Thiaw\",\"Serigne Cheikh Mbacke\");\n System.out.println(p1.toString());\n /**\n * Construction avec comme parametre nom, prenom et age\n */\n Personne p2 = new Personne(\"Thiaw\",\"Serigne Cheikh Mbacke\",22);\n System.out.println(p2.toString());\n /**\n * Construction tous les parametres\n */\n Personne p3= new Personne(\"Thiaw\",\"Serigne Cheikh Mbacke\",22,Sexe.Masculin);\n System.out.println(p3.toString());\n }", "public Constructor(){\n\t\t\n\t}", "public Datos(){\n }", "OBJECT createOBJECT();", "public Persona(){\n \n }", "public Persona(){\n \n }", "public Persona() {\n\t}", "public UserParameter() {\n }", "public void initObjects() {\n /*\n using findViewById references to the todoTitleEdittext,todoDateEditText,todoDescriptionEditText,saveTodoButton to from layout\n */\n todoTitleEditText = (EditText) findViewById(R.id.editText_todo_title);\n todoDateEditText = (EditText) findViewById(R.id.editText_todo_date);\n todoDescriptionEditText = (EditText) findViewById(R.id.editText_todo_description);\n saveTodoButton = (Button) findViewById(R.id.button_save_todo);\n }", "public Vehiculo() {\r\n }", "@Override\n\tprotected void initParams() {\n\t\t\n\t}", "public void limpiarCampos() {\n\t\ttema = new Tema();\n\t\ttemaSeleccionado = new Tema();\n\t\tmultimedia = new Multimedia();\n\t}", "public Regla2(){ /*ESTE ES EL CONSTRUCTOR POR DEFECTO */\r\n\r\n /* TODAS LAS CLASES TIENE EL CONSTRUCTOR POR DEFECTO, A VECES SE CREAN AUTOMATICAMENTE, PERO\r\n PODEMOS CREARLOS NOSOTROS TAMBIEN SI NO SE HUBIERAN CREADO AUTOMATICAMENTE\r\n */\r\n \r\n }", "public Producto (){\n\n }", "public Kullanici() {}", "@Test\n\tpublic void testProfessorConstructor3Params(){\n\t\tString firstname = \"Dennis\";\n\t\tString lastName = \"Ritchie\";\n\t\tlong id = 0451;\n\t\tProfessor testProfessor = new Professor(firstname, lastName, id);\n\t\tAssert.assertEquals(\"Dennis\", testProfessor.getFirstName());\n\t\tAssert.assertEquals(\"Ritchie\", testProfessor.getLastName());\n\t\tAssert.assertEquals(Long.valueOf(0451), testProfessor.getId());\n\t}", "@Test\n\tpublic void testProfessorConstructor2params(){\n\t\tString firstname = \"Steven\";\n\t\tString lastName = \"Beaty\";\n\t\tProfessor testProfessor = new Professor(firstname, lastName);\n\t\tAssert.assertEquals(\"Steven\", testProfessor.getFirstName());\n\t\tAssert.assertEquals(\"Beaty\", testProfessor.getLastName());\n\t}", "private LocalParameters() {\n\n\t}", "public void inicializar();", "private void initObjects() {\n databaseHelper = new DatabaseHelper(activity);\n dbHelper = new DBHelper(activity);\n inputValidation = new InputValidation(activity);\n progress = new ProgressDialog(activity);\n user=new User();\n }", "public LightParameter()\r\n\t{\r\n\t}", "public Car () {\n\n Make = \"\";\n Model = \"\";\n Year = 2017;\n Price = 0.00;\n }", "public Empleado(String nombre, String departamento, String posicion, int salario)\n {\n // initialise instance variables\n this.nombre=nombre;\n this.departamento=departamento;\n this.posicion=posicion;\n this.salario=salario;\n \n }", "public ObjectFactory() {}", "public ObjectFactory() {}", "public ObjectFactory() {}", "public Perro() {\n// super(\"No define\", \"NN\", 0); en caso el constructor de animal tenga parametros\n this.pelaje = \"corto\";\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }", "public ObjectFactory() {\n }" ]
[ "0.6691094", "0.65038514", "0.6500137", "0.64892906", "0.647681", "0.63497096", "0.63317436", "0.6300511", "0.6288437", "0.62867844", "0.6286124", "0.6274608", "0.62738955", "0.6253334", "0.6188737", "0.61876935", "0.6159943", "0.6158305", "0.61524844", "0.61366314", "0.61364347", "0.61231124", "0.611199", "0.6085346", "0.608102", "0.60756147", "0.6075281", "0.6073674", "0.6066635", "0.60296404", "0.60255176", "0.60246885", "0.60202885", "0.6017477", "0.6013318", "0.600146", "0.59795874", "0.5978569", "0.5957268", "0.5956111", "0.59522486", "0.5949123", "0.594723", "0.59435284", "0.59435284", "0.59435284", "0.59390867", "0.593748", "0.59357566", "0.5925593", "0.59230196", "0.59228706", "0.59215266", "0.5919299", "0.5918604", "0.5917426", "0.5914862", "0.59091204", "0.5907911", "0.5906907", "0.5906578", "0.5899501", "0.58970916", "0.58966035", "0.5892858", "0.58866346", "0.58862126", "0.5885056", "0.58793104", "0.58793104", "0.587917", "0.58745027", "0.58727205", "0.5871008", "0.58678216", "0.58674073", "0.58555895", "0.58510077", "0.5850997", "0.5850803", "0.5839561", "0.583609", "0.583589", "0.58339286", "0.5833577", "0.5823697", "0.5820027", "0.5811831", "0.5811831", "0.5811831", "0.58091", "0.5801357", "0.5801357", "0.5801357", "0.5801357", "0.5801357", "0.5801357", "0.5801357", "0.5801357", "0.5801357", "0.5801357" ]
0.0
-1
Use this factory method to create a new instance of this fragment using the provided parameters.
public static CartFragment newInstance(String param1, String param2) { CartFragment fragment = new CartFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static FragmentTousWanted newInstance() {\n FragmentTousWanted fragment = new FragmentTousWanted();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "protected abstract Fragment createFragment();", "public void createFragment() {\n\n }", "@Override\n protected Fragment createFragment() {\n Intent intent = getIntent();\n\n long id = intent.getLongExtra(MovieDetailFragment.EXTRA_ID, -1);\n return MovieDetailFragment.newInstance(id);\n }", "public CuartoFragment() {\n }", "public StintFragment() {\n }", "public ExploreFragment() {\n\n }", "public RickAndMortyFragment() {\n }", "public FragmentMy() {\n }", "public LogFragment() {\n }", "public FeedFragment() {\n }", "public HistoryFragment() {\n }", "public HistoryFragment() {\n }", "public static MyFeedFragment newInstance() {\n return new MyFeedFragment();\n }", "public WkfFragment() {\n }", "public static ScheduleFragment newInstance() {\n ScheduleFragment fragment = new ScheduleFragment();\n Bundle args = new Bundle();\n //args.putString(ARG_PARAM1, param1);\n //args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public ProfileFragment(){}", "public WelcomeFragment() {}", "public static ForumFragment newInstance() {\n ForumFragment fragment = new ForumFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n\n return fragment;\n }", "public static NotificationFragment newInstance() {\n NotificationFragment fragment = new NotificationFragment();\n Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public progFragment() {\n }", "public HeaderFragment() {}", "public static RouteFragment newInstance() {\n RouteFragment fragment = new RouteFragment();\n Bundle args = new Bundle();\n //fragment.setArguments(args);\n return fragment;\n }", "public EmployeeFragment() {\n }", "public Fragment_Tutorial() {}", "public NewShopFragment() {\n }", "public FavoriteFragment() {\n }", "public static MyCourseFragment newInstance() {\n MyCourseFragment fragment = new MyCourseFragment();\r\n// fragment.setArguments(args);\r\n return fragment;\r\n }", "public static MessageFragment newInstance() {\n MessageFragment fragment = new MessageFragment();\n Bundle args = new Bundle();\n\n fragment.setArguments(args);\n return fragment;\n }", "public static ReservationFragment newInstance() {\n\n ReservationFragment _fragment = new ReservationFragment();\n// Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n// fragment.setArguments(args);\n return _fragment;\n }", "public CreateEventFragment() {\n // Required empty public constructor\n }", "public static RecipeListFragment newInstance() {\n RecipeListFragment fragment = new RecipeListFragment();\n// Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n// fragment.setArguments(args);\n return fragment;\n }", "public static Fragment newInstance() {\n\t\treturn new ScreenSlidePageFragment();\n\t}", "public NoteActivityFragment() {\n }", "public static WeekViewFragment newInstance(int param1, int param2) {\n WeekViewFragment fragment = new WeekViewFragment();\n //WeekViewFragment 객체 생성\n Bundle args = new Bundle();\n //Bundle 객체 생성\n args.putInt(ARG_PARAM1, param1);\n //ARG_PARAM1에 param1의 정수값 넣어서 args에 저장\n args.putInt(ARG_PARAM2, param2);\n //ARG_PARAM2에 param2의 정수값 넣어서 args에 저장\n fragment.setArguments(args);\n //args를 매개변수로 한 setArguments() 메소드 수행하여 fragment에 저장\n return fragment; //fragment 반환\n }", "public static Fragment0 newInstance(String param1, String param2) {\n Fragment0 fragment = new Fragment0();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static QueenBEmbassyF newInstance() {\n QueenBEmbassyF fragment = new QueenBEmbassyF();\n //the way to pass arguments between fragments\n Bundle args = new Bundle();\n\n fragment.setArguments(args);\n return fragment;\n }", "public static Fragment newInstance() {\n StatisticsFragment fragment = new StatisticsFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public EventHistoryFragment() {\n\t}", "public HomeFragment() {}", "public PeopleFragment() {\n // Required empty public constructor\n }", "public static FeedFragment newInstance() {\n FeedFragment fragment = new FeedFragment();\n return fragment;\n }", "public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public VantaggiFragment() {\n // Required empty public constructor\n }", "public AddressDetailFragment() {\n }", "public ArticleDetailFragment() { }", "public static DropboxMainFrag newInstance() {\n DropboxMainFrag fragment = new DropboxMainFrag();\n // set arguments in Bundle\n return fragment;\n }", "public RegisterFragment() {\n }", "public EmailFragment() {\n }", "public static CommentFragment newInstance() {\n CommentFragment fragment = new CommentFragment();\n\n return fragment;\n }", "public static FragmentComida newInstance(String param1) {\n FragmentComida fragment = new FragmentComida();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n return fragment;\n\n\n }", "public static ParqueosFragment newInstance() {\n ParqueosFragment fragment = new ParqueosFragment();\n return fragment;\n }", "public ForecastFragment() {\n }", "public FExDetailFragment() {\n \t}", "public static AddressFragment newInstance(String param1) {\n AddressFragment fragment = new AddressFragment();\n\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n\n return fragment;\n }", "public TripNoteFragment() {\n }", "public ItemFragment() {\n }", "public NoteListFragment() {\n }", "public CreatePatientFragment() {\n\n }", "public DisplayFragment() {\n\n }", "public static frag4_viewcompliment newInstance(String param1, String param2) {\r\n frag4_viewcompliment fragment = new frag4_viewcompliment();\r\n Bundle args = new Bundle();\r\n args.putString(ARG_PARAM1, param1);\r\n args.putString(ARG_PARAM2, param2);\r\n fragment.setArguments(args);\r\n return fragment;\r\n }", "public static fragment_profile newInstance(String param1, String param2) {\n fragment_profile fragment = new fragment_profile();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "@Override\n\tprotected Fragment createFragment() {\n\t\treturn new FormFragment();\n\t}", "public static MainFragment newInstance() {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public ProfileFragment() {\n\n }", "public BackEndFragment() {\n }", "public CustomerFragment() {\n }", "public static FriendsFragment newInstance(int sectionNumber) {\n \tFriendsFragment fragment = new FriendsFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_SECTION_NUMBER, sectionNumber);\n fragment.setArguments(args);\n return fragment;\n }", "public ArticleDetailFragment() {\n }", "public ArticleDetailFragment() {\n }", "public ArticleDetailFragment() {\n }", "public static Fragment newInstance() {\n return new SettingsFragment();\n }", "public SummaryFragment newInstance()\n {\n return new SummaryFragment();\n }", "public PeersFragment() {\n }", "public TagsFragment() {\n }", "public static ProfileFragment newInstance() {\n ProfileFragment fragment = new ProfileFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, \"\");\n args.putString(ARG_PARAM2, \"\");\n fragment.setArguments(args);\n return fragment;\n }", "public static FriendsFragment newInstance() {\n FriendsFragment fragment = new FriendsFragment();\n\n return fragment;\n }", "public HomeSectionFragment() {\n\t}", "public static FirstFragment newInstance(String text) {\n\n FirstFragment f = new FirstFragment();\n Bundle b = new Bundle();\n b.putString(\"msg\", text);\n\n f.setArguments(b);\n\n return f;\n }", "public PersonDetailFragment() {\r\n }", "public static LogFragment newInstance(Bundle params) {\n LogFragment fragment = new LogFragment();\n fragment.setArguments(params);\n return fragment;\n }", "public RegisterFragment() {\n // Required empty public constructor\n }", "public VehicleFragment() {\r\n }", "public static Fine newInstance(String param1, String param2) {\n Fine fragment = new Fine();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static FriendsFragment newInstance(String param1, String param2) {\n FriendsFragment fragment = new FriendsFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public static ChangesViewFragment newInstance() {\n\t\tChangesViewFragment fragment = new ChangesViewFragment();\n\t\tBundle args = new Bundle();\n\t\targs.putInt(HomeViewActivity.ARG_SECTION_NUMBER, 2);\n\t\tfragment.setArguments(args);\n\t\treturn fragment;\n\t}", "public static NoteFragment newInstance(String param1, String param2) {\n NoteFragment fragment = new NoteFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static MainFragment newInstance(Context context) {\n MainFragment fragment = new MainFragment();\n if(context != null)\n fragment.setVariables(context);\n return fragment;\n }", "@Override\n\tprotected Fragment createFragment() {\n\t\treturn new CrimeListFragment();\n\t}", "public static MoneyLogFragment newInstance() {\n MoneyLogFragment fragment = new MoneyLogFragment();\n return fragment;\n }", "public static ForecastFragment newInstance() {\n\n //Create new fragment\n ForecastFragment frag = new ForecastFragment();\n return(frag);\n }", "public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static MainFragment newInstance(String param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public static MyTaskFragment newInstance(String param1) {\n MyTaskFragment fragment = new MyTaskFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n fragment.setArguments(args);\n return fragment;\n }", "public static MyProfileFragment newInstance(String param1, String param2) {\n MyProfileFragment fragment = new MyProfileFragment();\n return fragment;\n }", "public static MainFragment newInstance(int param1, String param2) {\n MainFragment fragment = new MainFragment();\n Bundle args = new Bundle();\n args.putInt(ARG_PARAM1, param1);\n\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }", "public PlaylistFragment() {\n }", "public static HistoryFragment newInstance() {\n HistoryFragment fragment = new HistoryFragment();\n return fragment;\n }", "public static SurvivorIncidentFormFragment newInstance(String param1, String param2) {\n// SurvivorIncidentFormFragment fragment = new SurvivorIncidentFormFragment();\n// Bundle args = new Bundle();\n// args.putString(ARG_PARAM1, param1);\n// args.putString(ARG_PARAM2, param2);\n// fragment.setArguments(args);\n// return fragment;\n\n SurvivorIncidentFormFragment fragment = new SurvivorIncidentFormFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n\n\n }", "public static PersonalFragment newInstance(String param1, String param2) {\n PersonalFragment fragment = new PersonalFragment();\n Bundle args = new Bundle();\n args.putString(ARG_PARAM1, param1);\n args.putString(ARG_PARAM2, param2);\n fragment.setArguments(args);\n return fragment;\n }" ]
[ "0.7259329", "0.72331375", "0.71140355", "0.69909847", "0.69902235", "0.6834592", "0.683074", "0.68134046", "0.6801526", "0.6801054", "0.67653185", "0.6739714", "0.6739714", "0.6727412", "0.6717231", "0.6705855", "0.6692112", "0.6691661", "0.66869426", "0.66606814", "0.6646188", "0.66410166", "0.6640725", "0.6634425", "0.66188246", "0.66140765", "0.6608169", "0.66045964", "0.65977716", "0.6592119", "0.659137", "0.65910816", "0.65830594", "0.65786606", "0.6562876", "0.65607685", "0.6557126", "0.65513307", "0.65510213", "0.65431285", "0.6540448", "0.65336084", "0.6532555", "0.6528302", "0.6524409", "0.652328", "0.6523149", "0.6516528", "0.65049976", "0.6497274", "0.6497235", "0.64949715", "0.64944136", "0.6484968", "0.6484214", "0.64805835", "0.64784926", "0.64755154", "0.64710265", "0.6466466", "0.6457089", "0.645606", "0.6454554", "0.6452161", "0.64520335", "0.6450325", "0.64488834", "0.6446765", "0.64430225", "0.64430225", "0.64430225", "0.64420956", "0.6441306", "0.64411277", "0.6438451", "0.64345145", "0.64289486", "0.64287597", "0.6423755", "0.64193285", "0.6418699", "0.6414679", "0.6412867", "0.6402168", "0.6400724", "0.6395624", "0.6395109", "0.6391252", "0.63891554", "0.63835025", "0.63788056", "0.63751805", "0.63751805", "0.63751805", "0.6374796", "0.63653135", "0.6364529", "0.6360922", "0.63538784", "0.6351111", "0.635067" ]
0.0
-1
Create places for the petrinet
public void buildPointPetriNet(){ createPlace(pnet, "int", 3); createPlace(pnet, "Point", 2); createPlace(pnet, "MyPoint", 2); createPlace(pnet, "void", 2); // Create transitions for the petri-net pnet.createTransition("int<-getX(Point)"); pnet.createTransition("int<-getY(Point)"); pnet.createTransition("void<-setX(Point,int)"); pnet.createTransition("void<-setY(Point,int)"); pnet.createTransition("Point<-Point(void)"); pnet.createTransition("int<-getX(MyPoint)"); pnet.createTransition("int<-getY(MyPoint)"); pnet.createTransition("MyPoint<-MyPoint(int,int)"); // Create clone transitions for the petri-net pnet.createTransition("int<-clone(int)"); pnet.createTransition("Point<-clone(Point)"); pnet.createTransition("MyPoint<-clone(MyPoint)"); pnet.createTransition("void<-clone(void)"); // Create flows for the petri-net pnet.createFlow("Point","int<-getX(Point)",1); pnet.createFlow("int<-getX(Point)","int",1); pnet.createFlow("Point","int<-getY(Point)",1); pnet.createFlow("int<-getY(Point)","int",1); pnet.createFlow("Point","void<-setX(Point,int)",1); pnet.createFlow("int","void<-setX(Point,int)",1); pnet.createFlow("void<-setX(Point,int)","void",1); pnet.createFlow("Point","void<-setY(Point,int)",1); pnet.createFlow("int","void<-setY(Point,int)",1); pnet.createFlow("void<-setY(Point,int)","void",1); pnet.createFlow("void","Point<-Point(void)",1); pnet.createFlow("Point<-Point(void)","Point",1); pnet.createFlow("MyPoint","int<-getX(MyPoint)",1); pnet.createFlow("int<-getX(MyPoint)","int",1); pnet.createFlow("MyPoint","int<-getY(MyPoint)",1); pnet.createFlow("int<-getY(MyPoint)","int",1); pnet.createFlow("int","MyPoint<-MyPoint(int,int)",2); pnet.createFlow("MyPoint<-MyPoint(int,int)","MyPoint",1); // Create flows for the clone edges pnet.createFlow("int","int<-clone(int)",1); pnet.createFlow("int<-clone(int)","int",2); pnet.createFlow("Point","Point<-clone(Point)",1); pnet.createFlow("Point<-clone(Point)","Point",2); pnet.createFlow("MyPoint","MyPoint<-clone(MyPoint)",1); pnet.createFlow("MyPoint<-clone(MyPoint)","MyPoint",2); pnet.createFlow("void","void<-clone(void)",1); pnet.createFlow("void<-clone(void)","void",2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createLocations() {\n createAirports();\n createDocks();\n createEdges();\n createCrossroads();\n }", "private static void createPlace(Place place) {\r\n\t\tint tempInt = -1;\r\n\t\tContainerNII placeNii = new ContainerNII();\r\n\t\tGeoCoordinate position = new GeoCoordinate();\r\n\t\tMedia media = new Media();\r\n\t\t\r\n\t\tinsertNIIValues(placeNii, \"place\");\r\n\t\tplace.setNii(placeNii);\r\n\t\t\t\t\r\n\t\tif ((tempInt = insertInteger(\"place radius: \")) != -1)\r\n\t\t\t\tplace.setRadius(tempInt);\r\n\t\t\r\n\t\tinsertPosition(position);\r\n\t\tplace.setPosition(position);\r\n\t\t\r\n\t\tinsertMedia(media);\r\n\t\tplace.setMedia(media);\r\n\t}", "private void placesInit()\n {\n\n for(Map.Entry<String,Place> placeEntry: placesMap.entrySet())\n {\n addPlace(placeEntry.getKey(),placeEntry.getValue());\n }\n\n }", "public void setPlaces(int places) {\r\n this.places = places;\r\n }", "private void createCommunalPlaces(int populationSize) {\n int nHospitals = populationSize / PopulationParameters.get().buildingDistribution.populationToHospitalsRatio;\n int nSchools = populationSize / PopulationParameters.get().buildingDistribution.populationToSchoolsRatio;\n int nShops = populationSize / PopulationParameters.get().buildingDistribution.populationToShopsRatio;\n int nOffices = populationSize / PopulationParameters.get().buildingDistribution.populationToOfficesRatio;\n int nConstructionSites = populationSize / PopulationParameters.get().buildingDistribution.populationToConstructionSitesRatio;\n int nNurseries = populationSize / PopulationParameters.get().buildingDistribution.populationToNurseriesRatio;\n int nRestaurants = populationSize / PopulationParameters.get().buildingDistribution.populationToRestaurantsRatio;\n int nCareHomes = populationSize / PopulationParameters.get().buildingDistribution.populationToCareHomesRatio;\n\n createNHospitals(nHospitals);\n createNSchools(nSchools);\n createNShops(nShops);\n createNOffices(nOffices);\n createNConstructionSites(nConstructionSites);\n createNNurseries(nNurseries);\n createNRestaurants(nRestaurants);\n createNCareHomes(nCareHomes);\n\n LOGGER.info(\"Total number of communal places = {}\", getCommunalPlaces().size());\n }", "Parking createParking();", "@Override\n\t@Transactional\n\n\tpublic void initPlaces() {\n\t\tsalleRepository.findAll().forEach(salle->{\n\t\t\tfor(int i=0;i<salle.getNombrePlace();i++) {\n\t\t\tPlace place=new Place();\n\t\t\tplace.setNumero(i+1);\n\t\t\tplace.setSalle(salle);\n\t\t\tplaceRepository.save(place);\n\t\t\t}\n\t\t\t});\n\t}", "private void setUpPlaces(){\n db.collection(\"Tokens\").get()\n .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\n @Override\n public void onComplete(@NonNull Task<QuerySnapshot> task) {\n if (task.isSuccessful()) {\n for (QueryDocumentSnapshot document : task.getResult()) {\n String id = document.getId();\n String name = document.get(\"name\").toString();\n String desc = document.get(\"description\").toString();\n String[] latLng = document.get(\"latlng\").toString().split(\",\");\n double latitude = Double.parseDouble(latLng[0]);\n double longitude = Double.parseDouble(latLng[1]);\n places.add(new PlaceToken(id, name, desc, new LatLng(latitude, longitude)));\n }\n }\n }\n });\n }", "private static Place buildPlace(Place parent, BindingSet bindings) {\n Value placeValue = bindings.getValue(\"place\");\n Value featureValue = bindings.getValue(\"feature\");\n Value latitudeValue = bindings.getValue(\"latitude\");\n Value longitudeValue = bindings.getValue(\"longitude\");\n Value populationValue = bindings.getValue(\"population\");\n\n // extract GeoNames ID from GeoNames URL\n int geoID;\n try {\n String geoURL = placeValue.stringValue();\n int startPos = Place.URL_PREFIX.length();\n int endPos = geoURL.length() - Place.URL_SUFFIX.length();\n geoID = Integer.parseInt(geoURL.substring(startPos, endPos));\n } catch (NumberFormatException e) {\n LOGGER.warn(\"cannot extract ID from URL: \" + placeValue.stringValue(), e);\n return null; // cannot build place without ID\n }\n\n // parse coordinates if available\n double latitude = 0;\n double longitude = 0;\n try {\n latitude = Double.parseDouble(latitudeValue.stringValue());\n longitude = Double.parseDouble(longitudeValue.stringValue());\n } catch (NumberFormatException e) {\n LOGGER.warn(\"cannot parse coordinates\", e);\n }\n\n // parse population if available\n long population = 0;\n if (populationValue != null) {\n try {\n population = Long.parseLong(populationValue.stringValue());\n } catch (NumberFormatException e) {\n LOGGER.warn(\"cannot parse population\", e);\n }\n }\n\n // extract feature if available\n String feature = \"\";\n String featureURL = featureValue.stringValue();\n if (featureURL.startsWith(FEATURE_PREFIX)) feature = featureURL.substring(FEATURE_PREFIX.length());\n else LOGGER.warn(\"cannot extract feature from URL: \" + featureURL);\n\n // build place\n return new Place(geoID, latitude, longitude, population, feature, parent);\n }", "@Override\n\tprotected void placeStones(int numStones) {\n\n\t\tShape pitBounds = this.getShape();\n\t\tdouble pitW = pitBounds.getBounds().getWidth();\n\t\tdouble pitH = pitBounds.getBounds().getHeight();\n\t\t\n\n\t\tint stoneWidth = this.stoneIcon.getIconWidth();\n\t\tint stoneHeight = this.stoneIcon.getIconHeight();\n\n\t\t\t\n\t\tfor (int i = 0; i < numStones; i++){\n\t\t\tboolean locationFound = false;\n\t\t\tdo{\n\t\t\t\tfloat x = (float) Math.random();\n\t\t\t\tfloat y = (float) Math.random();\n\n\t\t\t\tx *= pitW;\n\t\t\t\ty *= pitH;\n\t\t\t\t\n\t\t\t\tEllipse2D.Float stoneBounds = new Ellipse2D.Float((float) (x+pitBounds.getBounds().getX()), (float) (y+pitBounds.getBounds().getY()), (float) (stoneWidth), (float) (stoneHeight));\n\n\t\t\t\tSystem.out.println(stoneBounds.getBounds());\n\t\t\t\tpitBounds.getBounds().setLocation(0, 0);\n\t\t\t\tArea pitArea = new Area(pitBounds);\n\t\t\t\tArea pendingStoneLocation = new Area(stoneBounds);\n\t\t\t\tArea intersectionArea = (Area) pitArea.clone();\n\t\t\t\tintersectionArea.add(pendingStoneLocation);\n\t\t\t\tintersectionArea.subtract(pitArea);\n\t\t\t\t\n\t\t\t\tif(intersectionArea.isEmpty() ){\n\t\t\t\t\tlocationFound = true;\n\t\t\t\t\tPoint2D p = new Point2D.Float((float) (x/pitW), (float) (y/pitH));\n\t\t\t\t\trelativeStoneLocations.add(p);\n\t\t\t\t\tSystem.out.println(p);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} while(!locationFound);\n\t\n\t\t}\n\t}", "public void buildLocations() {\n try (PreparedStatement prep = Database.getConnection().prepareStatement(\n \"CREATE TABLE IF NOT EXISTS locations (id TEXT, latitude\"\n + \" REAL, longitude REAL, name TEXT, PRIMARY KEY (id));\")) {\n prep.executeUpdate();\n } catch (final SQLException exc) {\n exc.printStackTrace();\n }\n }", "public void initSpawnPoints() {\n this.spawnPointList = new ArrayList<Node>();\n \n //Player spawn point location (5,0,47) In Ready Room\n this.addSpawnPoint(5.5f,0,47.5f,90, true);\n //Mob spawn point location (16,0,47) In Zone 2\n this.addSpawnPoint(16.5f, 0, 47.5f, 270, false); \n //Mob spawn point location (21,0,43)\n this.addSpawnPoint(21.5f, 0, 43.5f, 0,false);\n \n //Mob spawners in Zone 3\n this.addSpawnPoint(17.5f, 0, 37.5f, 90, false);\n this.addSpawnPoint(29.5f, 0, 37.5f, 90, false);\n this.addSpawnPoint(17.5f, 0, 29.5f, 270, false);\n \n //Mob spawners in Zone 4\n this.addSpawnPoint(12.5f, 0, 29.5f, 90, false);\n this.addSpawnPoint(6.5f, 0, 20.5f, 0, false);\n \n //Mob spawners in Zone 5\n this.addSpawnPoint(9.5f, 0, 6.5f, 0, false);\n this.addSpawnPoint(17.5f, 0, 6.5f, 0, false);\n this.addSpawnPoint(24.5f, 0, 8.5f, 270, false);\n this.addSpawnPoint(24.5f, 0, 11.5f, 270, false);\n this.addSpawnPoint(24.5f, 0, 14.5f, 270, false);\n }", "private void fillPlacesList() {\n // Set up an ArrayAdapter to convert likely places into TextViews to populate the ListView\n ArrayAdapter<String> placesAdapter =\n new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mLikelyPlaceNames);\n lstPlaces.setAdapter(placesAdapter);\n lstPlaces.setOnItemClickListener(listClickedHandler);\n }", "void newRoutePoint(RoutePointDTO routePointDTO, RouteDTO routeDTO, List<RoutePointDTO> points);", "private void CreaCoordinate(){\n \n this.punto = new Point(80, 80);\n \n }", "public void Add_place(String p)\n {\n\n place = new String(p);\n }", "void makePlacement(String placement) {\n\n // Task8 Do not clear the textField in order to place pieces step by step.\n // board.getChildren().clear();\n if (!StepsGame.isPlacementWellFormed(placement)) {\n throw new IllegalArgumentException(\"Hide board incorrect length: \" + placement);\n }\n Rectangle r = new Rectangle(BOARD_X, BOARD_Y, XSIDE*SQUARE_SIZE, YSIDE*SQUARE_SIZE);\n r.setFill(SUBBOARD_FILL);\n r.setStroke(SUBBOARD_STROKE);\n board.getChildren().add(r);\n String alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxy\";\n for (int i = 0; i<50; i++){\n double x = 1.0/3;\n Text t = new Text(BOARD_X + SQUARE_SIZE/3 + (i %XSIDE) * SQUARE_SIZE - 5, BOARD_Y + 2*SQUARE_SIZE/3 +(i / XSIDE) * SQUARE_SIZE + 10, alphabet.substring(i, i+1));\n t.setFont(new Font(20));\n t.setFill(Color.GREY);\n board.getChildren().add(t);\n }\n // Making board and adding the letters.\n\n\n String[] onepiece = placement.split(\"(?<=\\\\G...)\");\n String[] shape = new String[onepiece.length];\n String[] location = new String[onepiece.length];\n char[] loc = new char[onepiece.length];\n int[] lct = new int[onepiece.length];\n for (int i = 0; i<onepiece.length; i++){\n shape[i] = onepiece[i].substring(0, 2);\n location[i] = onepiece[i].substring(2, 3);\n loc[i] = location[i].charAt(0);\n if(loc[i] >= 'A' && loc[i] <= 'Y'){\n lct[i] = (int)loc[i] - 65;\n }else if(loc[i] >= 'a' && loc[i] <= 'y'){\n lct[i] = (int)loc[i] - 72;\n }\n //Split String into 3 letters and NUMBER the positions A-y into 0-49.\n\n\n String tile = shape[i];\n if (tile != \"\")\n board.getChildren().add(new Square(tile, lct[i]-11));\n }\n // Adding shapes\n board.toBack();\n\n // FIXME Task 4: implement the simple placement viewer\n }", "public Place(Scanner game) \r\n\t{\r\n\t\t// Initially adding exit and nowhere place to static collection.\r\n\t\tif ( firstTime)\r\n\t\t{\t\r\n\t\t\tif( flag ==0)\r\n\t\t\t{\r\n\t\t\t\tid = 1;\r\n\t\t\t\tname = \"Exit\";\r\n\t\t\t\tdescription = \" Exit\";\r\n\t\t\t\ttm.put(id, this);\r\n\t\t\t\tflag =1;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tid = 0;\r\n\t\t\t\tname = \"no where\";\r\n\t\t\t\tdescription = \"no where\";\r\n\t\t\t\ttm.put(id, this);\r\n\t\t\t\tfirstTime = false;\r\n\t\t\t}\r\n\t\t\r\n\t\t}\t\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Get a line and extend it as scanner input.. Parse and extract the data from scanner and initialze data fields of Place class.\r\n\t\t\tString line = null;\r\n\t\t\tline = Game.getCleanLine(game);\r\n\t\t\tScanner input = new Scanner (line);\r\n\t\t \r\n\t\t\t// Parsing the data and plugging into data fields of Place class.\r\n\t\t\tid = input.nextInt();\t\r\n\t\t\tString restOfLine = input.nextLine();\r\n\t\t\tname = restOfLine;\r\n\t\t\r\n\t\t\tint number = game.nextInt(); \r\n\r\n\t\t\tfor ( int i=0; i < number ; i ++)\r\n\t\t\t{\r\n\t\t\t\tline = Game.getCleanLine(game);\r\n\t\t\t\tScanner a = new Scanner (line);\r\n\t\t\t\tif (description == null)\r\n\t\t\t\t\tdescription =a.nextLine().concat(\"\\n\");\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tdescription = description.concat( a.nextLine().concat( \"\\n\"));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\t knownPlaces.add(this);\r\n\t\t\ttm.put(id, this);\t // Pushing this place to static collection of known places. ( Map).\r\n\t\t}\r\n\t\t\r\n\t\t//io2= new IO();\r\n\t}", "public void create(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\t\tthis.position[1][1] = 1;//putting player in this position\n\n\t\t//creating door in the rooms\n\t\tfor(int i = 0; i <this.Door.length; i++){\n\t\t\tfor(int p = 0; p < this.Door.length; p++){\n\t\t\t\tthis.Door[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Door[9][13] = 1;//puts the door here \n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 4; p < 7; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 4; p < 7; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 7; i< 8 ; i++){\n\t\t\tfor(int p = 2; p < 7; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 17; i< 18 ; i++){\n\t\t\tfor(int p = 13; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\t\n\t\t}\n\t\tfor(int i = 14; i< 15 ; i++){\n\t\t\tfor(int p = 13; p < 17; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\t\n\t\t}\t\n\t\tfor(int i = 11; i< 12 ; i++){\n\t\t\tfor(int p = 10; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 3; p < 6; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 16; i< 17 ; i++){\n\t\t\tfor(int p = 6; p < 13; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 12; i< 13 ; i++){\n\t\t\tfor(int p = 5; p < 10; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\t\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes \n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{ \n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}", "public Place() {\r\n\t\tthis.name = \"Unknown Place\";\r\n\t\tthis.data = new LinkedHashMap<Integer, Data>();\r\n\t\tthis.populateData();\r\n\t}", "private void addPlacesToWorld(ArrayList<Place> places, GameWorld world) {\n for (int i = 0; i < places.size(); i++) {\n world.addPlace(places.get(i));\n }\n }", "private void loadParkingLots() {\n ParkingLot metrotown = new ParkingLot(\"Metrotown\", 4);\n ParkingLot pacificcenter = new ParkingLot(\"PacificCenter\", 5);\n\n for (int i = 0; i < 3; i++) {\n metrotown.addParkingSpot(new ParkingSpot(\"M\" + i, \"medium\", 5));\n pacificcenter.addParkingSpot(new ParkingSpot(\"PC\" + i, \"large\", 4));\n }\n\n parkinglots.add(metrotown);\n parkinglots.add(pacificcenter);\n }", "public void assignPoint(Person person, String cityName) {\n List<Place> zipsForCity;\n\n if (cityName == null) {\n int size = zipCodes.keySet().size();\n cityName = (String) zipCodes.keySet().toArray()[person.randInt(size)];\n }\n zipsForCity = zipCodes.get(cityName);\n\n if (zipsForCity == null) {\n zipsForCity = zipCodes.get(cityName + \" Town\");\n }\n\n Place place;\n if (zipsForCity != null && zipsForCity.size() == 1) {\n place = zipsForCity.get(0);\n } else if (zipsForCity != null) {\n String personZip = (String) person.attributes.get(Person.ZIP);\n if (personZip == null) {\n place = zipsForCity.get(person.randInt(zipsForCity.size()));\n } else {\n place = zipsForCity.stream()\n .filter(c -> personZip.equals(c.postalCode))\n .findFirst()\n .orElse(zipsForCity.get(person.randInt(zipsForCity.size())));\n }\n } else {\n // The place doesn't exist for some reason, pick a random location...\n String key = (String) zipCodes.keySet().toArray()[person.randInt(zipCodes.keySet().size())];\n place = zipCodes.get(key).get(person.randInt(zipCodes.get(key).size()));\n }\n\n if (place != null) {\n // Get the coordinate of the city/town\n Point2D.Double coordinate = new Point2D.Double();\n coordinate.setLocation(place.coordinate);\n // And now perturbate it slightly.\n // Precision within 0.001 degree is more or less a neighborhood or street.\n // Precision within 0.01 is a village or town\n // Precision within 0.1 is a large city\n double dx = person.rand(-0.05, 0.05);\n double dy = person.rand(-0.05, 0.05);\n coordinate.setLocation(coordinate.x + dx, coordinate.y + dy);\n person.attributes.put(Person.COORDINATE, coordinate);\n }\n }", "private void createMaps() {\r\n\t\tint SIZE = 100;\r\n\t\tint x = 0, y = -1;\r\n\t\tfor (int i = 0; i < SIZE; i++) {\r\n\t\t\tif (i % 10 == 0) {\r\n\t\t\t\tx = 0;\r\n\t\t\t\ty = y + 1;\r\n\t\t\t}\r\n\t\t\tshipStateMap.put(new Point(x, y), 0);\r\n\t\t\tshipTypeMap.put(new Point(x, y), 0);\r\n\t\t\tx++;\r\n\t\t}\r\n\t}", "public void generate() {\n\t\tLocation location0 = new Location();\n\t\tlocation0.setAddress(\"Zhong Nan Hai\");\n\n\t\tlocation0.setLatitude(0.0);\n\t\tlocation0.setLongitude(0.0);\n;\n\t\tTestDriver.locationList.add(location0);\n\t\t\n\t\t\n\t\tLocation location1 = new Location();\n\t\tlocation1.setAddress(\"Tian An Men\");\n\t\tlocation1.setLatitude(0.1);\n\t\tlocation1.setLongitude(0.1);\n\n\t\tTestDriver.locationList.add(location1);\n\t\t\n\t\t\n\t\tLocation location2 = new Location();\n\t\tlocation2.setAddress(\"White House\");\n\t\tlocation2.setLatitude(100.21);\n\t\tlocation2.setLongitude(102.36);\n\t\tTestDriver.locationList.add(location2);\n\t}", "public PlaceList() {\n\t\tthis.places = new ArrayList<Place>();\n\t}", "void getPlacements() {\n previousTotalPlacement = 0;\n loadingPlacement = true;\n page_to_call_placement = 1;\n isFirstRunPlacement = true;\n isLastPageLoadedPlacement = false;\n lastPageFlagPlacement = 0;\n Log.d(\"PlacmentTesting\", \"previousTotalPlacement: \" + previousTotalPlacement);\n Log.d(\"PlacmentTesting\", \"page_to_call_placement: \" + page_to_call_placement);\n Log.d(\"PlacmentTesting\", \"lastPageFlagPlacement: \" + lastPageFlagPlacement);\n\n GetPlacementsByAdminMetadata();\n\n }", "public static void makeGrid (Species map[][], int numSheepStart, int numWolfStart, int numPlantStart, int sheepHealth, int plantHealth, int wolfHealth, int plantSpawnRate) {\n \n // Declare coordinates to randomly spawn species\n int y = 0;\n int x = 0;\n \n // Initialise plants\n Plant plant;\n \n // Spawn plants\n for (int i = 0; i < numPlantStart; i++) {\n \n // Choose random coordinates to spawn\n y = (int)(Math.random() * map[0].length); \n x = (int)(Math.random() * map.length);\n \n // Checks for an empty space\n if (map[y][x] == null) { \n \n // Choose a random plant (50% chance healthy, 25% poisonous or energizing)\n int plantChoice = (int) Math.ceil(Math.random() * 100);\n \n // Create the new plants\n if ((plantChoice <= 100) && (plantChoice >= 50)) {\n plant = new HealthyPlant(plantHealth, x, y, plantSpawnRate);\n } else if ((plantChoice < 50) && (plantChoice >= 25)) {\n plant = new EnergizingPlant(plantHealth, x, y, plantSpawnRate);\n } else {\n plant = new PoisonousPlant(plantHealth, x, y, plantSpawnRate);\n }\n \n // Set plant coordinates\n plant.setX(x);\n plant.setY(y);\n map[y][x] = plant;\n \n // No space\n } else { \n i -= 1;\n }\n \n }\n \n // Spawn sheep\n for (int i = 0; i < numSheepStart; i++) { \n \n // Choose random coordinates to spawn\n y = (int)(Math.random() * map[0].length); \n x = (int)(Math.random() * map.length);\n \n // Checks for an empty space\n if (map[y][x] == null) {\n \n // Create new sheep\n Sheep sheep = new Sheep(sheepHealth, x, y, 5); \n \n // Set sheep coordinates\n sheep.setX(x);\n sheep.setY(y);\n map[y][x] = sheep;\n \n // No space\n } else { \n i -= 1; \n }\n \n }\n \n // Spawn wolves\n for (int i = 0; i < numWolfStart; i++) { \n \n // Choose random coordinates to spawn\n y = (int)(Math.random() * map[0].length); \n x = (int)(Math.random() * map.length);\n \n // Checks for an empty space\n if (map[y][x] == null) { \n \n // Create new wolf\n Wolf wolf = new Wolf(wolfHealth, x, y, 5); \n \n // Set wolf coordinates\n wolf.setX(x);\n wolf.setY(y);\n map[y][x] = wolf; \n \n // No space\n } else { \n i -= 1; \n }\n }\n \n }", "private void prepare()\n {\n Block block = new Block(10);\n addObject(block,372,150);\n Wall wall = new Wall();\n addObject(wall,52,167);\n Wall wall2 = new Wall();\n addObject(wall2,160,167);\n Wall wall3 = new Wall();\n addObject(wall3,550,167);\n Wall wall4 = new Wall();\n addObject(wall4,650,167);\n Wall wall5 = new Wall();\n addObject(wall5,750,167);\n block.setLocation(306,171);\n Robot robot = new Robot();\n addObject(robot,48,51);\n Pizza pizza = new Pizza();\n addObject(pizza,550,60);\n Pizza pizza2 = new Pizza();\n addObject(pizza2,727,53);\n Pizza pizza3 = new Pizza();\n addObject(pizza3,364,303);\n Pizza pizza4 = new Pizza();\n addObject(pizza4,224,400);\n Pizza pizza5 = new Pizza();\n addObject(pizza5,622,395);\n ScorePanel scorePanel = new ScorePanel();\n addObject(scorePanel,106,525);\n Home home = new Home();\n addObject(home,717,521);\n\n block.setLocation(344,173);\n pizza3.setLocation(394,297);\n Pizza pizza6 = new Pizza();\n addObject(pizza6,711,265);\n Pizza pizza7 = new Pizza();\n addObject(pizza7,68,276);\n\n }", "public Strategy(BoardPanel p, Board b, ArrayList<Place> places) {\n\t\tthis.p = p;\n\t\tthis.b = b;\n\t\tthis.places = places;\n\t\trand = new Random();\n\t}", "void setPlaces(Place[] places);", "private void placeRooms() {\n if (roomList.size() == 0) {\n throw new IllegalArgumentException(\"roomList must have rooms\");\n }\n // This is a nice cool square\n map = new int[MAP_SIZE][MAP_SIZE];\n\n for (Room room : roomList) {\n assignPosition(room);\n }\n }", "public ShortestPathsCalculator(int cityID, ArrayList<Place> places) throws IOException{\n\t\t\tthis.pcc = new HashMap<Place, HashMap<Place,ITIN>>();\n\t\t\t// Chargement des PCC\n\t\t\tBufferedReader input = new BufferedReader(new FileReader(Emplacements.FICHIER_PCC(cityID)));\n\t\t\tinput.readLine();\n\t\t\tint nbPoints = Integer.parseInt(input.readLine());\n\t\t\tint i = 1;\n\t\t\twhile(i<=nbPoints){\n\t\t\t\tinput.readLine();\n\t\t\t\tHashMap<Place,ITIN> plusCourtsChemins = new HashMap<Place, ITIN>();\n\t\t\t\tint fromX = Integer.parseInt(input.readLine());\n\t\t\t\tint fromY = Integer.parseInt(input.readLine());\n\t\t\t\tPlace fromTmp = new Place(new Point(fromX,fromY),-1);\n\t\t\t\tPlace from = places.get(places.indexOf(fromTmp));\n\t\t\t\tint j = 1;\n\t\t\t\twhile(j<=nbPoints-1){\n\t\t\t\t\tinput.readLine();\n\t\t\t\t\tint toX = Integer.parseInt(input.readLine());\n\t\t\t\t\tint toY = Integer.parseInt(input.readLine());\n\t\t\t\t\tPlace toTmp = new Place(new Point(toX,toY),-1);\n\t\t\t\t\tPlace to = places.get(places.indexOf(toTmp));\n\t\t\t\t\tITIN chem = new ITIN(from, NiveauTemps.TEMPS_MOY, to, NiveauTemps.TEMPS_MOY);\n\t\t\t\t\tinput.readLine();\n\t\t\t\t\tint nbEtapes = Integer.parseInt(input.readLine());\n\t\t\t\t\tSystem.out.println(nbEtapes);\n\t\t\t\t\tint k = 1;\n\t\t\t\t\twhile(k<=nbEtapes){\n\t\t\t\t\t\tinput.readLine();\n\t\t\t\t\t\tint byX = Integer.parseInt(input.readLine());\n\t\t\t\t\t\tSystem.out.println(byX);\n\t\t\t\t\t\tint byY = Integer.parseInt(input.readLine());\n\t\t\t\t\t\tSystem.out.println(byY);\n\t\t\t\t\t\tPlace byTmp = new Place(new Point(byX,byY),-1);\n\t\t\t\t\t\tSystem.out.println(byTmp);\n\t\t\t\t\t\tSystem.out.println(places);\n\t\t\t\t\t\tPlace by = places.get(places.indexOf(byTmp));\n\t\t\t\t\t\tchem.addEtape(by, NiveauTemps.PAS_DE_VISITE);\n\t\t\t\t\t\tk++;\n\t\t\t\t\t}\n\t\t\t\t\tplusCourtsChemins.put(to, chem);\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t\tpcc.put(from, plusCourtsChemins);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}", "public Place(int x, int y, TYPE typeDiskHere){\n this.x=x;\n this.y=y;\n isFull=true;\n type=typeDiskHere;\n }", "public Trip createTrip() {\n\n\t\t//Trip trip = new Trip();\n\n\t\tEditText name = (EditText) findViewById(R.id.trip_name);\n\t\tString trip_name = name.getText().toString();\n\t\ttrip.setName(trip_name);\n\n\t\tEditText location = (EditText) findViewById(R.id.location);\n\t\tString trip_location = location.getText().toString();\n\t\ttrip.setLocation(trip_location);\n\n\t\tEditText date = (EditText) findViewById(R.id.date);\n\t\tString trip_date = date.getText().toString();\n\t\ttrip.setTravelDate(trip_date);\n\n\t\tEditText time = (EditText) findViewById(R.id.time);\n\t\tString trip_time = time.getText().toString();\n\t\ttrip.setTravelTime(trip_time);\n\n\t\tEditText meeting_spot = (EditText) findViewById(R.id.meeting_spot);\n\t\tString meet_spot = meeting_spot.getText().toString();\n\t\ttrip.setMeetSpot(meet_spot);\n\n\t\t/*EditText participants = (EditText) findViewById(R.id.participants);\n\t\tString trip_participants = participants.getText().toString();\n\t\tString[] friendsArray;\n\t\tint numOfParticipants = 0;\n\t\tArrayList<Person> friends = new ArrayList<Person>();\n\t\tif(trip_participants.equals(\"\")) {\n\t\t\tfriends = null;\n\t\t} else {\n\t\t\tfriendsArray = trip_participants.split(\",\");\n\t\t\tint arrayLength = friendsArray.length;\n\t\t\tfor(int i=0; i<arrayLength; i++) {\n\t\t\t\tPerson person = new Person(friendsArray[i].trim());\n\t\t\t\tfriends.add(person);\n\t\t\t\tnumOfParticipants++;\n\t\t\t}\n\t\t}*/\n\n\t\t/*Trip trip = new Trip(trip_name, 1001, numOfParticipants, trip_location, trip_time, trip_date,\n\t\t\t\tfriends, meet_spot);*/\n\n\t\ttrip.setPersons(persons);\n\t\treturn trip;\n\t}", "private void addSpawnsToList()\n\t{\n\t\tSPAWNS.put(1, new ESSpawn(1, GraciaSeeds.DESTRUCTION, new Location(-245790,220320,-12104), new int[]{TEMPORARY_TELEPORTER}));\n\t\tSPAWNS.put(2, new ESSpawn(2, GraciaSeeds.DESTRUCTION, new Location(-249770,207300,-11952), new int[]{TEMPORARY_TELEPORTER}));\n\t\t//Energy Seeds\n\t\tSPAWNS.put(3, new ESSpawn(3, GraciaSeeds.DESTRUCTION, new Location(-248360,219272,-12448), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(4, new ESSpawn(4, GraciaSeeds.DESTRUCTION, new Location(-249448,219256,-12448), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(5, new ESSpawn(5, GraciaSeeds.DESTRUCTION, new Location(-249432,220872,-12448), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(6, new ESSpawn(6, GraciaSeeds.DESTRUCTION, new Location(-248360,220888,-12448), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(7, new ESSpawn(7, GraciaSeeds.DESTRUCTION, new Location(-250088,219256,-12448), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(8, new ESSpawn(8, GraciaSeeds.DESTRUCTION, new Location(-250600,219272,-12448), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(9, new ESSpawn(9, GraciaSeeds.DESTRUCTION, new Location(-250584,220904,-12448), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(10, new ESSpawn(10, GraciaSeeds.DESTRUCTION, new Location(-250072,220888,-12448), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(11, new ESSpawn(11, GraciaSeeds.DESTRUCTION, new Location(-253096,217704,-12296), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(12, new ESSpawn(12, GraciaSeeds.DESTRUCTION, new Location(-253112,217048,-12288), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(13, new ESSpawn(13, GraciaSeeds.DESTRUCTION, new Location(-251448,217032,-12288), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(14, new ESSpawn(14, GraciaSeeds.DESTRUCTION, new Location(-251416,217672,-12296), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(15, new ESSpawn(15, GraciaSeeds.DESTRUCTION, new Location(-251416,217672,-12296), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(16, new ESSpawn(16, GraciaSeeds.DESTRUCTION, new Location(-251416,217016,-12280), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(17, new ESSpawn(17, GraciaSeeds.DESTRUCTION, new Location(-249752,217016,-12280), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(18, new ESSpawn(18, GraciaSeeds.DESTRUCTION, new Location(-249736,217688,-12296), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(19, new ESSpawn(19, GraciaSeeds.DESTRUCTION, new Location(-252472,215208,-12120), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(20, new ESSpawn(20, GraciaSeeds.DESTRUCTION, new Location(-252552,216760,-12248), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(21, new ESSpawn(21, GraciaSeeds.DESTRUCTION, new Location(-253160,216744,-12248), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(22, new ESSpawn(22, GraciaSeeds.DESTRUCTION, new Location(-253128,215160,-12096), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(23, new ESSpawn(23, GraciaSeeds.DESTRUCTION, new Location(-250392,215208,-12120), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(24, new ESSpawn(24, GraciaSeeds.DESTRUCTION, new Location(-250264,216744,-12248), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(25, new ESSpawn(25, GraciaSeeds.DESTRUCTION, new Location(-249720,216744,-12248), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(26, new ESSpawn(26, GraciaSeeds.DESTRUCTION, new Location(-249752,215128,-12096), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(27, new ESSpawn(27, GraciaSeeds.DESTRUCTION, new Location(-250280,216760,-12248), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(28, new ESSpawn(28, GraciaSeeds.DESTRUCTION, new Location(-250344,216152,-12248), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(29, new ESSpawn(29, GraciaSeeds.DESTRUCTION, new Location(-252504,216152,-12248), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(30, new ESSpawn(30, GraciaSeeds.DESTRUCTION, new Location(-252520,216792,-12248), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(31, new ESSpawn(31, GraciaSeeds.DESTRUCTION, new Location(-242520,217272,-12384), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(32, new ESSpawn(32, GraciaSeeds.DESTRUCTION, new Location(-241432,217288,-12384), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(33, new ESSpawn(33, GraciaSeeds.DESTRUCTION, new Location(-241432,218936,-12384), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(34, new ESSpawn(34, GraciaSeeds.DESTRUCTION, new Location(-242536,218936,-12384), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(35, new ESSpawn(35, GraciaSeeds.DESTRUCTION, new Location(-240808,217272,-12384), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(36, new ESSpawn(36, GraciaSeeds.DESTRUCTION, new Location(-240280,217272,-12384), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(37, new ESSpawn(37, GraciaSeeds.DESTRUCTION, new Location(-240280,218952,-12384), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(38, new ESSpawn(38, GraciaSeeds.DESTRUCTION, new Location(-240792,218936,-12384), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(39, new ESSpawn(39, GraciaSeeds.DESTRUCTION, new Location(-239576,217240,-12640), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(40, new ESSpawn(40, GraciaSeeds.DESTRUCTION, new Location(-239560,216168,-12640), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(41, new ESSpawn(41, GraciaSeeds.DESTRUCTION, new Location(-237896,216152,-12640), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(42, new ESSpawn(42, GraciaSeeds.DESTRUCTION, new Location(-237912,217256,-12640), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(43, new ESSpawn(43, GraciaSeeds.DESTRUCTION, new Location(-237896,215528,-12640), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(44, new ESSpawn(44, GraciaSeeds.DESTRUCTION, new Location(-239560,215528,-12640), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(45, new ESSpawn(45, GraciaSeeds.DESTRUCTION, new Location(-239560,214984,-12640), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(46, new ESSpawn(46, GraciaSeeds.DESTRUCTION, new Location(-237896,215000,-12640), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(47, new ESSpawn(47, GraciaSeeds.DESTRUCTION, new Location(-237896,213640,-12768), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(48, new ESSpawn(48, GraciaSeeds.DESTRUCTION, new Location(-239560,213640,-12768), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(49, new ESSpawn(49, GraciaSeeds.DESTRUCTION, new Location(-239544,212552,-12768), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(50, new ESSpawn(50, GraciaSeeds.DESTRUCTION, new Location(-237912,212552,-12768), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(51, new ESSpawn(51, GraciaSeeds.DESTRUCTION, new Location(-237912,211912,-12768), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(52, new ESSpawn(52, GraciaSeeds.DESTRUCTION, new Location(-237912,211400,-12768), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(53, new ESSpawn(53, GraciaSeeds.DESTRUCTION, new Location(-239560,211400,-12768), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(54, new ESSpawn(54, GraciaSeeds.DESTRUCTION, new Location(-239560,211912,-12768), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(55, new ESSpawn(55, GraciaSeeds.DESTRUCTION, new Location(-241960,214536,-12512), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(56, new ESSpawn(56, GraciaSeeds.DESTRUCTION, new Location(-241976,213448,-12512), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(57, new ESSpawn(57, GraciaSeeds.DESTRUCTION, new Location(-243624,213448,-12512), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(58, new ESSpawn(58, GraciaSeeds.DESTRUCTION, new Location(-243624,214520,-12512), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(59, new ESSpawn(59, GraciaSeeds.DESTRUCTION, new Location(-241976,212808,-12504), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(60, new ESSpawn(60, GraciaSeeds.DESTRUCTION, new Location(-241960,212280,-12504), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(61, new ESSpawn(61, GraciaSeeds.DESTRUCTION, new Location(-243624,212264,-12504), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(62, new ESSpawn(62, GraciaSeeds.DESTRUCTION, new Location(-243624,212792,-12504), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(63, new ESSpawn(63, GraciaSeeds.DESTRUCTION, new Location(-243640,210920,-12640), new int[]{ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(64, new ESSpawn(64, GraciaSeeds.DESTRUCTION, new Location(-243624,209832,-12640), new int[]{ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(65, new ESSpawn(65, GraciaSeeds.DESTRUCTION, new Location(-241976,209832,-12640), new int[]{ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(66, new ESSpawn(66, GraciaSeeds.DESTRUCTION, new Location(-241976,210920,-12640), new int[]{ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(67, new ESSpawn(67, GraciaSeeds.DESTRUCTION, new Location(-241976,209192,-12640), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(68, new ESSpawn(68, GraciaSeeds.DESTRUCTION, new Location(-241976,208664,-12640), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(69, new ESSpawn(69, GraciaSeeds.DESTRUCTION, new Location(-243624,208664,-12640), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(70, new ESSpawn(70, GraciaSeeds.DESTRUCTION, new Location(-243624,209192,-12640), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(71, new ESSpawn(71, GraciaSeeds.DESTRUCTION, new Location(-241256,208664,-12896), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(72, new ESSpawn(72, GraciaSeeds.DESTRUCTION, new Location(-240168,208648,-12896), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(73, new ESSpawn(73, GraciaSeeds.DESTRUCTION, new Location(-240168,207000,-12896), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(74, new ESSpawn(74, GraciaSeeds.DESTRUCTION, new Location(-241256,207000,-12896), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(75, new ESSpawn(75, GraciaSeeds.DESTRUCTION, new Location(-239528,208648,-12896), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(76, new ESSpawn(76, GraciaSeeds.DESTRUCTION, new Location(-238984,208664,-12896), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(77, new ESSpawn(77, GraciaSeeds.DESTRUCTION, new Location(-239000,207000,-12896), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(78, new ESSpawn(78, GraciaSeeds.DESTRUCTION, new Location(-239512,207000,-12896), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE}));\n\t\tSPAWNS.put(79, new ESSpawn(79, GraciaSeeds.DESTRUCTION, new Location(-245064,213144,-12384), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(80, new ESSpawn(80, GraciaSeeds.DESTRUCTION, new Location(-245064,212072,-12384), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(81, new ESSpawn(81, GraciaSeeds.DESTRUCTION, new Location(-246696,212072,-12384), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(82, new ESSpawn(82, GraciaSeeds.DESTRUCTION, new Location(-246696,213160,-12384), new int[]{ENERGY_SEED_WIND,ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(83, new ESSpawn(83, GraciaSeeds.DESTRUCTION, new Location(-245064,211416,-12384), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(84, new ESSpawn(84, GraciaSeeds.DESTRUCTION, new Location(-245048,210904,-12384), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(85, new ESSpawn(85, GraciaSeeds.DESTRUCTION, new Location(-246712,210888,-12384), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(86, new ESSpawn(86, GraciaSeeds.DESTRUCTION, new Location(-246712,211416,-12384), new int[]{ENERGY_SEED_DARKNESS,ENERGY_SEED_WATER}));\n\t\tSPAWNS.put(87, new ESSpawn(87, GraciaSeeds.DESTRUCTION, new Location(-245048,209544,-12512), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(88, new ESSpawn(88, GraciaSeeds.DESTRUCTION, new Location(-245064,208456,-12512), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(89, new ESSpawn(89, GraciaSeeds.DESTRUCTION, new Location(-246696,208456,-12512), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(90, new ESSpawn(90, GraciaSeeds.DESTRUCTION, new Location(-246712,209544,-12512), new int[]{ENERGY_SEED_FIRE,ENERGY_SEED_WIND,ENERGY_SEED_EARTH}));\n\t\tSPAWNS.put(91, new ESSpawn(91, GraciaSeeds.DESTRUCTION, new Location(-245048,207816,-12512), new int[]{ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(92, new ESSpawn(92, GraciaSeeds.DESTRUCTION, new Location(-245048,207288,-12512), new int[]{ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(93, new ESSpawn(93, GraciaSeeds.DESTRUCTION, new Location(-246696,207304,-12512), new int[]{ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(94, new ESSpawn(94, GraciaSeeds.DESTRUCTION, new Location(-246712,207816,-12512), new int[]{ENERGY_SEED_DIVINITY,ENERGY_SEED_DARKNESS}));\n\t\tSPAWNS.put(95, new ESSpawn(95, GraciaSeeds.DESTRUCTION, new Location(-244328,207272,-12768), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(96, new ESSpawn(96, GraciaSeeds.DESTRUCTION, new Location(-243256,207256,-12768), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(97, new ESSpawn(97, GraciaSeeds.DESTRUCTION, new Location(-243256,205624,-12768), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(98, new ESSpawn(98, GraciaSeeds.DESTRUCTION, new Location(-244328,205608,-12768), new int[]{ENERGY_SEED_WATER,ENERGY_SEED_FIRE,ENERGY_SEED_WIND}));\n\t\tSPAWNS.put(99, new ESSpawn(99, GraciaSeeds.DESTRUCTION, new Location(-242616,207272,-12768), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(100, new ESSpawn(100, GraciaSeeds.DESTRUCTION, new Location(-242104,207272,-12768), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(101, new ESSpawn(101, GraciaSeeds.DESTRUCTION, new Location(-242088,205624,-12768), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\tSPAWNS.put(102, new ESSpawn(102, GraciaSeeds.DESTRUCTION, new Location(-242600,205608,-12768), new int[]{ENERGY_SEED_EARTH,ENERGY_SEED_DIVINITY}));\n\t\t// Seed of Annihilation\n\t\tSPAWNS.put(103, new ESSpawn(103, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184519,183007,-10456), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(104, new ESSpawn(104, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184873,181445,-10488), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(105, new ESSpawn(105, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184009,180962,-10488), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(106, new ESSpawn(106, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185321,181641,-10448), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(107, new ESSpawn(107, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184035,182775,-10512), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(108, new ESSpawn(108, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185433,181935,-10424), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(109, new ESSpawn(109, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183309,183007,-10560), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(110, new ESSpawn(110, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184929,181886,-10488), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(111, new ESSpawn(111, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184009,180392,-10424), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(112, new ESSpawn(112, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183793,183239,-10488), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(113, new ESSpawn(113, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184245,180848,-10464), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(114, new ESSpawn(114, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-182704,183761,-10528), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(115, new ESSpawn(115, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184705,181886,-10504), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(116, new ESSpawn(116, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184304,181076,-10488), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(117, new ESSpawn(117, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183596,180430,-10424), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(118, new ESSpawn(118, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184422,181038,-10480), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(119, new ESSpawn(119, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184929,181543,-10496), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(120, new ESSpawn(120, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184398,182891,-10472), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(121, new ESSpawn(121, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177606,182848,-10584), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(122, new ESSpawn(122, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178104,183224,-10560), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(123, new ESSpawn(123, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177274,182284,-10600), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(124, new ESSpawn(124, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177772,183224,-10560), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(125, new ESSpawn(125, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181532,180364,-10504), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(126, new ESSpawn(126, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181802,180276,-10496), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(127, new ESSpawn(127, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178429,180444,-10512), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(128, new ESSpawn(128, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177606,182190,-10600), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(129, new ESSpawn(129, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-177357,181908,-10576), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(130, new ESSpawn(130, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178747,179534,-10408), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(131, new ESSpawn(131, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178429,179534,-10392), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(132, new ESSpawn(132, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178853,180094,-10472), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(133, new ESSpawn(133, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181937,179660,-10416), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(134, new ESSpawn(134, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-180992,179572,-10416), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(135, new ESSpawn(135, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185552,179252,-10368), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(136, new ESSpawn(136, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184572,178913,-10400), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(137, new ESSpawn(137, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184768,178348,-10312), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(138, new ESSpawn(138, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-184572,178574,-10352), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(139, new ESSpawn(139, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185062,178913,-10384), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(140, new ESSpawn(140, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181397,179484,-10416), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(141, new ESSpawn(141, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-181667,179044,-10408), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(142, new ESSpawn(142, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-185258,177896,-10240), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(143, new ESSpawn(143, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183506,176570,-10280), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(144, new ESSpawn(144, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183719,176804,-10240), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(145, new ESSpawn(145, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183648,177116,-10240), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(146, new ESSpawn(146, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183932,176492,-10240), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(147, new ESSpawn(147, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183861,176570,-10240), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(148, new ESSpawn(148, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-183790,175946,-10240), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(149, new ESSpawn(149, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178641,179604,-10416), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(150, new ESSpawn(150, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-178959,179814,-10432), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(151, new ESSpawn(151, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-176367,178456,-10376), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(152, new ESSpawn(152, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-175845,177172,-10264), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(153, new ESSpawn(153, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-175323,177600,-10248), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(154, new ESSpawn(154, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-174975,177172,-10216), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(155, new ESSpawn(155, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-176019,178242,-10352), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(156, new ESSpawn(156, GraciaSeeds.ANNIHILATION_BISTAKON, new Location(-174801,178456,-10264), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(157, new ESSpawn(157, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185648,183384,-15680), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(158, new ESSpawn(158, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186740,180908,-15528), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(159, new ESSpawn(159, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185297,184658,-15680), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(160, new ESSpawn(160, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185697,181601,-15488), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(161, new ESSpawn(161, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186684,182744,-15536), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(162, new ESSpawn(162, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184908,183384,-15616), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(163, new ESSpawn(163, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184994,185572,-15784), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(164, new ESSpawn(164, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185796,182616,-15608), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(165, new ESSpawn(165, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184970,184385,-15648), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(166, new ESSpawn(166, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185995,180809,-15512), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(167, new ESSpawn(167, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185352,182872,-15632), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(168, new ESSpawn(168, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185624,184294,-15680), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(169, new ESSpawn(169, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184486,185774,-15816), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(170, new ESSpawn(170, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186496,184112,-15680), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(171, new ESSpawn(171, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184232,185976,-15816), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(172, new ESSpawn(172, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184994,185673,-15792), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(173, new ESSpawn(173, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185733,184203,-15680), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(174, new ESSpawn(174, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185079,184294,-15680), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(175, new ESSpawn(175, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184803,180710,-15528), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(176, new ESSpawn(176, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186293,180413,-15528), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(177, new ESSpawn(177, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185352,182936,-15632), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(178, new ESSpawn(178, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184356,180611,-15496), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(179, new ESSpawn(179, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185375,186784,-15816), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(180, new ESSpawn(180, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184867,186784,-15816), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(181, new ESSpawn(181, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180553,180454,-15152), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(182, new ESSpawn(182, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180422,180454,-15152), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(183, new ESSpawn(183, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-181863,181138,-15120), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(184, new ESSpawn(184, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-181732,180454,-15152), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(185, new ESSpawn(185, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180684,180397,-15152), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(186, new ESSpawn(186, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-182256,180682,-15112), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(187, new ESSpawn(187, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185492,179492,-15392), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(188, new ESSpawn(188, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185894,178538,-15336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(189, new ESSpawn(189, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-186028,178856,-15336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(190, new ESSpawn(190, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185224,179068,-15336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(191, new ESSpawn(191, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185492,178538,-15336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(192, new ESSpawn(192, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185894,178538,-15336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(193, new ESSpawn(193, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180619,178855,-15152), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(194, new ESSpawn(194, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180255,177892,-15152), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(195, new ESSpawn(195, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-185804,176472,-15336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(196, new ESSpawn(196, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184580,176370,-15320), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(197, new ESSpawn(197, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184308,176166,-15320), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(198, new ESSpawn(198, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-183764,177186,-15304), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(199, new ESSpawn(199, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180801,177571,-15144), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(200, new ESSpawn(200, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184716,176064,-15320), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(201, new ESSpawn(201, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-184444,175452,-15296), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(202, new ESSpawn(202, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180164,177464,-15152), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(203, new ESSpawn(203, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-180164,178213,-15152), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(204, new ESSpawn(204, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-179982,178320,-15152), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(205, new ESSpawn(205, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176925,177757,-15824), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(206, new ESSpawn(206, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176164,179282,-15720), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(207, new ESSpawn(207, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175692,177613,-15800), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(208, new ESSpawn(208, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175418,178117,-15824), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(209, new ESSpawn(209, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176103,177829,-15824), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(210, new ESSpawn(210, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175966,177325,-15792), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(211, new ESSpawn(211, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174778,179732,-15664), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(212, new ESSpawn(212, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175692,178261,-15824), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(213, new ESSpawn(213, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-176038,179192,-15736), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(214, new ESSpawn(214, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175660,179462,-15680), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(215, new ESSpawn(215, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175912,179732,-15664), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(216, new ESSpawn(216, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175156,180182,-15680), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(217, new ESSpawn(217, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174240,182059,-15664), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(218, new ESSpawn(218, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-175590,181478,-15640), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(219, new ESSpawn(219, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174510,181561,-15616), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(220, new ESSpawn(220, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174240,182391,-15688), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(221, new ESSpawn(221, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174105,182806,-15672), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(222, new ESSpawn(222, GraciaSeeds.ANNIHILATION_REPTILIKON, new Location(-174645,182806,-15712), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(223, new ESSpawn(223, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-214962,182403,-10992), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(224, new ESSpawn(224, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-215019,182493,-11000), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(225, new ESSpawn(225, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-211374,180793,-11672), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(226, new ESSpawn(226, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-211198,180661,-11680), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(227, new ESSpawn(227, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-213097,178936,-12720), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(228, new ESSpawn(228, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-213517,178936,-12712), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(229, new ESSpawn(229, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-214105,179191,-12720), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(230, new ESSpawn(230, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-213769,179446,-12720), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(231, new ESSpawn(231, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-214021,179344,-12720), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(232, new ESSpawn(232, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-210582,180595,-11672), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(233, new ESSpawn(233, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-210934,180661,-11696), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(234, new ESSpawn(234, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207058,178460,-12656), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(235, new ESSpawn(235, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207454,179151,-11368), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(236, new ESSpawn(236, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207422,181365,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(237, new ESSpawn(237, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207358,180627,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(238, new ESSpawn(238, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207230,180996,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(239, new ESSpawn(239, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-208515,184160,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(240, new ESSpawn(240, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207613,184000,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(241, new ESSpawn(241, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-208597,183760,-11352), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(242, new ESSpawn(242, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206710,176142,-12656), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(243, new ESSpawn(243, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206361,178136,-11336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(244, new ESSpawn(244, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206178,178630,-12672), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(245, new ESSpawn(245, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-205738,178715,-12656), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(246, new ESSpawn(246, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206442,178205,-12648), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(247, new ESSpawn(247, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206585,178874,-11336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(248, new ESSpawn(248, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206073,179366,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(249, new ESSpawn(249, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206009,178628,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(250, new ESSpawn(250, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206155,181301,-12656), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(251, new ESSpawn(251, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206595,181641,-12656), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(252, new ESSpawn(252, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206507,181641,-12656), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(253, new ESSpawn(253, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206507,181471,-12640), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(254, new ESSpawn(254, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206974,175972,-12672), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(255, new ESSpawn(255, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206304,175130,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(256, new ESSpawn(256, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206886,175802,-12672), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(257, new ESSpawn(257, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207238,175972,-12672), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(258, new ESSpawn(258, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206386,174857,-11328), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(259, new ESSpawn(259, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-206386,175039,-11336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(260, new ESSpawn(260, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-205976,174584,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(261, new ESSpawn(261, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-207367,184320,-11336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(262, new ESSpawn(262, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219002,180419,-12608), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(263, new ESSpawn(263, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218853,182790,-12592), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(264, new ESSpawn(264, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218853,183343,-12600), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(265, new ESSpawn(265, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218358,186247,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(266, new ESSpawn(266, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218358,186083,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(267, new ESSpawn(267, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-217574,185796,-11352), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(268, new ESSpawn(268, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219178,181051,-12592), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(269, new ESSpawn(269, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-220171,180313,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(270, new ESSpawn(270, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219293,183738,-12592), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(271, new ESSpawn(271, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219381,182553,-12584), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(272, new ESSpawn(272, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219600,183024,-11336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(273, new ESSpawn(273, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219940,182680,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(274, new ESSpawn(274, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219260,183884,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(275, new ESSpawn(275, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219855,183540,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(276, new ESSpawn(276, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218946,186575,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(277, new ESSpawn(277, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219882,180103,-12592), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(278, new ESSpawn(278, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219266,179787,-12584), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(279, new ESSpawn(279, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219201,178337,-12592), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(280, new ESSpawn(280, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219716,179875,-11336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(281, new ESSpawn(281, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219716,180021,-11328), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(282, new ESSpawn(282, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219989,179437,-11336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(283, new ESSpawn(283, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219078,178298,-12592), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(284, new ESSpawn(284, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218684,178954,-11328), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(285, new ESSpawn(285, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219089,178456,-11328), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(286, new ESSpawn(286, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-220266,177623,-12608), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(287, new ESSpawn(287, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219201,178025,-12592), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(288, new ESSpawn(288, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219142,177044,-12592), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(289, new ESSpawn(289, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219690,177895,-12592), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(290, new ESSpawn(290, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219754,177623,-12584), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(291, new ESSpawn(291, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218791,177830,-12584), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(292, new ESSpawn(292, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218904,176219,-12592), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(293, new ESSpawn(293, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218768,176384,-12584), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(294, new ESSpawn(294, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218774,177626,-11320), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(295, new ESSpawn(295, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218774,177792,-11328), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(296, new ESSpawn(296, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219880,175901,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(297, new ESSpawn(297, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219210,176054,-12592), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(298, new ESSpawn(298, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219850,175991,-12608), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(299, new ESSpawn(299, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-219079,175021,-11336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(300, new ESSpawn(300, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218812,174229,-11344), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\tSPAWNS.put(301, new ESSpawn(301, GraciaSeeds.ANNIHILATION_COKRAKON, new Location(-218723,174669,-11336), new int[]{ ENERGY_SEED_WATER, ENERGY_SEED_FIRE, ENERGY_SEED_WIND, ENERGY_SEED_EARTH, ENERGY_SEED_DIVINITY, ENERGY_SEED_DARKNESS }));\n\t\t//@formatter:on\n\t}", "Builder addLocationCreated(Place value);", "Spawn(LatLngBounds bounds) {\n Random rand = new Random();\n double rangeNS = bounds.northeast.latitude - bounds.southwest.latitude;\n double rangeEW = bounds.northeast.longitude - bounds.southwest.longitude;\n position = new LatLng(rand.nextDouble() * rangeNS + bounds.southwest.latitude,\n rand.nextDouble() * rangeEW + bounds.southwest.longitude);\n Log.w(\"spawnpoint\", \"Placed at \" + position.toString());\n return;\n }", "public PlaceList(ArrayList<Place> placeList) {\n\t\tthis.places = new ArrayList<Place>(placeList);\n\t}", "private void initTestBuildingWithRoomsAndWorkplaces() {\n\t\tinfoBuilding = dataHelper.createPersistedBuilding(\"50.20\", \"Informatik\", new ArrayList<Property>());\n\t\troom1 = dataHelper.createPersistedRoom(\"Seminarraum\", \"-101\", -1, Arrays.asList(new Property(\"WLAN\")));\n\n\t\tworkplace1 = dataHelper.createPersistedWorkplace(\"WP1\",\n\t\t\t\tArrays.asList(new Property(\"LAN\"), new Property(\"Lampe\")));\n\t\tworkplace2 = dataHelper.createPersistedWorkplace(\"WP2\", Arrays.asList(new Property(\"LAN\")));\n\n\t\troom1.addContainedFacility(workplace1);\n\t\troom1.addContainedFacility(workplace2);\n\n\t\tinfoBuilding.addContainedFacility(room1);\n\t}", "private static void createThings(City city)\n {\n int i =0, j =1;\n Thing book = new Thing(city, j, i);\n Thing ipod = new Thing(city, j, i);\n \n //Most of the curly braces were excluded here for stylistic purposes [minimizing the code length]\n \n /* For loop with nested if else statements: //purpose\\\\: fill out the walls area with objects \n * without having to type down standalone code for each object on its own. */\n for(i=0; i<6; i++)\n for(j=1; j<7; j++)\n if(i == 5 && j == 6)\n continue; // Forgo placing an object at the aforementioned intersection\n else\n if(i == 3 && j == 3)\n { // Place TWO OBJECTS at the same intersection (st 4, ave 3)\n book = new Thing(city, j, i);\n ipod = new Thing(city, j, i);\n }\n else // continue with placing the remaining objects\n {\n book = new Thing(city, j, i);\n }\n }", "private Route initialSpotMapping(Route route) {\n\t\tDate start_time = new Date();\n\n\t\t// increment calculation-level & mark route as processed\n\t\tcalculationLevel++;\n\n\t\t// initialize grid-structure\n\t\tSystem.out.println(\"Grid erstellt! -- Datenbankverbindung aufbauen!\");\n\t\t// create first spot\n\t\tSpot spot = generateSpot(route, 0);\n\t\troute.route[0].setSpot(spot);\n\t\troute.route[0].setMappedToSpot(true);\n\t\tspot.spotID = spotQuery.addSpot(spot,session);\n\n\t\tSystem.out.println(spot + \" zur Datenbank hinzufügen\");\n\t\t// create further spots\n\t\tfor (int j = 1; j < route.route.length; j++) {\n\t\t\tInfoBundle infobundle = searchClosestSpot(route.route[j]);\n\t\t\troute.route[j].setClosestSpotInfo(infobundle);\n\t\t\tif (infobundle == null || infobundle.distance >= Spot.stdRadius * 2) {\n\t\t\t\tspot = generateSpot(route, j);\n\t\t\t\troute.route[j].setSpot(spot);\n\t\t\t\troute.route[j].setMappedToSpot(true);\n\t\t\t\tspot.spotID = spotQuery.addSpot(spot,session);\n\t\t\t\tSystem.out.println(spot + \" zur Datenbank hinzufügen\");\n\n\t\t\t} else if (infobundle.inRange) {\n\t\t\t\tspot = spotRepository.getSpot(infobundle.minDistance_spotID);\n\t\t\t\tSystem.out.println(\"Einen Spot aus der Datenbank laden\");\n\t\t\t\troute.route[j].setSpot(spot);\n\t\t\t\troute.route[j].setMappedToSpot(true);\n\t\t\t} else if (!infobundle.inRange && infobundle.distance < Spot.stdRadius * 2) {\n\n\t\t\t}\n\t\t}\n\t\t// complete spot mapping and set neighbors of the created spots\n\t\tlastSpot = null;\n\t\tfor (int j = 0; j < route.route.length; j++) {\n\t\t\t// check for the points that wasn't able to build an own spot or\n\t\t\t// wasn't in the range of a spot\n\t\t\tif (!route.route[j].isMappedToSpot()) {\n\t\t\t\t// search for the closets spots\n\t\t\t\tInfoBundle infobundle = searchClosestSpot(route.route[j]);\n\t\t\t\troute.route[j].setClosestSpotInfo(infobundle);\n\t\t\t\t// check for the current point if its in range of a spot\n\t\t\t\tif (infobundle.inRange) {\n\t\t\t\t\tSystem.out.println(\"Einen Spot aus der Datenbank laden\");\n\t\t\t\t\tspot = spotRepository.getSpot(infobundle.minDistance_spotID);\n\t\t\t\t\troute.route[j].setSpot(spot);\n\t\t\t\t\troute.route[j].setMappedToSpot(true);\n\t\t\t\t}\n\t\t\t\t// else add it to the \"outside-area\" of the nearest spot,\n\t\t\t\t// because the distance to the nearest spot is too high to be\n\t\t\t\t// in range and is to close to build an own spot\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Einen Spot aus der Datenbank laden\");\n\t\t\t\t\tspot = spotRepository.getSpot(infobundle.minDistance_spotID);\n\t\t\t\t\troute.route[j].setSpot(spot);\n\t\t\t\t\troute.route[j].setMappedToSpot(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// set neighbors of the created spots\n\t\t\tSpot sp = route.route[j].getSpot();\n\t\t\tif (sp != null && lastSpot != null) {\n\t\t\t\tif (!sp.getSpotID().equals(lastSpot.getSpotID())) {\n\t\t\t\t\taddNeighbor(lastSpot,spot);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tlastSpot = sp;\n\t\t}\n\t\tlastSpot = null;\n\n\t\tDate stop_time = new Date();\n\t\tdouble time = stop_time.getTime() - start_time.getTime();\n\t\ttime = time / 1000;\n\t\tSystem.out.println(\"SPOT FINDING: \" + time + \" seconds\");\n\t\treturn route;\n\t}", "private void sendRequestAPI(Double lat,Double lng, String places) {\n\n String origin = String.valueOf(lat) + \",\" + String.valueOf(lng);\n Geocoder geocoder = new Geocoder(getActivity(), Locale.getDefault());\n String destination = \"0,0\";\n String wayPoints = \"0,0\";\n\n switch (places) {\n case \"Family Walk\" :\n destination = formatCoordinates(6);\n wayPoints = formatCoordinates(4) + \"|\" + formatCoordinates(5);\n break;\n\n case \"Retro Tour\" :\n destination = formatCoordinates(9);\n wayPoints =formatCoordinates(7) + \"|\" + formatCoordinates(8);\n break;\n\n case \"Sports Tour\" :\n destination = formatCoordinates(11);\n wayPoints = formatCoordinates(9) + \"|\" + formatCoordinates(8);\n break;\n case \"custom\":\n destination = getActivity().getIntent().getStringExtra(\"destination\");\n wayPoints = getActivity().getIntent().getStringExtra(\"waypoints\");\n break;\n\n }\n //String destination = \"-27.494721,153.014262\";\n //String wayPoints = \"-27.498172, 153.013585\";\n try {\n\n new Directions(this, origin, destination, wayPoints).execute();\n Double latDes= Double.parseDouble(destination.split(\",\")[0]);\n Double lngDes= Double.parseDouble(destination.split(\",\")[1]);\n String [] points = wayPoints.split(Pattern.quote(\"|\")) ;\n\n if(wayPoints.equals(\"\")){\n\n }\n else{\n for(String point : points) {\n Double latPoint = Double.parseDouble((point.split(\",\")[0]));\n Double lngPoint = Double.parseDouble((point.split(\",\")[1]));\n List<Address> addressesPoint = geocoder.getFromLocation(latPoint, lngPoint, 1);\n wayPointsMarkers.add(mMap.addMarker(new MarkerOptions().title(addressesPoint.get(0).getAddressLine(0))\n .position(new LatLng(latPoint, lngPoint))));\n }\n }\n\n\n List<Address> addressesStart = geocoder.getFromLocation(lat, lng, 1);\n List<Address> addressesEnd = geocoder.getFromLocation(latDes,\n lngDes, 1);\n //originMarkers.add(mMap.addMarker(new MarkerOptions().title(addressesStart.get(0).getAddressLine(0))\n //.position(new LatLng(lat, lng))));\n destinationMarkers.add(mMap.addMarker((new MarkerOptions().title(addressesEnd.get(0).getAddressLine(0))\n .position(new LatLng(latDes, lngDes)))));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latDes,\n lngDes), 16));\n\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Place(String name) {\r\n\t\tthis.name = name;\r\n\t\tthis.data = new LinkedHashMap<Integer, Data>();\r\n\t\tthis.populateData();\r\n\t}", "public void create3(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\n\n\t\t//creating stairs to connect rooms\n\t\tfor(int i = 0; i <this.Stairs.length; i++){\n\t\t\tfor(int p = 0; p < this.Stairs.length; p++){\n\t\t\t\tthis.Stairs[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}\n\t\tthis.Stairs[1][1] = 1;\n\n\t\t//creating board to keep track of garret\n\t\tfor(int i = 0; i <this.Garret.length; i++){\n\t\t\tfor(int p = 0; p < this.Garret.length; p++){\n\t\t\t\tthis.Garret[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of garret board\n\t\tthis.Garret[18][10] = 1;//putts garret there\n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 1; i< 6 ; i++){\n\t\t\tfor(int p = 7; p < 8; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 6; i< 7 ; i++){\n\t\t\tfor(int p = 7; p > 4; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 6; i< 11 ; i++){\n\t\t\tfor(int p = 4; p < 5; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 10; i< 11 ; i++){\n\t\t\tfor(int p = 5; p < 8; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 11; i< 15 ; i++){\n\t\t\tfor(int p = 7; p < 8; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 7; p > 3; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 13; i< 14 ; i++){\n\t\t\tfor(int p = 1; p < 4; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 12; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 5; i< 9 ; i++){\n\t\t\tfor(int p = 12; p < 13; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 13; i< 14 ; i++){\n\t\t\tfor(int p = 7; p < 12; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 13; i< 16 ; i++){\n\t\t\tfor(int p = 12; p < 13; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 9; i< 10 ; i++){\n\t\t\tfor(int p = 12; p < 19; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes\n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{\n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}", "public Place(int x, int y){\n this.x=x;\n this.y=y;\n isFull=false;\n }", "private void buildNetProperties() {\n\t\tint nofP, nofT, i;\n\t\tString s;\n\n\t\troot.add(netProperties);\n\t\tgetBasicNetProperty(woflan.InfoNofP, woflan.InfoPName, \"Places\",\n\t\t\t\tnetProperties);\n\t\tgetBasicNetProperty(woflan.InfoNofT, woflan.InfoTName, \"Transitions\",\n\t\t\t\tnetProperties);\n\t}", "public void update_all_places_add_edit_tour(ArrayList<entities.PlaceOfInterest> placesofcity) {\n\n\t\tRunnable runn = new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfor (entities.PlaceOfInterest place : placesofcity) {\n\n\t\t\t\t\tPlaceBase sp = new PlaceBase(place);\n\n\t\t\t\t\tsp.setOnMouseEntered(event -> {\n\t\t\t\t\t\tsp.setStyle(\"-fx-background-color : #BDBBC3\");\n\n\t\t\t\t\t});\n\t\t\t\t\tsp.setOnMouseExited(event -> {\n\t\t\t\t\t\tsp.setStyle(\"-fx-background-color : #EBE8F9\");\n\n\t\t\t\t\t});\n\n\t\t\t\t\tPlatform.runLater(() -> {\n\t\t\t\t\t\tboolean found = false;\n\n\t\t\t\t\t\tfor (Node n : pnItems.getChildren()) {\n\t\t\t\t\t\t\tif (n instanceof PlaceofInterestItem) {\n\t\t\t\t\t\t\t\tPlaceofInterestItem spp = (PlaceofInterestItem) n;\n\t\t\t\t\t\t\t\tSystem.out.println(spp.getplacetour().getName());\n\t\t\t\t\t\t\t\tif (spp.getplacetour().getName().equals(place.getName()))\n\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!found)\n\t\t\t\t\t\t\tpnItems2.getChildren().add(sp);\n\t\t\t\t\t\tnew SlideInUp(sp).play();\n\t\t\t\t\t});\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tFadeOutUp animate = new FadeOutUp(n[0]);\n\t\t\t\tanimate.play();\n\t\t\t\tanimate.setOnFinished(event1 -> {\n\t\t\t\t\tPlatform.runLater(() -> {\n\t\t\t\t\t\tpnItems.getChildren().remove(n[0]);\n\t\t\t\t\t});\n\n\t\t\t\t});\n\t\t\t\n\n\t\t\t}\n\t\t};\n\t\tThread thread = new Thread(runn);\n\t\tthread.start();\n\n\t}", "static void neighborhood()\r\n { \r\n // Puts the earth in a world and the three different color turtles in that world\r\n earth = new World();\r\n turtle1 = new Turtle(earth);\r\n turtle1.setColor(Color.BLUE);\r\n turtle2 = new Turtle(earth);\r\n turtle2.setColor(Color.RED);\r\n turtle3 = new Turtle(earth);\r\n turtle3.setColor(Color.GREEN);\r\n house(100, 100, turtle1);\r\n house(250, 100, turtle2);\r\n house(400, 100, turtle3);\r\n\r\n }", "private void cp1PlaceShips(){\n\t\tint start = 0;\n\t\tint stop = 4;\n\t\tboolean placed;\n\n\t\tfor(int x = start; x <= stop; x++){\n\t\t\tplaced = false;\n\n\t\t\twhile(!placed)\n\t\t\t{\n\t\t\t\tranX = ranNum.nextInt(600);\n\t\t\t\tranY = ranNum.nextInt(600);\n\t\t\t\tplaced = true;\n\n\t\t\t\tships[x] = new Ship(x, shipNames[x], 'H', shipPlayer[x], shipWidth[x], shipHeight[x], ranX, ranY, shipSize[x]);\n\t\t\t\tships[x].setLocation(ships[x].getX(), ships[x].getY());\n\t\t\t\tships[x].setSize(ships[x].getWidth(), ships[x].getHeight());\n\n\t\t\t\tif(ships[x].getX() + ships[x].getWidth() < boardOne.getWidth() && ships[x].getY() + ships[x].getHeight() < boardOne.getHeight()){\n\t\t\t\t\tfor(int y = start; y < x; y++){\n\t\t\t\t\t\tif(ships[x].getBounds().intersects(ships[y].getBounds())){\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tplaced = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboardOne.add(ships[x]);\n\t\t}\n\t}", "private void placeAllShips()\n {\n \t\n \t//place 2 aircrafts\n \tfor(int n = 0; n < 2; n++){\n \trandomRow = rnd.nextInt(10); //get random integer from 0-9\n \trandomCol = rnd.nextInt(10);//get random integer from 0-9\n \trandomDir = rnd.nextInt(2);//get random integer from 0-1\n \twhile(!checkOverlap(randomRow,randomCol,AIRCRAFT_CARRIER_LENGTH)){ //check if random integers overlap existing ones\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \t//place aircraft if no overlap\n \tfor(int i = randomRow; i <randomRow + AIRCRAFT_CARRIER_LENGTH ; i++){\n \t\tfor(int j = randomCol; j < randomCol + AIRCRAFT_CARRIER_LENGTH; ++j){\n \t\t\tif(randomDir == DIRECTION_RIGHT)\n \t\t\t\tgrid[i][randomCol] = SHIP;\n \t\t\tif(randomDir == DIRECTION_DOWN)\n \t\t\t\tgrid[randomRow][j] = SHIP;\n \t\t\t}\n \t\t}\n \t}\n \t\n \t\n \t//place battleship\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,BATTLESHIP_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i <randomRow + BATTLESHIP_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + BATTLESHIP_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\t\n \t//place destroyer\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,DESTROYER_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + DESTROYER_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + DESTROYER_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\t\n \t//place submarine\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,SUBMARINE_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + SUBMARINE_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + SUBMARINE_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\n \t//place patrol\n \trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \trandomDir = rnd.nextInt(2);\n \twhile(!checkOverlap(randomRow,randomCol,PATROL_BOAT_LENGTH)){\n \t\trandomRow = rnd.nextInt(10);\n \trandomCol = rnd.nextInt(10);\n \t}\n \tfor(int i = randomRow; i < randomRow + PATROL_BOAT_LENGTH ; i++){\n\t\t\tfor(int j = randomCol; j < randomCol + PATROL_BOAT_LENGTH; j++){\n\t\t\t\tif(randomDir == DIRECTION_RIGHT)\n\t\t\t\t\tgrid[i][randomCol] = SHIP;\n\t\t\t\tif(randomDir == DIRECTION_DOWN)\n\t\t\t\t\tgrid[randomRow][j] = SHIP;\n\t\t\t}\n\t\t}\n }", "private void createPlanets()\n\t{\n\t\tdouble semimajorAxis;\n\t\tdouble eccentricityOfOrbit;\n\t\tdouble inclinationOnPlane;\n\t\tdouble perihelion;\n\t\tdouble longitudeOfAscendingNode;\n\t\tdouble meanLongitude;\n String unicode_icon;\n\t\t\n\t\tplanetList.clear();\n\t\t\n\t\t//*****************\n\t\t//create Mercury\n\t\t//*****************\n\t\tPlanet mercury = new Planet(\"Mercury\");\n\t\tunicode_icon = \"\\u263f\";\n\t\tmeanLongitude = 60.750646;\n\t\tsemimajorAxis = 0.387099;\n\t\teccentricityOfOrbit = 0.205633;\n\t\tinclinationOnPlane = 7.004540;\n\t\tperihelion = 77.299833;\n\t\tlongitudeOfAscendingNode = 48.212740;\n\t\t\n\t\tmercury.setUnicodeIcon(unicode_icon);\n\t\tmercury.setSemimajorAxis(semimajorAxis);\n\t\tmercury.setEccentricityOfOrbit(eccentricityOfOrbit);\n\t\tmercury.setInclinationOnPlane(inclinationOnPlane);\n\t\tmercury.setPerihelion(perihelion);\n\t\tmercury.setLongitudeOfAscendingNode(longitudeOfAscendingNode);\n\t\tmercury.setMeanLongitude(meanLongitude);\n\t\tmercury.setOrbitalPeriod(0.24852);\n\t\tplanetList.add(mercury);\n\t\t\n\t\t//*****************\n\t\t//create Venus\n\t\t//*****************\n\t\tPlanet venus = new Planet(\"Venus\");\n\t\tunicode_icon = \"\\u2640\";\n\t\tmeanLongitude = 88.455855;\n\t\tsemimajorAxis = 0.723332;\n\t\teccentricityOfOrbit = 0.006778;\n\t\tinclinationOnPlane = 3.394535;\n\t\tperihelion = 131.430236;\n\t\tlongitudeOfAscendingNode = 76.589820;\n\t\t\n\t\tvenus.setUnicodeIcon(unicode_icon);\n\t\tvenus.setSemimajorAxis(semimajorAxis);\n\t\tvenus.setEccentricityOfOrbit(eccentricityOfOrbit);\n\t\tvenus.setInclinationOnPlane(inclinationOnPlane);\n\t\tvenus.setPerihelion(perihelion);\n\t\tvenus.setLongitudeOfAscendingNode(longitudeOfAscendingNode);\n\t\tvenus.setMeanLongitude(meanLongitude);\n\t\tvenus.setOrbitalPeriod(0.615211);\n\t\tplanetList.add(venus);\n\t\t\n\t\t//*****************\n\t\t//create Earth\n\t\t//*****************\n\t\tearth = new Planet(\"Earth\");\n\t\tunicode_icon = \"\\u2695\";\t\n\t\tmeanLongitude = 99.403308;\n\t\tsemimajorAxis = 1.000;\n\t\teccentricityOfOrbit = 0.016713;\n\t\tinclinationOnPlane = 1.00;\n\t\tperihelion = 102.768413;\n\t\tlongitudeOfAscendingNode = 1.00;\n\t\t\n\t\tearth.setUnicodeIcon(unicode_icon);\n\t\tearth.setSemimajorAxis(semimajorAxis);\n\t\tearth.setEccentricityOfOrbit(eccentricityOfOrbit);\n\t\tearth.setInclinationOnPlane(inclinationOnPlane);\n\t\tearth.setPerihelion(perihelion);\n\t\tearth.setLongitudeOfAscendingNode(longitudeOfAscendingNode);\n\t\tearth.setMeanLongitude(meanLongitude);\n\t\tearth.setOrbitalPeriod(1.00004);\n\t\t//earth not added to list, kept as separate object\n\t\t\n\t\t//*****************\n\t\t//create Mars\n\t\t//*****************\n\t\tPlanet mars = new Planet(\"Mars\");\n\t\tunicode_icon = \"\\u2642\";\n\t\tmeanLongitude = 240.739474;\n\t\tsemimajorAxis = 1.523688;\n\t\teccentricityOfOrbit = 0.093396;\n\t\tinclinationOnPlane = 1.849736;\n\t\tperihelion = 335.874939;\n\t\tlongitudeOfAscendingNode = 49.480308;\n\t\t\n\t\tmars.setUnicodeIcon(unicode_icon);\n\t\tmars.setSemimajorAxis(semimajorAxis);\n\t\tmars.setEccentricityOfOrbit(eccentricityOfOrbit);\n\t\tmars.setInclinationOnPlane(inclinationOnPlane);\n\t\tmars.setPerihelion(perihelion);\n\t\tmars.setLongitudeOfAscendingNode(longitudeOfAscendingNode);\n\t\tmars.setMeanLongitude(meanLongitude);\n\t\tmars.setOrbitalPeriod(1.880932);\n\t\tplanetList.add(mars);\n\t\t\n\t\t//*****************\n\t\t//create Jupiter\n\t\t//*****************\n\t\tPlanet jupiter = new Planet(\"Jupiter\");\n\t\tunicode_icon = \"\\u2643\";\n\t\tmeanLongitude = 90.638185;\n\t\tsemimajorAxis = 5.202561;\n\t\teccentricityOfOrbit = 0.048482;\n\t\tinclinationOnPlane = 1.303613;\n\t\tperihelion = 14.170747;\n\t\tlongitudeOfAscendingNode = 100.353142;\n\t\t\n\t\tjupiter.setUnicodeIcon(unicode_icon);\n\t\tjupiter.setSemimajorAxis(semimajorAxis);\n\t\tjupiter.setEccentricityOfOrbit(eccentricityOfOrbit);\n\t\tjupiter.setInclinationOnPlane(inclinationOnPlane);\n\t\tjupiter.setPerihelion(perihelion);\n\t\tjupiter.setLongitudeOfAscendingNode(longitudeOfAscendingNode);\n\t\tjupiter.setMeanLongitude(meanLongitude);\n\t\tjupiter.setOrbitalPeriod(11.863075);\n\t\tplanetList.add(jupiter);\n\t\t\n\t\t//*****************\n\t\t//create Saturn\n\t\t//*****************\n\t\tPlanet saturn = new Planet(\"Saturn\");\n\t\tunicode_icon = \"\\u2644\";\n\t\tmeanLongitude = 287.690033;\n\t\tsemimajorAxis = 9.554747;\n\t\teccentricityOfOrbit = 0.055581;\n\t\tinclinationOnPlane = 2.488980;\n\t\tperihelion = 92.861407;\n\t\tlongitudeOfAscendingNode = 113.576139;\n\t\t\t\t\n\t\tsaturn.setUnicodeIcon(unicode_icon);\n\t\tsaturn.setSemimajorAxis(semimajorAxis);\n\t\tsaturn.setEccentricityOfOrbit(eccentricityOfOrbit);\n\t\tsaturn.setInclinationOnPlane(inclinationOnPlane);\n\t\tsaturn.setPerihelion(perihelion);\n\t\tsaturn.setLongitudeOfAscendingNode(longitudeOfAscendingNode);\n\t\tsaturn.setMeanLongitude(meanLongitude);\n\t\tsaturn.setOrbitalPeriod(29.471362);\n\t\tplanetList.add(saturn);\n\t\t\n\t\t//*****************\n\t\t//create Uranus\n\t\t//*****************\n\t\tPlanet uranus = new Planet(\"Uranus\");\n\t\tunicode_icon = \"\\u2645\";\n\t\tmeanLongitude = 271.063148;\n\t\tsemimajorAxis = 19.21814;\n\t\teccentricityOfOrbit = 0.046321;\n\t\tinclinationOnPlane = 0.773059;\n\t\tperihelion = 172.884833;\n\t\tlongitudeOfAscendingNode = 73.926961;\n\t\t\n\t\turanus.setUnicodeIcon(unicode_icon);\n\t\turanus.setSemimajorAxis(semimajorAxis);\n\t\turanus.setEccentricityOfOrbit(eccentricityOfOrbit);\n\t\turanus.setInclinationOnPlane(inclinationOnPlane);\n\t\turanus.setPerihelion(perihelion);\n\t\turanus.setLongitudeOfAscendingNode(longitudeOfAscendingNode);\n\t\turanus.setMeanLongitude(meanLongitude);\n\t\turanus.setOrbitalPeriod(84.039492);\n\t\tplanetList.add(uranus);\n\t\t\n\t\t//*****************\n\t\t//create Neptune\n\t\t//*****************\n\t\tPlanet neptune = new Planet(\"Neptune\");\n\t\tunicode_icon = \"\\u2646\";\n\t\tmeanLongitude = 282.349556;\n\t\tsemimajorAxis = 30.109570;\n\t\teccentricityOfOrbit = 0.009003;\n\t\tinclinationOnPlane = 1.770646;\n\t\tperihelion = 48.009758;\n\t\tlongitudeOfAscendingNode = 131.670599;\n\t\t\n\t\tneptune.setUnicodeIcon(unicode_icon);\n\t\tneptune.setSemimajorAxis(semimajorAxis);\n\t\tneptune.setEccentricityOfOrbit(eccentricityOfOrbit);\n\t\tneptune.setInclinationOnPlane(inclinationOnPlane);\n\t\tneptune.setPerihelion(perihelion);\n\t\tneptune.setLongitudeOfAscendingNode(longitudeOfAscendingNode);\n\t\tneptune.setMeanLongitude(meanLongitude);\n\t\tneptune.setOrbitalPeriod(164.79246);\n\t\tplanetList.add(neptune);\n\t\t\n\t\t//*****************\n\t\t//create Pluto\n\t\t//*****************\n\t\tPlanet pluto = new Planet(\"Pluto\");\n\t\tunicode_icon = \"\\u263f\";\n\t\tmeanLongitude = 246.77027;\n\t\tsemimajorAxis = 39.3414;\n\t\teccentricityOfOrbit = 0.24624;\n\t\tinclinationOnPlane = 17.1420;\n\t\tperihelion = 224.133;\n\t\tlongitudeOfAscendingNode = 110.144;\n\t\t\n\t\tpluto.setUnicodeIcon(unicode_icon);\n\t\tpluto.setSemimajorAxis(semimajorAxis);\n\t\tpluto.setEccentricityOfOrbit(eccentricityOfOrbit);\n\t\tpluto.setInclinationOnPlane(inclinationOnPlane);\n\t\tpluto.setPerihelion(perihelion);\n\t\tpluto.setLongitudeOfAscendingNode(longitudeOfAscendingNode);\n\t\tpluto.setMeanLongitude(meanLongitude);\n\t\tpluto.setOrbitalPeriod(246.77027);\n\t\tplanetList.add(pluto);\n\t}", "public void createPhilosophers() {\n\t\tphil1 = new Philosopher(1,stick1,stick2);\n\t\tphil2 = new Philosopher(2,stick2,stick3);\n\t\tphil3 = new Philosopher(3,stick3,stick4);\n\t\tphil4 = new Philosopher(4,stick4,stick5);\n\t\tphil5 = new Philosopher(5,stick5,stick1);\n\t}", "public static void instantiate(){\n listOfpoints = new ArrayList<>(12);\n listOfPolygons = new ArrayList<>(listOfpoints.size());\n\n for ( int i= 0 ; i < 70; i++ ){\n listOfpoints.add(new ArrayList<LatLng>());\n }\n\n listOfpoints.get(0).add(new LatLng(44.4293595,26.1035863));\n listOfpoints.get(0).add(new LatLng(44.4295434,26.1035434));\n listOfpoints.get(0).add(new LatLng(44.4297579,26.103479));\n listOfpoints.get(0).add(new LatLng(44.431566,26.1033503));\n listOfpoints.get(0).add(new LatLng(44.4327305,26.1031572));\n listOfpoints.get(0).add(new LatLng(44.4337724,26.1029211));\n listOfpoints.get(0).add(new LatLng(44.4342474,26.1028138));\n listOfpoints.get(0).add(new LatLng( 44.4348756,26.1025563));\n listOfpoints.get(0).add(new LatLng(44.4353199,26.1023203));\n listOfpoints.get(0).add(new LatLng( 44.4353046,26.101977));\n listOfpoints.get(0).add(new LatLng( 44.4352893,26.1015478));\n listOfpoints.get(0).add(new LatLng(44.4351974,26.1010758));\n listOfpoints.get(0).add(new LatLng(44.4350595,26.100432));\n listOfpoints.get(0).add(new LatLng(44.4348756,26.0995523));\n listOfpoints.get(0).add(new LatLng(44.4346458,26.0983292));\n listOfpoints.get(0).add(new LatLng(44.4343547,26.098415));\n listOfpoints.get(0).add(new LatLng( 44.4340176,26.0983506));\n listOfpoints.get(0).add(new LatLng( 44.4327918,26.0975996));\n listOfpoints.get(0).add(new LatLng(44.4318878,26.0972134));\n listOfpoints.get(0).add(new LatLng( 44.4307692,26.0968701));\n listOfpoints.get(0).add(new LatLng( 44.4300644,26.0968271));\n listOfpoints.get(0).add(new LatLng( 44.4298498,26.0972992));\n listOfpoints.get(0).add(new LatLng(44.4297732,26.0977713));\n listOfpoints.get(0).add(new LatLng(44.4296966,26.0985867));\n listOfpoints.get(0).add(new LatLng (44.4296506,26.0994235));\n listOfpoints.get(0).add(new LatLng (44.4295587,26.1002389));\n listOfpoints.get(0).add(new LatLng (44.4294361,26.1007754));\n listOfpoints.get(0).add(new LatLng (44.4292369,26.1016766));\n listOfpoints.get(0).add(new LatLng (44.429099,26.1025778));\n listOfpoints.get(0).add(new LatLng (44.4289917,26.1033717));\n\n\n listOfpoints.get(1).add(new LatLng (44.4356099,26.1021262));\n listOfpoints.get(1).add(new LatLng (44.43630606,26.1017829));\n listOfpoints.get(1).add(new LatLng (44.4370654,26.101461));\n listOfpoints.get(1).add(new LatLng (44.4382451,26.1007958));\n listOfpoints.get(1).add(new LatLng (44.4393176,26.1002379));\n listOfpoints.get(1).add(new LatLng (44.4406045,26.0996371));\n listOfpoints.get(1).add(new LatLng (44.4418301,26.0990792));\n listOfpoints.get(1).add(new LatLng (44.4415084,26.0983067));\n listOfpoints.get(1).add(new LatLng (44.4412173,26.0977059));\n listOfpoints.get(1).add(new LatLng (44.4409875,26.097148));\n listOfpoints.get(1).add(new LatLng (44.4406811,26.0965472));\n listOfpoints.get(1).add(new LatLng (44.4404207,26.0959893));\n listOfpoints.get(1).add(new LatLng (44.4400989,26.0963326));\n listOfpoints.get(1).add(new LatLng (44.4393636,26.0968691));\n listOfpoints.get(1).add(new LatLng (44.4390725,26.0969549));\n listOfpoints.get(1).add(new LatLng (44.4381532,26.0971051));\n listOfpoints.get(1).add(new LatLng (44.4372952,26.0975557));\n listOfpoints.get(1).add(new LatLng (44.4365598,26.0977703));\n listOfpoints.get(1).add(new LatLng (44.4358244,26.0977918));\n listOfpoints.get(1).add(new LatLng (44.435043,26.0980063));\n listOfpoints.get(1).add(new LatLng (44.4348132,26.0979205));\n listOfpoints.get(1).add(new LatLng (44.4348591,26.0983497));\n listOfpoints.get(1).add(new LatLng (44.4352115,26.1003452));\n listOfpoints.get(1).add(new LatLng (44.435472,26.1017185));\n listOfpoints.get(1).add(new LatLng (44.4356099,26.1021262));\n\n\n listOfpoints.get(2).add(new LatLng (44.4358071,26.1034753));\n listOfpoints.get(2).add(new LatLng (44.435899,26.1039688));\n listOfpoints.get(2).add(new LatLng (44.4360216,26.1044623));\n listOfpoints.get(2).add(new LatLng (44.4360982,26.1049988));\n listOfpoints.get(2).add(new LatLng (44.4362361,26.1055781));\n listOfpoints.get(2).add(new LatLng (44.4363127,26.1059));\n listOfpoints.get(2).add(new LatLng (44.4364506,26.1063721));\n listOfpoints.get(2).add(new LatLng (44.4365425,26.1067583));\n listOfpoints.get(2).add(new LatLng (44.4367264,26.1068441));\n listOfpoints.get(2).add(new LatLng (44.4369715,26.1071016));\n listOfpoints.get(2).add(new LatLng (44.4374312,26.1073591));\n listOfpoints.get(2).add(new LatLng (44.4380593,26.1076381));\n listOfpoints.get(2).add(new LatLng (44.4386722,26.1078741));\n listOfpoints.get(2).add(new LatLng (44.439239,26.1080672));\n listOfpoints.get(2).add(new LatLng (44.4399744,26.1083033));\n listOfpoints.get(2).add(new LatLng (44.4406485,26.1084106));\n listOfpoints.get(2).add(new LatLng (44.4407557,26.1080458));\n listOfpoints.get(2).add(new LatLng (44.440817,26.1075737));\n listOfpoints.get(2).add(new LatLng (44.440863,26.1070373));\n listOfpoints.get(2).add(new LatLng (44.4410928,26.1070587));\n listOfpoints.get(2).add(new LatLng (44.4419814,26.1071016));\n listOfpoints.get(2).add(new LatLng (44.4422877,26.1071875));\n listOfpoints.get(2).add(new LatLng (44.4432069,26.107445));\n listOfpoints.get(2).add(new LatLng (44.443498,26.107402));\n listOfpoints.get(2).add(new LatLng (44.4433754,26.10693));\n listOfpoints.get(2).add(new LatLng (44.4432988,26.1065008));\n listOfpoints.get(2).add(new LatLng (44.4431763,26.1059858));\n listOfpoints.get(2).add(new LatLng (44.4429465,26.1052992));\n listOfpoints.get(2).add(new LatLng (44.4429312,26.1044838));\n listOfpoints.get(2).add(new LatLng (44.4429312,26.1036469));\n listOfpoints.get(2).add(new LatLng (44.4429618,26.1029818));\n listOfpoints.get(2).add(new LatLng (44.4432069,26.1027457));\n listOfpoints.get(2).add(new LatLng (44.4431303,26.1025311));\n listOfpoints.get(2).add(new LatLng (44.4429618,26.1022737));\n listOfpoints.get(2).add(new LatLng (44.4427627,26.101866));\n listOfpoints.get(2).add(new LatLng (44.4426707,26.1015656));\n listOfpoints.get(2).add(new LatLng (44.4426554,26.101072));\n listOfpoints.get(2).add(new LatLng (44.4427014,26.1002781));\n listOfpoints.get(2).add(new LatLng (44.4427933,26.0989692));\n listOfpoints.get(2).add(new LatLng (44.4420426,26.0993125));\n listOfpoints.get(2).add(new LatLng (44.4412,26.0997202));\n listOfpoints.get(2).add(new LatLng (44.4400663,26.100321));\n listOfpoints.get(2).add(new LatLng (44.4390399,26.100836));\n listOfpoints.get(2).add(new LatLng (44.4382279,26.1012651));\n listOfpoints.get(2).add(new LatLng (44.4374924,26.1016514));\n listOfpoints.get(2).add(new LatLng (44.4366038,26.1021449));\n listOfpoints.get(2).add(new LatLng (44.4358071,26.1026384));\n listOfpoints.get(2).add(new LatLng (44.4357305,26.1027886));\n listOfpoints.get(2).add(new LatLng (44.4358071,26.1034753));\n\n\n listOfpoints.get(3).add(new LatLng (44.4290806,26.1040332));\n listOfpoints.get(3).add(new LatLng (44.4295709,26.1054494));\n listOfpoints.get(3).add(new LatLng (44.4302604,26.1070373));\n listOfpoints.get(3).add(new LatLng (44.4307508,26.1080887));\n listOfpoints.get(3).add(new LatLng (44.432804,26.111994));\n listOfpoints.get(3).add(new LatLng (44.4329113,26.1123373));\n listOfpoints.get(3).add(new LatLng (44.4330798,26.1136248));\n listOfpoints.get(3).add(new LatLng (44.4332483,26.1150195));\n listOfpoints.get(3).add(new LatLng (44.433325,26.1158349));\n listOfpoints.get(3).add(new LatLng (44.4347959,26.1162855));\n listOfpoints.get(3).add(new LatLng (44.4359143,26.1166288));\n listOfpoints.get(3).add(new LatLng (44.4365272,26.1168005));\n listOfpoints.get(3).add(new LatLng (44.4367723,26.1168434));\n listOfpoints.get(3).add(new LatLng (44.4373852,26.1166503));\n listOfpoints.get(3).add(new LatLng (44.43809,26.1163713));\n listOfpoints.get(3).add(new LatLng (44.4378755,26.1154272));\n listOfpoints.get(3).add(new LatLng (44.435516,26.1027672));\n listOfpoints.get(3).add(new LatLng (44.433708,26.1034109));\n listOfpoints.get(3).add(new LatLng (44.4330032,26.1035826));\n listOfpoints.get(3).add(new LatLng (44.4321451,26.1038401));\n listOfpoints.get(3).add(new LatLng (44.4309959,26.1039259));\n listOfpoints.get(3).add(new LatLng (44.4302451,26.1039903));\n listOfpoints.get(3).add(new LatLng (44.4296628,26.1039903));\n listOfpoints.get(3).add(new LatLng(44.4290806,26.1040332));\n\n\n\n listOfpoints.get(4).add(new LatLng ( 44.4343669 ,26.0798289));\n listOfpoints.get(4).add(new LatLng (44.434229 ,26.0801508));\n listOfpoints.get(4).add(new LatLng (44.4335088 ,26.0905363));\n listOfpoints.get(4).add(new LatLng (44.4333862 ,26.092124));\n listOfpoints.get(4).add(new LatLng ( 44.433233 ,26.0926177));\n listOfpoints.get(4).add(new LatLng ( 44.4329879 ,26.0932614));\n listOfpoints.get(4).add(new LatLng (44.4327427 , 26.0936906));\n listOfpoints.get(4).add(new LatLng (44.4301838 ,26.0965659));\n listOfpoints.get(4).add(new LatLng (44.4301685 ,26.0967161));\n listOfpoints.get(4).add(new LatLng (44.4305209 ,26.096759));\n listOfpoints.get(4).add(new LatLng (44.4311338 ,26.0968878));\n listOfpoints.get(4).add(new LatLng (44.4317468 ,26.097038));\n listOfpoints.get(4).add(new LatLng (44.4323137 ,26.0972955));\n listOfpoints.get(4).add(new LatLng (44.4327427 ,26.0974457));\n listOfpoints.get(4).add(new LatLng (44.4333709 ,26.0978534));\n listOfpoints.get(4).add(new LatLng (44.4338919 ,26.0981538));\n listOfpoints.get(4).add(new LatLng (44.434229 ,26.0982611));\n listOfpoints.get(4).add(new LatLng ( 44.4345354 ,26.0982611));\n listOfpoints.get(4).add(new LatLng (44.4346886 ,26.0981752));\n listOfpoints.get(4).add(new LatLng (44.4345814, 26.0918667));\n listOfpoints.get(4).add(new LatLng (44.4343669 ,26.0798289));\n\n\n listOfpoints.get(5).add(new LatLng (44.4348405,26.097773));\n listOfpoints.get(5).add(new LatLng (44.435043,26.0980063));\n listOfpoints.get(5).add(new LatLng (44.4365598,26.0977703));\n listOfpoints.get(5).add(new LatLng (44.4372952, 26.0975557));\n listOfpoints.get(5).add(new LatLng (44.4381532, 26.0971051));\n listOfpoints.get(5).add(new LatLng ( 44.4393636,26.0968691));\n listOfpoints.get(5).add(new LatLng(44.4397739, 26.0964855));\n listOfpoints.get(5).add(new LatLng (44.4402029,26.0960993));\n listOfpoints.get(5).add(new LatLng (44.4406778,26.0956487));\n listOfpoints.get(5).add(new LatLng(44.4405706,26.0952195));\n listOfpoints.get(5).add(new LatLng (44.4403408 ,26.0942539));\n listOfpoints.get(5).add(new LatLng (44.440065 ,26.0931811));\n listOfpoints.get(5).add(new LatLng (44.4400497, 26.0919151));\n listOfpoints.get(5).add(new LatLng (44.4398199 ,26.0897693));\n listOfpoints.get(5).add(new LatLng (44.4397893 ,26.0891041));\n listOfpoints.get(5).add(new LatLng (44.4399271 , 26.0879668));\n listOfpoints.get(5).add(new LatLng (44.4399731 ,26.0873017));\n listOfpoints.get(5).add(new LatLng (44.4399884 ,26.0867223));\n listOfpoints.get(5).add(new LatLng (44.4365719, 26.0887179));\n listOfpoints.get(5).add(new LatLng (44.434672 ,26.0898337));\n listOfpoints.get(5).add(new LatLng (44.4348405 ,26.097773));\n\n\n listOfpoints.get(6).add(new LatLng (44.4365425,26.1067583));\n listOfpoints.get(6).add(new LatLng (44.4365354,26.1075151));\n listOfpoints.get(6).add(new LatLng (44.4375926,26.113137));\n listOfpoints.get(6).add(new LatLng (44.4378224,26.114167));\n listOfpoints.get(6).add(new LatLng (44.4435828,26.1191452));\n listOfpoints.get(6).add(new LatLng (44.4440117, 26.1184585));\n listOfpoints.get(6).add(new LatLng (44.4448849, 26.1172784));\n listOfpoints.get(6).add(new LatLng (44.4457888,26.1161411));\n listOfpoints.get(6).add(new LatLng (44.4462483, 26.1149395));\n listOfpoints.get(6).add(new LatLng (44.4466773, 26.113137));\n listOfpoints.get(6).add(new LatLng (44.4467998, 26.1121929));\n listOfpoints.get(6).add(new LatLng (44.4467539, 26.1112917));\n listOfpoints.get(6).add(new LatLng (44.4469683, 26.1101973));\n listOfpoints.get(6).add(new LatLng (44.4458041, 26.1093176));\n listOfpoints.get(6).add(new LatLng (44.4453905, 26.1091888));\n listOfpoints.get(6).add(new LatLng (44.4448083, 26.1089099));\n listOfpoints.get(6).add(new LatLng (44.4442109, 26.1084163));\n listOfpoints.get(6).add(new LatLng (44.4435828, 26.1076224));\n listOfpoints.get(6).add(new LatLng (44.4433377, 26.107558));\n listOfpoints.get(6).add(new LatLng (44.4420662,26.1072791));\n listOfpoints.get(6).add(new LatLng (44.440863,26.1070373));\n listOfpoints.get(6).add(new LatLng (44.4407946,26.1082018));\n listOfpoints.get(6).add(new LatLng ( 44.4406107,26.1085451));\n listOfpoints.get(6).add(new LatLng (44.43986, 26.1084163));\n listOfpoints.get(6).add(new LatLng (44.4384659, 26.1079014));\n listOfpoints.get(6).add(new LatLng (44.4372095, 26.1073864));\n listOfpoints.get(6).add(new LatLng (44.4365425, 26.1067583));\n\n\n listOfpoints.get(7).add(new LatLng (44.4268641,26.1040563));\n listOfpoints.get(7).add(new LatLng ( 44.4265883,26.1107511));\n listOfpoints.get(7).add(new LatLng (44.4261898,26.118905));\n listOfpoints.get(7).add(new LatLng (44.4274311,26.1189909));\n listOfpoints.get(7).add(new LatLng (44.4276303,26.1189265));\n listOfpoints.get(7).add(new LatLng (44.4285497,26.1191625));\n listOfpoints.get(7).add(new LatLng (44.4288408,26.1193342));\n listOfpoints.get(7).add(new LatLng (44.4294997,26.1199564));\n listOfpoints.get(7).add(new LatLng (44.4297909, 26.1200852));\n listOfpoints.get(7).add(new LatLng (44.4303272,26.1203427));\n listOfpoints.get(7).add(new LatLng (44.431124, 26.1205787));\n listOfpoints.get(7).add(new LatLng (44.4328861, 26.1207289));\n listOfpoints.get(7).add(new LatLng (44.4329933, 26.1206431));\n listOfpoints.get(7).add(new LatLng (44.4331159, 26.1194844));\n listOfpoints.get(7).add(new LatLng (44.4331925,26.118154));\n listOfpoints.get(7).add(new LatLng (44.4332844,26.1160512));\n listOfpoints.get(7).add(new LatLng (44.4328094,26.112339));\n listOfpoints.get(7).add(new LatLng (44.4327022, 26.1120171));\n listOfpoints.get(7).add(new LatLng (44.4299135, 26.1064596));\n listOfpoints.get(7).add(new LatLng (44.4289634,26.1040778));\n listOfpoints.get(7).add(new LatLng (44.4281819,26.1039705));\n listOfpoints.get(7).add(new LatLng (44.4268641,26.1040563));\n\n\n\n\n listOfpoints.get(8).add (new LatLng (44.4262461,26.1007836));\n listOfpoints.get(8).add (new LatLng (44.4260163,26.1014488));\n listOfpoints.get(8).add (new LatLng (44.4259397,26.1023715));\n listOfpoints.get(8).add (new LatLng (44.4258784,26.103616));\n listOfpoints.get(8).add (new LatLng (44.426001,26.1039593));\n listOfpoints.get(8).add (new LatLng (44.42643,26.1039593));\n listOfpoints.get(8).add (new LatLng (44.4272882,26.1038735));\n listOfpoints.get(8).add (new LatLng (44.4282995,26.1038306));\n listOfpoints.get(8).add (new LatLng (44.4289278,26.1035731));\n listOfpoints.get(8).add (new LatLng (44.4289431,26.1028006));\n listOfpoints.get(8).add (new LatLng (44.4291423,26.1015132));\n listOfpoints.get(8).add (new LatLng (44.4286366,26.1007836));\n listOfpoints.get(8).add (new LatLng (44.4284834,26.1010196));\n listOfpoints.get(8).add (new LatLng (44.4271043,26.1008694));\n listOfpoints.get(8).add (new LatLng (44.4262461, 26.1007836));\n\n\n\n listOfpoints.get(9).add(new LatLng (44.4262461,26.1007836));\n listOfpoints.get(9).add(new LatLng (44.4284834,26.1010196));\n listOfpoints.get(9).add(new LatLng (44.4290094,26.1000479));\n listOfpoints.get(9).add(new LatLng (44.4292545,26.0986961));\n listOfpoints.get(9).add(new LatLng (44.4293465,26.0971726));\n listOfpoints.get(9).add(new LatLng (44.4294844,26.0964216));\n listOfpoints.get(9).add(new LatLng (44.4301739,26.0956276));\n listOfpoints.get(9).add(new LatLng (44.432411,26.0931385));\n listOfpoints.get(9).add(new LatLng (44.4327022,26.0925163));\n listOfpoints.get(9).add(new LatLng (44.4328401,26.0919584));\n listOfpoints.get(9).add(new LatLng (44.4329014, 26.0913576));\n listOfpoints.get(9).add(new LatLng (44.4260059,26.0907353));\n listOfpoints.get(9).add(new LatLng (44.4262051,26.091658));\n listOfpoints.get(9).add(new LatLng (44.4265882, 26.0922588));\n listOfpoints.get(9).add(new LatLng (44.4269867,26.0926879));\n listOfpoints.get(9).add(new LatLng (44.4267108,26.0998763));\n listOfpoints.get(9).add(new LatLng (44.4262461,26.1007836));\n\n\n listOfpoints.get(10).add(new LatLng (44.4260059,26.0907353));\n listOfpoints.get(10).add(new LatLng (44.4215507, 26.0903665));\n listOfpoints.get(10).add(new LatLng (44.4255811,26.0980483));\n listOfpoints.get(10).add(new LatLng ( 44.4265772,26.0999795));\n listOfpoints.get(10).add(new LatLng (44.4266998,26.099722));\n listOfpoints.get(10).add(new LatLng (44.4269867, 26.0926879));\n listOfpoints.get(10).add(new LatLng (44.4265882,26.0922588));\n listOfpoints.get(10).add(new LatLng (44.4262051,26.091658));\n listOfpoints.get(10).add(new LatLng (44.4260059,26.0907353));\n\n\n listOfpoints.get(11).add(new LatLng (44.4214281, 26.0905382));\n listOfpoints.get(11).add(new LatLng (44.4207385, 26.0915467));\n listOfpoints.get(11).add(new LatLng (44.4199568, 26.0929629));\n listOfpoints.get(11).add(new LatLng (44.4192059,26.0943576));\n listOfpoints.get(11).add(new LatLng (44.4187155,26.095409));\n listOfpoints.get(11).add(new LatLng (44.4186235,26.0957524));\n listOfpoints.get(11).add(new LatLng (44.4189607, 26.0968253));\n listOfpoints.get(11).add(new LatLng (44.4212442,26.1039063));\n listOfpoints.get(11).add(new LatLng (44.4227001,26.1039921));\n listOfpoints.get(11).add(new LatLng (44.4251367,26.1039921));\n listOfpoints.get(11).add(new LatLng (44.425765,26.103799));\n listOfpoints.get(11).add(new LatLng (44.425811,26.1027476));\n listOfpoints.get(11).add(new LatLng (44.4259182,26.101503));\n listOfpoints.get(11).add(new LatLng (44.4260715,26.1009237));\n listOfpoints.get(11).add(new LatLng (44.4264086,26.1001297));\n listOfpoints.get(11).add(new LatLng (44.4260255, 26.0993143));\n listOfpoints.get(11).add(new LatLng (44.4252899, 26.0978981));\n listOfpoints.get(11).add(new LatLng (44.424064,26.0955593));\n listOfpoints.get(11).add(new LatLng (44.4230372,26.0935851));\n listOfpoints.get(11).add(new LatLng (44.4214281,26.0905382));\n\n\n listOfpoints.get(12).add(new LatLng (44.4213365,26.1040423));\n listOfpoints.get(12).add(new LatLng (44.4216123,26.1052654));\n listOfpoints.get(12).add(new LatLng (44.4226851,26.1084411));\n listOfpoints.get(12).add(new LatLng (44.4237731,26.1117241));\n listOfpoints.get(12).add(new LatLng (44.4244168,26.11181));\n listOfpoints.get(12).add(new LatLng (44.4263629,26.1118743));\n listOfpoints.get(12).add(new LatLng (44.4264242,26.1109946));\n listOfpoints.get(12).add(new LatLng (44.4265315,26.1078832));\n listOfpoints.get(12).add(new LatLng (44.4267154,26.1041496));\n listOfpoints.get(12).add(new LatLng (44.4254588, 26.1042354));\n listOfpoints.get(12).add(new LatLng (44.4242482,26.1041925));\n listOfpoints.get(12).add(new LatLng (44.4213365,26.1040423));\n\n\n\n listOfpoints.get(13).add(new LatLng (44.4212442, 26.1039063));\n listOfpoints.get(13).add(new LatLng (44.4208987, 26.1041756));\n listOfpoints.get(13).add(new LatLng (44.4155345,26.1045404));\n listOfpoints.get(13).add(new LatLng (44.4156111, 26.1051198));\n listOfpoints.get(13).add(new LatLng (44.4156724, 26.106257));\n listOfpoints.get(13).add(new LatLng (44.4157184,26.1068793));\n listOfpoints.get(13).add(new LatLng (44.4157797, 26.1071153));\n listOfpoints.get(13).add(new LatLng (44.415841, 26.1077805));\n listOfpoints.get(13).add(new LatLng (44.4159024,26.1090465));\n listOfpoints.get(13).add(new LatLng (44.416025,26.1110635));\n listOfpoints.get(13).add(new LatLng (44.4161629,26.1116643));\n listOfpoints.get(13).add(new LatLng (44.4163468, 26.112072));\n listOfpoints.get(13).add(new LatLng (44.4166993,26.1127158));\n listOfpoints.get(13).add(new LatLng (44.4170518, 26.1133595));\n listOfpoints.get(13).add(new LatLng (44.4177109, 26.1127158));\n listOfpoints.get(13).add(new LatLng (44.4184006,26.1118575));\n listOfpoints.get(13).add(new LatLng (44.4190136,26.1112566));\n listOfpoints.get(13).add(new LatLng (44.4199331, 26.1107846));\n listOfpoints.get(13).add(new LatLng (44.4215883,26.1101838));\n listOfpoints.get(13).add(new LatLng (44.4229369,26.10954));\n listOfpoints.get(13).add(new LatLng (44.422753, 26.1089178));\n listOfpoints.get(13).add(new LatLng (44.4222626,26.1074372));\n listOfpoints.get(13).add(new LatLng (44.4217262,26.1059137));\n listOfpoints.get(13).add(new LatLng (44.4212442, 26.1039063));\n\n\n\n listOfpoints.get(14).add(new LatLng (44.4172379,26.1135832));\n listOfpoints.get(14).add(new LatLng (44.4169314,26.1139266));\n listOfpoints.get(14).add(new LatLng (44.4177284,26.1143128));\n listOfpoints.get(14).add(new LatLng (44.4185253,26.1147205));\n listOfpoints.get(14).add(new LatLng (44.4237666,26.1189047));\n listOfpoints.get(14).add(new LatLng (44.4237819,26.1191408));\n listOfpoints.get(14).add(new LatLng (44.4240425,26.1191622));\n listOfpoints.get(14).add(new LatLng (44.4258814,26.1192481));\n listOfpoints.get(14).add(new LatLng (44.425912,26.1188404));\n listOfpoints.get(14).add(new LatLng (44.426004,26.1167804));\n listOfpoints.get(14).add(new LatLng (44.4261113,26.1148063));\n listOfpoints.get(14).add(new LatLng (44.4262798,26.1120812));\n listOfpoints.get(14).add(new LatLng (44.4238739,26.1119525));\n listOfpoints.get(14).add(new LatLng (44.4235674,26.1115662));\n listOfpoints.get(14).add(new LatLng (44.4230157,26.109914));\n listOfpoints.get(14).add(new LatLng (44.4218817,26.1103646));\n listOfpoints.get(14).add(new LatLng (44.4200733,26.1110512));\n listOfpoints.get(14).add(new LatLng (44.4187246,26.1118666));\n listOfpoints.get(14).add(new LatLng (44.4172379,26.1135832));\n\n\n listOfpoints.get(15).add(new LatLng (44.4329128,26.0911565));\n listOfpoints.get(15).add(new LatLng (44.4334184,26.0843973));\n listOfpoints.get(15).add(new LatLng (44.4305378,26.0839467));\n listOfpoints.get(15).add(new LatLng (44.4304765,26.0840969));\n listOfpoints.get(15).add(new LatLng (44.4305531,26.0845475));\n listOfpoints.get(15).add(new LatLng (44.4306604,26.0853844));\n listOfpoints.get(15).add(new LatLng (44.4302773,26.0908131));\n listOfpoints.get(15).add(new LatLng (44.4304765,26.0910277));\n listOfpoints.get(15).add(new LatLng (44.4329128,26.0911565));\n\n\n listOfpoints.get(16).add(new LatLng (44.4254029,26.0786466));\n listOfpoints.get(16).add(new LatLng (44.4252956,26.0790543));\n listOfpoints.get(16).add(new LatLng (44.4246213,26.0901265));\n listOfpoints.get(16).add(new LatLng (44.4247746,26.0905127));\n listOfpoints.get(16).add(new LatLng (44.4298621,26.0909634));\n listOfpoints.get(16).add(new LatLng (44.4300919,26.0907273));\n listOfpoints.get(16).add(new LatLng (44.430475,26.0853414));\n listOfpoints.get(16).add(new LatLng ( 44.4291112,26.0806422));\n listOfpoints.get(16).add(new LatLng (44.428391,26.0795693));\n listOfpoints.get(16).add(new LatLng (44.4277781,26.0794835));\n listOfpoints.get(16).add(new LatLng (44.42574,26.0784535));\n listOfpoints.get(16).add(new LatLng (44.4254029,26.0786466));\n\n\n listOfpoints.get(17).add(new LatLng (44.4334039,26.1159853));\n listOfpoints.get(17).add(new LatLng (44.433312,26.1178736));\n listOfpoints.get(17).add(new LatLng (44.4331128,26.1208562));\n listOfpoints.get(17).add(new LatLng (44.4327757,26.1238603));\n listOfpoints.get(17).add(new LatLng (44.4325765,26.1256413));\n listOfpoints.get(17).add(new LatLng (44.4354264,26.1251477));\n listOfpoints.get(17).add(new LatLng (44.4389196,26.122723));\n listOfpoints.get(17).add(new LatLng (44.4391954,26.1224012));\n listOfpoints.get(17).add(new LatLng (44.4381383,26.1165003));\n listOfpoints.get(17).add(new LatLng (44.4368666,26.1169724));\n listOfpoints.get(17).add(new LatLng (44.4364683,26.1169295));\n listOfpoints.get(17).add(new LatLng (44.4334039,26.1159853));\n\n\n listOfpoints.get(18).add(new LatLng (44.4454662,26.0911104));\n listOfpoints.get(18).add(new LatLng (44.4453896, 26.0909388));\n listOfpoints.get(18).add(new LatLng (44.4444245,26.0918185));\n listOfpoints.get(18).add(new LatLng (44.4428313, 26.093342));\n listOfpoints.get(18).add(new LatLng (44.4413912,26.0947797));\n listOfpoints.get(18).add(new LatLng (44.4405333,26.0959169));\n listOfpoints.get(18).add(new LatLng (44.4419274,26.0990069));\n listOfpoints.get(18).add(new LatLng (44.4433368,26.0983202));\n listOfpoints.get(18).add(new LatLng (44.4452824,26.0973761));\n listOfpoints.get(18).add(new LatLng (44.446707,26.0966894));\n listOfpoints.get(18).add(new LatLng (44.4468296,26.0961959));\n listOfpoints.get(18).add(new LatLng (44.4465385,26.0945651));\n listOfpoints.get(18).add(new LatLng (44.4462628,26.0935351));\n listOfpoints.get(18).add(new LatLng (44.4454662,26.0911104));\n\n\n listOfpoints.get(19).add(new LatLng (44.4401196,26.0817507));\n listOfpoints.get(19).add(new LatLng (44.4401043,26.0831669));\n listOfpoints.get(19).add(new LatLng (44.4402115,26.0846046));\n listOfpoints.get(19).add(new LatLng (44.440089,26.0863641));\n listOfpoints.get(19).add(new LatLng (44.4399358,26.0894755));\n listOfpoints.get(19).add(new LatLng ( 44.4402115, 26.0932949));\n listOfpoints.get(19).add(new LatLng (44.4407937,26.0953763));\n listOfpoints.get(19).add(new LatLng (44.440855,26.0952047));\n listOfpoints.get(19).add(new LatLng (44.4450832,26.0910419));\n listOfpoints.get(19).add(new LatLng (44.4454509,26.0905698));\n listOfpoints.get(19).add(new LatLng (44.4445011,26.0879949));\n listOfpoints.get(19).add(new LatLng (44.4437964,26.0862783));\n listOfpoints.get(19).add(new LatLng (44.4434287,26.0840681));\n listOfpoints.get(19).add(new LatLng (44.443061, 26.0812143));\n listOfpoints.get(19).add(new LatLng (44.4423257, 26.0809997));\n listOfpoints.get(19).add(new LatLng (44.4419887, 26.0810211));\n listOfpoints.get(19).add(new LatLng (44.4411767, 26.0813215));\n listOfpoints.get(19).add(new LatLng (44.4401196, 26.0817507));\n\n\n listOfpoints.get(20).add(new LatLng (44.418527,26.0958537));\n listOfpoints.get(20).add(new LatLng (44.4145114,26.0985144));\n listOfpoints.get(20).add(new LatLng (44.4143275,26.098729));\n listOfpoints.get(20).add(new LatLng (44.4143275,26.0990294));\n listOfpoints.get(20).add(new LatLng (44.4143735, 26.0993727));\n listOfpoints.get(20).add(new LatLng (44.4144195, 26.0998233));\n listOfpoints.get(20).add(new LatLng (44.4142969, 26.1008104));\n listOfpoints.get(20).add(new LatLng (44.4140976,26.1009177));\n listOfpoints.get(20).add(new LatLng (44.4138983,26.1008962));\n listOfpoints.get(20).add(new LatLng (44.4138064,26.1006602));\n listOfpoints.get(20).add(new LatLng (44.4137451,26.1000379));\n listOfpoints.get(20).add(new LatLng (44.4130247,26.098729));\n listOfpoints.get(20).add(new LatLng (44.4127335,26.0984286));\n listOfpoints.get(20).add(new LatLng (44.4113386,26.0985144));\n listOfpoints.get(20).add(new LatLng (44.4102503, 26.0985788));\n listOfpoints.get(20).add(new LatLng (44.414021,26.1043509));\n listOfpoints.get(20).add(new LatLng (44.4143122,26.1043938));\n listOfpoints.get(20).add(new LatLng (44.4159522,26.1042865));\n listOfpoints.get(20).add(new LatLng (44.4191554,26.104029));\n listOfpoints.get(20).add(new LatLng (44.4210711,26.1038574));\n listOfpoints.get(20).add(new LatLng (44.4208259,26.1030205));\n listOfpoints.get(20).add(new LatLng (44.4203508,26.1016258));\n listOfpoints.get(20).add(new LatLng (44.4198297,26.1000379));\n listOfpoints.get(20).add(new LatLng (44.4192167, 26.0981067));\n listOfpoints.get(20).add(new LatLng (44.418527,26.0958537));\n\n\n listOfpoints.get(21).add(new LatLng (44.410189,26.0984071));\n listOfpoints.get(21).add(new LatLng (44.4103883,26.0984715));\n listOfpoints.get(21).add(new LatLng (44.4128867,26.0983213));\n listOfpoints.get(21).add(new LatLng (44.4138524, 26.1000594));\n listOfpoints.get(21).add(new LatLng (44.4138524,26.1004671));\n listOfpoints.get(21).add(new LatLng (44.4139597,26.1007246));\n listOfpoints.get(21).add(new LatLng (44.4141742,26.1007246));\n listOfpoints.get(21).add(new LatLng (44.4142662,26.1003812));\n listOfpoints.get(21).add(new LatLng (44.4143275,26.0996946));\n listOfpoints.get(21).add(new LatLng (44.4141589,26.0986646));\n listOfpoints.get(21).add(new LatLng (44.418435,26.0957464));\n listOfpoints.get(21).add(new LatLng (44.4190021,26.0946306));\n listOfpoints.get(21).add(new LatLng (44.4183737,26.0934504));\n listOfpoints.get(21).add(new LatLng (44.4176534, 26.0933431));\n listOfpoints.get(21).add(new LatLng (44.4165652, 26.0933431));\n listOfpoints.get(21).add(new LatLng (44.4155996,26.0927423));\n listOfpoints.get(21).add(new LatLng (44.4149406,26.0921415));\n listOfpoints.get(21).add(new LatLng (44.4142662,26.0919055));\n listOfpoints.get(21).add(new LatLng (44.412994, 26.0920986));\n listOfpoints.get(21).add(new LatLng (44.4098211,26.0943945));\n listOfpoints.get(21).add(new LatLng (44.4096679,26.0947164));\n listOfpoints.get(21).add(new LatLng (44.4096985, 26.0953816));\n listOfpoints.get(21).add(new LatLng (44.4088401, 26.0962399));\n listOfpoints.get(21).add(new LatLng (44.4088248,26.0966047));\n listOfpoints.get(21).add(new LatLng (44.410189, 26.0984071));\n\n\n listOfpoints.get(22).add(new LatLng (44.4238034,26.0734041));\n listOfpoints.get(22).add(new LatLng (44.4252745,26.0779102));\n listOfpoints.get(22).add(new LatLng (44.426102,26.0783394));\n listOfpoints.get(22).add(new LatLng (44.4286458, 26.079541));\n listOfpoints.get(22).add(new LatLng (44.4293813,26.0807855));\n listOfpoints.get(22).add(new LatLng (44.4303313,26.0837038));\n listOfpoints.get(22).add(new LatLng (44.4329668,26.08409));\n listOfpoints.get(22).add(new LatLng (44.4335797,26.0839613));\n listOfpoints.get(22).add(new LatLng (44.4337023,26.0821159));\n listOfpoints.get(22).add(new LatLng (44.4339474,26.0797556));\n listOfpoints.get(22).add(new LatLng (44.434499,26.078039));\n listOfpoints.get(22).add(new LatLng (44.4358473,26.0748632));\n listOfpoints.get(22).add(new LatLng (44.4351732,26.073962));\n listOfpoints.get(22).add(new LatLng (44.433212,26.0710867));\n listOfpoints.get(22).add(new LatLng (44.4312201,26.0683401));\n listOfpoints.get(22).add(new LatLng (44.4299329,26.067396));\n listOfpoints.get(22).add(new LatLng (44.4283087,26.0655506));\n listOfpoints.get(22).add(new LatLng (44.4274812,26.0668381));\n listOfpoints.get(22).add(new LatLng (44.4261633,26.0691984));\n listOfpoints.get(22).add(new LatLng (44.4249374,26.0715587));\n listOfpoints.get(22).add(new LatLng (44.4238034,26.0734041));\n\n\n listOfpoints.get(23).add(new LatLng (44.4205851,26.0657652));\n listOfpoints.get(23).add(new LatLng (44.4169069,26.0695417));\n listOfpoints.get(23).add(new LatLng (44.4131364,26.073447));\n listOfpoints.get(23).add(new LatLng (44.4139948,26.0749491));\n listOfpoints.get(23).add(new LatLng (44.4156807,26.0782106));\n listOfpoints.get(23).add(new LatLng (44.4178265,26.0819443));\n listOfpoints.get(23).add(new LatLng (44.4184089,26.0840471));\n listOfpoints.get(23).add(new LatLng (44.4213514,26.0900982));\n listOfpoints.get(23).add(new LatLng (44.4240486, 26.0903986));\n listOfpoints.get(23).add(new LatLng (44.424447,26.0897978));\n listOfpoints.get(23).add(new LatLng (44.4252132,26.0783394));\n listOfpoints.get(23).add(new LatLng (44.4236808, 26.0737474));\n listOfpoints.get(23).add(new LatLng (44.4205851,26.0657652));\n\n\n\n listOfpoints.get(24).add(new LatLng (44.4427933,26.0989692));\n listOfpoints.get(24).add(new LatLng (44.442854,26.1011417));\n listOfpoints.get(24).add(new LatLng (44.4434668,26.1027725));\n listOfpoints.get(24).add(new LatLng (44.4430685, 26.1033304));\n listOfpoints.get(24).add(new LatLng (44.4430685,26.1047895));\n listOfpoints.get(24).add(new LatLng (44.4437732,26.1076648));\n listOfpoints.get(24).add(new LatLng (44.4446617,26.1085661));\n listOfpoints.get(24).add(new LatLng (44.4461629,26.1092956));\n listOfpoints.get(24).add(new LatLng (44.447174,26.1100252));\n listOfpoints.get(24).add(new LatLng (44.4473272,26.108609));\n listOfpoints.get(24).add(new LatLng (44.4480624,26.107064));\n listOfpoints.get(24).add(new LatLng (44.4480931,26.1060341));\n listOfpoints.get(24).add(new LatLng (44.4476948,26.1029871));\n listOfpoints.get(24).add(new LatLng (44.448522, 26.1028583));\n listOfpoints.get(24).add(new LatLng (44.4499006,26.102515));\n listOfpoints.get(24).add(new LatLng (44.4509729, 26.101485));\n listOfpoints.get(24).add(new LatLng (44.4529335,26.1007555));\n listOfpoints.get(24).add(new LatLng (44.452719,26.0935457));\n listOfpoints.get(24).add(new LatLng (44.4521063,26.0865934));\n listOfpoints.get(24).add(new LatLng (44.4506359,26.0897262));\n listOfpoints.get(24).add(new LatLng (44.4472046,26.0966785));\n listOfpoints.get(24).add(new LatLng (44.4465306,26.0971077));\n listOfpoints.get(24).add(new LatLng (44.4427933,26.0989692));\n\n\n listOfpoints.get(25).add(new LatLng (44.3944544,26.1201103));\n listOfpoints.get(25).add(new LatLng (44.3948837,26.1205394));\n listOfpoints.get(25).add(new LatLng (44.400587,26.1207969));\n listOfpoints.get(25).add(new LatLng (44.4069336,26.1209686));\n listOfpoints.get(25).add(new LatLng (44.4075468,26.1204536));\n listOfpoints.get(25).add(new LatLng (44.4081599,26.119252));\n listOfpoints.get(25).add(new LatLng (44.4083439, 26.1177499));\n listOfpoints.get(25).add(new LatLng (44.4084665, 26.1148317));\n listOfpoints.get(25).add(new LatLng (44.4090183,26.1131151));\n listOfpoints.get(25).add(new LatLng (44.4102139, 26.1109693));\n listOfpoints.get(25).add(new LatLng (44.411992,26.106549));\n listOfpoints.get(25).add(new LatLng (44.4128197, 26.105562));\n listOfpoints.get(25).add(new LatLng (44.4140152, 26.1047037));\n listOfpoints.get(25).add(new LatLng (44.4105512, 26.099468));\n listOfpoints.get(25).add(new LatLng (44.4088344, 26.0971077));\n listOfpoints.get(25).add(new LatLng (44.4074854,26.0960777));\n listOfpoints.get(25).add(new LatLng (44.4067803, 26.0957773));\n listOfpoints.get(25).add(new LatLng (44.4047262, 26.096936));\n listOfpoints.get(25).add(new LatLng (44.4024267, 26.098481));\n listOfpoints.get(25).add(new LatLng (44.4015068, 26.0996826));\n listOfpoints.get(25).add(new LatLng (44.3998818, 26.1055191));\n listOfpoints.get(25).add(new LatLng (44.3944544, 26.1201103));\n\n\n\n listOfpoints.get(26).add(new LatLng (44.4523651,26.0865441));\n listOfpoints.get(26).add(new LatLng (44.4526408,26.0898486));\n listOfpoints.get(26).add(new LatLng (44.4530697,26.0983887));\n listOfpoints.get(26).add(new LatLng (44.4558573,26.0971013));\n listOfpoints.get(26).add(new LatLng ( 44.4622592,26.0925522));\n listOfpoints.get(26).add(new LatLng ( 44.4635762, 26.0910073));\n listOfpoints.get(26).add(new LatLng (44.4658121,26.0865441));\n listOfpoints.get(26).add(new LatLng (44.4631474,26.0864153));\n listOfpoints.get(26).add(new LatLng (44.4534067,26.0861578));\n listOfpoints.get(26).add(new LatLng (44.4523651,26.0865441));\n\n\n\n listOfpoints.get(27).add(new LatLng (44.4346864, 26.0895482));\n listOfpoints.get(27).add(new LatLng (44.4398343, 26.0864583));\n listOfpoints.get(27).add(new LatLng (44.439865,26.0816947));\n listOfpoints.get(27).add(new LatLng (44.4420098,26.0807076));\n listOfpoints.get(27).add(new LatLng (44.4429903, 26.0808793));\n listOfpoints.get(27).add(new LatLng (44.4426532,26.0791626));\n listOfpoints.get(27).add(new LatLng (44.4405084, 26.0729399));\n listOfpoints.get(27).add(new LatLng (44.440202, 26.0727253));\n listOfpoints.get(27).add(new LatLng (44.4384555, 26.0702363));\n listOfpoints.get(27).add(new LatLng (44.4362186, 26.0744849));\n listOfpoints.get(27).add(new LatLng (44.4344413,26.0792914));\n listOfpoints.get(27).add(new LatLng (44.4346864,26.0895482));\n\n\n\n listOfpoints.get(28).add(new LatLng (44.443266, 26.0812226));\n listOfpoints.get(28).add(new LatLng (44.443061,26.0812143));\n listOfpoints.get(28).add(new LatLng (44.4437562,26.0855141));\n listOfpoints.get(28).add(new LatLng (44.4440626,26.0866299));\n listOfpoints.get(28).add(new LatLng (44.444798, 26.0884753));\n listOfpoints.get(28).add(new LatLng (44.4465443,26.0937539));\n listOfpoints.get(28).add(new LatLng (44.4468813,26.0958138));\n listOfpoints.get(28).add(new LatLng (44.4471264,26.0961142));\n listOfpoints.get(28).add(new LatLng (44.4492097, 26.0919943));\n listOfpoints.get(28).add(new LatLng (44.4507109,26.0889473));\n listOfpoints.get(28).add(new LatLng (44.4519056, 26.0864153));\n listOfpoints.get(28).add(new LatLng (44.4518137,26.0848275));\n listOfpoints.get(28).add(new LatLng (44.4481987, 26.0827246));\n listOfpoints.get(28).add(new LatLng (44.4455026,26.081523));\n listOfpoints.get(28).add(new LatLng (44.443266, 26.0812226));\n\n\n\n listOfpoints.get(29).add(new LatLng (44.4380283, 26.1146959));\n listOfpoints.get(29).add(new LatLng (44.437967, 26.115168));\n listOfpoints.get(29).add(new LatLng (44.4410924, 26.131905));\n listOfpoints.get(29).add(new LatLng (44.4413375,26.1327204));\n listOfpoints.get(29).add(new LatLng (44.443758, 26.1284717));\n listOfpoints.get(29).add(new LatLng (44.4467299, 26.1259827));\n listOfpoints.get(29).add(new LatLng (44.4480167,26.1254248));\n listOfpoints.get(29).add(new LatLng (44.4491809, 26.124266));\n listOfpoints.get(29).add(new LatLng (44.4380283, 26.1146959));\n\n\n listOfpoints.get(30).add(new LatLng (44.4129016,26.0735409));\n listOfpoints.get(30).add(new LatLng (44.4072915,26.0791628));\n listOfpoints.get(30).add(new LatLng (44.4031525,26.0816948));\n listOfpoints.get(30).add(new LatLng (44.4003317,26.0844414));\n listOfpoints.get(30).add(new LatLng (44.3973268,26.0850422));\n listOfpoints.get(30).add(new LatLng (44.4005463,26.0880463));\n listOfpoints.get(30).add(new LatLng (44.4017115, 26.0912221));\n listOfpoints.get(30).add(new LatLng (44.4043176,26.0963719));\n listOfpoints.get(30).add(new LatLng (44.4048695, 26.096329));\n listOfpoints.get(30).add(new LatLng (44.4060652,26.0956423));\n listOfpoints.get(30).add(new LatLng (44.4070462,26.0953848));\n listOfpoints.get(30).add(new LatLng (44.4084871, 26.096329));\n listOfpoints.get(30).add(new LatLng (44.4094682, 26.0951703));\n listOfpoints.get(30).add(new LatLng (44.4094375, 26.0944836));\n listOfpoints.get(30).add(new LatLng (44.4132388, 26.09178));\n listOfpoints.get(30).add(new LatLng (44.4145263, 26.091737));\n listOfpoints.get(30).add(new LatLng (44.4163656,26.0929387));\n listOfpoints.get(30).add(new LatLng (44.4183273,26.0930674));\n listOfpoints.get(30).add(new LatLng (44.4189404,26.0941832));\n listOfpoints.get(30).add(new LatLng (44.4212086, 26.0904067));\n listOfpoints.get(30).add(new LatLng (44.4210553,26.0898488));\n listOfpoints.get(30).add(new LatLng (44.4186339, 26.0850852));\n listOfpoints.get(30).add(new LatLng (44.4181741,26.0840123));\n listOfpoints.get(30).add(new LatLng (44.4176836, 26.0822527));\n listOfpoints.get(30).add(new LatLng (44.4171932,26.0813944));\n listOfpoints.get(30).add(new LatLng (44.4150781, 26.077575));\n listOfpoints.get(30).add(new LatLng (44.4129016, 26.0735409));\n\n\n\n listOfpoints.get(31).add(new LatLng (44.4152528, 26.1045537));\n listOfpoints.get(31).add(new LatLng (44.4142412, 26.1048541));\n listOfpoints.get(31).add(new LatLng (44.4125552,26.1062274));\n listOfpoints.get(31).add(new LatLng (44.4118501,26.1074291));\n listOfpoints.get(31).add(new LatLng (44.4107158,26.1103473));\n listOfpoints.get(31).add(new LatLng (44.4093976,26.1127935));\n listOfpoints.get(31).add(new LatLng (44.4087844, 26.1144243));\n listOfpoints.get(31).add(new LatLng (44.4085392, 26.1156259));\n listOfpoints.get(31).add(new LatLng (44.4085392,26.1170421));\n listOfpoints.get(31).add(new LatLng (44.4083246, 26.1195741));\n listOfpoints.get(31).add(new LatLng (44.4074355, 26.1209903));\n listOfpoints.get(31).add(new LatLng (44.409183, 26.1223636));\n listOfpoints.get(31).add(new LatLng (44.4168774, 26.1136518));\n listOfpoints.get(31).add(new LatLng (44.4158658, 26.1113344));\n listOfpoints.get(31).add(new LatLng (44.4156513, 26.1077295));\n listOfpoints.get(31).add(new LatLng (44.4152528,26.1045537));\n\n\n listOfpoints.get(32).add(new LatLng (44.4169364, 26.1141937));\n listOfpoints.get(32).add(new LatLng (44.4164766, 26.114537));\n listOfpoints.get(32).add(new LatLng (44.4110201,26.120631));\n listOfpoints.get(32).add(new LatLng (44.4094872,26.122648));\n listOfpoints.get(32).add(new LatLng (44.4131046, 26.1296003));\n listOfpoints.get(32).add(new LatLng (44.4151891, 26.1329906));\n listOfpoints.get(32).add(new LatLng (44.4171203, 26.1348789));\n listOfpoints.get(32).add(new LatLng (44.4201242, 26.1365526));\n listOfpoints.get(32).add(new LatLng (44.4204001,26.1351364));\n listOfpoints.get(32).add(new LatLng (44.4206759, 26.1333339));\n listOfpoints.get(32).add(new LatLng (44.42181,26.1313169));\n listOfpoints.get(32).add(new LatLng (44.4228827, 26.1314028));\n listOfpoints.get(32).add(new LatLng (44.4255799, 26.1284845));\n listOfpoints.get(32).add(new LatLng (44.4256412, 26.1274975));\n listOfpoints.get(32).add(new LatLng (44.4257638, 26.1234634));\n listOfpoints.get(32).add(new LatLng (44.425917, 26.1195152));\n listOfpoints.get(32).add(new LatLng (44.4238635, 26.1194294));\n listOfpoints.get(32).add(new LatLng (44.4193273,26.115567));\n listOfpoints.get(32).add(new LatLng (44.4169364, 26.1141937));\n\n\n listOfpoints.get(33).add(new LatLng (44.4261929,26.1191112));\n listOfpoints.get(33).add(new LatLng (44.4255799,26.1284845));\n listOfpoints.get(33).add(new LatLng (44.4318104,26.1386596));\n listOfpoints.get(33).add(new LatLng (44.4320863,26.1385309));\n listOfpoints.get(33).add(new LatLng (44.4313814,26.1329948));\n listOfpoints.get(33).add(new LatLng (44.4316879,26.129819));\n listOfpoints.get(33).add(new LatLng (44.4326992,26.1229526));\n listOfpoints.get(33).add(new LatLng (44.4328861,26.1207289));\n listOfpoints.get(33).add(new LatLng (44.4300024, 26.1205493));\n listOfpoints.get(33).add(new LatLng (44.4288684,26.1196481));\n listOfpoints.get(33).add(new LatLng (44.4275797,26.1191541));\n listOfpoints.get(33).add(new LatLng (44.4261929,26.1191112));\n\n\n listOfpoints.get(34).add(new LatLng (44.4202782, 26.1364709));\n listOfpoints.get(34).add(new LatLng (44.4204314,26.1366855));\n listOfpoints.get(34).add(new LatLng (44.4255806,26.1375009));\n listOfpoints.get(34).add(new LatLng (44.4293579,26.1390888));\n listOfpoints.get(34).add(new LatLng (44.4303615,26.139196));\n listOfpoints.get(34).add(new LatLng (44.4317406,26.1386596));\n listOfpoints.get(34).add(new LatLng (44.4266686,26.1303877));\n listOfpoints.get(34).add(new LatLng (44.4255882,26.128596));\n listOfpoints.get(34).add(new LatLng (44.4250212,26.1291968));\n listOfpoints.get(34).add(new LatLng (44.4230214, 26.1315571));\n listOfpoints.get(34).add(new LatLng (44.4227685,26.1316644));\n listOfpoints.get(34).add(new LatLng (44.4217877,26.1315678));\n listOfpoints.get(34).add(new LatLng (44.4207762,26.1334668));\n listOfpoints.get(34).add(new LatLng (44.4202782,26.1364709));\n\n\n listOfpoints.get(35).add(new LatLng (44.4438143,26.1191764));\n listOfpoints.get(35).add(new LatLng (44.4437985,26.1194425));\n listOfpoints.get(35).add(new LatLng (44.4469926,26.1222749));\n listOfpoints.get(35).add(new LatLng (44.4492443, 26.1240881));\n listOfpoints.get(35).add(new LatLng (44.4504315,26.123144));\n listOfpoints.get(35).add(new LatLng (44.4512893,26.1217492));\n listOfpoints.get(35).add(new LatLng (44.451421, 26.1212347));\n listOfpoints.get(35).add(new LatLng (44.4523401, 26.1180161));\n listOfpoints.get(35).add(new LatLng (44.4527077, 26.1145399));\n listOfpoints.get(35).add(new LatLng (44.452944, 26.1009052));\n listOfpoints.get(35).add(new LatLng (44.4516573,26.1013558));\n listOfpoints.get(35).add(new LatLng (44.4510217,26.1016777));\n listOfpoints.get(35).add(new LatLng (44.4500413,26.1025574));\n listOfpoints.get(35).add(new LatLng (44.449712,26.1027291));\n listOfpoints.get(35).add(new LatLng (44.4477666,26.1031153));\n listOfpoints.get(35).add(new LatLng (44.4479198,26.1042526));\n listOfpoints.get(35).add(new LatLng (44.448027,26.1051967));\n listOfpoints.get(35).add(new LatLng (44.4481419,26.1058619));\n listOfpoints.get(35).add(new LatLng (44.4481189, 26.1070206));\n listOfpoints.get(35).add(new LatLng (44.448004,26.1073425));\n listOfpoints.get(35).add(new LatLng (44.4473836,26.1088338));\n listOfpoints.get(35).add(new LatLng (44.4472917,26.1100569));\n listOfpoints.get(35).add(new LatLng (44.4471385, 26.1102929));\n listOfpoints.get(35).add(new LatLng (44.4469241,26.1116877));\n listOfpoints.get(35).add(new LatLng (44.4469394,26.1122456));\n listOfpoints.get(35).add(new LatLng (44.4467403,26.1136403));\n listOfpoints.get(35).add(new LatLng (44.445959,26.1161938));\n listOfpoints.get(35).add(new LatLng (44.4448254,26.1176744));\n listOfpoints.get(35).add(new LatLng (44.4438143,26.1191764));\n\n\n listOfpoints.get(36).add(new LatLng (44.4391967, 26.1225882));\n listOfpoints.get(36).add(new LatLng (44.4372662,26.123983));\n listOfpoints.get(36).add(new LatLng (44.4356115, 26.1252275));\n listOfpoints.get(36).add(new LatLng (44.4344471, 26.1254207));\n listOfpoints.get(36).add(new LatLng (44.4324705,26.1258069));\n listOfpoints.get(36).add(new LatLng (44.4315052, 26.1327377));\n listOfpoints.get(36).add(new LatLng (44.432256,26.1385742));\n listOfpoints.get(36).add(new LatLng (44.4351059,26.1373511));\n listOfpoints.get(36).add(new LatLng (44.4376339, 26.1363641));\n listOfpoints.get(36).add(new LatLng (44.4389822, 26.1353985));\n listOfpoints.get(36).add(new LatLng (44.4401772,26.1345402));\n listOfpoints.get(36).add(new LatLng (44.4411883, 26.1334458));\n listOfpoints.get(36).add(new LatLng (44.4402231, 26.1281458));\n listOfpoints.get(36).add(new LatLng (44.4398861,26.126279));\n listOfpoints.get(36).add(new LatLng (44.4391967, 26.1225882));\n\n\n\n listOfpoints.get(37).add(new LatLng (44.3978822,26.1102715));\n listOfpoints.get(37).add(new LatLng (44.3977135, 26.1097995));\n listOfpoints.get(37).add(new LatLng (44.3909519,26.1099282));\n listOfpoints.get(37).add(new LatLng (44.3874558, 26.1100784));\n listOfpoints.get(37).add(new LatLng (44.3877779, 26.1129538));\n listOfpoints.get(37).add(new LatLng (44.3881766, 26.1154428));\n listOfpoints.get(37).add(new LatLng (44.3886059, 26.1165586));\n listOfpoints.get(37).add(new LatLng (44.3894799, 26.1180178));\n listOfpoints.get(37).add(new LatLng (44.3906606, 26.1193052));\n listOfpoints.get(37).add(new LatLng (44.3927152, 26.1205927));\n listOfpoints.get(37).add(new LatLng (44.3936352, 26.1206785));\n listOfpoints.get(37).add(new LatLng (44.3940339, 26.1202279));\n listOfpoints.get(37).add(new LatLng (44.3978822,26.1102715));\n\n\n\n listOfpoints.get(38).add(new LatLng (44.389256,26.0917973));\n listOfpoints.get(38).add(new LatLng (44.3892556,26.0920523));\n listOfpoints.get(38).add(new LatLng (44.4003643, 26.0970731));\n listOfpoints.get(38).add(new LatLng (44.4008548, 26.0971482));\n listOfpoints.get(38).add(new LatLng (44.4030625, 26.0971601));\n listOfpoints.get(38).add(new LatLng (44.4043195,26.0965593));\n listOfpoints.get(38).add(new LatLng (44.4019587, 26.0920531));\n listOfpoints.get(38).add(new LatLng (44.4005636,26.0883195));\n listOfpoints.get(38).add(new LatLng (44.3987104,26.0864919));\n listOfpoints.get(38).add(new LatLng (44.3972443, 26.0851884));\n listOfpoints.get(38).add(new LatLng (44.3961557,26.0851884));\n listOfpoints.get(38).add(new LatLng (44.3946992,26.0841584));\n listOfpoints.get(38).add(new LatLng (44.3918473,26.0856819));\n listOfpoints.get(38).add(new LatLng (44.3912493,26.08639));\n listOfpoints.get(38).add(new LatLng (44.389256, 26.0917973));\n\n\n\n listOfpoints.get(39).add(new LatLng (44.4029942,26.0973363));\n listOfpoints.get(39).add(new LatLng (44.4011008,26.0974224));\n listOfpoints.get(39).add(new LatLng (44.399997,26.0972078));\n listOfpoints.get(39).add(new LatLng (44.389065,26.0922189));\n listOfpoints.get(39).add(new LatLng (44.3863339,26.0922418));\n listOfpoints.get(39).add(new LatLng (44.387806,26.0981212));\n listOfpoints.get(39).add(new LatLng (44.3887261,26.1004386));\n listOfpoints.get(39).add(new LatLng (44.3889714,26.1023269));\n listOfpoints.get(39).add(new LatLng (44.3887567,26.1040435));\n listOfpoints.get(39).add(new LatLng (44.3875607,26.1097513));\n listOfpoints.get(39).add(new LatLng (44.3977341,26.1097306));\n listOfpoints.get(39).add(new LatLng (44.3979142,26.1101973));\n listOfpoints.get(39).add(new LatLng (44.397964,26.1101222));\n listOfpoints.get(39).add(new LatLng (44.3996198,26.1059165));\n listOfpoints.get(39).add(new LatLng (44.4016128,26.0990715));\n listOfpoints.get(39).add(new LatLng (44.4030402,26.0978593));\n listOfpoints.get(39).add(new LatLng (44.4029942,26.0973363));\n\n\n\n listOfpoints.get(40).add(new LatLng (44.4496116, 26.1241839));\n listOfpoints.get(40).add(new LatLng (44.4494277,26.1245701));\n listOfpoints.get(40).add(new LatLng (44.4610682, 26.1325953));\n listOfpoints.get(40).add(new LatLng (44.4618646,26.1326811));\n listOfpoints.get(40).add(new LatLng (44.4644374, 26.1345265));\n listOfpoints.get(40).add(new LatLng (44.4660607, 26.1368439));\n listOfpoints.get(40).add(new LatLng (44.4665813,26.1365435));\n listOfpoints.get(40).add(new LatLng (44.4663976,26.1354277));\n listOfpoints.get(40).add(new LatLng (44.4667345, 26.1349985));\n listOfpoints.get(40).add(new LatLng (44.4681739, 26.1354277));\n listOfpoints.get(40).add(new LatLng (44.4701952, 26.1371014));\n listOfpoints.get(40).add(new LatLng (44.4719714, 26.1368868));\n listOfpoints.get(40).add(new LatLng (44.4730739, 26.1358998));\n listOfpoints.get(40).add(new LatLng (44.4731964,26.1346981));\n listOfpoints.get(40).add(new LatLng (44.4687252,26.1305783));\n listOfpoints.get(40).add(new LatLng (44.466857,26.1310932));\n listOfpoints.get(40).add(new LatLng (44.4662751, 26.1310932));\n listOfpoints.get(40).add(new LatLng (44.4658769, 26.1300633));\n listOfpoints.get(40).add(new LatLng (44.4666426, 26.129162));\n listOfpoints.get(40).add(new LatLng (44.4689089,26.1285183));\n listOfpoints.get(40).add(new LatLng (44.4697971, 26.1290333));\n listOfpoints.get(40).add(new LatLng (44.4723389, 26.1319945));\n listOfpoints.get(40).add(new LatLng (44.4743294,26.1327669));\n listOfpoints.get(40).add(new LatLng (44.4750338,26.1320374));\n listOfpoints.get(40).add(new LatLng (44.4756462,26.1297199));\n listOfpoints.get(40).add(new LatLng (44.4742376,26.1249563));\n listOfpoints.get(40).add(new LatLng (44.4742988, 26.1238835));\n listOfpoints.get(40).add(new LatLng (44.4741457,26.1231968));\n listOfpoints.get(40).add(new LatLng (44.4676533,26.1269734));\n listOfpoints.get(40).add(new LatLng (44.4668876,26.1267588));\n listOfpoints.get(40).add(new LatLng (44.4649275,26.1207506));\n listOfpoints.get(40).add(new LatLng (44.4648662,26.120064));\n listOfpoints.get(40).add(new LatLng (44.4674389,26.118562));\n listOfpoints.get(40).add(new LatLng (44.4689089,26.1177895));\n listOfpoints.get(40).add(new LatLng (44.4710833,26.1160729));\n listOfpoints.get(40).add(new LatLng (44.4714202,26.1163304));\n listOfpoints.get(40).add(new LatLng (44.4722777,26.116502));\n listOfpoints.get(40).add(new LatLng (44.4729208,26.1131117));\n listOfpoints.get(40).add(new LatLng (44.4723083,26.1107084));\n listOfpoints.get(40).add(new LatLng (44.4725227,26.1095926));\n listOfpoints.get(40).add(new LatLng (44.4733801,26.1087343));\n listOfpoints.get(40).add(new LatLng (44.4735945, 26.1082194));\n listOfpoints.get(40).add(new LatLng (44.4700727,26.1101076));\n listOfpoints.get(40).add(new LatLng (44.4533184,26.1047861));\n listOfpoints.get(40).add(new LatLng (44.4531039,26.105344));\n listOfpoints.get(40).add(new LatLng (44.4528589,26.1152146));\n listOfpoints.get(40).add(new LatLng (44.4526138,26.1174891));\n listOfpoints.get(40).add(new LatLng (44.452093,26.1197207));\n listOfpoints.get(40).add(new LatLng (44.4508982,26.1229822));\n listOfpoints.get(40).add(new LatLng (44.4496116, 26.1241839));\n\n\n listOfpoints.get(41).add(new LatLng (44.4531249,26.1045259));\n listOfpoints.get(41).add(new LatLng (44.4550165,26.1051764));\n listOfpoints.get(41).add(new LatLng (44.4698103,26.1097469));\n listOfpoints.get(41).add(new LatLng (44.4709588,26.1093392));\n listOfpoints.get(41).add(new LatLng (44.4739216,26.1077299));\n listOfpoints.get(41).add(new LatLng (44.4734929,26.1050262));\n listOfpoints.get(41).add(new LatLng (44.4721455,26.105155));\n listOfpoints.get(41).add(new LatLng (44.4701242,26.1040392));\n listOfpoints.get(41).add(new LatLng (44.467521, 26.101593));\n listOfpoints.get(41).add(new LatLng (44.4673067, 26.1001768));\n listOfpoints.get(41).add(new LatLng (44.4664185,26.099061));\n listOfpoints.get(41).add(new LatLng (44.4660816,26.0979023));\n listOfpoints.get(41).add(new LatLng (44.4662041,26.0968294));\n listOfpoints.get(41).add(new LatLng (44.4671535,26.0960569));\n listOfpoints.get(41).add(new LatLng (44.4677661,26.0958853));\n listOfpoints.get(41).add(new LatLng (44.4680723,26.0951986));\n listOfpoints.get(41).add(new LatLng (44.4691748,26.0952415));\n listOfpoints.get(41).add(new LatLng (44.4720536,26.0967865));\n listOfpoints.get(41).add(new LatLng (44.4742278,26.0964861));\n listOfpoints.get(41).add(new LatLng (44.4749015, 26.0951986));\n listOfpoints.get(41).add(new LatLng (44.4747178,26.0948124));\n listOfpoints.get(41).add(new LatLng (44.4719617,26.0923662));\n listOfpoints.get(41).add(new LatLng (44.4714717,26.0908642));\n listOfpoints.get(41).add(new LatLng (44.4717167,26.0897913));\n listOfpoints.get(41).add(new LatLng (44.4723598,26.0888901));\n listOfpoints.get(41).add(new LatLng (44.4732479,26.0894909));\n listOfpoints.get(41).add(new LatLng (44.4732785,26.0900917));\n listOfpoints.get(41).add(new LatLng (44.4732479,26.0907783));\n listOfpoints.get(41).add(new LatLng (44.4735235,26.0912075));\n listOfpoints.get(41).add(new LatLng (44.4740135,26.0907354));\n listOfpoints.get(41).add(new LatLng (44.4734316,26.0891046));\n listOfpoints.get(41).add(new LatLng (44.4724211,26.0881176));\n listOfpoints.get(41).add(new LatLng (44.4661428,26.0866585));\n listOfpoints.get(41).add(new LatLng (44.4639989,26.09095));\n listOfpoints.get(41).add(new LatLng (44.4621305,26.0931387));\n listOfpoints.get(41).add(new LatLng (44.4558053,26.0973375));\n listOfpoints.get(41).add(new LatLng (44.4531632,26.0985928));\n listOfpoints.get(41).add(new LatLng (44.4531249,26.1045259));\n\n\n\n listOfpoints.get(42).add(new LatLng (44.4386598, 26.0701274));\n listOfpoints.get(42).add(new LatLng (44.4404676, 26.072638));\n listOfpoints.get(42).add(new LatLng (44.4426125, 26.0786676));\n listOfpoints.get(42).add(new LatLng (44.4427656, 26.0791182));\n listOfpoints.get(42).add(new LatLng (44.4429801, 26.0806202));\n listOfpoints.get(42).add(new LatLng (44.4461972, 26.0758781));\n listOfpoints.get(42).add(new LatLng ( 44.4465955, 26.0753846));\n listOfpoints.get(42).add(new LatLng ( 44.4468405, 26.0753202));\n listOfpoints.get(42).add(new LatLng (44.4474227, 26.0759639));\n listOfpoints.get(42).add(new LatLng (44.4501186, 26.0695052));\n listOfpoints.get(42).add(new LatLng ( 44.4472848, 26.063776));\n listOfpoints.get(42).add(new LatLng ( 44.4461972,26.0623597));\n listOfpoints.get(42).add(new LatLng (44.4454925, 26.0618233));\n listOfpoints.get(42).add(new LatLng ( 44.4442057,26.0612654));\n listOfpoints.get(42).add(new LatLng (44.4432099,26.0609435));\n listOfpoints.get(42).add(new LatLng ( 44.4429035,26.062467));\n listOfpoints.get(42).add(new LatLng (44.4385679, 26.0699558));\n listOfpoints.get(42).add(new LatLng (44.4386598, 26.0701274));\n\n\n\n listOfpoints.get(43).add(new LatLng ( 44.4430787,26.0806953));\n listOfpoints.get(43).add(new LatLng ( 44.443126, 26.0810753));\n listOfpoints.get(43).add(new LatLng ( 44.4455924,26.0813757));\n listOfpoints.get(43).add(new LatLng (44.4467107,26.0816761));\n listOfpoints.get(43).add(new LatLng (44.4514593,26.0842939));\n listOfpoints.get(43).add(new LatLng (44.4518575,26.0844441));\n listOfpoints.get(43).add(new LatLng (44.4519188,26.0818906));\n listOfpoints.get(43).add(new LatLng (44.4520107,26.0813971));\n listOfpoints.get(43).add(new LatLng (44.452026,26.0767193));\n listOfpoints.get(43).add(new LatLng (44.4527, 26.0732861));\n listOfpoints.get(43).add(new LatLng ( 44.4511682,26.0706039));\n listOfpoints.get(43).add(new LatLng (44.4503219, 26.069692));\n listOfpoints.get(43).add(new LatLng (44.4502719,26.0698017));\n listOfpoints.get(43).add(new LatLng (44.4475595, 26.0760068));\n listOfpoints.get(43).add(new LatLng (44.447414, 26.0761356));\n listOfpoints.get(43).add(new LatLng (44.4468242, 26.0754811));\n listOfpoints.get(43).add(new LatLng (44.4465485, 26.0755562));\n listOfpoints.get(43).add(new LatLng (44.4462728, 26.0759746));\n listOfpoints.get(43).add(new LatLng (44.4430787,26.0806953));\n\n\n\n listOfpoints.get(44).add(new LatLng (44.4283234, 26.0653913));\n listOfpoints.get(44).add(new LatLng (44.4299706,26.0672689));\n listOfpoints.get(44).add(new LatLng (44.431342,26.068213));\n listOfpoints.get(44).add(new LatLng (44.4358314, 26.0745752));\n listOfpoints.get(44).add(new LatLng (44.4382828,26.0698974));\n listOfpoints.get(44).add(new LatLng (44.4353105,26.0630095));\n listOfpoints.get(44).add(new LatLng (44.435096,26.0616792));\n listOfpoints.get(44).add(new LatLng (44.4344678, 26.0595763));\n listOfpoints.get(44).add(new LatLng (44.4320315, 26.0595334));\n listOfpoints.get(44).add(new LatLng (44.4316178, 26.0600913));\n listOfpoints.get(44).add(new LatLng (44.4291968, 26.0639));\n listOfpoints.get(44).add(new LatLng (44.4283234, 26.0653913));\n\n\n listOfpoints.get(45).add(new LatLng (44.4413922,26.133057));\n listOfpoints.get(45).add(new LatLng (44.441285, 26.1333359));\n listOfpoints.get(45).add(new LatLng (44.4414535,26.1345376));\n listOfpoints.get(45).add(new LatLng (44.4428936,26.1475195));\n listOfpoints.get(45).add(new LatLng (44.443154,26.1493863));\n listOfpoints.get(45).add(new LatLng (44.4434451, 26.149794));\n listOfpoints.get(45).add(new LatLng (44.4437515,26.1497082));\n listOfpoints.get(45).add(new LatLng (44.4445175,26.1494721));\n listOfpoints.get(45).add(new LatLng (44.4454979,26.1488713));\n listOfpoints.get(45).add(new LatLng (44.4459574,26.1481847));\n listOfpoints.get(45).add(new LatLng (44.447091,26.147262));\n listOfpoints.get(45).add(new LatLng (44.448148,26.1456527));\n listOfpoints.get(45).add(new LatLng (44.4520847, 26.1353101));\n listOfpoints.get(45).add(new LatLng (44.4529577,26.1321129));\n listOfpoints.get(45).add(new LatLng (44.4531262,26.1316623));\n listOfpoints.get(45).add(new LatLng (44.4536776, 26.1311473));\n listOfpoints.get(45).add(new LatLng (44.4547192, 26.1298813));\n listOfpoints.get(45).add(new LatLng (44.455148,26.1288513));\n listOfpoints.get(45).add(new LatLng (44.449833, 26.1251177));\n listOfpoints.get(45).add(new LatLng (44.4491437, 26.12471));\n listOfpoints.get(45).add(new LatLng (44.4477038,26.1259545));\n listOfpoints.get(45).add(new LatLng (44.4462332, 26.1266841));\n listOfpoints.get(45).add(new LatLng (44.4447013, 26.1279501));\n listOfpoints.get(45).add(new LatLng (44.4436596, 26.129259));\n listOfpoints.get(45).add(new LatLng (44.4413922,26.133057));\n\n\n\n listOfpoints.get(46).add(new LatLng (44.4322314,26.1388506));\n listOfpoints.get(46).add(new LatLng (44.4335155,26.1535014));\n listOfpoints.get(46).add(new LatLng (44.4338066,26.1552395));\n listOfpoints.get(46).add(new LatLng (44.434971,26.1596598));\n listOfpoints.get(46).add(new LatLng (44.4350966, 26.1598576));\n listOfpoints.get(46).add(new LatLng (44.4421748,26.1571969));\n listOfpoints.get(46).add(new LatLng (44.4425731, 26.1570252));\n listOfpoints.get(46).add(new LatLng (44.4429102, 26.1561669));\n listOfpoints.get(46).add(new LatLng (44.443477, 26.1502231));\n listOfpoints.get(46).add(new LatLng (44.4429255, 26.1494077));\n listOfpoints.get(46).add(new LatLng (44.442328, 26.144215));\n listOfpoints.get(46).add(new LatLng (44.4418837, 26.1404384));\n listOfpoints.get(46).add(new LatLng (44.4412556, 26.1349882));\n listOfpoints.get(46).add(new LatLng (44.4411331, 26.1338295));\n listOfpoints.get(46).add(new LatLng (44.4406428,26.1344732));\n listOfpoints.get(46).add(new LatLng (44.4388656, 26.1357821));\n listOfpoints.get(46).add(new LatLng (44.4374868, 26.1367048));\n listOfpoints.get(46).add(new LatLng (44.4350813, 26.137606));\n listOfpoints.get(46).add(new LatLng (44.4322314, 26.1388506));\n\n\n\n listOfpoints.get(47).add(new LatLng (44.4202257, 26.1368063));\n listOfpoints.get(47).add(new LatLng (44.4179627,26.1463187));\n listOfpoints.get(47).add(new LatLng (44.4227749, 26.149709));\n listOfpoints.get(47).add(new LatLng (44.4231734, 26.1503527));\n listOfpoints.get(47).add(new LatLng (44.4237251, 26.1504386));\n listOfpoints.get(47).add(new LatLng (44.4261157, 26.1495373));\n listOfpoints.get(47).add(new LatLng (44.4262996, 26.1508463));\n listOfpoints.get(47).add(new LatLng (44.4268206, 26.1524341));\n listOfpoints.get(47).add(new LatLng (44.4283937, 26.1547449));\n listOfpoints.get(47).add(new LatLng (44.433251, 26.1534574));\n listOfpoints.get(47).add(new LatLng (44.4320712, 26.1388662));\n listOfpoints.get(47).add(new LatLng (44.430401,26.139467));\n listOfpoints.get(47).add(new LatLng (44.4295736, 26.1393812));\n listOfpoints.get(47).add(new LatLng (44.4254668, 26.137686));\n listOfpoints.get(47).add(new LatLng (44.4241642,26.1374929));\n listOfpoints.get(47).add(new LatLng (44.4202257,26.1368063));\n\n\n\n listOfpoints.get(48).add(new LatLng (44.4234516,26.1510693));\n listOfpoints.get(48).add(new LatLng (44.425076, 26.1630856));\n listOfpoints.get(48).add(new LatLng (44.4292135,26.1619484));\n listOfpoints.get(48).add(new LatLng(44.4286618, 26.1578285));\n listOfpoints.get(48).add(new LatLng (44.4287078,26.156026));\n listOfpoints.get(48).add(new LatLng (44.4286925,26.1557042));\n listOfpoints.get(48).add(new LatLng (44.4269762, 26.1532151));\n listOfpoints.get(48).add(new LatLng (44.4262407, 26.151713));\n listOfpoints.get(48).add(new LatLng (44.4259189, 26.1499535));\n listOfpoints.get(48).add(new LatLng (44.4237122, 26.1506402));\n listOfpoints.get(48).add(new LatLng (44.4234516, 26.1510693));\n\n\n\n listOfpoints.get(49).add(new LatLng (44.4285513, 26.1548459));\n listOfpoints.get(49).add(new LatLng (44.4286925, 26.1557042));\n listOfpoints.get(49).add(new LatLng (44.4287964, 26.1580645));\n listOfpoints.get(49).add(new LatLng (44.4290876, 26.1602317));\n listOfpoints.get(49).add(new LatLng (44.4302981,26.1670124));\n listOfpoints.get(49).add(new LatLng (44.4357222, 26.1692654));\n listOfpoints.get(49).add(new LatLng (44.4362584,26.1689865));\n listOfpoints.get(49).add(new LatLng (44.4366108, 26.1683857));\n listOfpoints.get(49).add(new LatLng (44.4367794,26.1675274));\n listOfpoints.get(49).add(new LatLng (44.433332, 26.1536442));\n listOfpoints.get(49).add(new LatLng (44.4285513, 26.1548459));\n\n\n\n listOfpoints.get(50).add(new LatLng (44.4178742, 26.14650));\n listOfpoints.get(50).add(new LatLng (44.4142265, 26.15554));\n listOfpoints.get(50).add(new LatLng (44.41369, 26.1578359));\n listOfpoints.get(50).add(new LatLng (44.4131842,26.1635008));\n listOfpoints.get(50).add(new LatLng (44.4133221, 26.1636295));\n listOfpoints.get(50).add(new LatLng (44.4154679, 26.1645951));\n listOfpoints.get(50).add(new LatLng (44.4169393, 26.1648526));\n listOfpoints.get(50).add(new LatLng (44.4181654, 26.1648097));\n listOfpoints.get(50).add(new LatLng (44.420403, 26.1642732));\n listOfpoints.get(50).add(new LatLng (44.4248319, 26.1631574));\n listOfpoints.get(50).add(new LatLng (44.4232688, 26.151227));\n listOfpoints.get(50).add(new LatLng (44.4226558, 26.1500253));\n listOfpoints.get(50).add(new LatLng (44.4178742, 26.1465063));\n\n\n listOfpoints.get(51).add(new LatLng (44.409177,26.1228262));\n listOfpoints.get(51).add(new LatLng (44.4079354,26.1261736));\n listOfpoints.get(51).add(new LatLng (44.3993506, 26.1595188));\n listOfpoints.get(51).add(new LatLng (44.4000559,26.1602484));\n listOfpoints.get(51).add(new LatLng (44.407077,26.1638962));\n listOfpoints.get(51).add(new LatLng (44.4081807, 26.1641108));\n listOfpoints.get(51).add(new LatLng (44.4091004, 26.1638104));\n listOfpoints.get(51).add(new LatLng (44.4114916, 26.162995));\n listOfpoints.get(51).add(new LatLng (44.4129018, 26.16351));\n listOfpoints.get(51).add(new LatLng (44.413147, 26.1608063));\n listOfpoints.get(51).add(new LatLng (44.4135762, 26.1567723));\n listOfpoints.get(51).add(new LatLng (44.4148943, 26.1529957));\n listOfpoints.get(51).add(new LatLng (44.4176838,26.1461722));\n listOfpoints.get(51).add(new LatLng (44.4183121,26.1435329));\n listOfpoints.get(51).add(new LatLng (44.4200133, 26.1367523));\n listOfpoints.get(51).add(new LatLng (44.4175152,26.1354433));\n listOfpoints.get(51).add(new LatLng (44.4159825, 26.1342417));\n listOfpoints.get(51).add(new LatLng (44.4146031,26.1324822));\n listOfpoints.get(51).add(new LatLng (44.4113383,26.1266242));\n listOfpoints.get(51).add(new LatLng (44.409177,26.1228262));\n\n\n listOfpoints.get(52).add(new LatLng (44.3988714,26.159323));\n listOfpoints.get(52).add(new LatLng (44.4079468,26.1248191));\n listOfpoints.get(52).add(new LatLng (44.4088665, 26.1225875));\n listOfpoints.get(52).add(new LatLng (44.4080694,26.1217721));\n listOfpoints.get(52).add(new LatLng (44.4065059,26.1213858));\n listOfpoints.get(52).add(new LatLng (44.3941185, 26.120785));\n listOfpoints.get(52).add(new LatLng (44.3862678, 26.1391528));\n listOfpoints.get(52).add(new LatLng (44.3887826,26.1415131));\n listOfpoints.get(52).add(new LatLng (44.3886293, 26.1448605));\n listOfpoints.get(52).add(new LatLng (44.3891813, 26.1464484));\n listOfpoints.get(52).add(new LatLng (44.389304, 26.1472209));\n listOfpoints.get(52).add(new LatLng (44.3927079, 26.155761));\n listOfpoints.get(52).add(new LatLng (44.3941492, 26.1572631));\n listOfpoints.get(52).add(new LatLng (44.3985648, 26.16031));\n listOfpoints.get(52).add(new LatLng (44.3988714, 26.159323));\n\n\n\n listOfpoints.get(53).add(new LatLng (44.3886499, 26.1177499));\n listOfpoints.get(53).add(new LatLng (44.3892939, 26.1179645));\n listOfpoints.get(53).add(new LatLng (44.3881592, 26.1159046));\n listOfpoints.get(53).add(new LatLng (44.3876838,26.1132224));\n listOfpoints.get(53).add(new LatLng (44.3873311, 26.1100895));\n listOfpoints.get(53).add(new LatLng (44.3887879, 26.1032445));\n listOfpoints.get(53).add(new LatLng (44.3888645, 26.1022789));\n listOfpoints.get(53).add(new LatLng (44.3886192, 26.1005838));\n listOfpoints.get(53).add(new LatLng (44.3883738,26.0998542));\n listOfpoints.get(53).add(new LatLng (44.3876225,26.097923));\n listOfpoints.get(53).add(new LatLng (44.3869478, 26.0954554));\n listOfpoints.get(53).add(new LatLng (44.3862577, 26.0924299));\n listOfpoints.get(53).add(new LatLng (44.3860584, 26.0924299));\n listOfpoints.get(53).add(new LatLng (44.3789427, 26.0917003));\n listOfpoints.get(53).add(new LatLng (44.3757526,26.1157758));\n listOfpoints.get(53).add(new LatLng (44.375998,26.1173208));\n listOfpoints.get(53).add(new LatLng (44.3765195,26.1189945));\n listOfpoints.get(53).add(new LatLng (44.3769183,26.1194665));\n listOfpoints.get(53).add(new LatLng (44.3775624, 26.1194236));\n listOfpoints.get(53).add(new LatLng (44.3786973,26.1184366));\n listOfpoints.get(53).add(new LatLng (44.3824393,26.1150248));\n listOfpoints.get(53).add(new LatLng (44.3831447, 26.114939));\n listOfpoints.get(53).add(new LatLng (44.3840802, 26.1151106));\n listOfpoints.get(53).add(new LatLng (44.3879598, 26.1175568));\n listOfpoints.get(53).add(new LatLng (44.3886499,26.1177499));\n\n\n listOfpoints.get(54).add(new LatLng ( 44.3939843, 26.1207857));\n listOfpoints.get(54).add(new LatLng (44.3928679,26.120861));\n listOfpoints.get(54).add(new LatLng (44.3916643, 26.1202602));\n listOfpoints.get(54).add(new LatLng (44.3901386, 26.1189727));\n listOfpoints.get(54).add(new LatLng (44.3894869, 26.1181573));\n listOfpoints.get(54).add(new LatLng (44.3881836, 26.1178784));\n listOfpoints.get(54).add(new LatLng (44.3839589, 26.1153034));\n listOfpoints.get(54).add(new LatLng (44.3830541, 26.1151318));\n listOfpoints.get(54).add(new LatLng (44.382479, 26.1153034));\n listOfpoints.get(54).add(new LatLng (44.3814899, 26.1160544));\n listOfpoints.get(54).add(new LatLng (44.3792585,26.1181466));\n listOfpoints.get(54).add(new LatLng (44.3765793, 26.1204638));\n listOfpoints.get(54).add(new LatLng (44.3792479, 26.1275449));\n listOfpoints.get(54).add(new LatLng (44.379524,26.135098));\n listOfpoints.get(54).add(new LatLng (44.3856888, 26.1398616));\n listOfpoints.get(54).add(new LatLng (44.3939843,26.1207857));\n\n\n listOfpoints.get(55).add(new LatLng (44.3777851, 26.0469458));\n listOfpoints.get(55).add(new LatLng (44.3767422, 26.0507223));\n listOfpoints.get(55).add(new LatLng (44.3901146,26.0632536));\n listOfpoints.get(55).add(new LatLng (44.4006018,26.0712359));\n listOfpoints.get(55).add(new LatLng (44.4064272, 26.0638544));\n listOfpoints.get(55).add(new LatLng (44.4054461,26.0626528));\n listOfpoints.get(55).add(new LatLng (44.3997432, 26.0485766));\n listOfpoints.get(55).add(new LatLng (44.3817726,26.0459158));\n listOfpoints.get(55).add(new LatLng (44.3777851, 26.0469458));\n\n\n listOfpoints.get(56).add(new LatLng (44.406462, 26.0640051));\n listOfpoints.get(56).add(new LatLng (44.4007746, 26.0715552));\n listOfpoints.get(56).add(new LatLng (44.3971564,26.0688944));\n listOfpoints.get(56).add(new LatLng (44.3905634, 26.0639591));\n listOfpoints.get(56).add(new LatLng (44.3862699, 26.078207));\n listOfpoints.get(56).add(new LatLng (44.38124,26.0855027));\n listOfpoints.get(56).add(new LatLng (44.3802585, 26.0858031));\n listOfpoints.get(56).add(new LatLng (44.3797064, 26.0867901));\n listOfpoints.get(56).add(new LatLng (44.3790009,26.091425));\n listOfpoints.get(56).add(new LatLng (44.3848591,26.091897));\n listOfpoints.get(56).add(new LatLng (44.3890301,26.0918541));\n listOfpoints.get(56).add(new LatLng (44.3909928, 26.0865755));\n listOfpoints.get(56).add(new LatLng (44.3915141,26.0856314));\n listOfpoints.get(56).add(new LatLng (44.3946727, 26.0839608));\n listOfpoints.get(56).add(new LatLng (44.3961445,26.0850122));\n listOfpoints.get(56).add(new LatLng (44.3967425,26.0849907));\n listOfpoints.get(56).add(new LatLng (44.4002074, 26.0843041));\n listOfpoints.get(56).add(new LatLng (44.4029362, 26.0816648));\n listOfpoints.get(56).add(new LatLng (44.4055576,26.0799267));\n listOfpoints.get(56).add(new LatLng (44.4070752,26.0791113));\n listOfpoints.get(56).add(new LatLng (44.4130379,26.0732319));\n listOfpoints.get(56).add(new LatLng (44.406462, 26.0640051));\n\n\n listOfpoints.get(57).add(new LatLng (44.4005004, 26.0494378));\n listOfpoints.get(57).add(new LatLng (44.4056207, 26.0623124));\n listOfpoints.get(57).add(new LatLng (44.4131623,26.0729554));\n listOfpoints.get(57).add(new LatLng (44.4204884,26.0654452));\n listOfpoints.get(57).add(new LatLng (44.4181895,26.0583212));\n listOfpoints.get(57).add(new LatLng (44.4005004, 26.0494378));\n\n\n listOfpoints.get(58).add(new LatLng (44.414413, 26.0354062));\n listOfpoints.get(58).add(new LatLng (44.415394, 26.0475512));\n listOfpoints.get(58).add(new LatLng (44.4158231,26.0502978));\n listOfpoints.get(58).add(new LatLng (44.4181221,26.0576363));\n listOfpoints.get(58).add(new LatLng (44.4207888, 26.0658331));\n listOfpoints.get(58).add(new LatLng (44.4237005, 26.0731287));\n listOfpoints.get(58).add(new LatLng (44.4298608,26.0624857));\n listOfpoints.get(58).add(new LatLng (44.4293091,26.0617562));\n listOfpoints.get(58).add(new LatLng (44.4290027,26.0610266));\n listOfpoints.get(58).add(new LatLng (44.4275316, 26.0600825));\n listOfpoints.get(58).add(new LatLng (44.426275, 26.0585375));\n listOfpoints.get(58).add(new LatLng (44.4259379,26.0566922));\n listOfpoints.get(58).add(new LatLng (44.4253862, 26.0520573));\n listOfpoints.get(58).add(new LatLng (44.4242829,26.0473366));\n listOfpoints.get(58).add(new LatLng (44.4229037,26.0406847));\n listOfpoints.get(58).add(new LatLng (44.4221374,26.0347624));\n listOfpoints.get(58).add(new LatLng (44.4165281,26.0346766));\n listOfpoints.get(58).add(new LatLng (44.414413,26.0354062));\n\n\n listOfpoints.get(59).add(new LatLng (44.4224216, 26.0344395));\n listOfpoints.get(59).add(new LatLng (44.422437, 26.0360274));\n listOfpoints.get(59).add(new LatLng (44.423004,26.040276));\n listOfpoints.get(59).add(new LatLng (44.4255632,26.0522065));\n listOfpoints.get(59).add(new LatLng (44.4259156,26.055468));\n listOfpoints.get(59).add(new LatLng (44.42636,26.0583219));\n listOfpoints.get(59).add(new LatLng (44.4274787,26.059781));\n listOfpoints.get(59).add(new LatLng (44.4290264, 26.0608325));\n listOfpoints.get(59).add(new LatLng (44.4293328,26.0616264));\n listOfpoints.get(59).add(new LatLng (44.4299764,26.0623989));\n listOfpoints.get(59).add(new LatLng (44.4319071,26.0594162));\n listOfpoints.get(59).add(new LatLng (44.4345885, 26.0593948));\n listOfpoints.get(59).add(new LatLng (44.4342361, 26.0348472));\n listOfpoints.get(59).add(new LatLng (44.4273254, 26.0330877));\n listOfpoints.get(59).add(new LatLng (44.4237396,26.0342893));\n listOfpoints.get(59).add(new LatLng (44.4224216,26.0344395));\n\n\n listOfpoints.get(60).add(new LatLng (44.4345371,26.034714));\n listOfpoints.get(60).add(new LatLng (44.4343687, 26.0351665));\n listOfpoints.get(60).add(new LatLng (44.4347671,26.059757));\n listOfpoints.get(60).add(new LatLng (44.435334, 26.0617097));\n listOfpoints.get(60).add(new LatLng (44.4355025, 26.0629327));\n listOfpoints.get(60).add(new LatLng (44.4356864,26.0635979));\n listOfpoints.get(60).add(new LatLng (44.4371728, 26.0669608));\n listOfpoints.get(60).add(new LatLng (44.4383602, 26.0697182));\n listOfpoints.get(60).add(new LatLng (44.4427184,26.0621798));\n listOfpoints.get(60).add(new LatLng (44.4429329,26.0609782));\n listOfpoints.get(60).add(new LatLng (44.447161,26.0392201));\n listOfpoints.get(60).add(new LatLng (44.4427491,26.0356152));\n listOfpoints.get(60).add(new LatLng (44.4345371,26.034714));\n\n\n listOfpoints.get(61).add(new LatLng (44.4053059, 26.0112059));\n listOfpoints.get(61).add(new LatLng (44.384914, 26.0334789));\n listOfpoints.get(61).add(new LatLng (44.3778596, 26.0462677));\n listOfpoints.get(61).add(new LatLng (44.3811722,26.0454952));\n listOfpoints.get(61).add(new LatLng (44.399879, 26.0482418));\n listOfpoints.get(61).add(new LatLng (44.4002162, 26.0489714));\n listOfpoints.get(61).add(new LatLng (44.4169858,26.0575115));\n listOfpoints.get(61).add(new LatLng (44.4180893, 26.0579407));\n listOfpoints.get(61).add(new LatLng (44.4156984,26.0508167));\n listOfpoints.get(61).add(new LatLng (44.4151773,26.0472977));\n listOfpoints.get(61).add(new LatLng (44.414135,26.0356247));\n listOfpoints.get(61).add(new LatLng (44.4110082, 26.0104334));\n listOfpoints.get(61).add(new LatLng (44.4061643,26.0117208));\n listOfpoints.get(61).add(new LatLng (44.4053059,26.0112059));\n\n\n listOfpoints.get(62).add(new LatLng (44.4103691, 26.0025379));\n listOfpoints.get(62).add(new LatLng (44.4103304, 26.0034906));\n listOfpoints.get(62).add(new LatLng (44.4127522,26.0228884));\n listOfpoints.get(62).add(new LatLng (44.4144076,26.0351192));\n listOfpoints.get(62).add(new LatLng (44.4167986,26.0343897));\n listOfpoints.get(62).add(new LatLng (44.4221013, 26.0343038));\n listOfpoints.get(62).add(new LatLng (44.4271277, 26.0328018));\n listOfpoints.get(62).add(new LatLng (44.4343295, 26.0347544));\n listOfpoints.get(62).add(new LatLng (44.4344597, 26.0345399));\n listOfpoints.get(62).add(new LatLng (44.436423, 26.0347646));\n listOfpoints.get(62).add(new LatLng (44.4424747, 26.0213321));\n listOfpoints.get(62).add(new LatLng (44.4459215, 26.0171264));\n listOfpoints.get(62).add(new LatLng (44.4457043,26.0167004));\n listOfpoints.get(62).add(new LatLng (44.4252662, 25.9987613));\n listOfpoints.get(62).add(new LatLng (44.4235193, 25.9990188));\n listOfpoints.get(62).add(new LatLng (44.4103691, 26.0025379));\n\n\n listOfpoints.get(63).add(new LatLng (44.450683, 26.0692569));\n listOfpoints.get(63).add(new LatLng (44.4530725,26.0733768));\n listOfpoints.get(63).add(new LatLng (44.4523986, 26.0762092));\n listOfpoints.get(63).add(new LatLng (44.4522454,26.0783979));\n listOfpoints.get(63).add(new LatLng (44.4521842,26.0858652));\n listOfpoints.get(63).add(new LatLng (44.4658762, 26.0861656));\n listOfpoints.get(63).add(new LatLng (44.4661262, 26.0856151));\n listOfpoints.get(63).add(new LatLng (44.4670374, 26.0787379));\n listOfpoints.get(63).add(new LatLng (44.467496, 26.0777089));\n listOfpoints.get(63).add(new LatLng (44.4773875,26.0721728));\n listOfpoints.get(63).add(new LatLng (44.4779387,26.0720012));\n listOfpoints.get(63).add(new LatLng (44.482103,26.0611007));\n listOfpoints.get(63).add(new LatLng (44.4811232,26.0571525));\n listOfpoints.get(63).add(new LatLng (44.4748153, 26.0461661));\n listOfpoints.get(63).add(new LatLng (44.4716917, 26.0438487));\n listOfpoints.get(63).add(new LatLng (44.4690579,26.0436771));\n listOfpoints.get(63).add(new LatLng (44.4667916, 26.0449645));\n listOfpoints.get(63).add(new LatLng (44.4519663, 26.0668513));\n listOfpoints.get(63).add(new LatLng (44.450683,26.0692569));\n\n\n listOfpoints.get(64).add(new LatLng (44.4663308, 26.0857322));\n listOfpoints.get(64).add(new LatLng (44.466193, 26.0862472));\n listOfpoints.get(64).add(new LatLng (44.4723947,26.0878994));\n listOfpoints.get(64).add(new LatLng (44.4731756,26.0883715));\n listOfpoints.get(64).add(new LatLng (44.4739718,26.090131));\n listOfpoints.get(64).add(new LatLng (44.4744158, 26.090882));\n listOfpoints.get(64).add(new LatLng (44.4748292,26.0909678));\n listOfpoints.get(64).add(new LatLng (44.4753498,26.0906889));\n listOfpoints.get(64).add(new LatLng (44.4774321, 26.0888006));\n listOfpoints.get(64).add(new LatLng (44.4801879,26.0864832));\n listOfpoints.get(64).add(new LatLng (44.4868014,26.0859682));\n listOfpoints.get(64).add(new LatLng (44.4880873,26.0854532));\n listOfpoints.get(64).add(new LatLng (44.489618,26.0824491));\n listOfpoints.get(64).add(new LatLng (44.4904753, 26.0788443));\n listOfpoints.get(64).add(new LatLng (44.4890057,26.0784151));\n listOfpoints.get(64).add(new LatLng (44.478167, 26.0727074));\n listOfpoints.get(64).add(new LatLng (44.4678468, 26.0779216));\n listOfpoints.get(64).add(new LatLng (44.467219, 26.0788228));\n listOfpoints.get(64).add(new LatLng (44.4663308, 26.0857322));\n\n\n listOfpoints.get(65).add(new LatLng (44.4432698,26.0604113));\n listOfpoints.get(65).add(new LatLng (44.443222,26.0605852));\n listOfpoints.get(65).add(new LatLng (44.4450067,26.0611538));\n listOfpoints.get(65).add(new LatLng (44.4465463,26.062173));\n listOfpoints.get(65).add(new LatLng (44.4472816,26.0631386));\n listOfpoints.get(65).add(new LatLng (44.448913,26.0666577));\n listOfpoints.get(65).add(new LatLng (44.4502551,26.0690373));\n listOfpoints.get(65).add(new LatLng (44.4664896,26.0448331));\n listOfpoints.get(65).add(new LatLng (44.4688479,26.0434168));\n listOfpoints.get(65).add(new LatLng (44.469491,26.0403269));\n listOfpoints.get(65).add(new LatLng (44.4702566,26.037237));\n listOfpoints.get(65).add(new LatLng (44.4701035,26.0353058));\n listOfpoints.get(65).add(new LatLng (44.4613441,26.0305422));\n listOfpoints.get(65).add(new LatLng (44.4611297,26.0346621));\n listOfpoints.get(65).add(new LatLng (44.4606089,26.0350913));\n listOfpoints.get(65).add(new LatLng (44.4595369,26.0350913));\n listOfpoints.get(65).add(new LatLng (44.458618,26.0354775));\n listOfpoints.get(65).add(new LatLng (44.4545745,26.0376233));\n listOfpoints.get(65).add(new LatLng (44.4501632,26.0417002));\n listOfpoints.get(65).add(new LatLng (44.4494892,26.0417002));\n listOfpoints.get(65).add(new LatLng (44.4485701,26.039297));\n listOfpoints.get(65).add(new LatLng (44.4477429,26.0380953));\n listOfpoints.get(65).add(new LatLng (44.4466093,26.0430306));\n listOfpoints.get(65).add(new LatLng (44.4432698,26.0604113));\n\n\n\n listOfpoints.get(66).add(new LatLng (44.4742952,26.0910108));\n listOfpoints.get(66).add(new LatLng (44.4741016,26.0912642));\n listOfpoints.get(66).add(new LatLng (44.4741016,26.0917148));\n listOfpoints.get(66).add(new LatLng (44.4743313,26.0922513));\n listOfpoints.get(66).add(new LatLng (44.4750816,26.0927019));\n listOfpoints.get(66).add(new LatLng (44.4758471,26.0937962));\n listOfpoints.get(66).add(new LatLng (44.4762758,26.0947189));\n listOfpoints.get(66).add(new LatLng (44.4766127,26.0962853));\n listOfpoints.get(66).add(new LatLng (44.4765514,26.0971436));\n listOfpoints.get(66).add(new LatLng (44.4761227,26.0977444));\n listOfpoints.get(66).add(new LatLng (44.4753878,26.0985169));\n listOfpoints.get(66).add(new LatLng (44.4745457,26.0985384));\n listOfpoints.get(66).add(new LatLng (44.4734585,26.0989675));\n listOfpoints.get(66).add(new LatLng (44.4729073,26.0990104));\n listOfpoints.get(66).add(new LatLng (44.4718508,26.0986671));\n listOfpoints.get(66).add(new LatLng (44.471223,26.0980663));\n listOfpoints.get(66).add(new LatLng (44.469263,26.0970792));\n listOfpoints.get(66).add(new LatLng (44.4689567,26.0971651));\n listOfpoints.get(66).add(new LatLng (44.468773,26.0975728));\n listOfpoints.get(66).add(new LatLng (44.4687424,26.0981092));\n listOfpoints.get(66).add(new LatLng (44.4688955,26.0985169));\n listOfpoints.get(66).add(new LatLng (44.4692017,26.0986886));\n listOfpoints.get(66).add(new LatLng (44.4694774,26.0985598));\n listOfpoints.get(66).add(new LatLng (44.4704268,26.0990319));\n listOfpoints.get(66).add(new LatLng (44.4707483,26.0994396));\n listOfpoints.get(66).add(new LatLng (44.4719733,26.1024651));\n listOfpoints.get(66).add(new LatLng (44.4735963,26.1028943));\n listOfpoints.get(66).add(new LatLng (44.474071,26.1035809));\n listOfpoints.get(66).add(new LatLng (44.4741322,26.1042676));\n listOfpoints.get(66).add(new LatLng (44.4735351,26.1047396));\n listOfpoints.get(66).add(new LatLng (44.474071,26.1077866));\n listOfpoints.get(66).add(new LatLng (44.4738413,26.1079583));\n listOfpoints.get(66).add(new LatLng (44.473826,26.1085591));\n listOfpoints.get(66).add(new LatLng (44.4733667,26.1097822));\n listOfpoints.get(66).add(new LatLng (44.4732595,26.1107478));\n listOfpoints.get(66).add(new LatLng (44.4734432,26.1111555));\n listOfpoints.get(66).add(new LatLng (44.4763087,26.1089172));\n listOfpoints.get(66).add(new LatLng (44.4946789,26.1040249));\n listOfpoints.get(66).add(new LatLng (44.4968217,26.0792198));\n listOfpoints.get(66).add(new LatLng (44.490592,26.0788336));\n listOfpoints.get(66).add(new LatLng (44.4898573,26.0820737));\n listOfpoints.get(66).add(new LatLng (44.4894593,26.0830178));\n listOfpoints.get(66).add(new LatLng (44.4882229,26.0855306));\n listOfpoints.get(66).add(new LatLng (44.4870595,26.0860456));\n listOfpoints.get(66).add(new LatLng (44.4801439,26.0866335));\n listOfpoints.get(66).add(new LatLng (44.4761173,26.090174));\n listOfpoints.get(66).add(new LatLng (44.4751527,26.0912469));\n listOfpoints.get(66).add(new LatLng (44.4742952,26.0910108));\n\n listOfpoints.get(67).add(new LatLng (44.4671287, 26.121282));\n listOfpoints.get(67).add(new LatLng (44.46768,26.1231274));\n listOfpoints.get(67).add(new LatLng (44.4696095,26.1234278));\n listOfpoints.get(67).add(new LatLng (44.4712938,26.1224408));\n listOfpoints.get(67).add(new LatLng (44.4723657,26.1229557));\n listOfpoints.get(67).add(new LatLng (44.4727944, 26.1226553));\n listOfpoints.get(67).add(new LatLng (44.4740193, 26.1226982));\n listOfpoints.get(67).add(new LatLng (44.4745399,26.1236424));\n listOfpoints.get(67).add(new LatLng (44.4743668,26.1243164));\n listOfpoints.get(67).add(new LatLng (44.4747037, 26.1250031));\n listOfpoints.get(67).add(new LatLng (44.4751324,26.1257541));\n listOfpoints.get(67).add(new LatLng (44.4758673,26.1267626));\n listOfpoints.get(67).add(new LatLng (44.4761736, 26.127578));\n listOfpoints.get(67).add(new LatLng (44.491758,26.1285221));\n listOfpoints.get(67).add(new LatLng (44.4931662, 26.1377919));\n listOfpoints.get(67).add(new LatLng (44.494452,26.1444008));\n listOfpoints.get(67).add(new LatLng (44.4947581,26.1462033));\n listOfpoints.get(67).add(new LatLng (44.4958601, 26.1472332));\n listOfpoints.get(67).add(new LatLng (44.4969009, 26.1458599));\n listOfpoints.get(67).add(new LatLng (44.4984926, 26.1450875));\n listOfpoints.get(67).add(new LatLng (44.5000231,26.1446583));\n listOfpoints.get(67).add(new LatLng (44.5006353,26.1435425));\n listOfpoints.get(67).add(new LatLng (44.5012475,26.1424267));\n listOfpoints.get(67).add(new LatLng (44.5057774, 26.144315));\n listOfpoints.get(67).add(new LatLng (44.5070629, 26.137191));\n listOfpoints.get(67).add(new LatLng (44.5066956, 26.1233723));\n listOfpoints.get(67).add(new LatLng (44.502227,26.1044896));\n listOfpoints.get(67).add(new LatLng (44.4952479,26.1044896));\n listOfpoints.get(67).add(new LatLng (44.4782558,26.1086953));\n listOfpoints.get(67).add(new LatLng (44.4765716,26.1090386));\n listOfpoints.get(67).add(new LatLng (44.4734175,26.1114848));\n listOfpoints.get(67).add(new LatLng (44.4739994,26.1124289));\n listOfpoints.get(67).add(new LatLng (44.4744587,26.1137163));\n listOfpoints.get(67).add(new LatLng (44.474275,26.1152613));\n listOfpoints.get(67).add(new LatLng (44.4738156,26.1171067));\n listOfpoints.get(67).add(new LatLng (44.4729582,26.1180937));\n listOfpoints.get(67).add(new LatLng (44.4705695, 26.1195099));\n listOfpoints.get(67).add(new LatLng (44.4677826,26.1202395));\n listOfpoints.get(67).add(new LatLng (44.4671287,26.121282));\n\n\n //Stockholm\n listOfpoints.get(68).add(new LatLng(59.339281, 18.005316));\n listOfpoints.get(68).add(new LatLng(59.263986, 18.253591));\n listOfpoints.get(68).add(new LatLng(59.260869, 17.878596));\n\n //Stockholm\n listOfpoints.get(69).add(new LatLng(59.342841, 18.040179));\n listOfpoints.get(69).add(new LatLng(59.355275, 17.884694));\n listOfpoints.get(69).add(new LatLng(59.423065, 18.075748));\n\n\n for(int i = 0 ; i < listOfpoints.size(); i++){\n listOfPolygons.add( MapsActivity.instance.mMap.addPolygon(new PolygonOptions()\n .addAll(listOfpoints.get(i))\n .strokeWidth(0)\n .fillColor(Color.argb(50, 0, 250, 0))) );\n }\n\n\n\n\n }", "public static ArrayList<Neighbourhood> generateNeighbourhoods() {\n People p1 = new People(\"Peter\", \"Smith\");\n People p2 = new People(\"Anna\", \"Hunter\");\n ArrayList<People> people = new ArrayList<People>();\n people.add(p1); people.add(p2);\n\n Post post1 = new Post(p1,\"Babysitter needed\",\"Hi we need a Babysitter for next Friday. Please send me a private message if you are interested. Pay is 5 pound per hour\");\n Post post2 = new Post(p1,\"Car for sale\");\n Post post3 = new Post(p2,\"Looking for plumber\");\n Post post4 = new Post(p2,\"Free beer\");\n\n ArrayList<Post> posts = new ArrayList<Post>();\n posts.add(post1);posts.add(post2);posts.add(post3);posts.add(post4);\n\n\n Neighbourhood n1 = new Neighbourhood(\"Partick\");\n n1.setPosts(posts);\n n1.setMembers(people);\n Neighbourhood n2 = new Neighbourhood(\"West End\");\n n2.setPosts(posts);\n n2.setMembers(people);\n ArrayList<Neighbourhood> neighbourhoods = new ArrayList<Neighbourhood>();\n neighbourhoods.add(n1);\n neighbourhoods.add(n2);\n return neighbourhoods;\n }", "private static void setupLocations() {\n\t\tcatanWorld = Bukkit.createWorld(new WorldCreator(\"catan\"));\n\t\tspawnWorld = Bukkit.createWorld(new WorldCreator(\"world\"));\n\t\tgameLobby = new Location(catanWorld, -84, 239, -647);\n\t\tgameSpawn = new Location(catanWorld, -83, 192, -643);\n\t\thubSpawn = new Location(spawnWorld, 8, 20, 8);\n\t\twaitingRoom = new Location(catanWorld, -159, 160, -344);\n\t}", "@Before\n public void setUp()\n {\n //ping for CSSE UWA\n csse = new GPSping(-31.977484,115.816228,1565063614);\n //ping for Perth train station 1 hour later\n perth = new GPSping(-31.951078,115.859945,1565063614+3600);\n //ping for Musee d'Orsay Paris on 20 Aug 2019\n paris = new GPSping(48.859741,2.326609,1566270756);\n //erroneous pings\n err1 = new GPSping(115.816228,-31.977484,1565063614);\n err2 = new GPSping(200,100,20);\n }", "public void create2(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\n\n\t\t//creating door in the rooms\n\t\tfor(int i = 0; i <this.Door.length; i++){\n\t\t\tfor(int p = 0; p < this.Door.length; p++){\n\t\t\t\tthis.Door[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Door[1][1] = 1;\n\n\t\t//creating stairs to transport to room3\n\t\tfor(int i = 0; i <this.Stairs.length; i++){\n\t\t\tfor(int p = 0; p < this.Stairs.length; p++){\n\t\t\t\tthis.Stairs[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Stairs[18][18] = 1;\n\n\t\t//creating board to keep track of ari\n\t\tfor(int i = 0; i <this.Ari.length; i++){\n\t\t\tfor(int p = 0; p < this.Ari.length; p++){\n\t\t\t\tthis.Ari[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}\n\t\tthis.Ari[7][11] = 1;//putts ari there\n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 3; i< 4 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 6; i< 7 ; i++){\n\t\t\tfor(int p = 19; p > 1; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 9; i< 10 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 12; i< 13 ; i++){\n\t\t\tfor(int p = 19; p > 1; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes\n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{\n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}", "private void boxCreator(int[] pos, int width, int height) {\n for (int x = pos[0]; x < pos[0] + width; x++) {\n tiles[x][pos[1]] = Tileset.WALL;\n }\n for (int y = pos[1]; y < pos[1] + height; y++) {\n tiles[pos[0]][y] = Tileset.WALL;\n }\n for (int x = pos[0]; x < pos[0] + width; x++) {\n tiles[x][pos[1] + height] = Tileset.WALL;\n }\n for (int y = pos[1]; y < pos[1] + height + 1; y++) {\n tiles[pos[0] + width][y] = Tileset.WALL;\n }\n for (int y = pos[1] + 1; y < pos[1] + height; y++) {\n for (int x = pos[0] + 1; x < pos[0] + width; x++) {\n tiles[x][y] = Tileset.FLOWER;\n }\n }\n }", "public void findStreets() {\r\n\t\tpolygonMap.resetStreets();\r\n\t\tpolygonMap.setCurrentPlayerID(client.getSettler().getID());\r\n\t\tfor (int i = 0; i < island.getRoads().length; i++) {\r\n\t\t\tif (buildStreetIsAllowed(island.getRoads()[i])\r\n\t\t\t\t\t&& !isWaterStreet(island.getRoads()[i])) {\r\n\t\t\t\tpolygonMap.addStreet(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "Position_ordonnee createPosition_ordonnee();", "Builder addLocationCreated(Place.Builder value);", "Location createLocation();", "Location createLocation();", "Location createLocation();", "@Override\n protected void createLocationCLI() {\n /*The rooms in the hallway01 location are created---------------------*/\n \n /*Hallway-------------------------------------------------------------*/\n Room hallway = new Room(\"Hallway 01\", \"This hallway connects the Personal, Laser and Net\");\n super.addRoom(hallway);\n }", "public void buildLocation() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT EXISTS location (location_name\"\n + \" TEXT, lat REAL, lon REAL PRIMARY KEY (location_name));\")) {\n prep.executeUpdate();\n } catch (final SQLException e) {\n e.printStackTrace();\n }\n }", "public static void createMap()\n\t\t\t{\n\t\t\tmap = new Vector<Location>(4);\n\t\n\t\t\tLocation location1 = new Location(\"the southwest room.\",\"You see doors to the north and east.\");\n\t\t\tLocation location2 = new Location(\"the southeast room.\",\"You see doors to the north and west.\");\n\t\t\tLocation location3 = new Location(\"the northwest room.\",\"You see doors to the south and east.\");\n\t\t\tLocation location4 = new Location(\"the northeast room.\",\"You see doors to the south and west.\");\n\n\t\t\tmap.addElement(location1);\n\t\t\tmap.addElement(location2);\n\t\t\tmap.addElement(location3);\n\t\t\tmap.addElement(location4);\n\t\t\t\n\t\t\t// This section defines the exits found in each location and the \n\t\t\t// locations to which they lead.\n\t\t\tlocation1.addExit(new Exit(Exit.north, location3));\n\t\t\tlocation1.addExit(new Exit(Exit.east, location2));\n\t\t\tlocation2.addExit(new Exit(Exit.north, location4));\n\t\t\tlocation2.addExit(new Exit(Exit.west, location1));\n\t\t\tlocation3.addExit(new Exit(Exit.south, location1));\n\t\t\tlocation3.addExit(new Exit(Exit.east, location4));\n\t\t\tlocation4.addExit(new Exit(Exit.west, location3));\n\t\t\tlocation4.addExit(new Exit(Exit.south, location2));\n\t\t\t\n\t\t\tcurrentLocation = location1;\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void createCpteEpargne(CompteEpargne cpt) {\n\t\t\n\t}", "private void createData() {\n//\n// tour = new Tour();\n// tour.setTitle(\"Death Valley\");\n// tour.setDescription(\"A tour to Death Valley\");\n// tour.setPrice(900);\n// tour.setImage(\"death_valley\");\n// tour = dataSource.create(tour);\n// Log.i(LOGTAG, \"Tour created with id \" + tour.getId());\n//\n// tour = new Tour();\n// tour.setTitle(\"San Francisco\");\n// tour.setDescription(\"A tour to San Francisco\");\n// tour.setPrice(1200);\n// tour.setImage(\"san_francisco\");\n// tour = dataSource.create(tour);\n// Log.i(LOGTAG, \"Tour created with id \" + tour.getId());\n\n ToursPullParser parser = new ToursPullParser();\n tours = parser.parseXML(this);\n\n for (Tour tour : tours) {\n dataSource.create(tour);\n }\n\n }", "public void createGrid() {\n\t\tint[][] neighbours = getIo().getNeighbours();\n\t\tsetGrid(new GridAlg(neighbours, animals));\n\t\tgetGrid().setStep(getStep());\n\t}", "static void setItemsAndContainers (){\n\t \t/**Add containers to places*/\n\t \tLocation.places[0].addContainer(Container.depths);\n\t \tLocation.places[1].addContainer(Container.secondaryInv);\n\t \tLocation.places[4].addContainer(Container.SRCloset);\n\t \tLocation.places[6].addContainer(Container.couch1);\n\t\t Location.places[6].addContainer(Container.couch2);\n\t\t Location.places[6].addContainer(Container.couch3);\n\t\t Location.places[6].addContainer(Container.couch4);\n\t\t Location.places[13].addContainer(Container.closetBathroom);\n Location.places[15].addContainer(Container.K1Couch);\n Location.places[16].addContainer(Container.fridge);\n Location.places[23].addContainer(Container.autoAisle);\n Location.places[24].addContainer(Container.aisle15B);\n Location.places[26].addContainer(Container.bb);\n\t\t \n\t\t /**Add items to places*/\n\t\t Location.places[0].addItem(Item.grabber);\n\t\t Location.places[1].addItem(Item.parcans);\n\t\t Location.places[3].addItem(Item.bookbag);\n\t\t Location.places[4].addItem(Item.ladder);\n\t\t Location.places[7].addItem(Item.drill);\n\t\t Location.places[7].addItem(Item.screws);\n\t\t Location.places[7].addItem(Item.pipe);\n\t\t Location.places[7].addItem(Item.twobyfour);\n\t\t Location.places[8].addItem(Item.rope);\n\t\t Location.places[11].addItem(Item.car);\n\t\t Location.places[12].addItem(Item.twentyDollars);\n\t\t Location.places[16].addItem(Item.tupperware);\n\t\t Location.places[18].addItem(Item.bottle);\n Location.places[19].addItem(Item.plunger);\n Location.places[20].addItem(Item.map);\n Location.places[21].addItem(Item.magnet);\n Location.places[23].addItem(Item.avocados);\n Location.places[25].addItem(Item.noodles);\n\t\t Location.places[26].addItem(Item.Unibrow); \n\t\t \n\t\t /**test purposes*/\n\t\t Location.places[10].addItem(Item.otherWrench);\n//\t\t Location.places[0].addItem(Item.repellent);\n//\t\t Location.places[7].addItem(Item.repellent);\n// Location.places[7].addItem(Item.wrench);\n Location.places[7].addItem(Item.keys);\n\t\t \n\t\t /**Adds items in containers*/\n\t\t Container.setItemsInContainers();\n\t\t }", "@Override\n\tvoid createNeighbourhood() {\n\t\t\n\t}", "private void cp2PlaceShips(){\n\t\tint start = 5, stop = 9, orientation;\n\t\tboolean placed;\n\n\t\tfor(int x = start; x <= stop; x++){\n\t\t\tplaced = false;\n\n\t\t\twhile(!placed)\n\t\t\t{\n\t\t\t\tranX = ranNum.nextInt(600);\n\t\t\t\tranY = ranNum.nextInt(600);\n\t\t\t\torientation = ranNum.nextInt(2);\n\t\t\t\tplaced = true;\n\n\t\t\t\tships[x] = new Ship(x, shipNames[x], 'H', shipPlayer[x], shipWidth[x], shipHeight[x], ranX, ranY, shipSize[x]);\n\t\t\t\tships[x].setLocation(ships[x].getX(), ships[x].getY());\n\t\t\t\tships[x].setSize(ships[x].getWidth(), ships[x].getHeight());\n\n\t\t\t\tif(orientation == 1){\n\t\t\t\t\tchangeOrientation(x);\n\t\t\t\t}\n\n\t\t\t\tif(ships[x].getX() + ships[x].getWidth() < boardTwo.getWidth() && ships[x].getY() + ships[x].getHeight() < boardTwo.getHeight()){\n\t\t\t\t\tfor(int y = start; y < x; y++){\n\t\t\t\t\t\tif(ships[x].getBounds().intersects(ships[y].getBounds())){\n\t\t\t\t\t\t\tplaced = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tplaced = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboardTwo.add(ships[x]);\n\t\t}\n\t}", "private void addCities() {\n int random2 = 0;\n for (int i = 1; i < MAP_LENGTH-1; i++) {\n for (int j = 1; j < MAP_LENGTH-1; j++) {\n if (tileMap[i][j].getTerrain() instanceof Grass) { //Make cities on grass tiles only\n random2 = (int)(Math.round(Math.random()*18));\n if (!adjacentCity(i, j) && (random2 < 3)) {\n tileMap[i][j].setCity(new City(i, j, false)); //If randomly chosen and not in proximity of another city, create a city there (right now set as not a capital)\n }\n }\n }\n }\n }", "private void openPlacesDialog() {\n DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n LatLng markerLatLng = mLikelyPlaceLatLngs[which];\n String markerSnippet = mLikelyPlaceAddresses[which];\n if (mLikelyPlaceAttributions[which] != null) {\n markerSnippet = markerSnippet + \"\\n\" + mLikelyPlaceAttributions[which];\n }\n\n mMap.addMarker(new MarkerOptions()\n .title(mLikelyPlaceNames[which])\n .position(markerLatLng)\n .snippet(markerSnippet));\n\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(markerLatLng,\n DEFAULT_ZOOM));\n }\n };\n\n // Display the dialog.\n AlertDialog dialog = new AlertDialog.Builder(this)\n // .setTitle(R.string.pick_place)\n .setItems(mLikelyPlaceNames, listener)\n .show();\n }", "public void add_one_place_to_tour(entities.PlaceOfInterestTour place) {\n\t\tPlaceofInterestItem sp = new PlaceofInterestItem(place);\n\t\t// delete buttons from list of item (place)\n\t\tsp.add_edit_layout();\n\n\t\tsp.setOnDragOver(event -> {\n\t\t\tfinal Dragboard dragboard = event.getDragboard();\n\t\t\tif (dragboard.hasString() && TAB_DRAG_KEY.equals(dragboard.getString()) && draggingTab.get() != null) {\n\t\t\t\tevent.acceptTransferModes(TransferMode.MOVE);\n\t\t\t\tevent.consume();\n\t\t\t}\n\t\t});\n\t\tsp.setOnDragDetected(event -> {\n\t\t\tDragboard dragboard = sp.startDragAndDrop(TransferMode.MOVE);\n\t\t\tClipboardContent clipboardContent = new ClipboardContent();\n\t\t\tclipboardContent.putString(TAB_DRAG_KEY);\n\t\t\tdragboard.setContent(clipboardContent);\n\t\t\tSnapshotParameters spp = new SnapshotParameters();\n\t\t\tspp.setFill(Color.WHITE);\n\t\t\tdragboard.setDragView(sp.snapshot(spp, null), event.getX(), event.getY());\n\t\t\tdraggingTab.set(sp);\n\t\t\tevent.consume();\n\t\t});\n\t\tsp.setOnDragDropped(event -> {\n\n\t\t\tDragboard db = event.getDragboard();\n\t\t\tboolean success = false;\n\t\t\tif (db.hasString()) {\n\t\t\t\tVBox parent = (VBox) sp.getParent();\n\t\t\t\tPlaceofInterestItem source = (PlaceofInterestItem) event.getGestureSource();\n\t\t\t\tint sourceIndex = parent.getChildren().indexOf(source);\n\t\t\t\tint targetIndex = parent.getChildren().indexOf(sp);\n\t\t\t\tList<Node> nodes = new ArrayList<Node>(parent.getChildren());\n\t\t\t\tif (sourceIndex < targetIndex) {\n\t\t\t\t\tCollections.rotate(nodes.subList(sourceIndex, targetIndex + 1), -1);\n\t\t\t\t} else {\n\t\t\t\t\tCollections.rotate(nodes.subList(targetIndex, sourceIndex + 1), 1);\n\t\t\t\t}\n\t\t\t\tparent.getChildren().clear();\n\t\t\t\tparent.getChildren().addAll(nodes);\n\t\t\t\tsuccess = true;\n\t\t\t}\n\t\t\tevent.setDropCompleted(success);\n\t\t\tevent.consume();\n\n\t\t});\n\n\t\tsp.setOnMouseEntered(event -> {\n\t\t\tsp.setStyle(\"-fx-background-color : #BDBBC3\");\n\t\t});\n\t\tsp.setOnMouseExited(event -> {\n\t\t\tsp.setStyle(\"-fx-background-color : #EBE8F9\");\n\t\t});\n\n\t\tPlatform.runLater(() -> {\n\t\t\tpnItems.getChildren().add(sp);\n\t\t\tnew SlideInUp(sp).play();\n\t\t});\n\n\t}", "private void addArchitectureMarkers() {\n try {\n // Get the text file\n InputStream file = getResources().openRawResource(R.raw.architecture);\n\n // Read the file to get contents\n BufferedReader reader = new BufferedReader(new InputStreamReader(file));\n String line;\n\n // Read every line of the file one line at a time\n while ((line = reader.readLine()) != null) {\n String[] architecture = line.split(\";\", 6);\n\n String architectureName = architecture[0];\n String placeID = architecture[1];\n String architectureDate = architecture[2];\n String architectureInfo = architecture[3];\n String architectureStyle = architecture[4];\n String architect = architecture[5];\n\n // Initialize Places.\n Places.initialize(getApplicationContext(), getString(R.string.google_directions_key));\n // Create a new Places client instance.\n PlacesClient placesClient = Places.createClient(this);\n // Specify the fields to return.\n List<Place.Field> placeFields = Arrays.asList(Place.Field.NAME, Place.Field.LAT_LNG,\n Place.Field.PHOTO_METADATAS);\n // Construct a request object, passing the place ID and fields array.\n FetchPlaceRequest request = FetchPlaceRequest.builder(placeID, placeFields).build();\n\n placesClient.fetchPlace(request).addOnSuccessListener((response) -> {\n Place place = response.getPlace();\n Log.i(\"TAG\", \"Place found: \" + place.getName());\n LatLng latlng = place.getLatLng();\n\n //Get the photo metadata.\n if (place.getPhotoMetadatas() == null) {\n Log.i(\"mylog\", \"no photo\");\n } else {\n //choose better default pictures for these buildings\n PhotoMetadata photoMetadata = place.getPhotoMetadatas().get(0);\n if (place.getName().equals(\"The Cube\")) {\n photoMetadata = place.getPhotoMetadatas().get(2);\n }\n if (place.getName().equals(\"Millennium Point Car Park\")) {\n photoMetadata = place.getPhotoMetadatas().get(1);\n }\n if (place.getName().equals(\"School of Art\")) {\n photoMetadata = place.getPhotoMetadatas().get(1);\n }\n if (place.getName().equals(\"Saint Martin in the Bull Ring\")) {\n photoMetadata = place.getPhotoMetadatas().get(2);\n }\n if (place.getName().equals(\"Bullring & Grand Central\")) {\n photoMetadata = place.getPhotoMetadatas().get(1);\n }\n if (place.getName().equals(\"Mailbox Birmingham\")) {\n photoMetadata = place.getPhotoMetadatas().get(1);\n }\n if (place.getName().equals(\"The International Convention Centre\")) {\n photoMetadata = place.getPhotoMetadatas().get(1);\n }\n if (place.getName().equals(\"Birmingham Museum & Art Gallery\")) {\n photoMetadata = place.getPhotoMetadatas().get(1);\n }\n // Create a FetchPhotoRequest.\n FetchPhotoRequest photoRequest = FetchPhotoRequest.builder(photoMetadata)\n .setMaxWidth(200)\n .setMaxHeight(200)\n .build();\n\n placesClient.fetchPhoto(photoRequest).addOnSuccessListener((fetchPhotoResponse) -> {\n Bitmap bitmap = fetchPhotoResponse.getBitmap();\n // Add border to image\n Bitmap bitmapWithBorder = Bitmap.createBitmap(bitmap.getWidth() + 12, bitmap.getHeight()\n + 12, bitmap.getConfig());\n Canvas canvas = new Canvas(bitmapWithBorder);\n canvas.drawColor(Color.rgb(255, 128, 128));\n canvas.drawBitmap(bitmap, 6, 6, null);\n //Add marker onto map\n Marker marker = mMap.addMarker(new MarkerOptions()\n .position(new LatLng(latlng.latitude, latlng.longitude))\n .title(architectureName)\n .icon(BitmapDescriptorFactory.fromBitmap(bitmapWithBorder)));\n marker.setTag(placeID);\n String url = getUrl(currentPosition, marker.getPosition(), \"walking\");\n new FetchURL(MapsActivity.this).execute(url, \"walking\");\n //Store marker info\n markersList.add(marker);\n markerHashmap.put(marker.getTitle(), bitmap);\n architectureDateHashmap.put(marker.getTitle(), architectureDate);\n architectureInfoHashmap.put(marker.getTitle(), architectureInfo);\n architectureStyleHashmap.put(marker.getTitle(), architectureStyle);\n architectHashmap.put(marker.getTitle(), architect);\n if (markersList.size() == 34) {\n //Set camera position once all markers loaded in\n setCameraPosition(mMap, markersList);\n }\n }).addOnFailureListener((exception) -> {\n if (exception instanceof ApiException) {\n ApiException apiException = (ApiException) exception;\n int statusCode = apiException.getStatusCode();\n // Handle error with given status code.\n Log.e(TAG, \"Photo not found: \" + exception.getMessage());\n }\n });\n }\n }).addOnFailureListener((exception) -> {\n if (exception instanceof ApiException) {\n ApiException apiException = (ApiException) exception;\n int statusCode = apiException.getStatusCode();\n // Handle error with given status code.\n Log.e(\"TAG\", \"Place not found: \" + placeID + exception.getMessage());\n\n }\n });\n }\n reader.close();\n } catch (NullPointerException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void createSeedMountains(Square[][]Squares, int rows, int columns, int mountains, int[][] terrainLoc)\n {\n int swellTolerance;\n \n if(columns>rows)\n {\n swellTolerance = rows/20+2;\n }\n else\n {\n swellTolerance = columns/20+2;\n }\n\n // go through every second column tops. iterator builds up in relation to horizontal size of the grid\n for (int i = 1;i < rows;i=i+rows/10+2)\n {\n // go through the row a number of times specified (can be done by setMountains() )\n for(int a = 0;a < mountains;a++)\n {\n // random a placement for the mountain seed\n int rand = (int )(Math.random() * columns + 1);\n \n // making sure the seed is far enough from the borders horizontally\n if (rand < 0 || rand >= columns)\n {\n for (;rand < 0 || rand >= columns;)\n {\n rand = (int )(Math.random() * columns +1);\n }\n }\n // making sure the seed is far enough from the borders vertically\n if (i<= columns-swellTolerance && i>=swellTolerance)\n {\n if(rand <=rows-swellTolerance && rand>=swellTolerance)\n {\n // placing seeds\n Squares[i][rand].setTerrain(1);\n terrainLoc[i][rand] = 1;\n } \n \n }\n }\n }\n }", "@Override\r\n\tpublic void placeCity(VertexLocation vertLoc) {\n\t\t\r\n\t}", "public void placeMandatoryObjects()\r\n {\r\n Random rng = new Random();\r\n //Adds an endgame chest somewhere (NOT in spawn)\r\n Room tempRoom = getRoom(rng.nextInt(dungeonWidth - 1) +1, rng.nextInt(dungeonHeight - 1) +1);\r\n tempRoom.addObject(new RoomObject(\"Endgame Chest\", \"overflowing with coolness!\"));\r\n if (tempRoom.getMonster() != null)\r\n {\r\n tempRoom.removeMonster();\r\n }\r\n tempRoom.addMonster(new Monster(\"Pelo Den Stygge\", \"FINAL BOSS\", 220, 220, 12));\r\n //Adds a merchant to the spawn room\r\n getRoom(0,0).addObject(new RoomObject(\"Merchant\", \"like a nice fella with a lot of goods (type \\\"wares\\\" to see his goods)\"));\r\n }", "private void openPlacesDialog() {\n // Ask the user to choose the place where they are now.\n DialogInterface.OnClickListener listener =\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n // The \"which\" argument contains the position of the selected item.\n LatLng markerLatLng = mLikelyPlaceLatLngs[which];\n String markerSnippet = mLikelyPlaceAddresses[which];\n if (mLikelyPlaceAttributions[which] != null) {\n markerSnippet = markerSnippet + \"\\n\" + mLikelyPlaceAttributions[which];\n }\n\n // Position the map's camera at the location of the marker.\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(markerLatLng,\n DEFAULT_ZOOM));\n }\n };\n\n // Display the dialog.\n AlertDialog dialog = new AlertDialog.Builder(this)\n .setTitle(R.string.pick_place)\n .setItems(mLikelyPlaceNames, listener)\n .show();\n }", "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 getPlaces() {\n places = new ArrayList<Place>();\n ref = new Firebase(\"https://flickering-torch-2192.firebaseio.com/places\");\n Query likeQuery = ref.orderByChild(\"likes\").limitToLast(10);\n likeQuery.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot querySnapshot) {\n for (DataSnapshot d : querySnapshot.getChildren()) {\n ref.child(d.getKey()).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.exists()) {\n Place p = dataSnapshot.getValue(Place.class);\n mMap.addMarker(new MarkerOptions().position(new LatLng(p.getLat(), p.getLon()))\n .title(p.getName()).snippet(p.getDescription())\n .icon(BitmapDescriptorFactory.fromResource(R.drawable.happy_marker)));\n }\n }\n\n @Override\n public void onCancelled(FirebaseError firebaseError) {\n\n }\n });\n }\n }\n\n @Override\n public void onCancelled(FirebaseError error) {\n showToast(error.getMessage());\n }\n });\n\n LatLng bristol = new LatLng(51.4556676, -2.6266423);\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(bristol, zoomLevel));\n }", "public void setPlace(int num) {\n\t\tplace = num;\n\t}", "public void setPlace(String place){\n this.place = place;\n }", "public static List<Location> generateLocations() {\n\t\tList<Location> locations = new ArrayList<Location>();\n\t\t\n\t\tfor(AREA area : AREA.values()) {\n\t\t\tLocation l = new Location(area);\n\t\t\t\n\t\t\tswitch (area) {\n\t\t\tcase Study:\n\t\t\t\tl.neighbors.add(AREA.HW_SH);\n\t\t\t\tl.neighbors.add(AREA.HW_SL);\n\t\t\t\tl.neighbors.add(AREA.Kitchen);\n\t\t\t\tl.isRoom = true;\n\t\t\t\tbreak;\n\t\t\tcase Hall:\n\t\t\t\tl.neighbors.add(AREA.HW_SH);\n\t\t\t\tl.neighbors.add(AREA.HW_HL);\n\t\t\t\tl.neighbors.add(AREA.HW_HB);\n\t\t\t\tl.isRoom = true;\n\t\t\t\tbreak;\n\t\t\tcase Lounge:\n\t\t\t\tl.neighbors.add(AREA.HW_HL);\n\t\t\t\tl.neighbors.add(AREA.HW_LD);\n\t\t\t\tl.neighbors.add(AREA.Conservatory);\n\t\t\t\tl.isRoom = true;\n\t\t\t\tbreak;\n\t\t\tcase Library:\n\t\t\t\tl.neighbors.add(AREA.HW_SL);\n\t\t\t\tl.neighbors.add(AREA.HW_LB);\n\t\t\t\tl.neighbors.add(AREA.HW_LC);\n\t\t\t\tl.isRoom = true;\n\t\t\t\tbreak;\n\t\t\tcase BilliardRoom:\n\t\t\t\tl.neighbors.add(AREA.HW_HB);\n\t\t\t\tl.neighbors.add(AREA.HW_LB);\n\t\t\t\tl.neighbors.add(AREA.HW_BD);\n\t\t\t\tl.neighbors.add(AREA.HW_BB);\n\t\t\t\tl.isRoom = true;\n\t\t\t\tbreak;\n\t\t\tcase DiningRoom:\n\t\t\t\tl.neighbors.add(AREA.HW_LD);\n\t\t\t\tl.neighbors.add(AREA.HW_BD);\n\t\t\t\tl.neighbors.add(AREA.HW_DK);\n\t\t\t\tl.isRoom = true;\n\t\t\t\tbreak;\n\t\t\tcase Conservatory:\n\t\t\t\tl.neighbors.add(AREA.HW_LC);\n\t\t\t\tl.neighbors.add(AREA.HW_CB);\n\t\t\t\tl.neighbors.add(AREA.Lounge);\n\t\t\t\tl.isRoom = true;\n\t\t\t\tbreak;\n\t\t\tcase Ballroom:\n\t\t\t\tl.neighbors.add(AREA.HW_BB);\n\t\t\t\tl.neighbors.add(AREA.HW_CB);\n\t\t\t\tl.neighbors.add(AREA.HW_BK);\n\t\t\t\tl.isRoom = true;\n\t\t\t\tbreak;\n\t\t\tcase Kitchen:\n\t\t\t\tl.neighbors.add(AREA.HW_DK);\n\t\t\t\tl.neighbors.add(AREA.HW_BK);\n\t\t\t\tl.neighbors.add(AREA.Study);\n\t\t\t\tl.isRoom = true;\n\t\t\t\tbreak;\n\t\t\tcase HW_SH:\n\t\t\t\tl.neighbors.add(AREA.Study);\n\t\t\t\tl.neighbors.add(AREA.Hall);\n\t\t\t\tbreak;\n\t\t\tcase HW_HL:\n\t\t\t\tl.neighbors.add(AREA.Hall);\n\t\t\t\tl.neighbors.add(AREA.Lounge);\n\t\t\t\tbreak;\n\t\t\tcase HW_SL:\n\t\t\t\tl.neighbors.add(AREA.Study);\n\t\t\t\tl.neighbors.add(AREA.Library);\n\t\t\t\tbreak;\n\t\t\tcase HW_HB:\n\t\t\t\tl.neighbors.add(AREA.Hall);\n\t\t\t\tl.neighbors.add(AREA.BilliardRoom);\n\t\t\t\tbreak;\n\t\t\tcase HW_LD:\n\t\t\t\tl.neighbors.add(AREA.Lounge);\n\t\t\t\tl.neighbors.add(AREA.DiningRoom);\n\t\t\t\tbreak;\n\t\t\tcase HW_LB:\n\t\t\t\tl.neighbors.add(AREA.Library);\n\t\t\t\tl.neighbors.add(AREA.BilliardRoom);\n\t\t\t\tbreak;\n\t\t\tcase HW_BD:\n\t\t\t\tl.neighbors.add(AREA.BilliardRoom);\n\t\t\t\tl.neighbors.add(AREA.DiningRoom);\n\t\t\t\tbreak;\n\t\t\tcase HW_LC:\n\t\t\t\tl.neighbors.add(AREA.Library);\n\t\t\t\tl.neighbors.add(AREA.Conservatory);\n\t\t\t\tbreak;\n\t\t\tcase HW_BB:\n\t\t\t\tl.neighbors.add(AREA.BilliardRoom);\n\t\t\t\tl.neighbors.add(AREA.Ballroom);\n\t\t\t\tbreak;\n\t\t\tcase HW_DK:\n\t\t\t\tl.neighbors.add(AREA.DiningRoom);\n\t\t\t\tl.neighbors.add(AREA.Kitchen);\n\t\t\t\tbreak;\n\t\t\tcase HW_CB:\n\t\t\t\tl.neighbors.add(AREA.Conservatory);\n\t\t\t\tl.neighbors.add(AREA.Ballroom);\n\t\t\t\tbreak;\n\t\t\tcase HW_BK:\n\t\t\t\tl.neighbors.add(AREA.Ballroom);\n\t\t\t\tl.neighbors.add(AREA.Kitchen);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlocations.add(l);\n\t\t}\n\t\t\n\t\treturn locations;\n\t}", "private void ShowNearbyPlaces(List<HashMap<String, String>> nearbyPlacesList) {\n for (int i = 0; i < nearbyPlacesList.size(); i++) {\n Log.d(\"onPostExecute\",\"Entered into showing locations\");\n MarkerOptions markerOptions = new MarkerOptions();\n HashMap<String, String> googlePlace = nearbyPlacesList.get(i);\n double lat = Double.parseDouble(googlePlace.get(\"lat\"));\n double lng = Double.parseDouble(googlePlace.get(\"lng\"));\n String placeName = googlePlace.get(\"place_name\");\n String vicinity = googlePlace.get(\"vicinity\");\n LatLng latLng = new LatLng(lat, lng);\n markerOptions.position(latLng);\n markerOptions.title(placeName);\n markerOptions.snippet(vicinity);\n\n if (this.mKind == \"police\")\n markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE));\n else if (this.mKind == \"hospital\")\n markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ORANGE));\n\n mMap.addMarker(markerOptions);\n }\n mMap.animateCamera(CameraUpdateFactory.zoomTo(12));\n }", "public static void createPlanets() {\n\t\tplanets = new PlanetV4[planetNames.length];\n\t\tfor (int i = 0; i < planetNames.length; i ++) {\n\t\t\tplanets[i] = new PlanetV4(planetNames[i], planetMasses[i], planetDiameters[i], planetPositions[i], planetVelocities[i], planetCircles[i]);\n\t\t\t//mainFrame.add(planets[i]);\n\t\t}\n\t}", "public ParkingSpot createSpot() {\n ParkingSpot spot = new ParkingSpot();\n spot.setTime(time);\n spot.setId(id);\n spot.setLongitude(longitude);\n spot.setLatitude(latitude);\n spot.setAccuracy(accuracy);\n return spot;\n }", "public PlaceReserveInformationExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public void setUpDialog(final LatLng position) {\n\t\tAlertDialog.Builder alert = new AlertDialog.Builder(this);\n\t\talert.setTitle(\"Create Place-It\");\n\t\tLayoutInflater inflater = getLayoutInflater();\n\t\tfinal View dialog = inflater.inflate(R.layout.placeit_form, null);\n\t\tfinal EditText title = (EditText) dialog.findViewById(R.id.title);\n\t\tfinal EditText description = (EditText) dialog\n\t\t\t\t.findViewById(R.id.description);\n\t\talert.setView(dialog);\n\t\t\n\t\t/* Initialize submission button. */\n\t\talert.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n\t\t\tpublic void onClick(DialogInterface dialog, int whichButton) {\n\t\t\t\t/* User submits his/her placeit and this method is called */\n\t\t\t\tString descText = description.getText().toString();\n\t\t\t\tString titleText = title.getText().toString();\n\t\t\t\t/* Notification of added place-it */\n\t\t\t\tToast.makeText(MainActivity.this, \"Place-it added!\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\n\t\t\t\tPlaceIt placeit = controller.AddPlaceIt(titleText, descText, position);\n\t\t\t\tsetupTimeDialog(placeit);\n\t\t\t\tsetUpSideBar();\n\t\t\t}\n\t\t});\n\t\t\n\t\t/* Cancel button which does nothing when clicked and exits the dialog. */\n\t\talert.setNegativeButton(\"Cancel\",\n\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int whichButton) {\n\t\t\t\t\t\tToast.makeText(MainActivity.this, \"Nothing added!\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\talert.show();\n\t}", "@Test\n public void savePlaces() {\n Assert.assertTrue(places.size() > 0);\n\n // save mock place\n boolean result = mDbHelper.savePlaces(Realm.getInstance(testConfig), places);\n\n // check result\n Assert.assertTrue(result);\n }", "private void startMapCreater() {\n\t\tNavigator navi = new Navigator(pilot);\n\t\tnavi.addWaypoint(0,0);\n\t\tnavi.addWaypoint(0,5000);\n\t\tBehavior forward = new Forward(navi);\n\t\tBehavior ultrasonic = new UltrasonicSensor(ultrasonicSensorAdaptor,pilot, sonicWheel,dis,dos,navi);\n\t\tBehavior stopEverything = new StopRobot(Button.ESCAPE);\n\t\tBehavior[] behaiverArray = {forward, ultrasonic, stopEverything};\n\t\tarb = new Arbitrator(behaiverArray);\n\t\t\n\t arb.go();\n\t\t\n\t}", "private void setupMarkers() {\n \t\tGPSFilterPolygon polygon = this.area.getPolygon();\n \n \t\tif ( polygon != null ) {\n \t\t\tfinal LatLngBounds.Builder builder = LatLngBounds.builder();\n \n \t\t\t// Put markers for each edge.\n \t\t\tfor ( GPSLatLng pos : polygon.getPoints() ) {\n \t\t\t\tLatLng point = this.convertLatLng( pos );\n \n \t\t\t\tbuilder.include( point );\n \n \t\t\t\tthis.addMarker( point );\n \t\t\t}\n \n \t\t\t// Add listener that moves camera so that all markers are in users view.\n \t\t\tthis.googleMap.setOnCameraChangeListener( new OnCameraChangeListener() {\n \t\t\t\t@Override\n \t\t\t\tpublic void onCameraChange( CameraPosition arg0 ) {\n \t\t\t\t\t// Move camera.\n \t\t\t\t\tmoveCameraToPolygon( builder, false );\n \n \t\t\t\t\t// Remove listener to prevent position reset on camera move.\n \t\t\t\t\tgoogleMap.setOnCameraChangeListener( null );\n \t\t\t\t}\n \t\t\t} );\n \n \t\t\tthis.updateGuiPolygon();\n \t\t}\n \t}", "private void initializeShippingPoints() {\n shipping_points = new ShippingPoint[num_shipping_points];\n \n int x_size = 8;\n int y_size = 8;\n int[][] grid = new int[x_size][y_size]; //keeps track of which locations are taken\n //so no two ShippingPoints have the same location\n \n int x = 0;\n int y = 0;\n \n for(int i = 0; i < num_shipping_points; i++)\n {\n x = (int)(Math.random() * x_size);\n y = (int)(Math.random() * y_size);\n while(grid[x][y] != 0) {\n x = (int)(Math.random() * x_size);\n y = (int)(Math.random() * y_size);\n }\n grid[x][y] = 1;\n if(i % 4 == 0) { //be careful -- probably won't work in the general case\n Supplier supplier = new Supplier(x, y, i);\n shipping_points[i] = supplier;\n }\n else {\n Customer customer = new Customer(x, y, i);\n shipping_points[i] = customer;\n }\n }\n \n if(eight_shipping_points) {\n //for 8 shipping points\n shipping_points[0].setPosition(4, 0);\n shipping_points[1].setPosition(8, 0);\n shipping_points[2].setPosition(8, 4);\n shipping_points[3].setPosition(8, 8);\n shipping_points[4].setPosition(4, 8);\n shipping_points[5].setPosition(0, 8);\n shipping_points[6].setPosition(0, 4);\n shipping_points[7].setPosition(0, 0);\n }\n \n else {\n //for 20 shipping points\n /**/shipping_points[0].setPosition(4,0);\n shipping_points[1].setPosition(8, 0);\n shipping_points[2].setPosition(12, 0);\n shipping_points[3].setPosition(16, 0);\n shipping_points[4].setPosition(20, 0);\n shipping_points[5].setPosition(20, 4);\n shipping_points[6].setPosition(20, 8);\n shipping_points[7].setPosition(20, 12);\n shipping_points[8].setPosition(20, 16);\n shipping_points[9].setPosition(20, 20);\n shipping_points[10].setPosition(16, 20);\n shipping_points[11].setPosition(12, 20);\n shipping_points[12].setPosition(8, 20);\n shipping_points[13].setPosition(4, 20);\n shipping_points[14].setPosition(0, 20);\n shipping_points[15].setPosition(0, 16);\n shipping_points[16].setPosition(0, 12);\n shipping_points[17].setPosition(0, 8);\n shipping_points[18].setPosition(0, 4);\n shipping_points[19].setPosition(0, 0);/**/\n }\n \n displayShippingPoints();\n }", "Position createPosition();", "private static void createRooms() {\n// Room airport, beach, jungle, mountain, cave, camp, raft, seaBottom;\n\n airport = new Room(\"airport\");\n beach = new Room(\"beach\");\n jungle = new Room(\"jungle\");\n mountain = new Room(\"mountain\");\n cave = new Room(\"cave\");\n camp = new Room(\"camp\");\n seaBottom = new Room(\"seabottom\");\n\n //Setting the the exits in different rooms\n beach.setExit(\"north\", jungle);\n beach.setExit(\"south\", seaBottom);\n beach.setExit(\"west\", camp);\n\n jungle.setExit(\"north\", mountain);\n jungle.setExit(\"east\", cave);\n jungle.setExit(\"south\", beach);\n\n mountain.setExit(\"south\", jungle);\n\n cave.setExit(\"west\", jungle);\n\n camp.setExit(\"east\", beach);\n\n seaBottom.setExit(\"north\", beach);\n\n // Starting room\n currentRoom = airport;\n }", "public void place(GamePiece teil, QPosition pos) { // old German method name: platziere\n for (int x = teil.getMinX(); x <= teil.getMaxX(); x++) {\n for (int y = teil.getMinY(); y <= teil.getMaxY(); y++) {\n if (teil.filled(x, y)) {\n int ax = pos.getX() + x - teil.getMinX();\n int ay = pos.getY() + y - teil.getMinY();\n set(ax, ay, teil.getBlockType(x, y));\n }\n }\n }\n view.draw();\n }", "public static List<Place> createFromXml(AbstractController controller, String xmlPath) {\n List<Place> places = new ArrayList<Place>();\n\n try {\n File xmlFile = new File(xmlPath);\n DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n Document doc = dBuilder.parse(xmlFile);\n\n NodeList nodeList = doc.getElementsByTagName(\"locality\");\n\n for(int i = 0; i < nodeList.getLength(); i++) {\n Node node = nodeList.item(i);\n\n if(node.getNodeType() == Node.ELEMENT_NODE) {\n\n Element placeElement = (Element) node;\n Element locationElement = (Element) placeElement.getElementsByTagName(\"location\").item(0);\n\n String name = placeElement.getAttribute(\"name\");\n String altitude = locationElement.getAttribute(\"altitude\");\n String latitude = locationElement.getAttribute(\"latitude\");\n String longitude = locationElement.getAttribute(\"longitude\");\n\n Place newPlace = new Place(controller, name, altitude, latitude, longitude);\n places.add(newPlace);\n }\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n return places;\n }" ]
[ "0.7036062", "0.67250323", "0.67071366", "0.60838985", "0.6064514", "0.5964835", "0.594365", "0.5883921", "0.5788858", "0.5756271", "0.56953835", "0.5681603", "0.5645718", "0.5637629", "0.56345344", "0.56327236", "0.56169665", "0.5604356", "0.55851865", "0.5584265", "0.55751383", "0.55724454", "0.55644983", "0.55395424", "0.5533698", "0.5531123", "0.5522931", "0.5504013", "0.54974073", "0.54399544", "0.54354894", "0.5428619", "0.5403653", "0.53892666", "0.5380962", "0.5369008", "0.53684115", "0.53661984", "0.5362543", "0.5361861", "0.53529245", "0.5352595", "0.5348851", "0.53458124", "0.5335618", "0.53334135", "0.53282046", "0.532714", "0.5324523", "0.5323801", "0.5322244", "0.5314386", "0.53007454", "0.5296401", "0.52934587", "0.528451", "0.5280387", "0.52733606", "0.5270794", "0.5259682", "0.5237487", "0.5231131", "0.52297026", "0.52297026", "0.52297026", "0.52264684", "0.5218651", "0.52140063", "0.5210337", "0.520863", "0.52084523", "0.5192722", "0.5190278", "0.5187974", "0.51734465", "0.51638985", "0.5161383", "0.5158607", "0.5153015", "0.5118981", "0.5114126", "0.5109632", "0.5107987", "0.5104266", "0.5097484", "0.50957364", "0.5095553", "0.50904477", "0.5087511", "0.5085985", "0.50856376", "0.5079638", "0.50781906", "0.50743955", "0.50675106", "0.506286", "0.50588816", "0.5058028", "0.50572056", "0.50562054" ]
0.5252975
60
Here I define the callback interface
public interface MyCallbackInterface { //its supposed to send the JSON object on request completed void onRequestCompleted(JSONArray result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void callbackCall() {\n\t\t\t}", "public void callback();", "public void callback() {\n }", "public interface Callback {\n }", "@Override\n\tpublic void callback() {\n\t}", "@Override\n\tpublic void callback(Object o) {}", "@Override\n\tpublic void onCallback() {\n\t\t\n\t}", "public interface CallbackListener {\n\n public abstract void callBack(String returnCode, Object result);\n\n}", "public Response callback() throws Exception;", "public interface Callback {\n public void run(Object result, Exception err, Object rock);\n }", "public interface Callback {\n public static final int TYPE_REGULAR = 0;\n public static final int TYPE_DRAFT = 1;\n public static final int TYPE_TRASH = 2;\n\n /**\n * Called when the specified mailbox does not exist.\n */\n public void onMailboxNotFound(boolean firstLoad);\n\n /**\n * Called when the user wants to open a message.\n * Note {@code mailboxId} is of the actual mailbox of the message, which is different from\n * {@link MessageListFragment#getMailboxId} if it's magic mailboxes.\n *\n * @param messageId the message ID of the message\n * @param messageMailboxId the mailbox ID of the message.\n * This will never take values like {@link Mailbox#QUERY_ALL_INBOXES}.\n * @param listMailboxId the mailbox ID of the listbox shown on this fragment.\n * This can be that of a magic mailbox, e.g. {@link Mailbox#QUERY_ALL_INBOXES}.\n * @param type {@link #TYPE_REGULAR}, {@link #TYPE_DRAFT} or {@link #TYPE_TRASH}.\n */\n public void onMessageOpen(long messageId, long messageMailboxId, long listMailboxId,\n int type);\n\n /**\n * Called when an operation is initiated that can potentially advance the current\n * message selection (e.g. a delete operation may advance the selection).\n * @param affectedMessages the messages the operation will apply to\n */\n public void onAdvancingOpAccepted(Set<Long> affectedMessages);\n\n /**\n * Called when a drag & drop is initiated.\n *\n * @return true if drag & drop is allowed\n */\n public boolean onDragStarted();\n\n /**\n * Called when a drag & drop is ended.\n */\n public void onDragEnded();\n }", "@Override\n\t\t\t\t\t\t\t\t\tpublic void callback(int position) {\n\n\t\t\t\t\t\t\t\t\t}", "public interface Callback {\n\n void call();\n\n}", "public interface Callback {\n\n /**\n * A callback method the user should implement. This method will be called when the send to the server has\n * completed.\n * @param send The results of the call. This send is guaranteed to be completed so none of its methods will block.\n */\n public void onCompletion(RecordSend send);\n}", "public interface Callback {\n void onExpanded(boolean z);\n\n void onInteraction();\n\n void onPrioritySettings();\n }", "public interface Callback {\n public void click();\n }", "public interface UHFCallbackLiatener {\n void refreshSettingCallBack(ReaderSetting readerSetting);\n void onInventoryTagCallBack(RXInventoryTag tag);\n void onInventoryTagEndCallBack(RXInventoryTag.RXInventoryTagEnd tagEnd);\n void onOperationTagCallBack(RXOperationTag tag);\n}", "public interface ICallback {\n void sucessed(String s);\n void fialed(String s);\n}", "public abstract EnvioMensajesCallBackInterface getInterfaceCallback();", "public interface ResponseCallback {\n void onSucceed(String tag, ResultDataBean resultDataBean);\n void error(String tag,String errorMessage );\n //TODO 如果需要可以把一下加上\n// void onFailed(String tag);\n// void onFinish(String tag);\n// void onStart(String tag);\n}", "int callback(int num_msg, Pointer msg, Pointer resp, Pointer _ptr);", "public interface Callback {\n void mo142a(MediaResource mediaResource);\n\n void mo143b(MediaResource mediaResource);\n }", "public interface Callback {\n\t\tvoid onMove(Player player, PlayerMoveEvent event);\n\t\t\n\t\tvoid onTeleport(Player player, PlayerTeleportEvent event);\n\t\t\n\t\tvoid onCombat(Player player);\n\t\t\n\t\tvoid onDeath(Player player);\n\t\t\n\t\tvoid onQuit(Player player);\n\t}", "public interface Callback {\n void call();\n}", "interface MyCallBack {\n\tpublic void onComplete(); \n}", "public interface CallBackListener\n{\n public void drawbackTexto0(String response);\n}", "public interface RequestCallBack {\r\n void successCallback(String string);\r\n void failedCallback(String string);\r\n}", "public interface ICallBAck {\n void getCallback();\n }", "public interface AddGoWuCheCallBack {\n public void success(AddGoWuCheBean bean);\n\n public void failuer(String e);\n}", "@Override\n public void onCallBack(int pos) {\n }", "public interface Callback {\n public void onItemSelected(Uri uri);\n }", "public interface CallbackInterface {\n void execute(String name);\n}", "public interface Icallback {\n void successful(String response);\n void fail(Error error);\n}", "public abstract void callback(Instruction instruction);", "public interface CommCallBack {\n\n /**\n * 成功的回调\n */\n void onSuccess(Object result);\n\n /**\n * 失败的回调\n */\n void onFail(Object result);\n}", "public interface RequestCallbackListener {\n public void notifyToCaller(boolean isExecuted,Object obj);\n}", "public interface ComCallBack {\n public void onCallBack(Object obj);\n}", "public interface Callback {\n void onItemSelected(Movie movie, MovieCategories movieCategory, int moviePosition);\n }", "public interface ResponseCallback {\r\n\t\t/**\r\n\t\t * Callback invoked when a response is returned by the request\r\n\t\t * @param response The returned response\r\n\t\t */\r\n\t\tpublic void onResponse(Response response) throws Exception;\r\n\t}", "public interface EventCallback {\n void invoke(String receiver,Object result);\n}", "public interface ClientCallbackSIMON_IF // extends ClientCallback_IF\n{\n public void callback(String text);\n\n public void ping();\n\n}", "public interface Callbacks {\n\t\t/**\n\t\t * Callback for when an item has been selected.\n\t\t */\n\t\tpublic void onItemSelected(Long id);\n\t}", "public interface ReceiveCallback extends MessageReceivedCallback{\n}", "public interface IConvertorCallback {\n\t/***\n\t * @param filename Indicates generated file name. \n\t */\n\tvoid notify(String filename);\n}", "@Override\n\t\t\t\t\t\t\tpublic void callback(HBCIPassport passport, int reason, String msg,\n\t\t\t\t\t\t\t\t\tint datatype, StringBuffer retData) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "public interface Callback {\n /**\n * DetailFragmentCallback for when an item has been selected.\n */\n public void onItemSelected(Uri movieUri);\n }", "public interface RequestCallBack {\n void succes(String json);\n void fail();\n}", "public interface CallBackInterface {\n}", "public interface OnRecordCallBack {\n\n int onSaveRecord(DataSource dataSource, int record);\n\n int onGetRecord(DataSource dataSource);\n\n int onResetRecord(DataSource dataSource);\n\n int onRemoveRecord(DataSource dataSource);\n\n void onClearRecord();\n\n}", "public interface RequestCallback {\n void callback(String response);\n}", "public interface ApiCallback {\n\n void apiCompleted(UploadStatusApiResponse response);\n}", "public interface GekozenWoordCallback {\n /**\n * Wordt uitgevoerd om te wachten op het resultaat van de query\n * @param gekozenWoord string van het gekozen woord\n */\n void onCallback(String gekozenWoord);\n\n}", "public interface CallBacksss {\n public void Call();\n}", "public interface DataCallback {\n public void onData(List t);\n}", "public interface CallBackFunction {\n public void onCallBack(String data);\n}", "public interface HttpCallbackListener {\n void onFinish(String responde);\n void onError(Exception e);\n}", "public interface API_CallBack {\n\n void ArrayData(ArrayList arrayList);\n\n void OnSuccess(String responce);\n\n void OnFail(String responce);\n\n\n}", "public interface MyCallback {\n\n void updateAdapter(Movies[] movies);\n}", "public interface IQueryTCFZListCallback {\n void querySuccessed();\n void queryUnSuccessed();\n}", "public interface MyCallback {\n void done(String result);\n}", "public interface Callback{\n //Required public empty constructor\n public void buttonClicked();\n }", "public interface Callbacks {\n /**\n * Callback for when an item has been selected.\n * public modifier left for readability\n */\n public void onItemSelected(int position);\n }", "public CallbackHandler() {\r\n // TODO Auto-generated constructor stub\r\n }", "public interface ICallbackImp {\n void onMsg(String msg);\n}", "public interface FlightTrackingCallbackHandler extends Remote {\n\n /*\n * Callback cuando el vuelo fue asignado a una pista\n */\n void onRunwayAssignment(final String flightId, final String destination, final String runway, final long flightsAhead)\n throws RemoteException;\n\n /*\n * Callback cuando el vuelo cambió su posicion en la cola de espera de la pista\n */\n void onQueuePositionUpdate(final String flightId, final String destination, final String runway, final long flightsAhead)\n throws RemoteException;\n\n /*\n * Callback cuando el vuelo despego\n */\n void onDeparture(final String flightId, final String destination, final String runway)\n throws RemoteException;\n\n /*\n * Callback para eliminar el handler de callbacks\n */\n void endProcess()\n throws RemoteException;\n}", "public interface Callbacks {\n void onCrimeSelected(Crime crime);\n }", "public interface Callbacks {\n void onCrimeSelected(Crime crime);\n }", "public static interface Callbacks\n {\n public abstract void ledClientConnected(LedClient ledclient);\n\n public abstract void ledClientDisconnected(LedClient ledclient);\n }", "public interface HttpCallbackListener {\n\n\tvoid onFinish(String response);\n\n\tvoid onError(Exception e);\n\n}", "public interface UpdateUserInfoCallback {\n\n void changeUserInfo();\n\n}", "public interface Callbacks {\n void onStateChanged();\n void onProximityNegative();\n }", "public interface IResultClientCallback extends IClientCallback {\n\n /**\n * A callback method executed when an operation successfully completes.\n * @param result The result model related to the operation.\n */\n void onComplete(ResultModel result);\n\n /**\n * {@inheritDoc}\n */\n void onError(ClientErrorType errorType, Exception exception);\n}", "public interface LocationCallBack {\n /**\n * location 定位服务\n */\n void Location(Location location, Boolean isChange);\n\n /**\n * baidu de return\n * @param location\n * @param isChange\n */\n void BaiduLocation(MyLocationData location, Boolean isChange);\n}", "public interface Callbacks {\n\t\t/**\n\t\t * Callback for when an item has been selected.\n\t\t */\n\t\tpublic void onItemSelected(String id);\n\t}", "public interface Callbacks {\n\t\t/**\n\t\t * Callback for when an item has been selected.\n\t\t */\n\t\tpublic void onItemSelected(String id);\n\t}", "EventCallbackHandler getCallbackHandler();", "public interface QARxDataCallBack<T> {\n void onSucess(T t);\n\n void onFail();\n\n}", "public interface Callback {\n /**\n * DetailFragmentCallback for when an item has been selected.\n */\n public void onItemSelected(Uri dateUri);\n }", "public interface Callback<T> {\n\n // 失败回调\n void onFail(int errorNo, String errorMsg);\n\n // 成功回调\n void onSuccess(T t);\n}", "public interface Callback<T> {\n\t/**\n\t * Executes when the method is complete\n\t * @param result The result of the method\n\t */\n\tpublic void onComplete(T result);\n}", "public interface ArtistResponseListener {\n\t// you can define any parameter as per your requirement\n\tpublic void callbackArtistResponse(List<Artist>artistList);\n}", "public interface Callbacks {\n /**\n * Callback for when an item has been selected.\n */\n public void onItemSelected(String summary, String poster);\n }", "public interface Callbacks {\n /**\n * Callback for when an item has been selected.\n */\n public void onItemSelected(int id);\n public void onCheckBoxChange(int id);\n }", "public static abstract interface M0_callbackPtr {\n\n public abstract int handler();\n }", "public interface IMineModel extends BaseModel {\n\n void loadImgCode(MyCallBack<Bundle> callback);\n void register(String mailAdd, String passWd, String verificationCode, String cookie, MyCallBack<PersonRegister> callback);\n}", "public interface GenreCallback<T> {\n void onSucess(ArrayList<T> data);\n\n void onError(Exception exception);\n}", "public interface ICallBack<T> {\n\n void start(Disposable d);\n\n void success(T t);\n\n void error(ExceptionHandle.ResponeThrowable dataEx);\n\n void complete();\n}", "public interface PaymentCallBackFacade {\n\n CommonResp callback(NotifyTradeStatusReq notifyTradeStatusReq);\n}", "public interface CheckoutCallback extends HttpRequestCallback{\n\n void onSuccess(Token token);\n\n void onFailure(Token token, String reason);\n}", "public interface ConnectCallback {\n\n public void onSuccess(String userid);\n}", "public interface Callbacks\n {\n public void onItemSelected(String id);\n }", "public interface Callback {\n /**\n * Show top tracks when an item has been selected.\n */\n void onTrackItemSelected(int position, List<USpotifyObject> tracks);\n }", "public interface FetchDataCallbackInterface {\n void fetchDataCallback(String result);\n}", "public interface YTranslatorCallBack {\n void getYTranslateCallBack(String responcse, String progressingName);\n /*void getYTranslateCallBackFromText(String response);\n void getYTranslateCallBackFromQTrans(String response);*/\n}", "public interface SendCallBack {\n\n void onSuccess();\n\n void onFailure();\n}", "public interface Callbacks {\n\t\tvoid onExerciseSelected(Exercise exercise);\n\t}", "public interface GetUserCallback {\n\n public abstract void done(User returnedUser);\n\n\n}", "public interface InfosCallback {\n void OnRequestDone(boolean isFailed, String result);\n}", "public interface CallbackFriends {\n\n /**\n * Retrieve friends\n *\n * @param friends List of user friends\n */\n void retrievedFriends(List<Friend> friends);\n\n\n /**\n * When no friends where retrieved\n */\n void noFriendsRetrieved();\n}", "public interface ActionCallBack {\n void acceptOrder(int position);\n void cancelOrder(int position);\n void readyToDeliver(int position);\n void showDetails(int position);\n\n\n\n}" ]
[ "0.8121364", "0.8074135", "0.8007718", "0.79711086", "0.7809902", "0.77962357", "0.76086783", "0.75892717", "0.74566555", "0.7369693", "0.73455036", "0.73286563", "0.72813284", "0.72630614", "0.725146", "0.7246145", "0.72365326", "0.721983", "0.7216395", "0.71877944", "0.7183666", "0.71664613", "0.71402377", "0.71311617", "0.71222574", "0.71149766", "0.7111585", "0.7110455", "0.71078163", "0.7088895", "0.7071909", "0.7059", "0.70428336", "0.70385236", "0.70385164", "0.70100677", "0.69955903", "0.69926643", "0.6990611", "0.69846433", "0.69779706", "0.6974238", "0.69701594", "0.69694024", "0.69610566", "0.69507575", "0.6950223", "0.693965", "0.6938104", "0.69372797", "0.69222474", "0.69137126", "0.6908304", "0.68981355", "0.68964386", "0.68948454", "0.6889058", "0.6887032", "0.68846315", "0.68845403", "0.6883647", "0.68826103", "0.68812823", "0.6878855", "0.6877577", "0.6874796", "0.6874796", "0.6868926", "0.68660367", "0.6866021", "0.6860495", "0.6853708", "0.68488336", "0.6843318", "0.6843318", "0.6839455", "0.6838926", "0.6836238", "0.68308306", "0.6827798", "0.6822946", "0.68214434", "0.6820007", "0.6816224", "0.68022", "0.6799858", "0.67973804", "0.6793486", "0.67932814", "0.6790866", "0.6790326", "0.6789486", "0.6783051", "0.6775458", "0.6763743", "0.6760509", "0.67595196", "0.6759028", "0.6758451", "0.6745611" ]
0.7530286
8
its supposed to send the JSON object on request completed
void onRequestCompleted(JSONArray result);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void sendJson(Object data);", "@Override\n\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\t\t\t\tpublic void onComplete(String response, Object state) {\n\t\t\t\t\t\t\t\tString json = response;\n\t\t\t\t\t\t\t\tLog.d(\"arv\", \"arv\"+json);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}", "void onComplete(boolean result, JSONObject jsonObject);", "@Override\r\n\t\t\t\tpublic void onSucceed(JSONObject obj) {\n\t\t\t\t\tLog.e(\"upload\",obj.toString());\r\n\t\t\t\t}", "@Override\n public void onResponse(JSONObject jsonObject)\n {\n }", "public HTTPResponse finish() {\n HTTPResponse response = new HTTPResponse();\n try {\n //create the HTTP connection\n super.CreateConnection();\n //write the JSON data via DataOutputStream\n DataOutputStream dataOutputStream = new DataOutputStream(super.httpConn.getOutputStream());\n dataOutputStream.writeBytes(jsonParam.toString());\n //get the results\n response.setResponseCode(super.httpConn.getResponseCode());\n response.setResponseBody(super.readResponseBody());\n dataOutputStream.flush();\n dataOutputStream.close();\n super.httpConn.disconnect();\n } catch (Exception e) {\n Log.e(TAG, e.getMessage());\n }\n return response;\n }", "@Override\n public void onResponse(JSONObject response) {\n processResponse(response);\n }", "public void send() {\n try {\n String message = _gson.toJson(this);\n byte[] bytes = message.getBytes(\"UTF-8\");\n int length = bytes.length;\n\n _out.writeInt(length);\n _out.write(bytes);\n \n } catch (IOException ex) {\n Logger.getLogger(ResponseMessage.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "void onResponseTaskCompleted(Request request, Response response, OHException ohex, Object data);", "public interface MyCallbackInterface {\n //its supposed to send the JSON object on request completed\n void onRequestCompleted(JSONArray result);\n }", "private void sendRequest(String URL) {\n RequestQueue requestQueue = Volley.newRequestQueue(context);\n\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, URL, new JSONObject(headers)\n , new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n Log.e(\"sendRequest Response\", response.toString());\n try {\n //temp\n JSONObject j = new JSONObject();\n j = response;\n Log.e(\"j\",j.toString());\n\n //responseJSONObject = new JSONObject(response);\n serverResponse.saveResponse(response);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"Response_Error\",databaseURL + \" : \" + error.toString());\n }\n });\n\n requestQueue.add(jsonObjectRequest);\n }", "void requestFinish();", "public void requestDone(Request request, boolean isSuccessful);", "protected void onEndRequest()\n\t{\n\t}", "@Override\r\n\tprotected void processRespond() {\n\r\n\t}", "@Override\r\n\tprotected void processRespond() {\n\r\n\t}", "void onComplete(RouterRequest request);", "@Override\n public void onResponse(JSONObject response) {\n procesarRespuesta(response);\n Log.i(TAG, \"processanddo respuesta...\" + response);\n }", "@Override\r\n\tpublic void onOk(HttpRequest paramHttpRequest, Object paramObject) {\n\r\n\t}", "@Override\n\tprotected void handleResult(JSONObject obj) {\n\t\t\n\t}", "@Override\n public void onResponse(JSONObject response) {\n Log.e(\"puto\",\"PRECEOSA \");\n procesarRespuesta(response);\n\n Log.e(\"puto\",\"respuetsa -\"+response);\n }", "@Override\n\t\tpublic void onServiceComplete(Boolean success, String jsonObj) {\n\n\t\t}", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] response) {\n Log.e(\"JSON\", new String(response));\n\n\n }", "private void sendJson(){\n RequestQueue requestQueue = Volley.newRequestQueue(this);\n JSONObject jsonBodyObj = new JSONObject();\n String url = \"http://10.0.2.2:5000/user\";\n try{\n jsonBodyObj.put(\"key1\", encodedString);\n jsonBodyObj.put(\"key2\", courseslistid.get(spinnerCourses.getSelectedItemPosition()));\n\n }catch (JSONException e){\n e.printStackTrace();\n }\n final String requestBody = jsonBodyObj.toString();\n\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST,\n url, null, new Response.Listener<JSONObject>(){\n @Override public void onResponse(JSONObject response) {\n Log.i(\"Response\",String.valueOf(response));\n }\n }, new Response.ErrorListener() {\n @Override public void onErrorResponse(VolleyError error) {\n VolleyLog.e(\"Error: \", error.getMessage());\n }\n }){\n @Override public Map<String, String> getHeaders() throws AuthFailureError {\n HashMap<String, String> headers = new HashMap<String, String>();\n headers.put(\"Content-Type\", \"application/json\");\n return headers;\n }\n\n\n @Override public byte[] getBody() {\n try {\n return requestBody == null ? null : requestBody.getBytes(\"utf-8\");\n } catch (UnsupportedEncodingException uee) {\n VolleyLog.wtf(\"Unsupported Encoding while trying to get the bytes of %s using %s\",\n requestBody, \"utf-8\");\n return null;\n }\n }\n };\n\n requestQueue.add(jsonObjectRequest);\n Toast.makeText(getApplicationContext(), \"Yoklama Alma Başarılı!\", Toast.LENGTH_LONG).show();\n\n }", "@Override\n protected void deliverResponse(JSONObject response) {\n listener.onResponse(response);\n System.out.println(\"response \"+response);\n }", "@Override\n public void onCompleted() {\n System.out.println(\"Sending final response as client is done\");\n //as client done, setting the result to response observer object\n responseObserver.onNext(LongGreetResponse.newBuilder().setResult(result).build());\n //complete the response\n responseObserver.onCompleted();\n }", "@Override\n\n\n\n public void done(List<MesosferData> list, MesosferException e) {\n loading.dismiss();\n\n // check if there is an exception happen\n if (e != null) {\n return;\n }\n\n for (MesosferData data : list) {\n VisitObject myObject = new VisitObject();\n\n Map<String, String> map = new HashMap<>();\n map.put(\"id\", \"ID : \" + data.getObjectId());\n try {\n map.put(\"data\", data.toJSON().toString(1));\n JSONObject dataJson = new JSONObject(data.toJSON().toString());\n// Log.d(\"Object\",dataJson.getString(\"namaKota\"));\n myObject.setObjOrigin(dataJson.getString(\"namaKota\"));\n myObject.setObjName(dataJson.getString(\"worthName\"));\n myObject.setObjPrice(dataJson.getString(\"worthPrice\"));\n myObject.setObjPhoto(dataJson.getString(\"imageWorth\"));\n myObject.setObjLat(dataJson.getString(\"worthLat\"));\n myObject.setObjLong(dataJson.getString(\"worthLng\"));\n\n// Log.d(\"Url Object\",myObject.getObjPhoto());\n\n } catch (JSONException e1) {\n map.put(\"data\", data.toJSON().toString());\n }\n// mapDataList.add(map);\n// Log.d(\"City Budget\",myCity.getCityBudget());\n if (myObject.getObjOrigin().equals(key)){\n// Log.d(\"masuk\", \"iya\");\n\n mObject.add(myObject);\n }\n// Log.d(\"mObject Size\", String.valueOf(mObject.size()));\n }\n objAdapter.notifyDataSetChanged();\n }", "@Override\n public void onCompleted() {\n responseObserver.onCompleted();\n }", "@Override\r\n\t\tpublic void onComplete(String response, Object state) {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void doUploadResult(String json) throws Exception {\n\n\t}", "@Override\n\tpublic void sendResponse() {\n\n\t}", "@Override\n\tpublic void sendResponse() {\n\t\t\n\t}", "private void makeJsonObjReq(JSONObject json,String url,final String file) {\n\t\t showProgressDialog();\n\t\t\tRequestQueue mRequestQueue = Volley.newRequestQueue(getApplicationContext());\n\t\t\tJsonUTF8Request jsonObjReq = new JsonUTF8Request(Method.POST,\n\t\t\t\turl, json,\n\t\t\t\tnew Response.Listener<JSONObject>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onResponse(JSONObject response) {\n\t\t\t\t\t\tLog.d(TAG, response.toString());\n\t\t\t\t\t // Dismiss the progress dialog\n\t\t\t\t\t\t \t JSONObject jsonObjSend = null;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tjsonObjSend = new JSONObject(response.toString());\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (response != null) {\n\t\t\t\t\t\t\t\t\tparseJsonFeed(response, file);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t \t} catch (JSONException e) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t} \n \n\t\t\t\t\t\thideProgressDialog();\n\t\t\t\t\t}\n\t\t\t\t}, new Response.ErrorListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onErrorResponse(VolleyError error) {\n\t\t\t\t\t\tVolleyLog.d(TAG, \"Error: \" + error.getMessage());\n\t\t\t\t\t\tif(incrConnexion<=Const.count)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpublier();\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\tToast.makeText(getBaseContext(),getString(R.string.st_connection_failled), Toast.LENGTH_LONG).show();\n\t\t\t\t\t\t\thideProgressDialog();\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tincrConnexion++;\n\t\t\t\t\t}\n\t\t\t\t}) {\n\n\t\t\t/**\n\t\t\t * Passing some request headers\n\t\t\t * */\n\t\t\t@Override\n\t\t\tpublic Map<String, String> getHeaders() throws AuthFailureError {\n\t\t\t\tHashMap<String, String> headers = new HashMap<String, String>();\n\t\t\t\theaders.put(\"Content-Type\", \"application/json;charset=UTF-8\");\n\t\t\t\treturn headers;\n\t\t\t}\n \n\n\t\t};\n\t\t/*\n\t\tint socketTimeout = Const.timer_connection_request;//30 seconds - change to what you want\n\t\tRetryPolicy policy = new DefaultRetryPolicy(socketTimeout, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);\n\t\tjsonObjReq.setRetryPolicy(policy);\n\t\tmRequestQueue.add(jsonObjReq);\n\t\t*/\n\t\t// Adding request to request queue\n\t\tAppController.getInstance().addToRequestQueue(jsonObjReq,\n\t\t\t\ttag_json_obj);\n \t}", "public abstract HTTPResponse finish();", "void response( JSONArray data );", "@Override\r\n\tpublic void httpResponse_success(Map<String, String> map,\r\n\t\t\tList<Object> list, Object jsonObj) {\n\t\tJSONObject json = (JSONObject) jsonObj;\r\n\t\ttry {\r\n\t\t\tJSONObject cg = json.getJSONObject(\"rvalue\").getJSONObject(\"cg\");\r\n\t\t} catch (JSONException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tMessage msg1 = new Message();\r\n\t\tmsg1.what = 1;\r\n\t\tmHandler.sendMessage(msg1);\r\n\t}", "public void callVolley(JSONObject obj){\n RequestQueue queue = Volley.newRequestQueue(mContext);\n JSONObject obj1 = obj;\n //1. URL dari BASE_URL\n BASE_URL = BASE_URL+obj1.toString();\n //2. input = parameter\n //3. response listener : panggil processResult((response listener dijalankan di UI Thread)\n JsonObjectRequest request = new JsonObjectRequest(Request.Method.POST, BASE_URL, obj1, new Response.Listener<JSONObject>() {\n\n @Override\n public void onResponse(JSONObject response) {\n processResult(response.toString());\n Log.d(\"RESPONSE\", response.toString());\n }\n }, new Response.ErrorListener() {\n\n @Override\n public void onErrorResponse(VolleyError volleyError) {\n Log.d(\"RESPONSE\", \"That didn't work!\");\n }\n });\n queue.add(request);\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"application/json\");\n try (PrintWriter out = response.getWriter()) {\n JSONArray jArr = new JSONArray();\n ArrayList<Queue> queueList = QueueDAO.getQueue();\n for(Queue q : queueList){\n JSONObject queue = new JSONObject();\n queue.put(\"patientID\", q.getPatientID());\n queue.put(\"visitID\", q.getVisitID());\n queue.put(\"timestamp\", q.getTimestamp());\n queue.put(\"status\", q.getStatus());\n queue.put(\"name\", q.getName());\n jArr.add(queue);\n }\n out.println(jArr.toString());\n response.setStatus(HttpServletResponse.SC_OK);\n }\n }", "@Override\n public void onSucceed(Object valor) {\n }", "@Override\n public void onCompleted() {\n System.out.println(\"Server has completed sending us response\");\n // on completed will be called right after onNext\n // Whenever server is done sending data latch is going down by 1\n latch.countDown();\n }", "@Override\n public void complete(String arg0, ResponseInfo info, JSONObject response) {\n if (info.isOK()) {\n Upload();\n }\n }", "public void sendResponse(ResponseNetObject response){\r\n\r\n sendObject(response);\r\n\r\n }", "@Override\r\n\t\t\t\t\tpublic void onResponse(HttpResponse resp) {\n\t\t\t\t\t\tLog.i(\"HttpPost\", \"Success\");\r\n\r\n\t\t\t\t\t}", "@Override\n public void onResponse(JSONObject response) {\n Toast.makeText(getApplicationContext(), \"Data Donation Successful!!\", Toast.LENGTH_LONG).show();\n Log.v(\"uploadresponse\", response.toString());\n }", "@Override\n public void onCompleted() {\n builder.setMessage(\"All request data received completely!\");\n responseObserver.onNext(builder.build());\n responseObserver.onCompleted();\n }", "@Override\n protected void onPostExecute(JSONObject jsonObject) {\n super.onPostExecute(jsonObject);\n }", "@Override\n public void onNext(JSONObject jsonObject) {\n }", "public void run() {\n req.response().end(\"0\"); // Default response = 0\n }", "@Override \n\t\t public void afterCompletion(HttpServletRequest request, \n\t\t HttpServletResponse response, Object object, Exception ex) \n\t\t throws Exception { \n\t\t System.out.println(\"AfterCompletion\");\n\t\t \n\n\t\t\t \n\t\t\n\t\t }", "protected abstract void onFinishObject(T result);", "public void onSuccessInBackground(JSONObject jsonObject);", "@Override\n public void onResponse(JSONObject response) {\n Log.d(\"JSON_RESPONSE\",\"onResponse:\" +response.toString());\n }", "@Override\n\t\t\t\tpublic void onFinished(JavaScriptObject result) {\n\t\t\t\t\tcontinueWithForm(events);\n\t\t\t\t}", "@Override\n \t\t\tpublic void onSuccess(int arg, JSONArray objects) {\n \t\t\t}", "@Override\n\t\t\t\t\tpublic void onComplete() {\n\t\t\t\t\t}", "private void submit()\n {\n ownerSelected = ownersDropDown.getSelectedItemPosition();\n dogSelected = dogsDropDown.getSelectedItemPosition();\n\n dog_id = dogID.get(dogSelected).toString();\n human_id = ownerID.get(ownerSelected).toString();\n\n String jsonBody = \"{}\";\n\n mOkHttpClient = new OkHttpClient();\n\n HttpUrl reqURL = HttpUrl.parse(\"https://final-project-saldanaj.appspot.com/dogs/\" + dog_id + \"/owner/\" + human_id);\n\n RequestBody body = RequestBody.create(JSON, jsonBody);\n\n Request request = new Request.Builder()\n .url(reqURL)\n .put(body)\n .build();\n\n mOkHttpClient.newCall(request).enqueue(new Callback(){\n\n @Override\n public void onFailure(Call call, IOException e)\n {\n e.printStackTrace();\n }\n\n\n @Override\n public void onResponse(Call call, Response response) throws IOException\n {\n String r = response.body().string();\n\n System.out.print(r);\n }\n\n }); // end of the newCall.enqueue callback\n\n }", "@Override\r\n\t\t\tpublic void onComplete() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void onComplete() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void run() {\n\t\tRequestBody body = RequestBody.create(this.jsonType, this.contents);\n\t\tRequest request = new Request.Builder()\n\t\t\t.url(this.serverURL)\n\t\t\t.post(body)\n\t\t\t.build();\n\t\t\n\t\ttry {\n\t\t\tResponse response = client.newCall(request).execute();\n\t\t\tString str = response.body().string();\n\t\t\t//logger.log(Level.INFO, \n\t\t\t//\t\tString.format(\"DEBUG postCallInfoToServerTask succeed: %s\", str));\n\t\t} catch (IOException e) {\n\t\t\tNetProphetLogger.logError(\"PostCallInfoTask.run\", e.toString());\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "public void onCompleted(GraphResponse response) {\n response.getRequest();\n }", "@Override\n\tprotected void doAfterCompletion(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object obj, Exception e) {\n\t\t\n\t}", "@Override\n public void onSuccess(String object) {\n if (mRecyclerViewRec.getVisibility() == View.VISIBLE) {\n updateReceivedView();\n } else {\n mReceivedCoins = Data.getReceivedCoins();\n }\n Log.d(TAG, \"[updateReceivedCoinsInBackground] updated\");\n }", "@Override\n\t\t\t\t\tpublic void onSuccess(ResponseInfo<String> arg0) {\n\t\t\t\t\t\terweimaJsonInfo(arg0.result);\n\t\t\t\t\t}", "@Override\n public void onResponse(String response) {\n progressDialog.dismiss();\n try {\n //Mengubah response string menjadi object\n JSONObject obj = new JSONObject(response);\n //obj.getString(\"message\") digunakan untuk mengambil pesan status dari response\n finish();\n\n\n //obj.getString(\"message\") digunakan untuk mengambil pesan message dari response\n Toast.makeText(AddKostActivity.this, obj.getString(\"message\"), Toast.LENGTH_SHORT).show();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}", "@Override\n\t\t\t\t\t\t public void run() {\n\t\t\t\t\t\t\t getResponse();\n\t\t\t\t\t\t }", "@Override\n\n public void onResponse(JSONObject response) {\n ringProgressDialog.hide();\n ((OrderItem)getTargetFragment()).onOrderPlaced(true,orderJSON);\n }", "@Override\r\n public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n Exception ex) throws Exception {\n\r\n }", "@Override\n public void onSuccess(int statusCode, Headers headers, JsonHttpResponseHandler.JSON json) {\n Log.i(\"doRequest\", json.jsonObject.toString());\n try {\n Log.i(\"doRequest array\", json.jsonObject.getJSONArray(\"results\").toString());\n\n JSONArray jsonArray = json.jsonObject.getJSONArray(\"results\");\n ArrayList<Business> businesses = Business.fromJson(jsonArray);\n\n for (int i=0; i<businesses.size(); i++)\n {\n Business business = businesses.get(i);\n Log.i(TAG, business.getName());\n\n mMap.addMarker(new MarkerOptions().position(business.getLatLng()).title(business.getName()).snippet(business.getAddress()));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(business.getLatLng(), 10));\n\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "private void sendStatus(HttpRequest request, HttpResponse response) {\r\n\t\tresponse.setHeader(\"Content-Type\", MediaType.JSON_UTF_8.toString());\r\n\t\tresponse.setStatus(200);\r\n\t\ttry {\r\n\t\t\tObject status = buildStatus(request);\r\n\t\t\tString reply = json.toJson(status);\r\n\t\t\t\r\n\t\t\t// do we return the whole status or just a part of it ?\r\n\t\t\tString jsonPath = request.getQueryParameter(\"jsonpath\");\r\n\t\t\tif (jsonPath != null) {\r\n\t\t\t\tstatus = JsonPath.using(jsonPathConf).parse(reply).read(jsonPath);\r\n\t\t\t\treply = status instanceof String ? status.toString() : json.toJson(status);\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tresponse.setContent(reply.getBytes(UTF_8));\r\n\t\t} catch (Throwable e) {\r\n\t\t\tthrow new GridException(e.getMessage());\r\n\t\t}\r\n\t}", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n public void onComplete() {\n }", "@Override\n\t\t\tpublic void onSuccess(Method method, JSONValue response) {\n\t\t\t}", "@Override\n\t\t\t\t\tpublic void onReqStart() {\n\t\t\t\t\t}", "@Override\n public Boolean onCompleted(Response response) throws Exception {\n System.out.println(response.getResponseBody());\n Type type = new TypeToken<Map<String, String>>() {\n }.getType();\n Map<String, String> jsonMap = jsonSeralizer.fromJson(response.getResponseBody(), type);\n //System.out.println(\"Results of Permssions set: \"+jsonMap);\n if (!jsonMap.get(\"success\").equals(1)) {\n System.out.println(\"File has been made available.\");\n return true;\n } else {\n System.out.println(jsonMap.get(\"error_message\"));\n return false;\n\n }\n }", "@Override\n public void onSuccess(String arg0) {\n LogUtil.d(\"mytest\", \"ret==\" + arg0);\n try {\n JSONObject jsonObjs = new JSONObject(arg0);\n String state = jsonObjs.getString(\"state\");\n if (!state.equals(\"200\")) {\n dismissLoadingLayout();\n Toast.makeText(getActivity(), \"发布失败\", Toast.LENGTH_SHORT).show();\n return;\n }\n JSONObject obj = jsonObjs.getJSONObject(\"data\");\n //JSONObject obj = new JSONObject(jsonObjs.getString(\"data\"));\n accessKeyId = obj.getString(\"accessKeyId\");\n accessKeySecret = obj.getString(\"accessKeySecret\");\n securityToken = obj.getString(\"securityToken\");\n expiration = obj.getString(\"expiration\");\n asyncPutObjectFromLocalFile(0);\n } catch (JSONException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\t// defaultHttpClient\n\t\t\t\t\tLog.e(\"URL_\", url);\n\t\t\t\t\tDefaultHttpClient httpClient = new DefaultHttpClient();\n\t\t\t\t\tHttpPost httpPost = new HttpPost(url);\n\t\t\t\t\tLog.e(\"URL\", url);\n\t\t\t\t\thttpPost.setEntity(new UrlEncodedFormEntity(params,\n\t\t\t\t\t\t\tHTTP.UTF_8));\n\t\t\t\t\t// httpPost.setEntity(new UrlEncodedFormEntity(params));\n\n\t\t\t\t\t\n\t\t\t\t\tHttpResponse httpResponse = httpClient.execute(httpPost);\n\t\t\t\t\tHttpEntity httpEntity = httpResponse.getEntity();\n\t\t\t\t\tis = httpEntity.getContent();\n\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tlistener.connectError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\n\t\t\t\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\t\t\t\tnew InputStreamReader(is, \"iso-8859-1\"), 8);\n\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\tString line = null;\n\t\t\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\t\t\tsb.append(line + \"n\");\n\t\t\t\t\t}\n\t\t\t\t\tis.close();\n\t\t\t\t\tjson = sb.toString();\n\t\t\t\t\t// Logger.e(json);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLog.e(\"Buffer Error\",\n\t\t\t\t\t\t\t\"Error converting result: \" + e.toString());\n\t\t\t\t\tlistener.connectError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// try parse the string to a JSON object\n\t\t\t\ttry {\n\t\t\t\t\tLog.e(\"_responce\", json);\n\t\t\t\t\tjObj = new JSONObject(json);\n\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\n\t\t\t\t\tlistener.connectError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tlistener.connectSucessfull(jObj);\n\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void onSuccess(List<Goods> object){\n\t\t\t\tcloseProgressDialog();\n\t\t\t\tonRefreshComplete();\n\t\t\t\tlist.addAll(object);\n\t\t\t\tLog.v(\"AAA\", JSON.toJSONString(list));\n\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t}", "public void onCompletion(RecordSend send);", "@Override\n public void onCompleted(Exception e, JsonObject result) {\n System.out.println(\"Forgot Response >>>\"+result);\n System.out.println(\"Forgot Response >>>\"+e);\n loader.cancel();\n if (e != null) {\n //Toast.makeText(ForgotActivity.this, \"Forgot Error\"+e, Toast.LENGTH_LONG).show();\n Common.ShowHttpErrorMessage(ForgotActivity.this, e.getMessage());\n return;\n }\n\n try {\n JSONObject JsonRes = new JSONObject(result.toString());\n if(JsonRes.getString(\"status\").equals(\"success\")) {\n Toast.makeText(ForgotActivity.this, JsonRes.getString(\"message\").toString(), Toast.LENGTH_LONG).show();\n finish();\n }\n } catch (JSONException e1) {\n e1.printStackTrace();\n }\n\n\n }", "@Override\n public void onResponse(JSONObject jsonObject) {\n System.out.println(jsonObject.toString());\n //Log.d(\"response from api\", \"onResponse: \\n\"\n // + jsonObject.toString());\n try {\n JSONObject j = jsonObject.getJSONObject(\"data\");\n Log.d(\"response from api\", j.toString());\n JSONObject rr = j.getJSONObject(\"orders\");\n Log.d(\"response from api\", rr.toString());\n Gson json = new Gson();\n Order me = json.fromJson(rr.toString(), Order.class);\n singleorder = me;\n Log.d(\"response from api\", me.getName());\n } catch (JSONException e) {\n Log.d(\"response from api\", \"paaaapiiii\");\n e.printStackTrace();\n }\n }", "@Override\n \t\t\t\tpublic void finished(Response response) {\n \t\t\t\t\tLog.w(\"myApp\", response.getResult() + \" \" + response.getError());\n \t\t\t\t}", "@Override\n \t\t\t\tpublic void finished(Response response) {\n \t\t\t\t\tLog.w(\"myApp\", response.getResult() + \" \" + response.getError());\n \t\t\t\t}", "public void request() {\n }", "public void doResult() throws Exception {\n\t\tJSONObject map=new JSONObject(getResult());\n\t\tif(!\"ok\".equalsIgnoreCase(map.getString(\"status\"))){\n\t\t\tdoFailureResult();\n\t\t\treturn;\n\t\t}\n\t\tif(getHandler()!=null){\n\t\t\tMessage hmsg=getHandler().obtainMessage();\n\t\t\thmsg.obj=map;\n\t\t\thmsg.arg1=1;\n\t\t\tgetHandler().sendMessage(hmsg);\n\t\t\tsetHandler(null);\n\t\t}\n\t}", "@Override\n public void onSucces(String result) {\n JSONObject object = new JSONObject();\n boolean isSuccess = object.optBoolean(result);\n Log.hb(\"orderDetailBean.order_info.status after::\"+orderDetailBean.order_info.status);\n finish();\n }" ]
[ "0.67955345", "0.6695014", "0.66372275", "0.6500939", "0.6419808", "0.6410074", "0.6380651", "0.6165908", "0.6164591", "0.6162349", "0.61541384", "0.61524516", "0.6151851", "0.6151764", "0.61516076", "0.60637105", "0.6055338", "0.6055338", "0.60515577", "0.6032265", "0.59884155", "0.59769017", "0.594904", "0.59486663", "0.5929822", "0.5905735", "0.5905571", "0.5886697", "0.5886391", "0.58762974", "0.58439946", "0.58300585", "0.58207136", "0.5814686", "0.58122134", "0.58058566", "0.57982606", "0.5792824", "0.5783542", "0.57832575", "0.57688856", "0.5752455", "0.57499033", "0.57357925", "0.5733696", "0.57248324", "0.5720821", "0.5703832", "0.5678229", "0.56768835", "0.5663989", "0.56621677", "0.56545436", "0.56451863", "0.5641563", "0.5635977", "0.56354856", "0.56325734", "0.5628906", "0.5628906", "0.56261206", "0.5622217", "0.5615448", "0.561441", "0.5613295", "0.5606193", "0.56033427", "0.5602554", "0.5600099", "0.5593825", "0.5591657", "0.5587889", "0.55873454", "0.5579254", "0.5576047", "0.5576047", "0.5576047", "0.5576047", "0.5576047", "0.5576047", "0.5576047", "0.5576047", "0.5576047", "0.5576047", "0.5576047", "0.5576047", "0.55710363", "0.55703306", "0.5568092", "0.5556194", "0.5541874", "0.5541208", "0.5537992", "0.5537621", "0.5533594", "0.553178", "0.553178", "0.5530363", "0.5521105", "0.5517015" ]
0.6331005
7
To handle low speed internet
public JSONArray getJSONFromUrl(String url) { HttpParams httpParameters = new BasicHttpParams(); // Set the timeout in milliseconds until a connection is established. // The default value is zero, that means the timeout is not used. int timeoutConnection = 3000; HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection); // Set the default socket timeout (SO_TIMEOUT) // in milliseconds which is the timeout for waiting for data. int timeoutSocket = 5000; HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket); DefaultHttpClient httpclient = new DefaultHttpClient(httpParameters); HttpGet httpget = new HttpGet(url); // Depends on your web service httpget.setHeader("Content-type", "application/json"); InputStream inputStream = null; String result = null; try { HttpResponse response = httpclient.execute(httpget); HttpEntity entity = response.getEntity(); inputStream = entity.getContent(); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"), 8); StringBuilder sb = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { sb.append(line).append("\n"); } result = sb.toString(); } catch (Exception e) { // Oops Log.i(TAG,e.toString()); Log.i(TAG,"reader read line didn't work"); } finally { try{ if(inputStream != null)inputStream.close(); } catch(Exception squish){ Log.i(TAG,squish.toString()); Log.i(TAG,"sqish! inputstream did not work!"); } } if(result == null){ Log.i(TAG,"result was NULL"); return null; } try { Log.i(TAG,"WE fetched this data "+result); // Send the url along with article data return new JSONArray(result); } catch (JSONException e) { e.printStackTrace(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void internetConnectionProble()\n\t\t{\n\n\n\t\t}", "public final void mo6817a(String str) {\n HttpURLConnection httpURLConnection;\n try {\n String valueOf = String.valueOf(str);\n C0633h.m5664a(valueOf.length() == 0 ? new String(\"Pinging URL: \") : \"Pinging URL: \".concat(valueOf));\n httpURLConnection = (HttpURLConnection) new URL(str).openConnection();\n C0341h.m5274a();\n String str2 = this.f8968a;\n httpURLConnection.setConnectTimeout(Felica.MAX_TIMEOUT);\n httpURLConnection.setInstanceFollowRedirects(true);\n httpURLConnection.setReadTimeout(Felica.MAX_TIMEOUT);\n if (str2 != null) {\n httpURLConnection.setRequestProperty(\"User-Agent\", str2);\n }\n httpURLConnection.setUseCaches(false);\n C0632g gVar = new C0632g();\n gVar.mo6813a(httpURLConnection, (byte[]) null);\n int responseCode = httpURLConnection.getResponseCode();\n gVar.mo6812a(httpURLConnection, responseCode);\n if (responseCode < 200) {\n }\n StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 65);\n sb.append(\"Received non-success response code \");\n sb.append(responseCode);\n sb.append(\" from pinging URL: \");\n sb.append(str);\n C0633h.m5672d(sb.toString());\n httpURLConnection.disconnect();\n } catch (IndexOutOfBoundsException e) {\n String message = e.getMessage();\n StringBuilder sb2 = new StringBuilder(String.valueOf(str).length() + 32 + String.valueOf(message).length());\n sb2.append(\"Error while parsing ping URL: \");\n sb2.append(str);\n sb2.append(\". \");\n sb2.append(message);\n C0633h.m5672d(sb2.toString());\n } catch (IOException e2) {\n String message2 = e2.getMessage();\n StringBuilder sb3 = new StringBuilder(String.valueOf(str).length() + 27 + String.valueOf(message2).length());\n sb3.append(\"Error while pinging URL: \");\n sb3.append(str);\n sb3.append(\". \");\n sb3.append(message2);\n C0633h.m5672d(sb3.toString());\n } catch (RuntimeException e3) {\n String message3 = e3.getMessage();\n StringBuilder sb4 = new StringBuilder(String.valueOf(str).length() + 27 + String.valueOf(message3).length());\n sb4.append(\"Error while pinging URL: \");\n sb4.append(str);\n sb4.append(\". \");\n sb4.append(message3);\n C0633h.m5672d(sb4.toString());\n } catch (Throwable th) {\n httpURLConnection.disconnect();\n throw th;\n }\n }", "private String loadFromNetwork(String urlString) throws IOException {\n InputStream stream = null;\n String str =\"\";\n\n try {\n stream = downloadUrl(urlString);\n str = readIt(stream, 450000);\n } finally {\n if (stream != null) {\n stream.close();\n }\n }\n return str;\n }", "@Override\r\n\tpublic void run() {\n\t\tresult = InternetConn.pushURL(URL);\r\n\t\tif(result.equals(\"-1\")){\r\n\t\t\t\r\n\t\t\tMessage msg = new Message();\r\n\t\t\tmsg.obj = \"网络连接错误\";\r\n\t\t\tmsg.what = -1;\r\n\t\t\tmHandler.sendMessage(msg);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tMessage msg = new Message();\r\n\t\t\tmsg.obj = result;\r\n\t\t\tmsg.what = 1;\r\n\t\t\tmHandler.sendMessage(msg);\r\n\t\t}\r\n\t}", "@Override\n protected Boolean doInBackground(String... args){\n ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo netInfo = cm.getActiveNetworkInfo();\n if (netInfo != null && netInfo.isConnected()) {\n try {\n URL url = new URL(\"http://www.google.com\");\n HttpURLConnection urlc = (HttpURLConnection) url.openConnection();\n urlc.setConnectTimeout(3000);\n urlc.connect();\n if (urlc.getResponseCode() == 200) {\n return true;\n }\n } catch (MalformedURLException e1) {\n // TODO Auto-generated catch block\n e1.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n return false;\n\n }", "private void updateNetworkSpeed() {\n Message obtain = Message.obtain();\n obtain.what = 200000;\n long j = 0;\n if (isDemoOrDrive() || this.mDisabled || !this.mIsNetworkConnected) {\n obtain.arg1 = 0;\n this.mHandler.removeMessages(200000);\n this.mHandler.sendMessage(obtain);\n this.mLastTime = 0;\n this.mTotalBytes = 0;\n return;\n }\n long currentTimeMillis = System.currentTimeMillis();\n long totalByte = getTotalByte();\n if (totalByte == 0) {\n this.mLastTime = 0;\n this.mTotalBytes = 0;\n totalByte = getTotalByte();\n }\n long j2 = this.mLastTime;\n if (j2 != 0 && currentTimeMillis > j2) {\n long j3 = this.mTotalBytes;\n if (!(j3 == 0 || totalByte == 0 || totalByte <= j3)) {\n j = ((totalByte - j3) * 1000) / (currentTimeMillis - j2);\n }\n }\n obtain.arg1 = 1;\n obtain.obj = Long.valueOf(j);\n this.mHandler.removeMessages(200000);\n this.mHandler.sendMessage(obtain);\n this.mLastTime = currentTimeMillis;\n this.mTotalBytes = totalByte;\n postUpdateNetworkSpeedDelay((long) this.mNetworkUpdateInterval);\n }", "private void checkInternetConnection() {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}", "public boolean isInternetReachable() {\n \t\ttry {\n \t\t\t// URL to a source\n \t\t\tURL url = new URL(\"http://www.betfair.com\");\n \t\t\t// Open a connection\n \t\t\tHttpURLConnection urlConnect = (HttpURLConnection) url\n \t\t\t\t\t.openConnection();\n \t\t\t// Retrieving data from the source - if there is no connection,\n \t\t\t// throws and exception\n \t\t\t@SuppressWarnings(\"unused\")\n \t\t\tObject objData = urlConnect.getContent();\n \t\t} catch (Exception e) {\n \t\t\treturn false;\n \t\t}\n \t\treturn true;\n \t}", "private void doPing()\r\n {\r\n requestQueue.add( new ChargerHTTPConn( weakContext,\r\n CHARGE_NODE_JSON_DATA, \r\n PING_URL,\r\n SN_HOST,\r\n null, \r\n cookieData,\r\n false,\r\n token,\r\n secret ) );\r\n }", "public void slowConnection(){\n if(connectionType == ConnectionType.RMI) {\n connectionType = ConnectionType.SOCKET;\n } else {\n connectionType = ConnectionType.RMI;\n }\n }", "public boolean probarInternet() {\n ConnectivityManager connectivityManager\n = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();\n return activeNetworkInfo != null && activeNetworkInfo.isConnected();\n }", "void onInternetConnectionLost();", "private Callable<Boolean> isReachable() {\n return () -> {\n try {\n if (!isOnline()) {\n return false;\n }\n\n URL url = new URL(\"https://api.vk.com\"); //url for ex.\n HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();\n httpURLConnection.setConnectTimeout(2000);\n httpURLConnection.connect();\n\n return true;\n } catch (Exception e) {\n return false;\n }\n };\n }", "public static boolean isConnectedToInternet() {\n String pingServerURL = pingBackUrl.substring(0, pingBackUrl.indexOf(\"/\", \"http://url\".length()));\n try {\n URL url = new URL(pingServerURL);\n HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();\n urlConn.connect();\n return (HttpURLConnection.HTTP_NOT_FOUND != urlConn.getResponseCode());\n } catch (MalformedURLException e) {\n LOG.error(\"LeadCapture : Error creating HTTP connection to the server : \" + pingServerURL);\n \n } catch (IOException e) {\n LOG.error(\"LeadCapture : Error creating HTTP connection to the server : \" + pingServerURL);\n }\n return false;\n }", "public boolean internetErisimi() {\n\n ConnectivityManager conMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n\n if (conMgr.getActiveNetworkInfo() != null\n\n && conMgr.getActiveNetworkInfo().isAvailable()\n\n && conMgr.getActiveNetworkInfo().isConnected()) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n\n }", "private void cekStatusGPSpeed() {\n\t\t\n\t\tlokasimanager = (LocationManager) Kecepatan.this.getSystemService(Context.LOCATION_SERVICE);\n\t\t\n\t\tcekGpsNet = new CekGPSNet(Kecepatan.this);\n\t\tisInternet = cekGpsNet.cekStatsInternet();\n\t\tisNetworkNyala = cekGpsNet.cekStatsNetwork();\n\t\tisGPSNyala = cekGpsNet.cekStatsGPS();\n\t\t\n\t\tstatusInternet = cekGpsNet.getKondisiNetwork(isInternet, isNetworkNyala);\n\t\tstatusGPS = cekGpsNet.getKondisiGPS(isGPSNyala);\n\t\t\n\t\tLog.w(\"STATUS GPS INTERNET\", \"GPS \" + statusGPS + \" INTERNET \" + statusInternet);\n\t\t\n\t\tif (statusInternet == CekGPSNet.TAG_NYALA) {\n\t\t\t\n\t\t\tlokasimanager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES , locListNetwork);\n\t\t\tLog.w(\"Network\", \"Network\");\n\t\t\t\n\t\t\tif (lokasimanager != null) {\n\t\t\t\tlocation = lokasimanager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n\t\t\t\t\n\t\t\t\tif (location != null) {\n\t\t\t\t\tlatitude = location.getLatitude();\n\t\t\t\t\tlongitude = location.getLongitude();\n\t\t\t\t\t\n\t\t\t\t\tLog.w(\"TAG NETWORK\", \" \" + latitude + \" \" + longitude);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\tif (statusGPS == CekGPSNet.TAG_NYALA) {\n\t\t\t\n\t\t\tlokasimanager.requestLocationUpdates(LocationManager.GPS_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES , locListGPS);\n\t\t\tLog.w(\"GPS\", \"GPS\");\n\t\t\t\n\t\t\tif (lokasimanager != null) {\n\t\t\t\tlocation = lokasimanager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n\t\t\t\t\n\t\t\t\tif (location != null) {\n\t\t\t\t\tlatitude = location.getLatitude();\n\t\t\t\t\tlongitude = location.getLongitude();\n\t\t\t\t\t\n\t\t\t\t\tLog.w(\"TAG GPS\", \" \" + latitude + \" \" + longitude);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\n protected String doInBackground(String... params) {\n try {\n String NewsData;\n //define the url we have to connect with\n URL url = new URL(params[0]);\n //make connect with url and send request\n HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();\n //waiting for 7000ms for response\n urlConnection.setConnectTimeout(7000);//set timeout to 5 seconds\n\n try {\n //getting the response data\n InputStream in = new BufferedInputStream(urlConnection.getInputStream());\n //convert the stream to string\n Operations operations = new Operations(getApplicationContext());\n NewsData = operations.ConvertInputToStringNoChange(in);\n //send to display data\n publishProgress(NewsData);\n } finally {\n //end connection\n urlConnection.disconnect();\n }\n\n } catch (Exception ex) {\n }\n return null;\n }", "private void setupHttpConnectionStuff() {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {\n System.setProperty(\"http.keepAlive\", \"false\");\n }\n if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\n try {\n final File httpCacheDir = new File(getCacheDir(), \"http\");\n HttpResponseCache.install(httpCacheDir, TEN_MEGABYTES);\n } catch (IOException ioe) {\n Log.e(Constants.LOG_TAG, \"Could not install http cache on this device.\");\n }\n }\n }", "private static InputStream performNetworkRequest(URL url) {\n if (url == null) {\n Log.e(LOG_TAG, \"Provided URL is null, exiting method early\");\n return null;\n }\n\n HttpURLConnection connection = null;\n InputStream responseStream = null;\n\n try {\n connection = (HttpURLConnection) url.openConnection();\n connection.setConnectTimeout(10000);\n connection.setReadTimeout(90000);\n connection.setRequestMethod(\"GET\");\n connection.connect();\n\n int responseCode = connection.getResponseCode();\n if (responseCode != 200) {\n Log.e(LOG_TAG, \"Response code different from expected code 200. Received code: \" + responseCode + \", exiting method early\");\n return null;\n }\n responseStream = connection.getInputStream();\n\n } catch (IOException e) {\n Log.e(LOG_TAG, \"Problem occured while performing network request\");\n e.printStackTrace();\n }\n return responseStream;\n }", "@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tProxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(\n\t\t\t\t\t\t\"proxy.iiit.ac.in\", 8080));\n\t\t\t\tURL url = new URL(url1);\n\t\t\t\tHttpURLConnection conn = (HttpURLConnection) url\n\t\t\t\t\t\t.openConnection(proxy);\n\t\t\t\tconn.setRequestMethod(\"GET\");\n\t\t\t\tconn.setRequestProperty(\"Accept\", \"application/json\");\n\n\t\t//\t\tif (conn.getResponseCode() != 200) {\n\t\t\t//\t\tthrow new RuntimeException(\"Failed : HTTP error code : \"\n\t\t\t//\t\t\t\t+ conn.getResponseCode());\n\t\t\t//\t}\n\n\t\t\t\t/*\n\t\t\t\t * BufferedReader br = new BufferedReader(new InputStreamReader(\n\t\t\t\t * (conn.getInputStream())));\n\t\t\t\t * \n\t\t\t\t * String output;\n\t\t\t\t * System.out.println(\"Output from Server .... \\n\"); while\n\t\t\t\t * ((output = br.readLine()) != null) {\n\t\t\t\t * System.out.println(output); }\n\t\t\t\t */\n\t\t\t\tlong tID = Thread.currentThread().getId();\n\t\t\t\tlong time = ManagementFactory.getThreadMXBean()\n\t\t\t\t\t\t.getThreadCpuTime(tID);\n\t\t\t\tSystem.out.println(\"My thread \" + tID + \" execution time: \"\n\t\t\t\t\t\t+ time + \" ns.\");\n\t\t\t\tsumTimes=sumTimes+time;\n\t\t\t\tconn.disconnect();\n\n\t\t\t} catch (MalformedURLException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t} catch (IOException e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t} catch (Exception e) {\n\n\t\t\t\te.printStackTrace();\n\n\t\t\t}\n\n\t\t\t// long end_time = System.currentTimeMillis();\n\n\t\t\t// long difference = end_time-start_time;\n\t\t\t// System.out.println(\"Complete in \"+difference+\" ms.\");\n\t\t}", "public Boolean isOnlineNet() {\n\n try {\n Process p = java.lang.Runtime.getRuntime().exec(\"ping -c 1 www.google.es\");\n\n int val = p.waitFor();\n boolean reachable = (val == 0);\n return reachable;\n\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return false;\n }", "private boolean isKonekInternet()\n\t{\n\t\tConnectivityManager connectivityManager = (ConnectivityManager) this\n\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\tif (connectivityManager != null)\n\t\t{\n\t\t\tNetworkInfo[] info = connectivityManager.getAllNetworkInfo();\n\t\t\tif (info != null)\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < info.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (info[i].getState() == NetworkInfo.State.CONNECTED)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn false;\n\t}", "void getHTML(String req) {\n html = \"\";\n int r;\n BufferedInputStream in = null;\n BufferedInputStream imgIn = null;\n boolean retry;\n Vector imageRd = new Vector(0);\n/*\n do {\n retry = false;\n try {\n\tin = new BufferedInputStream(url.openStream(), 4096);\n\t//\t System.out.println(\"DoneOpening input stream\");\n }\n catch (IOException ioe) {\n\trbe.stats.error(\"Unable to open URL.\" , url.toExternalForm());\n\tioe.printStackTrace();\n\tretry=true;\n System.err.println(\"Set retry=true, then continue...\");\n\tcontinue;\n }\n try {\n\t \n\t //\t while(in.available() == 0){\n\t // System.out.println(\"Nothing available on input stream!\");\n\t //}\n \n\t while ((r = in.read(buffer, 0, buffer.length))!=-1) {\n\t if (r>0) {\n\t\t html = html + new String(buffer, 0, r);\n\t }\n\t //\t System.out.print(\".\");\n\t }\n\t \n }\n catch (IOException ioe) {\n\trbe.stats.error(\"Unable to read HTML from URL.\" , \n\t\t\turl.toExternalForm());\n\tretry=true;\n\tcontinue;\n }\n\n if (retry) {\n\t try {\n\t if (waitKey) {\n\t\t rbe.getKey();\n\t }\n\t else {\n\t\t sleep(1000L);\n\t }\n\t }\n\t catch (InterruptedException inte) {\n\t System.out.println(\"In getHTML, caught interrupted exception!\");\n\t return;\n\t }\t \n }\n } while (retry);\n \n try {\n in.close();\n }\n catch (IOException ioe) {\n rbe.stats.error(\"Unable to close URL.\" , url.toExternalForm());\n }\n*/\n long startTime = System.currentTimeMillis();\n byte[] res = this.clientProxy.getHTMLText(req);\n long endTime = System.currentTimeMillis();\n this.html = new String(res);\n\n //System.out.println(html);\n\n /******\n html =\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"JIGSAW-SESSION-ID=kjfljelejl_343434223_32\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"I_ID=563 \" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"I_ID=534 \" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"I_ID=564 \" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"I_ID=568 \" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\" +\n \"<HTML> AA HTM IM AA HTM IM AA HTM IM AA HTM IM </HTML>\";\n ****/\n\n // Scan for image requests, and request those.\n int cur = 0;\n\n // Suppress image requests.\n if (!RBE.getImage) return;\n\n URL url = null;\n try {\n url = new URL(req);\n } catch (MalformedURLException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n findImg(html, url, imgPat, srcPat, quotePat, imageRd);\n findImg(html, url, inputPat, srcPat, quotePat, imageRd);\n\n if (DEBUG > 2) {\n System.out.println(\"Found \" + imageRd.size() + \" images.\");\n }\n while (imageRd.size() > 0) {\n int max = imageRd.size();\n int min = Math.max(max - rbe.maxImageRd, 0);\n int i;\n try {\n for (i = min; i < max; i++) {\n ImageReader rd = (ImageReader) imageRd.elementAt(i);\n //\tSystem.out.println(\"EB #\" + sessionID+ \"reading image: \" + rd.imgURLStr);\n // TODO TODO FETCHING IMAGES IS BUGGY !!!!!!!\n if (!rd.readImage()) {\n if (DEBUG > 2) {\n System.out.println(\"Read \" + rd.tot + \" bytes from \" +\n rd.imgURLStr);\n }\n imageRd.removeElementAt(i);\n i--;\n max--;\n }\n }\n } catch (Exception inte) {\n System.out.println(\"In getHTML, caught exception!\");\n return;\n }\n }\n }", "public static void isNetworkAvailable(final Handler handler, final int timeout) {\n\n new Thread() {\n\n private boolean responded = false;\n\n @Override\n public void run() {\n\n // set 'responded' to TRUE if is able to connect with google mobile (responds fast)\n\n new Thread() {\n\n @Override\n public void run() {\n HttpGet requestForTest = new HttpGet(\"http://m.google.com\");\n try {\n new DefaultHttpClient().execute(requestForTest); // can last...\n responded = true;\n } catch (Exception e) {}\n }\n\n }.start();\n\n try {\n int waited = 0;\n while(!responded && (waited < timeout)) {\n sleep(100);\n if(!responded ) { \n waited += 100;\n }\n }\n } \n catch(InterruptedException e) {} // do nothing \n finally { \n if (!responded) { handler.sendEmptyMessage(0); } \n else { handler.sendEmptyMessage(1); }\n }\n\n }\n\n }.start();\n\n}", "private void downloadRtData(){\n\t\ttry {\n\t\t\tif (socket != null) {\n\t\t\t\tInputStream inStream = socket.getInputStream();\n\t\t\t\tParser.readRtData(inStream, \"MainActivity\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tLog.d(\"IOException\", \"Exception downloading real time data\");\n\t\t}\n\t}", "public void run() {\n\t\t\t\tHttpURLConnection connection = null;\r\n\t\t\t\tStringBuilder response = new StringBuilder();\r\n\t\t\t\ttry{\r\n\t\t\t\t\tURL url = new URL(address);\r\n\t\t\t\t\tconnection = (HttpURLConnection) url.openConnection();\r\n\t\t\t\t\tconnection.setRequestMethod(\"GET\");\r\n\t\t\t\t\tconnection.setConnectTimeout(8000);\r\n\t\t\t\t\tconnection.setReadTimeout(8000);\r\n\t\t\t\t\tconnection.setDoInput(true);\r\n\t\t\t\t\t//connection.setDoOutput(true);\r\n\t\t\t\t\tint responseCode = connection.getResponseCode();\r\n\t\t\t\t\tLog.d(\"HttpUtil\", String.valueOf(responseCode));\r\n\t\t\t\t\tif(responseCode != 200){\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Get Fail\");\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tInputStream in = connection.getInputStream();\r\n\t\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in));\r\n\t\t\t\t\t\tString line;\r\n\t\t\t\t\t\twhile((line = reader.readLine()) != null){\r\n\t\t\t\t\t\t\tresponse.append(line);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Get Success\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onFinish(response.toString());\r\n\t\t\t\t\t}\r\n\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onError(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}finally{\r\n\t\t\t\t\tif(connection != null){\r\n\t\t\t\t\t\tconnection.disconnect();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "boolean isNetworkAvailable();", "private boolean checkInternetConnection() {\n ConnectivityManager cm =\n (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo activeNetwork = cm.getActiveNetworkInfo();\n return activeNetwork != null && activeNetwork.isConnectedOrConnecting();\n }", "private String webFetch1(String aURL, String aEncoding) {\n String result = \"\";\n long start = System.currentTimeMillis();\n Scanner scanner = null;\n URLConnection connection = null;\n try {\n //Ref: http://stackoverflow.com/questions/86824/why-would-a-java-net-connectexception-connection-timed-out-exception-occur-wh\n URL url = new URL(aURL);\n connection = url.openConnection(); //this doesn't talk to the network yet\n connection.setConnectTimeout(TIMEOUT); \n connection.setReadTimeout(TIMEOUT);\n connection.connect(); //actually connects; this shouldn't be needed here, since getInputStream is supposed to do it in the background\n scanner = new Scanner(connection.getInputStream(), aEncoding); \n scanner.useDelimiter(END_OF_INPUT);\n result = scanner.next();\n }\n catch (IOException ex) {\n long end = System.currentTimeMillis();\n long time = end - start;\n fLogger.severe(\n \"Problem connecting to \" + aURL + \" Encoding:\" + aEncoding + \n \". Exception: \" + ex.getMessage() + \" \" + ex.toString() + \" Cause:\" + ex.getCause() + \n \" Connection Timeout: \" + connection.getConnectTimeout() + \"msecs. Read timeout:\" + connection.getReadTimeout() + \"msecs.\"\n + \" Time taken to fail: \" + time + \" msecs.\"\n );\n }\n finally {\n if (scanner != null) scanner.close();\n }\n return result;\n }", "@Override\n public void run() {\n URL url;\n HttpURLConnection ur1Connection = null; //HttpsURLConnection aiso avaitab1e\n try {\n\n //String service = reqUrl; // call rhymebrain\n String service = \"https://rhymebrain.com/talk?\"; // call rhymebrain\n //String parm = \"getRhymes&word=\" + word;\n //String queryString = URLEncoder.encode(parm, \"UTF-8\");\n String queryString = \"getRhymes&word=\" + word + \"&maxResults=\" + String.valueOf(MAX_RESULTS);\n //try to process url and connect to it\n url = new URL( service + \"function=\" + queryString);\n Log.d(\"which URL: \", String.valueOf(url));\n ur1Connection = (HttpURLConnection)url.openConnection();\n ur1Connection.setRequestMethod(\"GET\");\n\n // Set connection timeout and read timeout value.\n ur1Connection.setConnectTimeout(70000);\n ur1Connection.setReadTimeout(70000);\n\n //create an input stream and stream reader from the connection\n InputStream inputStream = ur1Connection.getInputStream();\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\n\n //get some data from the stream\n int data = inputStreamReader.read();\n //string for collecting all output\n output = \"\";\n //if the stream is not empty\n while(data != -1) {\n //turn what we read into a char and print it\n char current = (char) data;\n output += current;\n data = inputStreamReader.read();\n\n //Log.d(\"Network\", output);\n }\n Log.d(\"Network\", output);\n parseJSON(output);\n int i =0;\n }catch (Exception e) {\n Log.d( \"Network\", e.toString());\n }finally {\n if (ur1Connection != null) {\n ur1Connection.disconnect();\n ur1Connection = null;\n }\n }\n }", "protected boolean NetworkAviable() {\n\t\t\tConnectivityManager cm =(ConnectivityManager)contextyeild.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\t\t NetworkInfo netInfo = cm.getActiveNetworkInfo();\n\t\t if (netInfo != null && netInfo.isConnectedOrConnecting()) {\n\t\t \t try{\n\t\t \t\t \n\t\t \t \t//new OnGetPondsdata().execute();\n\t\t \t }catch(Exception e){\n\t\t \t\t e.printStackTrace();\n\t\t \t }\n\t\t \t \t\n\t\t return true;\t\t \n\t\t }\n\t\t else{ \n\t\t \t\n\t\t \t// TODO Auto-generated method stub\n\t\t\t\tToast.makeText(contextyeild, \"No internet connection\", Toast.LENGTH_SHORT).show();\t\t\t\t\t\n\t\t }\n\t\t return false;\n\t\t\t}", "public static boolean isConnectionFast(int type, int subType){\n if(type==ConnectivityManager.TYPE_WIFI){\n \tSystem.out.println(\"WIFI\");\n \t\n return true;\n }else if(type==ConnectivityManager.TYPE_MOBILE){\n \t\n \tSystem.out.println(\"mobile\");\n \t\n switch(subType){\n case TelephonyManager.NETWORK_TYPE_1xRTT:\n return false; // ~ 50-100 kbps\n case TelephonyManager.NETWORK_TYPE_CDMA:\n return false; // ~ 14-64 kbps\n case TelephonyManager.NETWORK_TYPE_EDGE:\n return false; // ~ 50-100 kbps\n case TelephonyManager.NETWORK_TYPE_EVDO_0:\n return true; // ~ 400-1000 kbps\n case TelephonyManager.NETWORK_TYPE_EVDO_A:\n return true; // ~ 600-1400 kbps\n case TelephonyManager.NETWORK_TYPE_GPRS:\n \tSystem.out.println(\"GPRS\");\n return false; // ~ 100 kbps\n case TelephonyManager.NETWORK_TYPE_HSDPA:\n return true; // ~ 2-14 Mbps\n case TelephonyManager.NETWORK_TYPE_HSPA:\n return true; // ~ 700-1700 kbps\n case TelephonyManager.NETWORK_TYPE_HSUPA:\n return true; // ~ 1-23 Mbps\n case TelephonyManager.NETWORK_TYPE_UMTS:\n \tSystem.out.println(\"UMTS\");\n return true; // ~ 400-7000 kbps\n /*\n * Above API level 7, make sure to set android:targetSdkVersion \n * to appropriate level to use these\n */\n case TelephonyManager.NETWORK_TYPE_EHRPD: // API level 11 \n return true; // ~ 1-2 Mbps\n case TelephonyManager.NETWORK_TYPE_EVDO_B: // API level 9\n return true; // ~ 5 Mbps\n case TelephonyManager.NETWORK_TYPE_HSPAP: // API level 13\n return true; // ~ 10-20 Mbps\n case TelephonyManager.NETWORK_TYPE_IDEN: // API level 8\n return false; // ~25 kbps \n case TelephonyManager.NETWORK_TYPE_LTE: // API level 11\n return true; // ~ 10+ Mbps\n // Unknown\n case TelephonyManager.NETWORK_TYPE_UNKNOWN:\n default:\n return false;\n }\n }else{\n return false;\n }\n }", "private boolean isInternetConnected() {\n ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo ni = cm.getActiveNetworkInfo();\n if (ni!=null && ni.isAvailable() && ni.isConnected()) {\n return true;\n } else {\n return false;\n }\n }", "private boolean checkInternetConnection() {\n\n ConnectivityManager connectivityManager = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);\n\n NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();\n\n return (networkInfo != null && networkInfo.isConnected());\n\n }", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tSocket s = new Socket(ip,6969);\n\t\t\t\t\t\t\t\ts.close();\n\t\t\t\t\t\t\t\tconnection=true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t catch (UnknownHostException e1) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\tLog.d(null, \"Wrong ip\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t\t\tLog.d(null, \"Wrong ip\");\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}", "@Override\n\t\tprotected void onCancelled(String result) {\n\t\t\tsuper.onCancelled(result);\n\t\t\tCrouton.makeText(activity, \"Network connection is slow, Try again\", Style.ALERT).show();\n\t\t}", "@Override\n public void onErrorResponse(VolleyError error) {\n if (ConstantsDefined.isOnline(AllSectionsSummary.this)) {\n //Do nothing..\n Toast.makeText(AllSectionsSummary.this, \"Couldn't connect..Please try again..\", Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(AllSectionsSummary.this, \"Sorry! No internet connection\", Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n if (ConstantsDefined.isOnline(AllSectionsSummary.this)) {\n //Do nothing..\n Toast.makeText(AllSectionsSummary.this, \"Couldn't connect..Please try again..\", Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(AllSectionsSummary.this, \"Sorry! No internet connection\", Toast.LENGTH_SHORT).show();\n }\n }", "private boolean checkInternetConnection() {\n ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);\n\n NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();\n\n return networkInfo != null && networkInfo.isConnectedOrConnecting();\n }", "private boolean testConn(String URL)\n {\n\n if(TestHTTP.test(URL))\n \treturn true;\n else \n {\n \tlogfile.severe(URL+\" DOWN\");\n \treturn false;\n }\n }", "private static boolean pingURL(String url, int timeout) {\n try {\n HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();\n connection.setConnectTimeout(timeout);\n connection.setReadTimeout(timeout);\n connection.setRequestMethod(\"HEAD\");\n int responseCode = connection.getResponseCode();\n return (200 <= responseCode && responseCode <= 399);\n } catch (IOException exception) {\n return false;\n }\n }", "public boolean isConnectingToInternet(){\n ConnectivityManager connectivity = (ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE);\n if (connectivity != null)\n {\n NetworkInfo[] info = connectivity.getAllNetworkInfo();\n if (info != null)\n for (int i = 0; i < info.length; i++)\n if (info[i].getState() == NetworkInfo.State.CONNECTED)\n {\n return true;\n }\n \n }\n return false;\n }", "public boolean isConnectingToInternet(){\n ConnectivityManager connectivity = (ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE);\n if (connectivity != null)\n {\n NetworkInfo[] info = connectivity.getAllNetworkInfo();\n if (info != null)\n for (int i = 0; i < info.length; i++)\n if (info[i].getState() == NetworkInfo.State.CONNECTED)\n {\n return true;\n }\n \n }\n return false;\n }", "public final int isInternetOn() {\n ConnectivityManager connec =\r\n (ConnectivityManager)getSystemService(getBaseContext().CONNECTIVITY_SERVICE);\r\n\r\n // Check for network connections\r\n if ( connec.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.CONNECTED ||\r\n connec.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.CONNECTING ||\r\n connec.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.CONNECTING ||\r\n connec.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.CONNECTED ) {\r\n\r\n // if connected with internet\r\n\r\n //Toast.makeText(this, \" Connected \", Toast.LENGTH_LONG).show();\r\n return 1;\r\n\r\n } else if (\r\n connec.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.DISCONNECTED ||\r\n connec.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.DISCONNECTED ) {\r\n\r\n //Toast.makeText(this, \" Not Connected \", Toast.LENGTH_LONG).show();\r\n return 0;\r\n }\r\n return 0;\r\n }", "public static boolean isInternetOn(Context context) {\n _context = context;\n ConnectivityManager connec = null;\n // get Connectivity Manager object to check connection\n //ConnectivityManager connec = \n //(ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE);\n // get Connectivity Manager object to check connection\n try {\n connec = (ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE);\n // 0 is Mobile dataconnection\n // 1 for Wifi Connection\n NetworkInfo activeNetwork = connec.getActiveNetworkInfo();\n if (activeNetwork != null) {\n if (connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTING ||\n connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED) {\n //Common.IsLocalConnection = 2;\n return true;\n\n } else if (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED ||\n connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTING) {\n //Common.IsLocalConnection = 1;\n return true;\n } else if (connec.getNetworkInfo(0).getState() == NetworkInfo.State.DISCONNECTED ||\n connec.getNetworkInfo(1).getState() == NetworkInfo.State.DISCONNECTED) {\n //Common.IsLocalConnection = 0;\n return false;\n } // Check for network connections\n } else {\n // not connected to the internet\n }\n } catch (Exception ex) {\n CrashAnalytics.CrashReport(ex);\n }\n return false;\n }", "private boolean isConnectedToInternet(){\n ConnectivityManager connectivityManager = (ConnectivityManager) main.getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();\n return networkInfo != null && networkInfo.isConnected();\n }", "private static void disableConnectionReuseIfNecessary() {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {\n System.setProperty(\"http.keepAlive\", \"false\");\n }\n }", "private InputStream downloadUrl(String urlString) throws IOException {\n \tSystem.out.println(\"Inside downloadURL\");\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n \n conn.setReadTimeout(10000 /* milliseconds */);\n conn.setConnectTimeout(15000 /* milliseconds */);\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n // Starts the query\n conn.connect();\n InputStream stream = conn.getInputStream();\n return stream;\n }", "private boolean isInternetAvailable() {\n ConnectivityManager connectivityManager = (ConnectivityManager) getContext().getSystemService(Context.CONNECTIVITY_SERVICE);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Network[] networks = connectivityManager.getAllNetworks();\n NetworkInfo networkInfo;\n for (Network mNetwork : networks) {\n networkInfo = connectivityManager.getNetworkInfo(mNetwork);\n if (networkInfo.getState().equals(NetworkInfo.State.CONNECTED)) {\n return true;\n }\n }\n } else {\n if (connectivityManager != null) {\n NetworkInfo[] info = connectivityManager.getAllNetworkInfo();\n if (info != null) {\n for (NetworkInfo networkInfo : info) {\n if (networkInfo.getState() == NetworkInfo.State.CONNECTED) {\n return true;\n }\n }\n }\n }\n }\n Toast.makeText(getContext(), getString(R.string.internet_connection_needed),Toast.LENGTH_SHORT).show();\n return false;\n }", "void onInternetConnectionBack();", "private static HttpURLConnection createDefaultConnection(String url) throws IOException {\n HttpURLConnection connection = (HttpURLConnection) (new URL(url)).openConnection();\n connection.setReadTimeout(20000);\n connection.setConnectTimeout(20000);\n return connection;\n }", "private void showWeb() throws IOException{\n\n InputStream inputStream;\n BufferedReader bufferedReader;\n PrintWriter out;\n String request;\n String response;\n String[] requestParam;\n String[] requestParamButton;\n String path;\n String sensorDataIndex;\n String message = \"Don't have a Products\";\n String historyURL = \"/history\";\n String listURL = \"/list\";\n String invoiceURL = \"/invoice\";\n String testBadURL = \"/testError\";\n String buyForURL = \"/buyFor\";\n String pathForRefresh = \"\";\n String topic =\"\";\n //For test Status\n String httpStatus = \"\";\n\n try{\n inputStream = socket.getInputStream();\n bufferedReader = new BufferedReader(new InputStreamReader(inputStream));\n request = bufferedReader.readLine();\n if(!request.isEmpty()){\n System.out.println(request);\n requestParam = request.split(\" \");\n path = requestParam[1];\n System.out.println(path);\n if(!path.isEmpty()){\n requestParamButton = path.split(\":\");\n System.out.println(\"requestParamButton lenght is : \" + requestParamButton.length\n + \" last index have \" + requestParamButton[requestParamButton.length - 1]);\n sensorDataIndex = requestParamButton[requestParamButton.length - 1];\n }else{\n sensorDataIndex = \"0\";\n }\n //sensorDataIndex = \"0\";\n\n if(path.contains(buyForURL)){\n manuelOrder(sensorDataIndex);\n message = makeOneStringList();\n httpStatus = \"HTTP/1.1 200\";\n topic = \"List of products : \";\n pathForRefresh = listURL;\n }\n if(path.equals(invoiceURL)){\n message = makeOneStringInvoice();\n httpStatus = \"HTTP/1.1 200\";\n topic = \"Invoise : \";\n pathForRefresh = invoiceURL;\n }\n if(path.equals(historyURL)){\n message = makeOneStringHistory();\n httpStatus = \"HTTP/1.1 200\";\n topic = \"History of products : \";\n pathForRefresh = historyURL;\n }\n if(path.equals(listURL)){\n message = makeOneStringList();\n httpStatus = \"HTTP/1.1 200\";\n topic = \"List of products : \";\n pathForRefresh = listURL;\n /** compare Data from actualSensorData with response Data */\n //testShowList(message);\n }\n /** if path not equals /list or /history will be BAD REQUEST with status 400 */\n if(!path.equals(listURL) && !path.equals(historyURL) && !path.equals(invoiceURL) && !path.contains(buyForURL)){\n message = \"<h1 style='color:red'> BAD REQUEST, ALLOWED ONLY HTTP GET /list or /history REQUESTS </h1>\";\n httpStatus = \"HTTP/1.1 400\";\n topic = \"<h1 style='color:red'> ERROR </h1>\";\n pathForRefresh = testBadURL;\n }\n\n }\n\n /** Color test */\n //testColor(message,httpStatus);\n\n out = new PrintWriter(socket.getOutputStream());\n out.println(httpStatus);\n out.println(\"Content-type: text/html\");\n out.println(\"Server-name: myServer\");\n response = \"<html>\" + \"<head>\"\n + \"<meta http-equiv=\\\"refresh\\\" content=\\\"2\\\"; url=localhost:8282\" + pathForRefresh + \">\"\n + \"<meta charset='utf-8'>\" // Umlauts\n + \"<link rel=\\\"icon\\\" href=\\\"data:;base64,iVBORw0KGgo=\\\">\" // How to prevent favicon.ico requests?\n + \"<title>My Web Server</title></head>\"\n + \"<h1>Your request: \" + request + \"</h3>\"\n + \"<table width=\\\"200\\\">\"\n + \"<td><h3><a href=\\\"/list \\\">List</a></h3></td>\"\n + \"<td><h3><a href=\\\"/history \\\">History</a></h3></td>\"\n + \"<td><h3><a href=\\\"/testError \\\">TestError</a></h3></td>\"\n + \"<td><h3><a href=\\\"/invoice \\\">Invoice</a></h3></td>\"\n + \"<td><h3><a href=\\\"/buyFor \\\">BuyFor</a></h3></td>\"\n + \"</table>\"\n + \"<h1>\" + topic + \"</h1>\"\n + \"<table width=\\\"200\\\">\"\n + \"<h3>\" + message + \"</h3>\"\n + \"</table>\"\n + \"</html>\";\n out.println(\"Content-length: \" + response.length());\n out.println(\"\");\n out.println(response);\n out.flush();\n //out.close();\n //bufferedReader.close();\n }\n catch (IOException e)\n {\n System.out.println(\"Failed respond to client request: \" + e.getMessage());\n }\n\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n if (ConstantsDefined.isOnline(AllSectionsSummary.this)) {\n //Do nothing..\n Toast.makeText(AllSectionsSummary.this, \"Couldn't connect..Please try again..\", Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(AllSectionsSummary.this, \"Sorry! No internet connection\", Toast.LENGTH_SHORT).show();\n }\n }", "public static void main(String[] args)\n {\n getCurrentOS();\n logFilePath = createLogFile();\n\n // http://ценыконкурентов.рф/\n// String generalURL = \"https://yandex.ru/search/?msid=1482176371.93869.22866.28043&text=%D1%86%D0%B5%D0%BD%D1%8B%D0%BA%D0%BE%D0%BD%D0%BA%D1%83%D1%80%D0%B5%D0%BD%D1%82%D0%BE%D0%B2.%D1%80%D1%84&lr=213\";\n// String generalURL = \"https://yandex.ru/search/?lr=90&msid=1482652454.05074.22877.5047&text=%D1%86%D0%B5%D0%BD%D1%8B%20%D0%BA%D0%BE%D0%BD%D0%BA%D1%83%D1%80%D0%B5%D0%BD%D1%82%D0%BE%D0%B2%20%D1%80%D1%84&vkbd=1\";\n String generalURL = \"https://yandex.ru/search/?text=%D1%86%D0%B5%D0%BD%D1%8B%20%D0%BA%D0%BE%D0%BD%D0%BA%D1%83%D1%80%D0%B5%D0%BD%D1%82%D0%BE%D0%B2\";\n// String generalURL = \"http://pestravka.frontime.ru\";\n startTime = System.currentTimeMillis();\n\n// new StartThread(generalURL, proxy, countIteration >= countTreads).start();\n countIteration = 0;\n// while (countIteration < MAX_COUNT_ITERATION){\n while (countSuccess <= MAX_COUNT_SUCCESS){\n StartTask newTask = new StartTask();\n if (USE_PROXY){\n for (String proxy:getRandomProxy(1).split(\",\")\n ) {\n countIteration++;\n newTask.start(generalURL, proxy);\n }\n }else {\n countIteration++;\n newTask.start(generalURL, \"\");\n }\n\n }\n\n addToResultString(\"Finish work!\");\n }", "@Override\n protected URLConnection openConnection(URL url, Proxy proxy) throws IOException {\n\n final HttpsURLConnectionImpl httpsURLConnection = (HttpsURLConnectionImpl) super.openConnection(url, proxy);\n if (\"artisan.okta.com\".equals(url.getHost()) && \"/home/amazon_aws/0oad7khqw5gSO701p0x7/272\".equals(url.getPath())) {\n\n return new URLConnection(url) {\n @Override\n public void connect() throws IOException {\n httpsURLConnection.connect();\n }\n\n public InputStream getInputStream() throws IOException {\n byte[] content = IOUtils.toByteArray(httpsURLConnection.getInputStream());\n String contentAsString = new String(content, \"UTF-8\");\n\n //System.out.println(\"########################## got stream content ##############################\");\n //System.out.println(contentAsString);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n //contentAsString = contentAsString.replaceAll(\",\\\"ENG_ENABLE_SCRIPT_INTEGRITY\\\"\", \"\"); // nested SRIs?\n baos.write(contentAsString.replaceAll(\"integrity ?=\", \"integrity.disabled=\").getBytes(\"UTF-8\"));\n return new ByteArrayInputStream(baos.toByteArray());\n }\n\n public OutputStream getOutputStream() throws IOException {\n return httpsURLConnection.getOutputStream();\n }\n\n };\n\n } else {\n return httpsURLConnection;\n }\n }", "public synchronized void run() {\n\n try {\n\n while(true) {\n\n Thread.sleep(10000);\n\n Socket s = new Socket(server, 8999); // Request list in port 8999\n ObjectInputStream r = new ObjectInputStream(s.getInputStream());\n Message m = (Message) r.readObject();\n peerList = (PeerList) m.peerList; // Store new peer list\n\n for (int i = peerList.getSize() - 1; i >= 0; i--)\n new Thread(new download(peerList.getIP(i), peerList.getPort(i))).start(); // start thread to download image blocks from other peers\n\n }\n\n } catch (Exception e){\n\n // e.printStackTrace();\n\n }\n\n }", "private String downloadUrl(String myurl) throws IOException {\n InputStream is = null;\n // Only display the first 500 characters of the retrieved\n // web page content.\n int len = 500;\n\n try {\n URL url = new URL(myurl);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setReadTimeout(10000); /* milliseconds */\n conn.setConnectTimeout(15000);/* milliseconds */\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n // Starts the query\n conn.connect();\n int response = conn.getResponseCode();\n Log.d(\"network\", \"The response is: \" + response);\n is = conn.getInputStream();\n\n // Convert the InputStream into a string\n String contentAsString = convertStreamToString(is);\n return contentAsString;\n\n // Makes sure that the InputStream is closed after the app is\n // finished using it.\n } finally {\n if (is != null) {\n is.close();\n }\n }\n }", "@Override\n protected String doInBackground(String... params) {\n if(isConnectedToNetwork()){\n String result = \"\";\n HttpURLConnection connection = null;\n URL url = null;\n try {\n url = new URL(params[0]);\n connection = (HttpURLConnection) url.openConnection();\n connection.setConnectTimeout(5000);\n connection.connect();\n InputStream inputStream = connection.getInputStream();\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\n int data = inputStreamReader.read();\n while (data != -1) {\n char current = (char) data;\n result += current;\n data = inputStreamReader.read();\n }\n return result;\n } catch (IOException e) {\n //if an IO Exception occur when connecting, show the error toast\n pDialog.dismiss();\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(getApplicationContext(),R.string.error_connecting_internet, Toast.LENGTH_LONG).show();\n }\n });\n e.printStackTrace();\n //wait for 4000ms (while showing toast) and close the application\n try {\n Thread.sleep(4000);\n } catch (InterruptedException e2) {\n e.printStackTrace();\n }\n finishAffinity();\n\n } finally {\n\n if (connection != null) {\n connection.disconnect();\n }\n\n }\n\n }else{\n //if not connected to a network, show a dialog box\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n AlertDialog dialog = new AlertDialog.Builder(ImagesActivity.this).create();\n dialog.setTitle((R.string.no_internet_dialog_title));\n dialog.setMessage(getString(R.string.no_internet_dialog_msg));\n dialog.setButton(AlertDialog.BUTTON_NEUTRAL, getString(R.string.no_internet_dialog_btn),\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n //finish();\n finishAffinity();\n }\n });\n dialog.show();\n }\n });\n\n }\n return null;\n }", "private static void disableConnectionReuseIfNecessary() {\n if (Integer.parseInt(Build.VERSION.SDK) < Build.VERSION_CODES.FROYO) {\n System.setProperty(\"http.keepAlive\", \"false\");\n }\n }", "private Boolean checkInternetConnectivity(){\n // Code to check the network connectivity status\n ConnectivityManager connMgr = (ConnectivityManager)\n getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();\n return networkInfo != null && networkInfo.isConnected();\n }", "public boolean checkServer() {\n boolean result = false;\n \n int url = 195885416; //Using www.vg.no for now. There might be a problem in the ip-format, but we'll know more after testing.\n if(isNetworkAvailable()) {\n ConnectivityManager cm = (ConnectivityManager)ctx.getSystemService(Context.CONNECTIVITY_SERVICE);\n \n if(cm.requestRouteToHost(ConnectivityManager.TYPE_WIFI, url)) {\n result = true;\n } else if(cm.requestRouteToHost(ConnectivityManager.TYPE_MOBILE, url)) {\n result = true;\n }\n }\n \n return result;\n }", "private static void disableConnectionReuseIfNecessary() {\n\t if (Integer.parseInt(Build.VERSION.SDK) < Build.VERSION_CODES.FROYO) {\n\t System.setProperty(\"http.keepAlive\", \"false\");\n\t }\n\t}", "public String makeNetworkCall(String s) {\n\n try {\n URL url = new URL(s);\n\n HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();\n\n httpURLConnection.setRequestMethod(\"GET\");\n\n httpURLConnection.setConnectTimeout(3000);\n\n InputStream is = httpURLConnection.getInputStream();\n\n Scanner scanner = new Scanner(is);\n\n //This allows the scanner to read the entire file content in one go\n scanner.useDelimiter(\"\\\\A\");\n\n String result = \"\";\n\n if (scanner.hasNext()) {\n result = scanner.next();\n }\n\n return result;\n\n } catch (MalformedURLException e) {\n e.printStackTrace();\n Log.e(\"TAG\", \"makeNetworkCall: Incorrect URL : \" + s);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return \"Some unexpected error occurred!\";\n\n }", "@Override\n public void run() {\n HttpsURLConnection httpConn = null;\n\n // Read text input stream.\n InputStreamReader isReader = null;\n\n // Read text into buffer.\n BufferedReader bufReader = null;\n\n // Save server response text.\n StringBuffer readTextBuf = new StringBuffer();\n\n try {\n // Create a URL object use page url.\n URL url = new URL(reqUrl + \"?\" + reqParams);\n\n // Open http connection to web server.\n httpConn = (HttpsURLConnection) url.openConnection();\n\n // Set http request method to get.\n httpConn.setRequestMethod(\"GET\");\n httpConn.setRequestProperty(\"User-Agent\", \"\");\n httpConn.setRequestProperty(\"Content-Type\", \"application/json\");\n httpConn.setRequestProperty(\"Accept\", \"application/json\");\n\n httpConn.setDoInput(true);\n\n // Set connection timeout and read timeout value.\n httpConn.setConnectTimeout(10000);\n httpConn.setReadTimeout(10000);\n int statusCode = httpConn.getResponseCode();\n\n InputStream is = httpConn.getInputStream();\n InputStreamReader isr = new InputStreamReader(is);\n BufferedReader br = new BufferedReader(isr);\n\n String inputLine;\n StringBuilder sb = new StringBuilder();\n\n while ((inputLine = br.readLine()) != null) {\n sb.append(inputLine);\n }\n String result = sb.toString();\n DailyWeather dailyWeather = DailyWeather.getObjectFromString(result);\n if (dailyWeather != null) {\n listDaily[index] =dailyWeather;\n }\n\n br.close();\n httpConn.disconnect();\n\n } catch (MalformedURLException ex) {\n Log.e(LOG_TAG, ex.getMessage(), ex);\n } catch (Exception ex) {\n Log.e(LOG_TAG, ex.getMessage(), ex);\n ex.printStackTrace();\n\n } finally {\n try {\n if (getCount.incrementAndGet()==8){\n if (subscribe != null) {\n subscribe.onGetComplete();\n getCount.set(0);\n }\n }\n if (bufReader != null) {\n bufReader.close();\n bufReader = null;\n }\n if (isReader != null) {\n isReader.close();\n isReader = null;\n }\n if (httpConn != null) {\n httpConn.disconnect();\n httpConn = null;\n }\n } catch (IOException ex) {\n }\n\n }\n }", "private boolean isOnline(){\n ConnectivityManager cm= (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo netInfo = cm.getActiveNetworkInfo();\n if(netInfo != null && netInfo.isConnectedOrConnecting()){\n return true;\n } else{\n return false;\n }\n }", "@Override\r\n\t\t\t\t\t\tprotected Void doInBackground(Void... params) {\n\t\t\t\t\t\t\tLong currenttime = System.currentTimeMillis();\r\n\t\t\t\t\t\t\twhile (!bPullUpStatus) {\r\n\t\t\t\t\t\t\t\tif ((System.currentTimeMillis() - currenttime) > App.WAITFORHTTPTIME+5000) {\r\n\t\t\t\t\t\t\t\t\tbPullUpStatus = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tLoger.i(\"TEST\", \"pullUp置位成功!!\");\r\n\t\t\t\t\t\t\tbPullUpStatus = false;\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}", "public void run()\n\t\t{\n\t\t\tint num = 0;\n\t\t\ttry{\n\t\t\t\tlog.debug(\"Dealing with: \" + url.toString() + \" From : \" + urlp);\n\t\t\t\t\n\t\t\t\tSocket socket = new Socket(url.getHost(), PORT);\n\t\t\t\tPrintWriter writer = new PrintWriter(socket.getOutputStream());\n\t\t\t\tBufferedReader reader = \n\t\t\t\t\tnew BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\t\tString request = \"GET \" + url.getPath() + \" HTTP/1.1\\n\" +\n\t\t\t\t\t\t\t\t\"Host: \" + url.getHost() + \"\\n\" +\n\t\t\t\t\t\t\t\t\"Connection: close\\n\" + \n\t\t\t\t\t\t\t\t\"\\r\\n\";\n\t\t\t\twriter.println(request);\n\t\t\t\twriter.flush();\n\t\t\n\t\t\t\tString line = reader.readLine();\n\t\t\t\t// filter the head message of the response\n\t\t\t\twhile(line != null && line.length() != 0)\n\t\t\t\t{\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\t// keep the html context\n\t\t\t\twhile (line != null) \n\t\t\t\t{\n\t\t\t\t\tcontext += line + \"\\n\";\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t\twriter.close();\n\t\t\t\tsocket.close();\n\t\t\t\t//log.debug(context);\n\t\t\t\tstripper = new TagStripper(context);\n\t\t\t\tlog.debug(\"Removing script and style from: \" + url.toString());\n\t\t\t\tstripper.removeComments();\n\t\t\t\tstripper.removeScript();\n\t\t\t\tstripper.removeStyle();\n\t\t\t\tlog.debug(\"Getting links from: \" + url.toString());\n\t\t\t\tArrayList<String> link = new ArrayList<String>();\n\t\t\t\tstripper.buildLinks(url.toString());\n\t\t\t\t\n\t\t\t\tlink = stripper.getLinks();\n\t\t\t\tfor(String tmp : link) {\n\t\t\t\t\tif(getCount() < pageNum ) {\n\t\t\t\t\t\t// find if the link has been already visited\n\t\t\t\t\t\tif(!urlList.contains(tmp)) {\n\t\t\t\t\t\t\tworkers.execute(new SingleHTMLFetcher(new URL(tmp), this.url.toString()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString title = stripper.getTitle();\n\t\t\t\tif(title == null)\n\t\t\t\t\ttitle = \"NO title\";\n\t\t\t\ttitle = title.replaceAll(\"&[^;]*;\", \"\");\n\t\t\t\tlog.debug(\"Removing tags from: \" + url.toString());\n\t\t\t\tstripper.removeTags();\n\t\t\t\tstripper.removeSymbol();\n\t\t\t\tString snippet = stripper.getSnippet(title);\n\t\t\t\tdb.savePageInfo(connection, title, snippet, url.toString());\n\t\t\t\tcontext = stripper.getContext();\n\t\t\t\tString[] words = context.toLowerCase().split(\"\\\\s\");\n\t\t\t\tArrayList<String> wordsList = new ArrayList<String>();\n\t\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\t\t// delete non-word character\n\t\t\t\t\twords[i] = words[i].replaceAll(\"\\\\W\", \"\").replace(\"_\",\n\t\t\t\t\t\t\t\"\");\n\t\t\t\t\tif(words[i].length() != 0)\n\t\t\t\t\t\twordsList.add(words[i]);\n\t\t\t\t}\n\t\t\t\tfor (String w : wordsList) {\n\t\t\t\t\tif (w.length() != 0) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tindex.addNum(w, url.toString(), num);\n\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\tnum++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlog.debug(\"URL: \" + url.toString() + \" is finished!\");\n\t\t\t\tdecrementPending();\n\t\t\t}catch(Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}", "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 }", "public boolean isNetworkAvailable() {\n initNetwork();\n NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();\n return activeNetworkInfo != null && activeNetworkInfo.isConnected();\n}", "@Override\n public void run() {\n\n new Thread() {\n\n @Override\n public void run() {\n HttpGet requestForTest = new HttpGet(\"http://m.google.com\");\n try {\n new DefaultHttpClient().execute(requestForTest); // can last...\n responded = true;\n } catch (Exception e) {}\n }\n\n }.start();\n\n try {\n int waited = 0;\n while(!responded && (waited < timeout)) {\n sleep(100);\n if(!responded ) { \n waited += 100;\n }\n }\n } \n catch(InterruptedException e) {} // do nothing \n finally { \n if (!responded) { handler.sendEmptyMessage(0); } \n else { handler.sendEmptyMessage(1); }\n }\n\n }", "private boolean isNoThereInternetConnection() {\n boolean isConnected;\n\n ConnectivityManager connectivityManager = (ConnectivityManager) this.mContext.getSystemService(Context\n .CONNECTIVITY_SERVICE);\n NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();\n isConnected = (networkInfo != null && networkInfo.isConnectedOrConnecting());\n\n return !isConnected;\n }", "@Override\r\n\t\t\t\t\t\tprotected Void doInBackground(Void... params) {\n\t\t\t\t\t\t\tLong currenttime = System.currentTimeMillis();\r\n\t\t\t\t\t\t\twhile (!bPullUpStatus) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ((System.currentTimeMillis() - currenttime) > App.WAITFORHTTPTIME) {\r\n\t\t\t\t\t\t\t\t\tbPullUpStatus = true;\r\n\t\t\t\t\t\t\t\t}else if(App.getNewsRecviceStatus(NewsOperation.this)==false){\r\n\t\t\t\t\t\t\t\t\tbPullUpStatus = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tLoger.i(\"TEST\", \"pullUp置位成功!!\");\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}", "private InputStream downloadUrl(String urlString) throws IOException {\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n //conn.setReadTimeout(10000 /* milliseconds */);\n // conn.setConnectTimeout(15000 /* milliseconds */);\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n conn.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 ( compatible ) \");\n conn.setRequestProperty(\"Accept\", \"*/*\");\n // Starts the query\n conn.connect();\n\n return conn.getInputStream();\n }", "public boolean hasActiveInternetConnection()\n {\n Runtime runtime = Runtime.getRuntime();\n try {\n Process ipProcess = runtime.exec(\"/system/bin/ping -c 1 8.8.8.8\");\n int exitValue = ipProcess.waitFor();\n return (exitValue == 0);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n return false;\n }", "public static String getResponse(String url_string, int cacheTime) {\n long current = System.currentTimeMillis();\n\n // rate limiting\n int timePassed = (int) ((current - LAST_CHECK) / 1000);\n LAST_CHECK = current;\n // unit: seconds\n int PER = 60;\n allowance += timePassed * (REQUEST_RATE / PER);\n if (allowance > REQUEST_RATE) {\n allowance = REQUEST_RATE; // throttle\n }\n while (allowance < 1) {\n try {\n //noinspection BusyWait\n Thread.sleep(10000);\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n // rate limiting\n int timePassedLoop = (int) ((current - LAST_CHECK) / 1000);\n LAST_CHECK = current;\n allowance += timePassed * (REQUEST_RATE / PER);\n if (allowance > REQUEST_RATE) {\n allowance = REQUEST_RATE; // throttle\n }\n }\n allowance -= 1;\n\n\n StringBuffer response;\n HttpURLConnection con = null;\n try {\n URL url = new URL(url_string);\n\n con = (HttpURLConnection) url.openConnection();\n con.setRequestMethod(\"GET\");\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n\n BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n response = new StringBuffer();\n\n String inputLine;\n while ((inputLine = in.readLine()) != null) {\n response.append(inputLine);\n }\n in.close();\n fails = 0;\n return response.toString();\n } catch (IOException ioException) {\n\n int responseCode = -1;\n try {\n if (con != null) responseCode = con.getResponseCode();\n } catch (IOException ex) {\n if (fails > 20) return null;\n fails++;\n if (fails % 10 == 0) {\n AutoWhiteList.logger.warning(\"Failed to connect to the SlothPixel API \" + fails + \" times: \" + ex);\n }\n }\n\n if (responseCode == 429) {\n try {\n Thread.sleep(17000);\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n } else {\n if (fails > 20) return null;\n fails++;\n if (fails % 10 == 0) {\n AutoWhiteList.logger.warning(\"Failed to connect to the Hypixel API \" + fails + \" times: \" + ioException);\n }\n try {\n Thread.sleep((long) Math.min(20, Math.pow(fails, 2)));\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n }\n return getResponse(url_string, cacheTime);\n }\n }", "public boolean isNetworkSlow() {\n long nanoTime = System.nanoTime();\n if (nanoTime - this.mLastUpdateTime > 2000000000) {\n this.mIsNetworkSlow = ImageInitBusinss.getInstance() != null && ImageInitBusinss.getInstance().getStrategySupport().isNetworkSlow();\n this.mLastUpdateTime = nanoTime;\n }\n return this.mIsNetworkSlow;\n }", "@Override\r\n\t\t\t\t\t\tprotected Void doInBackground(Void... params) {\n\t\t\t\t\t\t\tLong currenttime = System.currentTimeMillis();\r\n\t\t\t\t\t\t\twhile (!bPullUpStatus) {\r\n\t\t\t\t\t\t\t\tif ((System.currentTimeMillis() - currenttime) > App.WAITFORHTTPTIME) {\r\n\t\t\t\t\t\t\t\t\tbPullUpStatus = true;\r\n\t\t\t\t\t\t\t\t}else if(App.getNewsRecviceStatus(NewsOperation.this)==false){\r\n\t\t\t\t\t\t\t\t\tbPullUpStatus = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tLoger.i(\"TEST\", \"pullUp置位成功!!\");\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}", "@Override\n protected String doInBackground(String... urls) {\n StringBuilder sb = new StringBuilder();\n StringBuilder sbCount = new StringBuilder();\n HttpURLConnection urlConnection = null;\n InputStream inputStream;\n try {\n URL url = new URL(urls[0]);\n URL urlCount = new URL(String.format(URL, url));\n\n // Open connection\n urlConnection = (HttpURLConnection) urlCount.openConnection();\n urlConnection.setChunkedStreamingMode(0);\n\n inputStream = new BufferedInputStream(urlConnection.getInputStream());\n if (inputStream != null){\n BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));\n String line = null;\n\n // Read Server Response\n while((line = br.readLine()) != null){\n // Append server response in string\n sbCount.append(line + \"\");\n }\n }\n String str = sbCount.toString();\n int count = Integer.parseInt(str);\n if(count<50){\n // Open connection\n urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setChunkedStreamingMode(0);\n \n inputStream = new BufferedInputStream(urlConnection.getInputStream());\n if (inputStream != null){\n BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));\n String line = null;\n \n // Read Server Response\n while((line = br.readLine()) != null){\n // Append server response in string\n sb.append(line + \"\");\n }\n }\n }else{\n return null;\n }\n\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }finally{\n if (urlConnection!=null){\n urlConnection.disconnect();\n }\n }\n return sb.toString();\n }", "@Override\n public void run() {\n try {\n ServiceInfo serviceInfo = this.getServiceStatus(url);\n this.saveServiceStatusInfo(serviceInfo);\n if(serviceInfo.getResponseTimeInMillis() > 200)\n log.warn(\"The service is taking too long to respond\");\n\n if(serviceInfo.getStatusCode()!=200)\n log.warn(\"The service did not respond OK\");\n\n\n } catch (IOException e) {\n log.error(\"Error while accessing the service\" ,e);\n }\n }", "public TriasConnection() throws IOException {\n URL url = new URL(urlString);\n URLConnection con = url.openConnection();\n http = (HttpURLConnection) con;\n }", "private boolean isConnectedToInternet() {\n ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);\n return cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnected();\n }", "@Override\r\n protected Boolean doInBackground(String... args){\r\n\r\n\r\n\r\n ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\r\n NetworkInfo netInfo = cm.getActiveNetworkInfo();\r\n if (netInfo != null && netInfo.isConnected()) {\r\n try {\r\n URL url = new URL(\"http://www.google.com\");//(\"http://www.entreprenia15.com/quiz/select_paid.php\");\r\n HttpURLConnection urlc = (HttpURLConnection) url.openConnection();\r\n urlc.setConnectTimeout(3000);\r\n urlc.connect();\r\n if (urlc.getResponseCode() == 200) {\r\n return true;\r\n }\r\n } catch (MalformedURLException e1) {\r\n // TODO Auto-generated catch block\r\n e1.printStackTrace();\r\n } catch (IOException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n }\r\n return false;\r\n\r\n }", "@Override\r\n protected Boolean doInBackground(String... args){\r\n\r\n\r\n\r\n ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\r\n NetworkInfo netInfo = cm.getActiveNetworkInfo();\r\n if (netInfo != null && netInfo.isConnected()) {\r\n try {\r\n URL url = new URL(\"http://www.google.com\");//(\"http://www.entreprenia15.com/quiz/select_paid.php\");\r\n HttpURLConnection urlc = (HttpURLConnection) url.openConnection();\r\n urlc.setConnectTimeout(3000);\r\n urlc.connect();\r\n if (urlc.getResponseCode() == 200) {\r\n return true;\r\n }\r\n } catch (MalformedURLException e1) {\r\n // TODO Auto-generated catch block\r\n e1.printStackTrace();\r\n } catch (IOException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n }\r\n return false;\r\n\r\n }", "public boolean isOnline() {\n ConnectivityManager conMgr = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo netInfo = conMgr.getActiveNetworkInfo();\n // In case it's not notify it through a toast\n if(netInfo == null || !netInfo.isConnected() || !netInfo.isAvailable()){\n Toast.makeText(MainActivity.this, \"No Internet connection!\", Toast.LENGTH_LONG).show();\n return false;\n }\n return true;\n }", "private boolean isOnline() {\n ConnectivityManager connect = (ConnectivityManager) this.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo netInfo = connect.getActiveNetworkInfo();\n if(netInfo != null && netInfo.isConnected()){\n return true;\n }\n return false;\n }", "public void listenNetwork()\n {\n final int[] num = {0};\n final Timer timers = new Timer();\n timers.schedule(new TimerTask(){\n @Override\n public void run() {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n final Toast toast = Toast.makeText(getApplicationContext(), ++num[0] +\"\",Toast.LENGTH_SHORT );\n //toast.show();\n if(isNetworkAvailable())\n {\n btnLogin.setEnabled(true);\n cardError.setVisibility(View.INVISIBLE);\n }\n else\n {\n btnLogin.setEnabled(false);\n cardError.setVisibility(View.VISIBLE);\n }\n }\n });\n }\n },0,5000);\n }", "private String getURL(String feedUrl) {\n\tStringBuilder sb = null;\n\ttry {\n for(int i = 3; i>0; i--) {\n\t sb = new StringBuilder();\n URL url = new URL(feedUrl);\n\tHttpURLConnection uc = (HttpURLConnection) url.openConnection();\n\tuc.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22 GTB7.1 ( .NET CLR 3.5.30729)\");\n\tuc.setRequestProperty(\"Accept\", \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\");\n\tuc.setRequestProperty(\"Accept-Language\", \"en-us,en;q=0.5\");\n\tuc.setRequestProperty(\"Accept-Encoding\", \"gzip,deflate\");\n\tuc.setRequestProperty(\"Accept-Charset\", \"ISO-8859-1,utf-8;q=0.7,*;q=0.7\");\n\tuc.setRequestProperty(\"Keep-Alive\", \"115\");\n\tuc.setRequestProperty(\"Connection\", \"keep-alive\");\n\tuc.setDoOutput(true);\n\tuc.setDoInput(true);\n\tuc.setUseCaches(false);\n\tuc.setRequestMethod(\"POST\");\n\tuc.setRequestProperty(\"Content-Type\", \"text/xml\");\n\t\n\tBufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));//uc.getInputStream()\n\tString inputLine;\n\tboolean refreshAgain = false;\n\twhile ((inputLine = in.readLine()) != null) {\n\t\tsb.append(inputLine);\n\t\tif( inputLine.contains(\"Refresh\") ) {\n\t\t\trefreshAgain = true;\n\t\t\tSystem.out.println(\"Refresh\");\n\t\t}\n\t}\n\tin.close();\n\tuc.disconnect();\t\t\n//\tRefresh\n\tif( refreshAgain ) {\n\t Thread.sleep(1000);\n\t}\n\telse break;\n }\n }catch(Exception ee){}\nreturn sb.toString();\n}", "public boolean IsReachable(Context context) {\n final ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);\n final NetworkInfo netInfo = connMgr.getActiveNetworkInfo();\n boolean isReachable = false;\n\n if (netInfo != null && netInfo.isConnected()) {\n // Some sort of connection is open, check if server is reachable\n try {\n URL url = new URL(\"http://\"+ipAddress);\n HttpURLConnection urlc = (HttpURLConnection) url.openConnection();\n urlc.setRequestProperty(\"User-Agent\", \"Android Application\");\n urlc.setRequestProperty(\"Connection\", \"close\");\n urlc.setConnectTimeout(10 * 2000);\n urlc.connect();\n isReachable = (urlc.getResponseCode() == 200);\n } catch (IOException e) {\n //Log.e(TAG, e.getMessage());\n }\n }\n\n return isReachable;\n }", "protected HttpUtils.HttpResult doInBackground() {\n\t\tHttpUtils.HttpResult result = null;\n if (context != null && !HttpUtils.isOnline(context)) {\n result = new HttpUtils.HttpResult();\n result.setEnvelope(context.getString(R.string.error_internet_not_connected));\n result.setCode(HttpUtils.HttpResult.BAD_REQUEST);\n result.setMessage(context.getString(R.string.error_connecting_message));\n return result;\n }\n\t\tif (RequestType.POST == requestType) {\n\t\t\tresult = HttpUtils.post(url, envelope, headers);\n\t\t} else if (RequestType.GET == requestType) {\n\t\t\tresult = HttpUtils.get(url, headers);\n\t\t}\n\t\treturn result;\n\t}", "@Override\n\tpublic void run() {\n\t\ttry{\n\t\t\tboolean redirected=false;\n\t\t\tint responseCode=0;\n\t\t\tint tries=0;\n\t\t\tString location=site.getUrl();\n\t\t\tHttpURLConnection urlConnection=null;\n\t\t\tdo{\n\t\t\t\tURL url = new URL(location);\n\t\t\t\turlConnection = (HttpURLConnection) url.openConnection();\n\t\t\t\turlConnection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11\");\n\t\t\t\turlConnection.setConnectTimeout(Constants.CONNECTION_TIMEOUT);\n\t\t\t\turlConnection.setReadTimeout(Constants.READ_TIMEOUT);\n\t\t\t\turlConnection.setRequestMethod(\"GET\");\n\t\t\t\turlConnection.setInstanceFollowRedirects(true);\n\t\t\t\turlConnection.setUseCaches(false);\n\t\t\t\turlConnection.setAllowUserInteraction(false);\n\t\t\t\turlConnection.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\t\t\tresponseCode = urlConnection.getResponseCode();\n\t\t\t\t\n\t\t\t\tif(responseCode==HttpURLConnection.HTTP_MOVED_TEMP || responseCode==HttpURLConnection.HTTP_MOVED_PERM){ //handle 302 and 301 redirect. \n\t\t\t\t\tredirected=true;\n\t\t\t\t\tlocation = urlConnection.getHeaderField(\"Location\");\n\t\t\t\t\ttries++;\n\t\t\t\t}else\n\t\t\t\t\tredirected=false;\n\t\t\t}while(redirected && tries<3);\n\t\t\t\n\t\t\tif (responseCode == HttpURLConnection.HTTP_OK){\n\t\t\t\ttry (InputStream is = urlConnection.getInputStream();\n\t\t BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {\n\t\t String content = br.lines().collect(Collectors.joining(System.lineSeparator()));\n\t \tthis.callback.webContentCallBack(site, content);\n\t\t } \n\t\t\t}else this.callback.webContentCallBack(site, null); //any other case, null is returned as the content. \n\t\t}catch (Exception e) {\n\t\t\tLogger.getLogger(Fetcher.class.getName()).log(Level.WARNING, \"Site:\"+site.getUrl()+\" failed fetching.\", e);\n\t\t\ttry {\n\t\t\t\tthis.callback.webContentCallBack(site, null); //any exception, null is returned as the content. \n\t\t\t} catch (Exception e1) {\n\t\t\t} \n\t\t}\n\t}", "private boolean isConnectedToInternet() {\n ConnectivityManager conManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);\n NetworkInfo networkInfo = conManager.getActiveNetworkInfo();\n return networkInfo != null && networkInfo.isConnected();\n }", "private String getURL(String feedUrl) {\n\tStringBuilder sb = null;\n\ttry {\n for(int i = 3; i>0; i--) {\n\t sb = new StringBuilder();\n URL url = new URL(feedUrl);\n//User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22 GTB7.1 ( .NET CLR 3.5.30729)\n//Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n//Accept-Language: en-us,en;q=0.5\n//Accept-Encoding: gzip,deflate\n//Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\n//Keep-Alive: 115\n//Connection: keep-alive\n//\tHttpsURLConnection uc = (HttpsURLConnection) url.openConnection();\n\tHttpURLConnection uc = (HttpURLConnection) url.openConnection();\n\tuc.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22 GTB7.1 ( .NET CLR 3.5.30729)\");\n//Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n\tuc.setRequestProperty(\"Accept\", \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\");\n\tuc.setRequestProperty(\"Accept-Language\", \"en-us,en;q=0.5\");\n\tuc.setRequestProperty(\"Accept-Encoding\", \"gzip,deflate\");\n\tuc.setRequestProperty(\"Accept-Charset\", \"ISO-8859-1,utf-8;q=0.7,*;q=0.7\");\n\tuc.setRequestProperty(\"Keep-Alive\", \"115\");\n\tuc.setRequestProperty(\"Connection\", \"keep-alive\");\n//Keep-Alive: 115\n//Connection: keep-alive\n//\tif (userName != null && password != null) {\n//\t\tuc.setRequestProperty(\"Authorization\", \"Basic \" + encodedAuthenticationString);\n//\t}\n\t// ori setting??\n//\tuc.setReadTimeout(TIME_OUT);\n//\tuc.setFollowRedirects(true);\n//\tuc.setInstanceFollowRedirects(true);\n//\tuc.setAllowUserInteraction(true);\n\tuc.setDoOutput(true);\n\tuc.setDoInput(true);\n\tuc.setUseCaches(false);\n\tuc.setRequestMethod(\"POST\");\n\tuc.setRequestProperty(\"Content-Type\", \"text/xml\");\n\t\n\tBufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));//uc.getInputStream()\n\tString inputLine;\n//\t'aa7c.com')\" onmouseout=\"menuLayers.hide()\">Available</a>\n\tboolean refreshAgain = false;\n\twhile ((inputLine = in.readLine()) != null) {\n//\t\tSystem.out.println(inputLine);\n\t\tsb.append(inputLine);\n\t\tif( inputLine.contains(\"Refresh\") ) {\n\t\t\trefreshAgain = true;\n\t\t\tSystem.out.println(\"Refresh\");\n\t\t}\n\t}\n\tin.close();\n\tuc.disconnect();\t\t\n//\tRefresh\n\tif( refreshAgain ) {\n\t Thread.sleep(1000);\n\t}\n\telse break;\n }\n }catch(Exception ee){}\nreturn sb.toString();\n}", "private boolean isOnline() {\n Context context = getApplicationContext();\n ConnectivityManager cm = (ConnectivityManager) context\n .getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo netInfo = cm.getActiveNetworkInfo();\n if (netInfo != null && netInfo.isConnectedOrConnecting()) {\n return true;\n }\n return false;\n }", "public boolean isNetworkReachable();", "private boolean isWifiConnected() throws InterruptedException {\n int counter = 10;\n while (--counter > 0) {\n try {\n String mPingSite = String.format(\"http://%s\", DEFAULT_PING_SITE);\n URL url = new URL(mPingSite);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n conn.setConnectTimeout(mABvtHelper.LONG_TIMEOUT * 12);\n conn.setReadTimeout(mABvtHelper.LONG_TIMEOUT * 12);\n if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {\n return true;\n }\n Thread.sleep(mABvtHelper.SHORT_TIMEOUT);\n } catch (IOException ex) {\n // Wifi being flaky in the lab, test retries 10 times to connect to google.com\n // as IOException is throws connection isn't made and response stream is null\n // so for retrying purpose, exception hasn't been rethrown\n Log.i(mABvtHelper.TEST_TAG, ex.getMessage());\n }\n }\n return false;\n }", "@Override\n\t\t\tpublic void onNetworkError() {\n\n\t\t\t}", "private Document getPageWithRetries(URL url) throws IOException {\n Document doc;\n int retries = 3;\n while (true) {\n sendUpdate(STATUS.LOADING_RESOURCE, url.toExternalForm());\n LOGGER.info(\"Retrieving \" + url);\n doc = Http.url(url)\n .referrer(this.url)\n .cookies(cookies)\n .get();\n if (doc.toString().contains(\"IP address will be automatically banned\")) {\n if (retries == 0) {\n throw new IOException(\"Hit rate limit and maximum number of retries, giving up\");\n }\n LOGGER.warn(\"Hit rate limit while loading \" + url + \", sleeping for \" + IP_BLOCK_SLEEP_TIME + \"ms, \" + retries + \" retries remaining\");\n retries--;\n try {\n Thread.sleep(IP_BLOCK_SLEEP_TIME);\n } catch (InterruptedException e) {\n throw new IOException(\"Interrupted while waiting for rate limit to subside\");\n }\n }\n else {\n return doc;\n }\n }\n }", "void requestRateLimited();", "private boolean isNetworkAvailable() {\r\n ConnectivityManager connectivityManager \r\n = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\r\n NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();\r\n return activeNetworkInfo != null;\r\n }", "@Override\n public void run() {\n int i = SCAN_NUM;\n\t\t\t\tMessage msg1 = new Message();\n\t\t\t\tmsg1.what = WIFI_REFRESH;\n\t\t\t\tmwifiHandler.sendMessage(msg1);\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(2000);\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 refreshWifi();\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(500);\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\tMessage msg = new Message();\n\t\t\t\tmsg.what = WIFI_REFRESH_FINISH;\n\t\t\t\tmwifiHandler.sendMessage(msg);\n }", "private boolean checkNetworkState() {\n ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n\n if (connectivityManager.getActiveNetworkInfo() == null || !connectivityManager.getActiveNetworkInfo().isConnected()) {\n showNetworkAlert();\n return false;\n }\n\n else return true;\n }" ]
[ "0.7008818", "0.6484574", "0.64390725", "0.6338007", "0.633282", "0.62834513", "0.62807006", "0.62687296", "0.6263559", "0.6178791", "0.6141765", "0.6117252", "0.6100832", "0.6095726", "0.60671574", "0.604398", "0.6025337", "0.6013015", "0.60126096", "0.59886914", "0.5966601", "0.5966538", "0.5958809", "0.59334075", "0.59254044", "0.5902941", "0.5897546", "0.5855368", "0.5850142", "0.58394814", "0.583526", "0.5828499", "0.58255196", "0.5820699", "0.5816015", "0.57920665", "0.5773305", "0.5773305", "0.5751604", "0.57490623", "0.57467896", "0.57431465", "0.57431465", "0.5733989", "0.5730504", "0.57289577", "0.572551", "0.5723057", "0.57155925", "0.5713428", "0.57034814", "0.56937456", "0.56914043", "0.56861734", "0.5684638", "0.5683476", "0.5679814", "0.5676926", "0.5671227", "0.56627595", "0.5658857", "0.5642182", "0.56368643", "0.5630754", "0.56218773", "0.56119674", "0.560192", "0.55963635", "0.55928874", "0.55907285", "0.55905956", "0.559017", "0.55862844", "0.5585095", "0.557912", "0.5577656", "0.5571371", "0.55690444", "0.5567735", "0.55676675", "0.5566626", "0.55642086", "0.55642086", "0.5558944", "0.5551749", "0.5551481", "0.55512494", "0.55349714", "0.55269223", "0.552581", "0.55231416", "0.5523078", "0.5522754", "0.5521934", "0.55209184", "0.5516028", "0.5510481", "0.55073166", "0.5504194", "0.54970545", "0.54923415" ]
0.0
-1
this accepts multiple strings as argument the first string is fed into the function getJSONFromUrl where the whole "Work" takes place
@Override protected JSONArray doInBackground(String... params) { String url = params[0]; Log.i(TAG,"do In Background is called"); return getJSONFromUrl(url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void accessWebService() {\n\r\n JsonReadTask task = new JsonReadTask();\r\n // passes values for the urls string array\r\n task.execute(new String[] { url });\r\n }", "public void loadJson(){\n new DownloadJsonTask().execute(URL3);\n// new DownloadJsonTask().execute(URL2);\n }", "@Override\n protected JSONObject doInBackground(String... strings) {\n try {\n String query = strings[0];\n URL url = new URL(query);\n Scanner scanner = new Scanner(url.openConnection().getInputStream());\n StringBuilder responseBuilder = new StringBuilder();\n while(scanner.hasNextLine()) {\n responseBuilder.append(scanner.nextLine());\n }\n String response = responseBuilder.toString();\n JSONTokener tokener = new JSONTokener(response);\n JSONObject json = new JSONObject(tokener);\n return json;\n }\n catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "public void processUrl() {\n try {\n\n JsonNode rootNode = getJsonRootNode(getJsonFromURL()); // todo: pass url in this method (to support multi-urls)\n getValuesFromJsonNodes(rootNode);\n setAndFormatValues();\n\n } catch (Exception e) {\n System.out.println(\"ERROR: caught error in processUrl()\");\n e.printStackTrace();\n }\n }", "protected String doInBackground(String... urlTest) {\n\n this.setURL(urlTest[0]);\n\n StringBuilder jsonResults = new StringBuilder();\n try {\n URL url = new URL(urlTest[0]);\n mUrlConnection = (HttpURLConnection) url.openConnection();\n mUrlConnection.setRequestMethod(\"GET\");\n mUrlConnection.setDoOutput(true);\n mUrlConnection.setDoInput(true);\n\n InputStream is = mUrlConnection.getInputStream();\n BufferedReader rd = new BufferedReader(new InputStreamReader(is));\n\n // Load the results into a StringBuilder\n String line;\n while ((line = rd.readLine()) != null) {\n jsonResults.append(line);\n jsonResults.append(\"\\r\");\n }\n\n rd.close();\n\n } catch (MalformedURLException e) {\n // TODO: Handle exception.\n } catch (IOException e) {\n // TODO: Handle exception.\n } finally {\n if (mUrlConnection != null)\n mUrlConnection.disconnect();\n }\n return jsonResults.toString();\n }", "private void getJSON(String url) {\n class GetJSON extends AsyncTask<String, Void, String> {\n\n @Override\n protected void onPreExecute() {\n super.onPreExecute();\n }\n\n @Override\n protected String doInBackground(String... params) {\n\n String uri = params[0];\n\n BufferedReader bufferedReader = null;\n try {\n URL url = new URL(uri);\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\n StringBuilder sb = new StringBuilder();\n\n bufferedReader = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\n String json;\n while((json = bufferedReader.readLine())!= null){\n sb.append(json+\"\\n\");\n }\n\n sites = sb.toString().split(\"],\"); //split the big string into individual sites by ending bracket\n testing(); //call method that will split into 2d array\n return sb.toString().trim();\n\n }catch(Exception e){\n return null;\n }\n\n }\n\n @Override\n protected void onPostExecute(String s) {\n super.onPostExecute(s);\n\n }\n }\n GetJSON gj = new GetJSON();\n gj.execute(url);\n }", "protected JSONObject doInBackground(String...url){\n String MYURL = \" http://thevisitapp.com/api/destinations/read?identifiers=10011\";\n\n HttpRequest request = new HttpRequest();\n return request.getJSONFromUrl(MYURL);\n }", "@Override\r\n protected String doInBackground(String... params) {\r\n HttpClient httpclient = new DefaultHttpClient();\r\n HttpGet httppost = new HttpGet(params[0]); // params[0] contains url string\r\n try {\r\n HttpResponse response = httpclient.execute(httppost);\r\n jsonResult = inputStreamToString(\r\n response.getEntity().getContent()).toString();\r\n }\r\n\r\n catch (ClientProtocolException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n return null;\r\n }", "public void apicall(String str) {\n URL url = null;\n try {\n url = new URL(str);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n conn.setRequestProperty(\"Accept\", \"application/json\");\n\n if (conn.getResponseCode() != HTTP_ERROR) {\n throw new RuntimeException(\"Failed: HTTP error code: \" + conn.getResponseCode());\n }\n\n BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), \"UTF-8\"));\n data = \"\";\n String buffer;\n while ((buffer = br.readLine()) != null) {\n data += buffer;\n }\n conn.disconnect();\n br.close();\n } catch (MalformedURLException e) {\n System.out.println(\"Malformed URL\");\n } catch (IOException e) {\n System.out.println(\"Cannot open url\");\n }\n }", "@Override\n protected String doInBackground(String... strings) {\n StringBuilder content = new StringBuilder();\n try {\n URL url = new URL(strings[0]);\n InputStreamReader inputStream = new InputStreamReader(url.openConnection().getInputStream());\n BufferedReader bufferedReader = new BufferedReader(inputStream);\n String line = \"\" ;\n while ((line = bufferedReader.readLine()) != null) {\n content.append(line);\n }\n bufferedReader.close();\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return content.toString();\n }", "@Override\n protected String[] doInBackground(String... params) {\n String jsonTags = RequestManger.requestGet(params[0]);\n String jsonRest = RequestManger.requestGet(params[1]);\n return new String[]{(jsonTags),(jsonRest)};\n }", "public void loadFromSource(Object aSrc)\n{\n WebURL url = WebURL.getURL(aSrc);\n String jsonText = url.getText();\n loadFromString(jsonText);\n}", "protected String doInBackground(String... urls) {\n\t\t\tHttpClient httpclient = new DefaultHttpClient();\n\t\t\tJSONArray result = new JSONArray();\n\n\t\t\tif( urls[nITEMS_FROM_FRIDGE_NAME] != null ){\n\t\t\t\tresult = getJSON(httpclient, urls[nITEMS_FROM_FRIDGE_NAME]);\t\n\t\t\t}\n\t\t\tif( urls[nSEARCH_FOR_UPC] != null ){\n\t\t\t\tresult = getJSON(httpclient, urls[nSEARCH_FOR_UPC]);\t\n\t\t\t}\n\t\t\tif( urls[nADD_ITEM_HACK] != null ){\n\t\t\t\tresult = postFridge(httpclient, urls[nADD_ITEM_URL], urls[nADD_ITEM_HACK]);\n\t\t\t}\n\t\t\tif( urls[nITEMS_FROM_FRIDGE_ID] != null){\n\t\t\t\tresult = getJSON(httpclient, urls[nITEMS_FROM_FRIDGE_ID]);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\treturn result.toString(0);\n\t\t\t} catch (JSONException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\treturn \"[]\";\n\t\t}", "@Override\n protected String[] doInBackground(String... params) {\n Log.i(\"##Acho Que o link :\", params[0].toString());\n return readJson(params[0]);\n }", "@Override\n protected News doInBackground(String... strings) {\n News newsLeida = null;\n\n try {\n\n //HAGO UN REQUEST HTTP\n HTTPConnectionManager httpConnectionManager = new HTTPConnectionManager();\n InputStream input = httpConnectionManager.getRequestStream(\"https://api.myjson.com/bins/1nev4\");\n\n //PARSER DE JSON\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(input));\n Gson gson = new Gson();\n Container container = gson.fromJson(bufferedReader, Container.class);\n newsLeida = container.getNewsList().get(0);\n\n }\n catch (Exception e){\n e.printStackTrace();\n }\n\n\n return newsLeida;\n }", "private void urlMethods(String URL, final String intUrls) {\n Utils.get(URL, null, new JsonHttpResponseHandler() {\n @Override\n public void onStart() {\n progressDialog.show();\n progressDialog.setMessage(\"Connecting to Server ...\");\n\n }\n\n\n @Override\n public void onSuccess(int statusCode, Header[] headers, JSONArray timeline) {\n // Pull out the first event on the public timeline\n try {\n\n if (timeline == null && timeline.length() <= 0) {\n filMthd();\n return;\n\n } else if (intUrls.equalsIgnoreCase(Utils.URL_POSCLIENT)) {\n whID = timeline.getJSONObject(0).getString(\"wh_id\");\n groupCode = timeline.getJSONObject(0).getString(\"group_code\");\n Utils.saveString(BackgrodBaseActivity.this, timeline.getJSONObject(0).getString(\"wh_id\").toString(), \"wh_id\");\n\n // String[] xyz = {\"company_name\", \"wh_name\", \"wh_id\", \"group_code\", \"tax_type\",\"tax_per\", \"curr_code\", \"pymt_code\", \"header_info\", \"footer_info\", \"absorb_tax\"};\n Utils.saveJSONArray(BackgrodBaseActivity.this, \"server\", \"key\", timeline);\n\n Utils.saveMap(getApplicationContext(), Utils.jsonToMap(timeline.getJSONObject(0)), \"getPOSClient\");\n Log.d(\"saved\", \"\" + whID);\n\n } else if (intUrls.equalsIgnoreCase(\"woImg\")) {\n jsBtnWoimg = new JSONArray();\n jsBtnWoimg = timeline;\n\n //Utils.saveJSONArray(getApplicationContext(), \"pages\", \"1\", timeline);\n\n }\n\n\n } catch (Exception exception) {\n Log.d(\"this error\", \"\" + exception);\n\n }\n\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {\n // Utils.alertDialogShow(getApplicationContext(), \"Error\", \" Connection refused\", 0);\n }\n\n\n @Override\n public void onFinish() {\n progressDialog.dismiss();\n if (intUrls.equalsIgnoreCase(Utils.URL_POSCLIENT)) {\n\n String urlMtds = Utils.INTIALSTRI + Utils._MEALGROUP + Utils.COMPCODE + \"&whid=\" + Utils.getString(BackgrodBaseActivity.this, \"wh_id\") + \"&mealid=\" + MealID + \"&regcode=\" + tsdArr.get(4) + \"&date=\" + Utils.currenDate();\n Log.d(\"urrrl2\", urlMtds);\n frstUrl(urlMtds, \"Meal GROUP\");\n } else if (intUrls.equalsIgnoreCase(\"woImg\")) {\n String urlMtds = Utils.INTIALSTRI + Utils._FULLDETAILS + Utils.COMPCODE + \"&paramgroup_code=\" + MealGroup;\n frstUrl(urlMtds, \"FULL DETAILS\");\n Log.d(\"urrrl3\", urlMtds);\n }\n\n\n }\n });\n\n\n }", "@Override\n\t\tprotected String doInBackground(String... url) {\n\t\t\tString output = \"\";\n\t\t\tHttpClient httpclient = new DefaultHttpClient();\n\t\t\tHttpResponse response;\n\t\t\ttry {\n\t\t\t\tresponse = httpclient.execute(new HttpGet(url[0]));\n\t\t\t\tStatusLine statusLine = response.getStatusLine();\n\t\t\t\tif (statusLine.getStatusCode() == HttpStatus.SC_OK) {\n\t\t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\t\t\t\tresponse.getEntity().writeTo(out);\n\t\t\t\t\tout.close();\n\t\t\t\t\toutput = out.toString();\n\t\t\t\t} else {\n\t\t\t\t\t// Close the connection\n\t\t\t\t\tresponse.getEntity().getContent().close();\n\t\t\t\t\tthrow new IOException(statusLine.getReasonPhrase());\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.e(\"GetJsonTask\",\n\t\t\t\t\t\t\"Could not get the data. This is the error message: \"\n\t\t\t\t\t\t\t\t+ e.getMessage());\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tjson = output;\n\t\t\treturn output;\n\t\t}", "@Override\n protected String doInBackground(String... string) {\n try {\n myurl = new URL(string[0]);\n httpURLConnection = (HttpURLConnection) myurl.openConnection();\n httpURLConnection.setRequestProperty(\"Accept\", \"application/json\");\n httpURLConnection.setRequestProperty(\"user-key\", \"e46faab9e2e5d0e8f5d57c4be68c269d\");\n httpURLConnection.connect();\n\n inputStream = httpURLConnection.getInputStream();\n inputStreamReader = new InputStreamReader(inputStream);\n bufferedReader = new BufferedReader(inputStreamReader);\n line = bufferedReader.readLine();\n result = new StringBuilder();\n while (line != null) {\n result.append(line);\n line = bufferedReader.readLine();\n }\n return result.toString();\n\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n return null;\n }", "public void downloadJSON(String url){\n //Build request for raw JSON data\n StringRequest jsonRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n try {\n //When data is received, convert to JSONObject and try to parse\n jsonResponse = new JSONObject(response);\n parseJSON(jsonResponse);\n } catch (JSONException JSONE) {\n //Print error if there was one\n JSONE.printStackTrace();\n ErrorUtils.errorDialog(BookDetailsActivity.this, \"Data Error\", \"There was an error with the data format. Please try again later.\");\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n //Print error\n ErrorUtils.errorDialog(BookDetailsActivity.this, \"Could not connect to the server\", \"Could not connect to the server at this time, please try again later.\");\n }\n });\n //Start the JSON request\n queue.add(jsonRequest);\n }", "private HashMap<String, JSONObject> search (String city, String state, String zip, String specialty) {\r\n\r\n //results are put in a hashmap with doctors' names as keys and their information as values\r\n HashMap<String,JSONObject> results = new HashMap<>();\r\n Timestamp timestamp = null;\r\n int number = 0;\r\n int code = 0;\r\n try {\r\n //timestamp of when the request is sent\r\n timestamp = new Timestamp(System.currentTimeMillis());\r\n //replace space in strings with +\r\n specialty = specialty.replaceAll(\" \", \"+\");\r\n city = city.replaceAll(\" \", \"+\");\r\n // Make call to a particular server URL\r\n URL url = new URL(\"https://chi-ngo-coolio-task2.herokuapp.com/?city=\" + city + \"&state=\" + state\r\n + \"&zip=\" + zip + \"&specialty=\" + specialty);\r\n //use this URL if task 2 fails\r\n //URL url = new URL(\"https:chi-ngo-coolio.herokuapp.com/?city=\" + city + \"&state=\" + state + \"&zip=\" + zip + \"&specialty=\" + specialty);\r\n /*\r\n * Create an HttpURLConnection. This is useful for setting headers\r\n * and for getting the path of the resource that is returned (which\r\n * may be different than the URL above if redirected).\r\n * HttpsURLConnection (with an \"s\") can be used if required by the site.\r\n */\r\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\r\n conn.setRequestMethod(\"GET\");\r\n code = conn.getResponseCode();\r\n //if the connection was successful\r\n if (code == 200) {\r\n //read all the response\r\n BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));\r\n String str;\r\n StringBuffer content = new StringBuffer();\r\n while ((str = in.readLine()) != null) {\r\n content.append(str);\r\n }\r\n in.close();\r\n //make a new parser to parse the response string into a JSONObject\r\n JSONParser p = new JSONParser();\r\n JSONObject response = (JSONObject) p.parse(content.toString());\r\n System.out.println(response.toJSONString());\r\n JSONArray doctors = (JSONArray) response.get(\"doctors\");\r\n //add each doctor and their information to the hashmap with their full names as keys\r\n for (int i = 0; i < doctors.size(); i++) {\r\n JSONObject info = (JSONObject) doctors.get(i);\r\n results.put((String) info.get(\"full_name\"),info);\r\n }\r\n //get the number of doctors found\r\n number = doctors.size();\r\n }\r\n //close the connection\r\n conn.disconnect();\r\n }\r\n // handle exceptions\r\n catch (MalformedURLException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n //send a POST request for logging data\r\n try {\r\n //convert the timestamp object to a string\r\n String time = timestamp.toString();\r\n //replace all spaces with +\r\n time = time.replaceAll(\" \", \"+\");\r\n /*\r\n * Create an HttpURLConnection. This is useful for setting headers\r\n * and for getting the path of the resource that is returned (which\r\n * may be different than the URL above if redirected).\r\n * HttpsURLConnection (with an \"s\") can be used if required by the site.\r\n */\r\n //connect to the server URL with a POST request for data logging to MongoDB\r\n URL url2 = new URL(\"https://chi-ngo-coolio-task2.herokuapp.com/?city=\" + city + \"&state=\" + state + \"&zip=\"\r\n + zip + \"&specialty=\" + specialty + \"&timestamp=\" + time + \"&number=\" + number + \"&code=\" + code);\r\n HttpURLConnection connection = (HttpURLConnection) url2.openConnection();\r\n connection.setRequestMethod(\"POST\");\r\n connection.setRequestProperty(\"Accept\", \"text/plain\");\r\n connection.getResponseCode();\r\n //close the connection\r\n connection.disconnect();\r\n } catch (MalformedURLException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n //return the result hashmap\r\n return results;\r\n }", "public String parseJSON(String urlString, String zipString, JsonElement root){\n String Data = \"nullJSONData\";\n\n JsonObject rootobj = root.getAsJsonObject(); //May be an array, may be an object. \n \n \n // if url string is for zipcode website\n // parse rootobj for zipcode \n if (urlString == \"http://freegeoip.net/json/\"){\n String zipcode = rootobj.get(\"zip_code\").getAsString(); //just grab the zipcode \n \n Data = \"The zipcode is \" + zipcode;\n }\n \n \n // if message from user contained a zip code\n // parse rootobj for weather data\n if (zipString != \"null Zip\"){\n \n String message = rootobj.get(\"message\").getAsString(); //just grab the message\n Double listCount = rootobj.get(\"cnt\").getAsDouble(); //just grab the message\n JsonArray JSONdataArray = rootobj.get(\"list\").getAsJsonArray(); //grab list array, which is \n \n // the first item in the array is a JSON Object\n // this first object has the tempurate stored in a nested object called main\n JsonObject firstObject = JSONdataArray.get(0).getAsJsonObject();\n JsonObject mainObject = firstObject.get(\"main\").getAsJsonObject();\n String temperature = mainObject.get(\"temp\").getAsString();\n Data = \"The tempurature is \" + temperature + \" degrees Fahrenheit.\"; \n \n }\n \n\n // parse rootobj for number of humans in space\n if (urlString == \"http://api.open-notify.org/astros.json/\"){\n \n String number = rootobj.get(\"number\").getAsString(); //just grab the message\n Data = \"There are currently \" + number + \" humans ins space.\"; \n\n \n } \n \n return Data;\n \n }", "public interface URLs\r\n{\r\n String BASIC_URL = \"http://api.timetable.asia/\";\r\n\r\n String KEY = \"221b368d7f5f597867f525971f28ff75\";\r\n\r\n String COMPANY_URL = \"operator.json\";\r\n String LANGUAGE_URL = \"lang.json\";\r\n String VEHICLE_URL = \"fleet.json\";\r\n String ROUTE_URL = \"route.json\";\r\n String TRIP_URL = \"trip.json\";\r\n String COMMIT_URL = \"commit.json\";\r\n String CURRENT_STATIONS_URL = \"station.json\";\r\n public static final String LANGPACK_URL = \"langpack.json\";\r\n}", "public String setUrl() throws JSONException {\n url = baseUrl + searchName;\n for(int i = 0; i < typesCheckList.size(); i++) {\n if(typesObj.has(typesCheckList.get(i))){\n url += typesObj.getString(typesCheckList.get(i));\n }\n }\n if(V)System.out.println(url);\n return url;\n }", "@Override\n\t\tprotected List<List<HashMap<String, String>>> doInBackground(String... params) {\n\t\t\treturn downloadUrl(params[0]);\n\t\t}", "protected String fetchJSON(String requestedUrl) throws IOException {\n Log.d(this.TAG, \"Hitting URL \" + requestedUrl);\n URL url = new URL(requestedUrl);\n HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n /* TODO: Set connection headers (User-agent, etc) */\n\n int status = connection.getResponseCode();\n if (status != HttpURLConnection.HTTP_OK) {\n throw new IOException(\"Bad URL: \" + requestedUrl);\n }\n\n InputStream in = connection.getInputStream();\n BufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n StringBuilder stringBuilder = new StringBuilder();\n String line;\n\n while ((line = reader.readLine()) != null) {\n stringBuilder.append(line);\n }\n\n connection.disconnect();\n return stringBuilder.toString();\n }", "public static void main(String[] args) throws JsonProcessingException {\n\t\tString txt= \"5C:A8:6A:ED:65:2D,B4:82:C5:00:22:DB,B4:82:C5:51:C2:30,\\\"UREC\\\",2097154,4,14,-59,6,2,Deauth by Inactivity or Many Retries,1517391829738\";\n\t\tString[] spliturl = txt.split(\",\");\n\t\tSystem.out.println(spliturl[0]);\n\t\tSystem.out.println(spliturl[4]);\n\t\tSystem.out.println(spliturl[5]);\n\t}", "public static void main(String[] args) throws IOException {\n\t\tURL url = new URL(\"http://jsonplaceholder.typicode.com/users\");\n\n\t\tHttpURLConnection connection = null;\n\n\t\ttry {\n\t\t\tconnection = (HttpURLConnection) url.openConnection();\n\t\t\tconnection.setRequestMethod(\"GET\");\n\t\t\tconnection.setRequestProperty(\"Content-Type\", \"application/json\");\n\n\t\t\t// devo settare lo User-Agent per evitare un HTTP error code 403\n\t\t\tconnection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11\");\n\n\t\t\tconnection.setRequestProperty(\"charset\", \"utf-8\");\n\t\t\tconnection.connect();\n\n\t\t\tlogger.info(connection.getContentType());\n\t\t\t//\t\t\t\tlogger.info(connection.getHeaderField(\"Content-Type\"));\n\n\t\t\tif (connection.getResponseCode() != 200) {\n\t\t\t\tthrow new RuntimeException(\"Failed : HTTP error code : \" + connection.getResponseCode());\n\t\t\t}\n\n\t\t\tif (connection.getRequestProperty(\"Content-Type\") != \"application/json\") {\n\t\t\t\tthrow new RuntimeException(\"Failed : Content-Type : \" + connection.getRequestProperty(\"Content-Type\"));\n\t\t\t}\n\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader((connection.getInputStream())));\n\n\t\t\tString str;\n\t\t\tStringBuffer stringBuffer = new StringBuffer();\n\t\t\twhile ((str = br.readLine()) != null) {\n\t\t\t\tstringBuffer.append(str);\n\t\t\t\tstringBuffer.append(\"\\n\");\n\t\t\t}\n\n\t\t\tstr = stringBuffer.toString();\n\t\t\tJSONParser parser = new JSONParser();\n\t\t\tObject obj = parser.parse(str);\n\t\t\tJSONArray msg = (JSONArray) obj;\n\n\t\t\tIterator<?> iterator = msg.iterator();\n\t\t\t\n//\t\t\tif(content == \"\"){\n\t\t\t\tObject a ;\n\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\ta=(Object)iterator.next();\n\t//\t\t\t\tlogger.info(\"A: \" +a.get(\"name\"));\n\t\t\t\t\tlogger.info(\"A: \" +a);\n\t\t\t\t}\n//\t\t\t}\n\t\t\t\n\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Errore: \" +e.getMessage());\n\t\t}finally{\n\t\t\tconnection.disconnect();\n\t\t}\n\n\t}", "public AsyncFlickrJSONData(String httpUrl){\n this.httpUrl = httpUrl;\n }", "public interface Url {\n String BASE_URL = \"http://v3.wufazhuce.com:8000/api/\";\n\n //获取最新 idlist(返回的字段用于下个接口获取某一天的onelist,一共10个返回值,也就是10天的数据)\n String ID_LIST = \"onelist/idlist/\";\n //获取某天的 onelist\n String ONE_LIST = \"onelist/\";\n\n //阅读列表\n String READ_LIST = \"channel/reading/more/0\";\n //音乐列表\n String MUSIC_LIST = \"channel/music/more/0\";\n //影视列表\n String MOVIE_LIST = \"channel/movie/more/0\";\n\n //阅读相关详情\n String READ_DETAIL = \"essay/\";\n //阅读详情(问答)\n String READ_QUESTION = \"question/itemId\";\n //音乐详情\n String MUSIC_DETAIL = \"music/detail/\";\n //影视详情\n String MOVIE_DETAIL = \"movie/itemId/story/1/0\";\n //影视详情(图片和视频)\n String MOVIE_DETAIL_PIC = \"movie/detail/itemId\";\n\n //阅读评论\n String READ_COMMENT = \"comment/praiseandtime/essay/\";\n //音乐评论\n String MUSIC_COMMENT = \"comment/praiseandtime/music/\";\n //影视评论\n String MOVIE_COMMENT = \"comment/praiseandtime/movie/itemId/0\";\n\n //http://v3.wufazhuce.com:8000/api/praise/add?channel=update&source_id=9598&source=summary&version=4.0.7&\n //uuid=ffffffff-a90e-706a-63f7-ccf973aae5ee&platform=android\n\n // 点赞\n String MUSIC_PRAISE = \"praise/add\";\n}", "@Override\n protected JSONObject doInBackground(String... urls) {\n try {\n // Make URL to send the request to\n URL url = new URL(BASE_URL + urls[0]);\n // Open up the connection to the URL\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\n con.setRequestMethod(\"POST\");\n con.setRequestProperty(\"Content-Type\",\n \"application/x-www-form-urlencoded\");\n con.setRequestProperty(\"Content-Length\",\n Integer.toString(urlParameters.getBytes().length));\n con.setRequestProperty(\"Content-Language\", \"en-US\");\n con.setUseCaches(false);\n con.setDoInput(true);\n con.setDoOutput(true);\n\n // Send request\n DataOutputStream wr = new DataOutputStream(con.getOutputStream ());\n wr.writeBytes(urlParameters);\n wr.flush ();\n wr.close ();\n\n // Get response\n InputStream is = con.getInputStream();\n BufferedReader rd = new BufferedReader(new InputStreamReader(is));\n String line;\n StringBuilder response = new StringBuilder();\n while((line = rd.readLine()) != null) {\n response.append(line);\n response.append('\\n');\n }\n rd.close();\n\n // Parse response into a JSONObject\n JSONObject result = new JSONObject(response.toString());\n return result;\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "public static String leituraJSON(String urlItens) {\n\n BufferedReader reader;\n String line;\n StringBuilder responseContent = new StringBuilder();\n\n try {\n URL url = new URL(urlItens);\n conn = (HttpURLConnection) url.openConnection();\n\n //request setup\n conn.setRequestMethod(\"GET\");\n conn.setConnectTimeout(5000);\n conn.setReadTimeout(5000);\n\n int status = conn.getResponseCode();\n // Se o status for 200 == conexão feita com sucesso\n\n if (status > 299) {\n reader = new BufferedReader(new InputStreamReader(conn.getErrorStream()));\n } else {\n reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));\n }\n while ((line = reader.readLine()) != null) {\n responseContent.append(line);\n }\n reader.close(); // encerra o buffer\n\n } catch (IOException e) {\n } finally {\n conn.disconnect(); // fecha a conexão\n }\n\n return responseContent.toString();\n }", "private static String getList(String responseString) throws JSONException {\n\t\tJSONObject array = new JSONObject(responseString);\n\t\treturn array.getString(\"url\");\n\t}", "@Override protected String doInBackground(String... params) {\r\n String returnVal = \"\";\r\n switch ( params[0] ) {\r\n case \"getIcyMetaData\":\r\n try {\r\n java.util.HashMap<String, String> icyMetaData = commonUtil.getIcyMetaData(params[1]);\r\n if ( icyMetaData.get(\"icy-metaint\")==null ) {\r\n returnVal = \"ERROR: ICY metadata not supported.\";\r\n } else {\r\n String streamTitle = icyMetaData.get(\"StreamTitle\"); if (streamTitle!=null && streamTitle.length()>0) returnVal = streamTitle; \r\n String icyName = icyMetaData.get(\"icy-name\"); if (icyName!=null && icyName.length()>0) returnVal = \"[\" + icyName + \"] \" + returnVal;\r\n }\r\n } catch (Exception e) {\r\n returnVal = \"ERROR: \" + e.getMessage();\r\n }\r\n break;\r\n case \"getMediaUrl\":\r\n returnVal = commonUtil.getMediaUrl2(params[1]);\r\n break;\r\n case \"wget\":\r\n java.util.List lines = commonUtil.wgets(params[1]);\r\n for (int i=0; i<lines.size(); i++)\r\n returnVal+=lines.get(i).toString().trim();\r\n break;\r\n default:\r\n String url = params[0];\r\n java.net.HttpURLConnection urlConn;\r\n try {\r\n //Open a new URL connection \r\n urlConn = (java.net.HttpURLConnection) (new java.net.URL(url)).openConnection();\r\n urlConn.setRequestMethod(\"GET\");\r\n // sets request headers \r\n //urlConn.setRequestProperty(\"Content-Type\", \"application/json\");\r\n //urlConn.setRequestProperty(\"Accept\", \"application/json\");\r\n returnVal += \"[HTTP \" + String.valueOf(urlConn.getResponseCode()) + \"]\";\r\n java.io.InputStream in;\r\n try {\r\n in = urlConn.getInputStream();\r\n } catch (Exception e) {\r\n returnVal += \"\\n\" + \"ERROR: \" + e.getMessage() + \"; url=\" + urlConn.getURL();\r\n return returnVal;\r\n }\r\n try {\r\n java.io.BufferedReader r = new java.io.BufferedReader(new java.io.InputStreamReader(\r\n new java.io.BufferedInputStream(in), java.nio.charset.StandardCharsets.UTF_8\r\n ));\r\n String line=null; while ((line=r.readLine())!=null) returnVal += \"\\n\" + line;\r\n } catch (Exception e) {\r\n returnVal += \"\\n\" + \"ERROR: \" + e.getMessage() + \"; url=\" + urlConn.getURL();\r\n } finally {\r\n urlConn.disconnect();\r\n }\r\n } catch (java.io.IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n return returnVal;\r\n }", "public static void main(String args[]) {\n try {\n URL url = new URL(USGS_REQUEST_URL);\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\n con.setRequestMethod(\"GET\");\n\n InputStream inputStream = con.getInputStream();\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);\n\n StringBuilder JSON_DATA = new StringBuilder();\n\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n\n while (true) {\n String line = bufferedReader.readLine();\n if(line == null)\n break;\n JSON_DATA.append(line);\n }\n\n System.out.println(JSON_DATA);\n con.disconnect();\n }\n catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "public interface RequestURLs {\n String DEFAULT_URL = \"http://aperturedev.co.kr:21002/petcommunity/\";\n\n /*\n 매칭 서비스 관련\n */\n String GET_PET_TYPES = DEFAULT_URL + \"services/get-pettypes.php\"; // 강아지 종을 가져온다.\n String REGIST_MATCH_PET = DEFAULT_URL + \"matching/regist-new-pet.php\"; // 팻 등록 실시\n String MATCHING_OTHER_PET = DEFAULT_URL + \"matching/matching.php\"; // 매칭할 팻을 하나 가져옵니다.\n\n /*\n 사용자 정보 관련\n */\n String GET_USER_INFO = DEFAULT_URL + \"users/get-info.php\"; // UUID -> 사용자 정보\n String REGIST_SERVICE = DEFAULT_URL + \"users/signup.php\"; // 회원가입을 실시한다.\n String IS_REGIST_SERVICE = DEFAULT_URL + \"/users/is-registed.php\"; // 회원가입 되어 있는지 확인한다.\n String LOGIN_SERVICE = DEFAULT_URL + \"users/signin.php\"; // 로그인 처리한다.\n\n\n\n\n}", "void mo59932a(String str, JSONObject jSONObject);", "public static void main(String[] args) {\n\t\tString url = \"http://qt.some.co.kr/TrendMap/JSON/ServiceHandler?lang=ko&source=twitter&startDate=20190101&endDate=20190924&keyword=%EC%95%84%EC%9D%B4%ED%8F%B0&topN=100&cutOffFrequencyMin=0&cutOffFrequencyMax=0&period=2&invertRowCol=on&start_weekday=SUNDAY&categorySetName=SM&command=GetAssociationTransitionBySentiment\";\n\t\tInputStream is = null;\n\t\ttry {\n\t\t\tis = new URL(url).openStream(); // URL객체로의 스트림 열기\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(is, \"UTF-8\")); // 받는 스트림을 버퍼에 저장\n\t\t\tString str;\n\t\t StringBuffer buffer = new StringBuffer(); // 문자열 연산이나 추가시 객체 공간을 유연하게 동작하기 위함\n\t\t while ((str = br.readLine()) != null) {\n\t\t buffer.append(str);\n\t\t }\n\t\t String b_str = buffer.toString();\n\t\t //System.out.println(\"buffer에 저장된 데이터 : \" + b_str);\n\t\t JSONParser jsonParser = new JSONParser();\n\t\t JSONObject jsonObject = (JSONObject) jsonParser.parse(b_str); // jSONObject 형태로 꺼내와야 하기 때문에 형 변형\n\t\t //System.out.println(\"1번째 jsonObejct = \" + jsonObject);\n\t\t JSONArray jsonArray = (JSONArray) jsonObject.get(\"rows\"); // key값이 rows인 데이터들을 JSONArray에 담는다\n\t\t //System.out.println(\"2번째 jsonArray = \" + jsonArray);\n\t\t for(int i=0; i<jsonArray.size(); i++) { // JSONArray 사이즈 만큼 반복\n\t\t \tJSONObject dataObject = (JSONObject) jsonArray.get(i);\n\t\t \t//System.out.println(\"3번째 jsonObject = \"+ \"(\"+i+\")+\"+ dataObject); // 각각의 데이터를 꺼내오기 위함\n\t\t \tSystem.out.println((i+1)+\"번째 날짜 : \"+dataObject.get(\"date\"));\n\t\t \tSystem.out.println((i+1)+\"번째 데이터 : \"+dataObject.get(\"아이폰\"));\n\t\t \tSystem.out.println(\"----------------------------\");\n\t\t \tJSONObject data = (JSONObject) dataObject.get(\"아이폰\");\n\t\t \tSystem.out.println(\"과연\"+data.get(\"negative\"));\n\t\t }\n\t\t} catch (Exception e) { \n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {is.close();} catch (IOException e) {e.printStackTrace();}\n\t\t}\n\t}", "void mo26099a(String str, JSONObject jSONObject);", "@Override\n\t\tprotected Void doInBackground( String... urls )\n\t\t{\n\t\t\tJsonObjectRequest jsonRequest = new JsonObjectRequest(\n\t\t\t\t\tRequest.Method.POST,\n\t\t\t\t\turls[ 0 ],\n\t\t\t\t\tnew JSONObject( params ),\t\t\t\t// Convert the supplied params to Json\n\t\t\t\t\tnew Response.Listener<JSONObject>()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onResponse( JSONObject response )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tjsonObject = response;\t\t\t// Set the field to the response\n\n\t\t\t\t\t\t\t// Display the first 500 characters of the response string.\n\t\t\t\t\t\t\tLog.i( LOG_TAG, \"Response is: \" + response.toString() );\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tnew Response.ErrorListener()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onErrorResponse( VolleyError error )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tjsonObject = null;\n\n\t\t\t\t\t\t\tLog.i( LOG_TAG, \"Request failed: \\n\" + error.getMessage() );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t// Add the request to the RequestQueue.\n\t\t\tqueue.add( jsonRequest );\n\n\t\t\treturn null;\n\n\t\t}", "protected abstract String getJobSubmitUrl(JsonObject build)\n throws IOException, UnsupportedEncodingException;", "@Override\n protected String[][] doInBackground(String... params) {\n if (params.length == 0) {\n return null;\n }\n\n String url = params[0];\n\n URL MovieRequestUrl = NetworkUtils.buildUrl(url);\n\n try {\n\n String jsonWeatherResponse = NetworkUtils\n .getResponseFromHttpUrl(MovieRequestUrl);\n\n\n String[][] simpleJsonWeatherData = OpenMovieJsonUtils\n .getSimpleMovieStringsFromJson(jsonWeatherResponse );\n\n return simpleJsonWeatherData;\n\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n\n }", "@Override\n public List<Story> loadInBackground() {\n // This method is called on a background thread and should generate a\n // new set of data to be delivered back to the client.\n String jsonDocumentAsString = \"{}\";\n\n // use URL to query API and return STRING(of JSON data)\n try {\n jsonDocumentAsString = makeHttpRequest(queryUrl);\n Log.v(LOG_TAG, \"HttpRequest done answer has size \" + jsonDocumentAsString.length());\n } catch (IOException e) {\n Log.e(LOG_TAG,\"HTTP error\", e);\n }\n\n // use STRING to pull out and DECODE JSON return ArrayList<Story>\n List<Story> listOfStory = QueryUtils.extractStories(jsonDocumentAsString);\n\n return listOfStory;\n }", "@Override\n protected LinkedHashMap<String, LinkedHashMap<String, Double>> doInBackground(String... strings) {\n if (strings.length == 0) {\n return null;\n }\n String fromCurrency = strings[0];\n String toCurrency = strings[1];\n\n URL requestUrl;\n requestUrl = NetworkUtils.buildUrl(fromCurrency, toCurrency);\n\n String responseFromUrl;\n LinkedHashMap<String, LinkedHashMap<String, Double>> resultFromJson;\n\n try {\n responseFromUrl = NetworkUtils\n .getResponseFromHttpUrl(requestUrl);\n\n\n resultFromJson\n = CryptoJsonUtils.getSimpleDataFromJson(responseFromUrl);\n return resultFromJson;\n\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n } catch (JSONException e) {\n e.printStackTrace();\n return null;\n }\n }", "public List<HashMap<String, String>> doInBackground(String... strings) {\n try {\n return new JsonParser().parseResult(new JSONObject(strings[0]));\n } catch (JSONException e) {\n e.printStackTrace();\n return null;\n }\n }", "private Map<String, String> populate(Map<String, String> argsMap) throws IOException, TaskExecutionException {\n\n SimpleHttpClient httpClient = SimpleHttpClient.builder(argsMap).build();\n try {\n String url = UrlBuilder.builder(argsMap).path(argsMap.get(\"location\")).build();\n Response response = httpClient.target(url).get();\n String responseBody = response.string();\n String header = response.getHeader(\"Content-Type\");\n\n Map<String, String> resultMap = null;\n if (header != null && header.contains(\"application/json\")) {\n resultMap = parsePlusStatsResult(responseBody);\n } else if (header != null && header.contains(\"text/plain\")) {\n resultMap = parseStubStatsResults(responseBody);\n } else {\n logger.error(\"Invalid content type [ \" + header + \" ] for URL \" + url);\n throw new TaskExecutionException(\"Invalid content type [ \" + header + \" ] for URL \" + url);\n }\n return resultMap;\n } finally {\n httpClient.close();\n }\n }", "@Override\n protected String doInBackground(String... params) {\n\n String uri = params[0];\n\n BufferedReader bufferedReader = null;\n try {\n URL url = new URL(uri);\n HttpURLConnection con = (HttpURLConnection) url.openConnection();//creating connection\n StringBuilder sb = new StringBuilder();\n\n bufferedReader = new BufferedReader(new InputStreamReader(con.getInputStream()));// getting the json string\n\n String json;\n json = bufferedReader.readLine();\n\n return json.trim(); //returning the json string\n\n }catch(Exception e){\n return null;\n }\n\n }", "@Override\n protected StringBuilder doInBackground(Void... voids) {\n try {\n URL url = new URL(\"https://api.nytimes.com/svc/books/v3/lists.json?\"+ \"list-name=\" + API_HARDCOVER_FICTION + \"&api-key=\" + API_KEY);\n HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();\n try {\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));\n StringBuilder stringBuilder = new StringBuilder();\n String line;\n while((line = bufferedReader.readLine()) != null) {\n stringBuilder.append(line).append(\"\\n\");\n }\n bufferedReader.close();\n return stringBuilder;\n }\n finally {\n httpURLConnection.disconnect();\n }\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "public String doInBackground(String... strings) {\n try {\n return HospitalMapsActivity.this.downloadUrl(strings[0]);\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "public void getJSON() throws JSONException {\n url = setUrl();\n System.out.println(\"after setAsyncUrl url = \" + url);\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(url)\n .build();\n client.newCall(request).enqueue(new Callback() {\n @Override\n public void onFailure(Call call, IOException e) {\n e.printStackTrace();\n }\n\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n if(response.isSuccessful()){\n jString = new String(response.body().string());\n if(V)System.out.println(\"jString = \" + jString);\n try {\n addSearchFragment(jString); // add retrieved search fragments to screen\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }\n });\n }", "@Override\n protected String doInBackground(String... url) {\n\n // For storing data from web service\n String data = \"\";\n\n try {\n // Fetching the data from web service\n data = downloadUrl(url[0]);\n Log.e(\"place json\", data);\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "private File downloadJSON(String urlString) throws IOException {\r\n\t\tString filename = \"\";\r\n\t\t\r\n\t\t//We choose to name the files as word_opensearch and word_wikipage, referring to the two File objects representing the JSONs we downloaded.\r\n\t\tif(urlString.contains(\"search\")) {\r\n\t\t\tfilename = \"JSON/\" + this.word + \"_opensearch.json\";\r\n\t\t} else {\r\n\t\t\tfilename = \"JSON/\" + this.word + \"_wikipage.json\";\r\n\t\t}\r\n\t\t\r\n\t\t//Constructing the File toReturn with the appropriate filename as checked above.\r\n\t\tFile toReturn = new File(filename);\r\n\t\t\r\n\t\t//This line deals with errors you recieve when dealing with how to fill whitespace when represented as a URL\r\n\t\tString messageText = URLEncoder.encode(this.word, \"UTF-8\");\r\n\t\t\r\n\t\t//Constructing the URL object from our long URL and converted text in message data\r\n\t\tURL website = new URL(urlString + messageText);\r\n\t\t\r\n\t\t//Write the bytes recieved from wikipedia's response to us opening a datastream\r\n\t\tReadableByteChannel rbc = Channels.newChannel(website.openStream());\r\n\t\tFileOutputStream fos;\r\n\t\ttry {\r\n\t\t\tfos = new FileOutputStream(toReturn);\r\n\t\t\tfos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);\r\n\t\t\tfos.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn toReturn;\r\n\t}", "private void parseJSON(String response)\n {\n try\n {\n // Using orj.json, get the file string and convert it to an object\n JSONObject object = (JSONObject) new JSONTokener(response).nextValue();\n\n // The Winnipeg Transit JSON results usually have nested values\n // We can identify the request by the first key of the first level\n\n // The method names() will retrieve an JSONArray with the key names\n JSONArray objectNames = object.names();\n\n // Retrieve the first key of the first level\n String firstKey = objectNames.getString(0);\n\n if (firstKey.equals(\"status\"))\n {\n parseStatus(object.getJSONObject(firstKey));\n }\n else if (firstKey.equals(\"stop-schedule\"))\n {\n parseStopSchedule(object.getJSONObject(firstKey));\n }\n }\n catch (JSONException e)\n {\n e.printStackTrace();\n }\n }", "@GET\n @Path(\"/multiget/{j}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response sayJsonHello(@PathParam(\"j\") String j) {\n\t StringTokenizer st = new StringTokenizer(j, \",\");\n String res = \"{\" + \"\\n\";\n\t while(st.hasMoreElements())\n\t {\n\t\t String next = st.nextToken();\n\t\t if(map.get(next) == null)\n\t\t return Response.status(404).build();\n\t\t res += next + \" : \" + map.get(next)+ \"\\n\";\n\t }\n\t res += \"}\";\n\t return Response.ok(res).build();\n }", "private List<URL> getJsonUrls(\n TreeLogger treeLogger,\n URL[] urls\n ) throws UnableToCompleteException {\n List<URL> jsonUrls = new ArrayList<>();\n for (URL url : urls) {\n\n jsonUrls.add(url);\n\n /**\n * check if filename is in format that could indicate that we have\n * url series <resourceName>_0.json\n */\n final RegExp compile = RegExp.compile(\"(.+)_(\\\\d+)\\\\.(\\\\w+)\");\n final MatchResult exec = compile.exec(url.getPath().substring(url.getPath().lastIndexOf(\"/\") + 1));\n if (exec != null) {\n final String filePrefix = exec.getGroup(1);\n int fileSequenceIndex = Integer.valueOf(exec.getGroup(2));\n final String fileExtension = exec.getGroup(3);\n URL siblingUrl = null;\n\n try {\n while (true) {\n String siblingUri = filePrefix + \"_\" + (++fileSequenceIndex) + \".\" + fileExtension;\n siblingUrl = new URL(url, siblingUri);\n siblingUrl.openStream();\n if (!jsonUrls.contains(siblingUrl)) {\n jsonUrls.add(siblingUrl);\n }\n }\n } catch (MalformedURLException e) {\n treeLogger.log(TreeLogger.ERROR, \"Reading of sibling texture atlas failed \", e);\n throw new UnableToCompleteException();\n } catch (IOException e) {\n if (Objects.equals(siblingUrl, url)) {\n treeLogger.log(TreeLogger.ERROR, \"Reading of sibling texture atlas failed \", e);\n throw new UnableToCompleteException();\n } else {\n // all siblings found process is finished\n }\n }\n }\n }\n return jsonUrls;\n }", "protected Object doInBackground(Object... objects) {\n\t\t\tString myurl = (String) objects[0];\n\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\tHttpClient client = new DefaultHttpClient();\n\t\t\tHttpGet httpGet = new HttpGet(myurl);\n\t\t\tSystem.out.println(\"Yay5\");\n\t\t\ttry {\n\t\t\t\tHttpResponse response = client.execute(httpGet);\n\t\t\t\tStatusLine statusLine = response.getStatusLine();\n\t\t\t\tint statusCode = statusLine.getStatusCode();\n\t\t\t\tSystem.out.println(\"Yay6\");\n\t\t\t\tif (statusCode == 200) {\n\t\t\t\t\tHttpEntity entity = response.getEntity();\n\t\t\t\t\tInputStream content = entity.getContent();\n\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(content));\n\t\t\t\t\tSystem.out.println(\"Yay7\");\n\t\t\t\t\tString line;\n\t\t\t\t\tList<String> diary = new ArrayList<String>();\n\t\t\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\t\t\tbuilder.append(line);\n\t\t\t\t\t\tdiary.add(line);\n\t\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Failed to download\");\n\t\t\t\t}\n\t\t\t} catch (ClientProtocolException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn builder.toString();\n\t\t}", "@Override\n protected String doInBackground(String... strings) {\n try {\n URL url = new URL(baseUrl + strings[0]);\n HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();\n\n connection.setRequestMethod(\"GET\");\n\n if(connection.getResponseCode() == 404) {\n mainInterface.onNoResultsFound();\n this.cancel(true);\n\n }\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));\n pokemons = new JSONArray(reader.readLine());\n System.out.println(\"tag00: \" + pokemons.getString(0));\n\n\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "@Override\n\t\tprotected ArrayList<Program> doInBackground(String... params) {\n\t\t\ttry {\n\t\t\t\tURL url = new URL(params[0]);\n\t\t\t\tHttpURLConnection con = (HttpURLConnection) url\n\t\t\t\t\t\t.openConnection();\n\t\t\t\tcon.setRequestMethod(\"GET\");\n\t\t\t\tcon.connect();\n\t\t\t\tint statusCode = con.getResponseCode();\n\t\t\t\tif (statusCode == HttpURLConnection.HTTP_OK) {\n\t\t\t\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\t\t\t\tnew InputStreamReader(con.getInputStream()));\n\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\tString line = reader.readLine();\n\t\t\t\t\twhile (line != null) {\n\t\t\t\t\t\tsb.append(line);\n\t\t\t\t\t\tline = reader.readLine();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn ContentUtil.ContentJSONParser.parsePrograms(sb\n\t\t\t\t\t\t\t.toString());\n\t\t\t\t}\n\n\t\t\t} catch (IOException | JSONException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "public static void main(String[] args){\n\t\tString s = HttpGet.sendGet(\"http://192.168.90.43/search_keyword.php\", \"platf=android&limit=30\");\r\n\t\tSystem.out.println(s);\r\n\t\ttry {\r\n\t\t\tHttpGet.jsonArr(HttpGet.jsonOb(s, \"result\"), \"default\");\r\n\t\t} catch (JSONException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n protected JSONObject doInBackground(String... url) {\n JSONObject data = null;\n\n try {\n // Fetching the data from web service\n data = new NetworkManager().makeHttpGetConnectionWithJsonOutput(url[0]);\n } catch (Exception e) {\n Log.d(\"Background Task\", e.toString());\n }\n return data;\n }", "void mo16412a(String str, JSONObject jSONObject);", "public void submitRequest(String location, WebViewModel vmodel) {\n String weatherUrl = \"https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/\" + location + \"?key=QZ2CJDXT7CYASXM6598KXSPDX\";\n //URL below is free API testing\n //String weatherUrl = \"https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/%22%20+%20location%20+%20%22?key=QZ2CJDXT7CYASXM6598KXSPDX\";\n\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest\n (Request.Method.GET, weatherUrl, null, new Response.Listener<JSONObject>() {\n\n @RequiresApi(api = Build.VERSION_CODES.N)\n @Override\n public void onResponse(JSONObject response) {\n String cityName = \"\";\n String countryName = \"\";\n String time = \"\";\n String temperature = \"\";\n String maxTemp = \"\";\n String minTemp = \"\";\n String skyCondition = \"\";\n String humidity = \"\";\n String tomorrow = \"\";\n String tonight = \"\";\n JSONArray daysArray;\n SimpleDateFormat dateProperFormat;\n\n try {\n location_splicer(response.getString(\"resolvedAddress\"));\n } catch(JSONException e) {\n System.out.println(\"Error gathering location\");\n }\n try {\n cityName = cityName + cityName_holder;\n } catch (Exception e) {\n System.out.println(\"Error gathering cityName\");\n }\n try {\n countryName = countryName + countryName_holder;\n } catch (Exception e) {\n System.out.println(\"Error gathering countryName\");\n }\n\n //Let's get weather objects for each day.\n try {\n daysArray = response.getJSONArray(\"days\");\n } catch (JSONException e) {\n e.printStackTrace();\n daysArray = null;\n System.out.println(\"ERROR DAYSARRAY\");\n }\n\n try {\n Date currentTime = Calendar.getInstance().getTime();\n Locale locale = Locale.getDefault();\n dateProperFormat =\n new SimpleDateFormat (\"yyyy-MM-dd\", locale);\n\n time = daysArray.getJSONObject(0).getString(\"datetime\");\n\n }catch (JSONException e) {\n System.out.println(\"Error gathering time\");\n }\n\n try {\n temperature = daysArray.getJSONObject(0).getString(\"temp\");\n //temperature = response.getJSONObject(\"currentConditions\").getString(\"temp\");\n if (temperature.length() > 2) {\n temperature = temperature.substring(0,2);\n }\n //temperature = response.getJSONArray(\"days\").getJSONObject(0).getString(\"temp\");\n }catch (JSONException e) {\n System.out.println(\"Error gathering temperature\");\n }\n try {\n maxTemp = daysArray.getJSONObject(0).getString(\"tempmax\");\n } catch (JSONException e) {\n System.out.println(\"Error getting max temperature\");\n }\n try {\n minTemp = daysArray.getJSONObject(0).getString(\"tempmin\");\n } catch (JSONException e) {\n System.out.println(\"Error getting max temperature\");\n }\n try {\n skyCondition = daysArray.getJSONObject(0).getString(\"icon\");\n\n //response.getJSONObject(\"currentConditions\").getString(\"conditions\");\n } catch (JSONException e) {\n System.out.println(\"Error gathering conditions\");\n }\n try {\n humidity = daysArray.getJSONObject(0).getString(\"humidity\");\n } catch (JSONException e) {\n System.out.println(\"Error gathering humidity\");\n }\n try {\n JSONArray hours = daysArray.getJSONObject(0).getJSONArray(\"hours\");\n tonight = \"unknown\";\n for (int i = 0; i < hours.length(); i++) {\n if (hours.getJSONObject(i).getString(\"datetime\").equals(\"23:00:00\")) {\n tonight = hours.getJSONObject(i).getString(\"temp\");\n }\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n try {\n tomorrow = daysArray.getJSONObject(1).getString(\"tempmax\");\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n\n WeatherReport newReport = new WeatherReport(cityName, countryName);\n\n newReport.updateWeatherReport(time, temperature, condition_parcer(skyCondition), humidity, maxTemp, minTemp, tomorrow, tonight);\n System.out.println(\"***JSON DATA***\");\n System.out.println(time);\n System.out.println(cityName);\n System.out.println(countryName);\n System.out.println(temperature);\n System.out.println(skyCondition);\n System.out.println(newReport.getHumidity());\n vmodel.addWeatherReport(newReport, context);\n System.out.println(\"Checking vmodel: \" +\n vmodel.getRecentReport().getLocationName_city() +\n \" is set as current city\");\n\n }\n }, error -> System.out.println(\"ERROR GETTING WEATHER\"));\n\n\n // Access the RequestQueue through your singleton class.\n this.addToRequestQueue(jsonObjectRequest);\n\n }", "public static void main(String[] args) throws JSONException {\n\t\t/*\n\t\t TODO CA the following is a test case! make it one, with some desc!\n\t\t * String buid = \"username_1373876832005\"; String pois_to =\n\t\t * \"poi_064f4a01-07bd-45fa-9579-63fa197d3d90\"; String coordinates_la =\n\t\t * \"35.14414934169342\"; String coordinates_lo = \"33.41130472719669\"; String\n\t\t * floor = \"0\"; String pois_from = \"poi_88a34fd5-75bd-4601-81dc-fe5aef69bd3c\";\n\t\t */\n\n\t\tString response;\n\n\t\tread_paramenters();\n\t\tif (access_token == null || host == null || port == null || cache == null || access_token.isEmpty()\n\t\t\t\t|| host.isEmpty() || port.isEmpty() || cache.isEmpty()) {\n\t\t\tSystem.out.println(\"Make sure that file \" + parametersFilename + \" is in the correct format!\");\n\t\t\tSystem.out.println(\"The format of the file is:\");\n\t\t\tSystem.out.println(\"host ap-dev.cs.ucy.ac.cy\");\n\t\t\tSystem.out.println(\"port 43\");\n\t\t\tSystem.out.println(\"cache res/\");\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"access_token <api_key> [The API key has be generated based on your google account through the anyplace architect]\");\n\t\t\tSystem.exit(0);\n\t\t}\n\n\t\tif (args.length == 0) {/* Menu of options is shown if no arguments are given. */\n\t\t\tSystem.out.println(\"Please use one of the available options available options:\");\n\n\t\t\tSystem.out.println(\"Navigation\");\n\t\t\tSystem.out.println(\"----------\");\n\t\t\tSystem.out.println(\"-poiDetails: Get Point of Interest details.\");\n\t\t\tSystem.out.println(\"-navigationXY: Get Navigation instructions from a given\tlocation to a POI.\");\n\t\t\tSystem.out.println(\"-navPoiToPoi: Get Navigation instructions between 2 POIs\");\n\n\t\t\tSystem.out.println(\"\\nMapping(Public)\");\n\t\t\tSystem.out.println(\"---------------\");\n\t\t\tSystem.out.println(\"-buildingAll: Get all annotated buildings.\");\n\t\t\tSystem.out.println(\"-buildingsByCampus: Get all buildings for a campus.\");\n\t\t\tSystem.out.println(\"-buildingsByBuildingCode: Get all buildings with the same code.\");\n\t\t\tSystem.out.println(\"-nearbyBuildings: Get annotated buildings near you (50 meters radius).\");\n\t\t\tSystem.out.println(\"-allBuildingFloors: Get all floors of a building.\");\n\t\t\tSystem.out.println(\"-allBuildingPOIs: Get all POIs inside a building.\");\n\t\t\tSystem.out.println(\"-allBuildingFloorPOIs: Get all POIs inside a floor.\");\n\t\t\tSystem.out.println(\"-connectionsByFloor: Get all POI connections inside a floor.\");\n\t\t\tSystem.out.println(\"-heatmapByBuildingFloor: Get all positions with their respective Wi-Fi radio measurements.\");\n\n\t\t\tSystem.out.println(\"\\nBlueprints\");\n\t\t\tSystem.out.println(\"----------\");\n\t\t\tSystem.out.println(\"-floor64: Downloads the floor plan in a base64 png format (w/o prefix).\");\n\t\t\tSystem.out.println(\"-floortiles: Fetches the floor plan tiles zip link.\");\n\n\t\t\tSystem.out.println(\"\\nPosition\");\n\t\t\tSystem.out.println(\"--------\");\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"-radioByCoordinatesFloor: Radiomap using all the entries near the coordinate parameters.\");\n\t\t\tSystem.out.println(\"-radioBuidFloor: Radiomap based on building and floor.\");\n\t\t\tSystem.out.println(\"-radioBuidFloorRange: Radiomap by limiting the range.\");\n\t\t\tSystem.out.println(\"-estimatePosition: Estimate the location of the user.\");\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"-estimatePosOffline: Estimate the location of the user offline. Needs the radiomap file\");\n\n\t\t} else {\n\t\t\tAnyplace client = new Anyplace(host, port, cache);\n\n\t\t\tif (args[0].equals(\"-poiDetails\")) {\n\t\t\t\tif (args.length != 2) {\n\t\t\t\t\tSystem.out.println(\"Usage: -poiDetails <pois>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString pois = args[1];\n\t\t\t\tresponse = client.poiDetails(access_token, pois);\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-navigationXY\")) {\n\t\t\t\tif (args.length != 6) {\n\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t.println(\"Usage: -navigationXY <buid> <floor> <pois_to> <coordinates_la> <coordinates_lo>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString buid = args[1];\n\t\t\t\tString floor = args[2];\n\t\t\t\tString pois_to = args[3];\n\t\t\t\tString coordinates_la = args[4];\n\t\t\t\tString coordinates_lo = args[5];\n\t\t\t\tresponse = client.navigationXY(access_token, pois_to, buid, floor, coordinates_la, coordinates_lo);\n\t\t\t\tSystem.out.println(response + \"\\n\"); /* .substring(0, 100) */\n\t\t\t} else if (args[0].equals(\"-navPoiToPoi\")) {\n\t\t\t\tif (args.length != 3) {\n\t\t\t\t\tSystem.out.println(\"Usage: -navPoiToPoi <pois_from> <pois_to>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString pois_from = args[1];\n\t\t\t\tString pois_to = args[2];\n\t\t\t\tresponse = client.navigationPoiToPoi(access_token, pois_to, pois_from);\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-buildingAll\")) {\n\t\t\t\tresponse = client.buildingAll();\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-buildingsByCampus\")) {\n\t\t\t\tif (args.length != 2) {\n\t\t\t\t\tSystem.out.println(\"Usage: -buildingsByCampus <cuid>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString cuid = args[1];\n\t\t\t\tresponse = client.buildingsByCampus(cuid);\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-buildingsByBuildingCode\")) {\n\t\t\t\tif (args.length != 2) {\n\t\t\t\t\tSystem.out.println(\"Usage: -buildingsByBuildingCode <bucode>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString bucode = args[1];\n\t\t\t\tresponse = client.buildingsByBuildingCode(bucode);\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-nearbyBuildings\")) {\n\t\t\t\tif (args.length != 3) {\n\t\t\t\t\tSystem.out.println(\"Usage: -nearbyBuildings <coordinates_lat> <coordinates_lon>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString coordinates_lat = args[1];\n\t\t\t\tString coordinates_lon = args[2];\n\t\t\t\tresponse = client.nearbyBuildings(access_token, coordinates_lat, coordinates_lon);\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-allBuildingFloors\")) {\n\t\t\t\tif (args.length != 2) {\n\t\t\t\t\tSystem.out.println(\"Usage: -allBuildingFloors <buid>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString buid = args[1];\n\t\t\t\tresponse = client.allBuildingFloors(buid);\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-allBuildingPOIs\")) {\n\t\t\t\tif (args.length != 2) {\n\t\t\t\t\tSystem.out.println(\"Usage: -allBuildingPOIs <buid>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString buid = args[1];\n\t\t\t\tresponse = client.allBuildingPOIs(buid);\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-allBuildingFloorPOIs\")) {\n\t\t\t\tif (args.length != 3) {\n\t\t\t\t\tSystem.out.println(\"Usage: -allBuildingPOIs <buid> <floor>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString buid = args[1];\n\t\t\t\tString floor = args[2];\n\t\t\t\tresponse = client.allBuildingFloorPOIs(buid, floor);\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-connectionsByFloor\")) {\n\t\t\t\tif (args.length != 3) {\n\t\t\t\t\tSystem.out.println(\"Usage: -connectionsByFloor <buid> <floor>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString buid = args[1];\n\t\t\t\tString floor = args[2];\n\t\t\t\tresponse = client.connectionsByFloor(buid, floor);\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-heatmapBuidFloor\")) {\n\t\t\t\tif (args.length != 3) {\n\t\t\t\t\tSystem.out.println(\"Usage: -heatmapBuidFloor <buid> <floor>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString buid = args[1];\n\t\t\t\tString floor = args[2];\n\t\t\t\tresponse = client.radioheatMapBuildingFloor(buid, floor);\n\t\t\t\tSystem.out.println(response + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-floor64\")) {\n\t\t\t\tif (args.length != 3) {\n\t\t\t\t\tSystem.out.println(\"Usage: -floor64 <buid> <floor>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString buid = args[1];\n\t\t\t\tString floor = args[2];\n\t\t\t\tresponse = client.floorplans64(access_token, buid, floor);\n\t\t\t\tSystem.out.println(response.substring(0, 100) + \"\\n\");\n\t\t\t} else if (args[0].equals(\"-floortiles\")) {\n\t\t\t\tif (args.length != 3) {\n\t\t\t\t\tSystem.out.println(\"Usage: -floortiles <buid> <floor>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString buid = args[1];\n\t\t\t\tString floor = args[2];\n\t\t\t\tresponse = client.floortiles(access_token, buid, floor);\n\t\t\t\tSystem.out.println(response + \"\\n\"); /* .substring(0, 100) */\n\t\t\t} else if (args[0].equals(\"-radioByCoordinatesFloor\")) {\n\t\t\t\tif (args.length != 4) {\n\t\t\t\t\tSystem.out.println(\"Usage: -radioByCoordinatesFloor <coordinates_lat> <coordinates_lon> <floor>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString coordinates_lat = args[1];\n\t\t\t\tString coordinates_lon = args[2];\n\t\t\t\tString floor = args[3];\n\t\t\t\tresponse = client.radioByCoordinatesFloor(access_token, coordinates_lat, coordinates_lon, floor);\n\t\t\t\tSystem.out.println(response + \"\\n\"); /* .substring(0, 100) */\n\t\t\t} else if (args[0].equals(\"-radioBuidFloor\")) {\n\t\t\t\tif (args.length != 3) {\n\t\t\t\t\tSystem.out.println(\"Usage: -radioBuidFloor <buid> <floor>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString buid = args[1];\n\t\t\t\tString floor = args[2];\n\t\t\t\tresponse = client.radioByBuildingFloor(access_token, buid, floor);\n\t\t\t\tSystem.out.println(response + \"\\n\"); /* .substring(0, 100) */\n\t\t\t} else if (args[0].equals(\"-radioBuidFloorRange\")) {\n\t\t\t\tif (args.length != 3) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\t\"Usage: -radioBuidFloorRange <buid> <foor> <coordinates_lat> <coordinates_lon> <range>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString buid = args[1];\n\t\t\t\tString floor = args[2];\n\t\t\t\tString coordinates_lat = args[3];\n\t\t\t\tString coordinates_lon = args[4];\n\t\t\t\tString range = args[5];\n\t\t\t\tresponse = client.radioByBuildingFloorRange(buid, floor, coordinates_lat, coordinates_lon, range);\n\t\t\t\tSystem.out.println(response + \"\\n\"); /* .substring(0, 100) */\n\t\t\t} else if (args[0].equals(\"-estimatePosition\")) {\n\t\t\t\tif (args.length != 5) {\n\t\t\t\t\tSystem.out.println(\"Usage: -estimatePosition <operating_system> <buid> <floor> <algorithm>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString operating_system = args[1];\n\t\t\t\tString buid = args[2];\n\t\t\t\tString floor = args[3];\n\t\t\t\tString algorithm = args[4];\n\n\t\t\t\tString cmd[] = new String[3];\n\t\t\t\tif (operating_system.equals(\"linux\")) {\n\t\t\t\t\tcmd[0] = \"/bin/sh\";\n\t\t\t\t\tcmd[1] = \"-c\";\n\t\t\t\t\tcmd[2] = \"sudo iwlist wlo1 scan | awk '/Address/ {print $5}; /level/ {print $3}' | cut -d\\\"=\\\" -f2 \";\n\t\t\t\t} else if (operating_system.equals(\"mac\")) {\n\t\t\t\t\tcmd[0] = \"/bin/sh\";\n\t\t\t\t\tcmd[1] = \"-c\";\n\t\t\t\t\tcmd[2] = \"/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -s | grep ':' | tr -s ' ' | cut -d' ' -f3 -f4| tr ' ' '\\n'\";\n\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Only linux and mac are the available operating systems\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\n\t\t\t\tString aps[] = new String[200];\n\t\t\t\tProcess p;\n\t\t\t\tString s, temp;\n\t\t\t\tint counter = 0;\n\t\t\t\ttry {\n\t\t\t\t\tp = Runtime.getRuntime().exec(cmd);\n\n\t\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));\n\t\t\t\t\twhile ((s = br.readLine()) != null && counter <= 20) {\n\t\t\t\t\t\ttemp = \"{\\\"bssid\\\":\\\"\";\n\t\t\t\t\t\ttemp += s;\n\t\t\t\t\t\ttemp += \"\\\",\\\"rss\\\":\";\n\t\t\t\t\t\ts = br.readLine();\n\t\t\t\t\t\ttemp += s;\n\t\t\t\t\t\ttemp += \"}\";\n\t\t\t\t\t\ttemp = temp.toLowerCase();\n\t\t\t\t\t\taps[counter++] = temp;\n\t\t\t\t\t}\n\t\t\t\t\tp.destroy();\n\t\t\t\t\tbr.close();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t}\n\t\t\t\taps = Arrays.copyOf(aps, counter);\n\t\t\t\tfor (int j = 0; j < counter; j++) {\n\t\t\t\t\tSystem.out.println(aps[j]);\n\t\t\t\t}\n\t\t\t\tresponse = client.estimatePosition(buid, floor, aps, algorithm);\n\t\t\t\tSystem.out.println(response + \"\\n\"); /* .substring(0, 100) */\n\t\t\t} else if (args[0].equals(\"-estimatePosOffline\")) {\n\t\t\t\tif (args.length != 5) {\n\t\t\t\t\tSystem.out.println(\"Usage: -estimatePosOffline <operating_system> <buid> <floor> <algorithm>\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\tString operating_system = args[1];\n\t\t\t\tString buid = args[2];\n\t\t\t\tString floor = args[3];\n\t\t\t\tString algorithm = args[4];\n\n\t\t\t\tString cmd[] = new String[3];\n\t\t\t\tif (operating_system.equals(\"linux\")) {\n\t\t\t\t\tcmd[0] = \"/bin/sh\";\n\t\t\t\t\tcmd[1] = \"-c\";\n\t\t\t\t\tcmd[2] = \"sudo iwlist wlo1 scan | awk '/Address/ {print $5}; /level/ {print $3}' | cut -d\\\"=\\\" -f2 \";\n\t\t\t\t} else if (operating_system.equals(\"mac\")) {\n\t\t\t\t\tcmd[0] = \"/bin/sh\";\n\t\t\t\t\tcmd[1] = \"-c\";\n\t\t\t\t\tcmd[2] = \"/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -s | grep ':' | tr -s ' ' | cut -d' ' -f3 -f4| tr ' ' '\\n'\";\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Only linux and mac are the available operating systems\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\n\t\t\t\tString aps[] = new String[200];\n\t\t\t\tProcess p;\n\t\t\t\tString s, temp;\n\t\t\t\tint counter = 0;\n\t\t\t\ttry {\n\t\t\t\t\tp = Runtime.getRuntime().exec(cmd);\n\n\t\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));\n\t\t\t\t\twhile ((s = br.readLine()) != null && counter <= 20) {\n\t\t\t\t\t\ttemp = \"{\\\"bssid\\\":\\\"\";\n\t\t\t\t\t\ttemp += s;\n\t\t\t\t\t\ttemp += \"\\\",\\\"rss\\\":\";\n\t\t\t\t\t\ts = br.readLine();\n\t\t\t\t\t\ttemp += s;\n\t\t\t\t\t\ttemp += \"}\";\n\t\t\t\t\t\ttemp = temp.toLowerCase();\n\t\t\t\t\t\taps[counter++] = temp;\n\t\t\t\t\t}\n\t\t\t\t\tp.destroy();\n\t\t\t\t\tbr.close();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t}\n\t\t\t\taps = Arrays.copyOf(aps, counter);\n\n\t\t\t\tresponse = client.estimatePositionOffline(buid, floor, aps, algorithm);\n\n\t\t\t\t//Location location = client.EstimatePositionOffline(..);\n\n\t\t\t\tSystem.out.println(response + \"\\n\"); /* .substring(0, 100) */\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Unknown argument: \" + args[0]);\n\t\t\t}\n\n\t\t}\n\t}", "@Override\n protected String doInBackground(String... urls) {\n //typical type of string array -> String...\n\n String result = \"\";\n URL url;\n //string into a URL object\n HttpURLConnection httpURLConnection = null;\n //retrieve information of any HTTP URL such as header information, status code, response code etc.\n\n try {\n url = new URL(urls[0]);\n //convert string into actual url using new URL object\n\n httpURLConnection = (HttpURLConnection) url.openConnection();\n //http url new connection using openConnection() and casting the result in httpURLConnection\n\n InputStream in = httpURLConnection.getInputStream();\n //gather data coming through\n\n InputStreamReader reader = new InputStreamReader(in);\n //read the data\n\n int data = reader.read();\n\n while(data != -1) {\n char current = (char) data;\n\n result += current;\n //add data letter by letter\n\n data = reader.read();\n //run untill the data is finished\n }\n\n return result;\n\n// } catch (MalformedURLException e) {\n// e.printStackTrace();\n// return \"Failed\";\n// } catch (IOException e) {\n// e.printStackTrace();\n// return \"Failed\";\n } catch (Exception e) {\n e.printStackTrace();\n return \"Failed\";\n }\n }", "@Override\n protected String doInBackground(String... arrays) {\n\n try {\n\n // doi tuong URL, dung de khoi tao dia chi request\n URL url = new URL(arrays[0]);\n\n // mo ket noi toi dia chi url\n HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();\n\n\n // doc du lieu thong qua InputStream\n InputStream inputStream = httpURLConnection.getInputStream();\n\n // doc du lieu\n BufferedReader r = new BufferedReader(new InputStreamReader(inputStream));\n\n StringBuilder total = new StringBuilder();\n\n for (String line; (line = r.readLine()) != null; ) {\n total.append(line).append('\\n');\n\n }\n\n return total.toString();\n\n\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "@Override\n protected String doInBackground(Void... params) {\n\n try {\n URL url = new URL(\"http://web-app.usc.edu/maps/all_map_data2.js\");\n HttpURLConnection conn = (HttpURLConnection) url.openConnection(); // connection\n\n conn.setRequestMethod(\"GET\"); // Get method\n\n int responseCode = conn.getResponseCode(); // get response code\n Log.e(\"responseCode\", Integer.toString(responseCode));\n\n InputStreamReader tmp = new InputStreamReader(conn.getInputStream(), \"UTF-8\");\n\n // TODO: not found check\n BufferedReader reader = new BufferedReader(tmp);\n StringBuilder builder = new StringBuilder();\n String str;\n while ((str = reader.readLine()) != null) {\n builder.append(str + \"\\n\");\n }\n\n Log.e(\"jsonStr\", builder.toString());\n return builder.toString();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return null;\n }", "public static int GenericGetJSONObjectdata(String p_GetURL, String p_SearchValue, int p_TestNumber,String p_TestDescription ,boolean p_debug ) throws IOException {\n\n\tString CallingMethod = \"GenericGetJSONObjectdata\";\n\tURL urlForGetRequest = new URL(p_GetURL);\n\tint found1 = 0;\n\n try {\n \t \n \t // Logic to call the GET API.\n\t\t\tString readLine = null;\n\t\t HttpURLConnection conection = (HttpURLConnection) urlForGetRequest.openConnection();\n\t\t conection.setRequestMethod(\"GET\");\n\t\t int responseCode = conection.getResponseCode();\n\t\t if (responseCode == HttpURLConnection.HTTP_OK) {\n\t\t BufferedReader in = new BufferedReader(new InputStreamReader(conection.getInputStream()));\n\t\t StringBuffer response = new StringBuffer();\n\n\t\t \twhile ((readLine = in .readLine()) != null) {\n\t\t\t response.append(readLine);\n\t\t\t } in .close();\n\t\t \n\n\t\t \n\t\t // We are using ObjectMapper Lib to convert/format the JSON object/JSON string into Java Object;\n\t\t\t ObjectMapper mapper = new ObjectMapper();\n\t\t\t mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n\t\t\t mapper.setSerializationInclusion(Include.NON_NULL);\n mapper.setSerializationInclusion(Include.NON_EMPTY);\n mapper.setSerializationInclusion(Include.NON_DEFAULT);\n \n\t\t\t \n\n\t try {\n\t \n\t \tif (p_debug) { System.out.println(\"GET URL results in JSON format below ==> \" + response.toString() + \" \\n\"); }\n\n\t //System.out.println(\"GET UR: JASON response in hash ==> \" + response.toString());\n\t JSONObjectRootClass JSONObjectJavaInstance = mapper.readValue(response.toString(), JSONObjectRootClass.class);\n\t String prettyStaff1 = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(JSONObjectJavaInstance);\n\t System.out.println(\"\\nTest \" + p_TestNumber + \" : URL ==> \" + p_GetURL);\n\t \n\t System.out.println(\"Test \" + p_TestNumber + \"==> URL results JSON object below :\\n \" + prettyStaff1 + \"\\n\");\n\t \n\t if (p_debug) { System.out.println(CallingMethod + \"==> \" + \"Before GenericTest . Result is ==> \" + found1); }\n\t found1 = GenericTestScenarios(JSONObjectJavaInstance,p_SearchValue,p_TestNumber,p_TestDescription, p_debug );\n\t if (p_debug) { System.out.println(CallingMethod + \"==> \" + \"After GenericTest . Result is ==> \" + found1); }\n\n\t } catch (IOException e) {\n\t e.printStackTrace();\n\t } // End of Mapper try catch\n\t\t \n\n } else { \n \t\t System.out.println(\"The GET URL \"\n \t\t \t\t+ \"call didnt return any results so not calling the test suite. Return 0(FALSE)\");\n } // End of Http get connection\n\n\t\t \n } catch (IOException e) {\n e.printStackTrace();\n }\n\treturn found1;\n\n }", "public interface MyCall {\n String URL=\"http://news-at.zhihu.com/api/4/\";\n @GET(\"news/latest\")\n Observable<b_Zhuihu1> getData1();\n @GET(\"sections \")\n Observable<b_Zhihu2> getData2();\n @GET(\"news/hot\")\n Observable<b_Zhihu3>getData3();\n\n String URL2=\"http://api.tianapi.com/wxnew/\";\n @GET(\"?key=52b7ec3471ac3bec6846577e79f20e4c&num=10&page=1\")\n Observable<b_Weixing> getData4();\n\n}", "@Override\n protected Object doInBackground(Object[] objects)\n {\n URL url = null; \n\n try\n {\n url = new URL(requestUrl);\n }\n catch (MalformedURLException e)\n {\n e.printStackTrace();\n }\n\n // Create and open HTTP connection\n HttpURLConnection connection = null;\n try\n {\n connection = (HttpURLConnection) url.openConnection();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n\n try\n {\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()));\n StringBuilder stringBuilder = new StringBuilder();\n String line;\n\n while ((line = bufferedReader.readLine()) != null)\n {\n stringBuilder.append(line);\n }\n\n bufferedReader.close();\n\n return stringBuilder.toString();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n connection.disconnect();\n }\n\n return null;\n }", "protected String doInBackground(String... args) {\n BufferedReader bufferedReader;\n\n try {\n URL url = new URL(urlForFetchTrees);\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\n StringBuilder sb = new StringBuilder();\n bufferedReader = new BufferedReader(new InputStreamReader(con.getInputStream()));\n String json;\n while ((json = bufferedReader.readLine()) != null) {\n sb.append(json + \"\\n\");\n }\n result = sb.toString();\n } catch (Exception e) {\n Log.e(\"log_tag\", \"Error converting result\" + e.toString());\n }\n return result;\n }", "@Override\n\t\tprotected ArrayList<WeatherStatus> doInBackground(Void... params)\n\t\t{\n\t\t\ttry {\n\t\t\t\tURL readURL = new URL(_stringUrl);\n\t\t\t\tHttpURLConnection conn = (HttpURLConnection) readURL.openConnection();\n\n\t\t\t\t// set connection properties\n\t\t\t\tconn.setReadTimeout(20000);\n\t\t\t\tconn.setConnectTimeout(20000);\n\t\t\t\tconn.setDoInput(true);\n\n\t\t\t\t// connect and read\n\t\t\t\tconn.connect();\n\t\t\t\tInputStream is = conn.getInputStream();\n\t\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(is));\n\n\t\t\t\t// read the contents of URL into a string for parsing\n\t\t\t\tStringBuilder jsonStringBldr = new StringBuilder();\n\t\t\t\tString currentLine;\n\t\t\t\twhile ((currentLine = in.readLine()) != null) {\n\t\t\t\t\tjsonStringBldr.append(currentLine);\n\t\t\t\t}\n\n\t\t\t\t// parse the JSON and send the resulting ArrayList to onPostExecute\n\t\t\t\treturn parseJSON(jsonStringBldr.toString());\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tLog.e(TAG,\"Error reading JSON: \" + e.getMessage());\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "@Override\n protected String doInBackground(String... arg0) {\n jobj = jsonparser.makeHttpRequest(url);\n try {\n metadata = jobj.getString(TAG_METADATA);\n } catch (Exception e) {\n e.printStackTrace();\n }\n return metadata;\n }", "public String doInBackground(String... args) {\n try {\n\n //create a URL object of what server to contact:\n URL url = new URL(args[0]);\n publishProgress(25);\n\n //open the connection\n HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();\n publishProgress(50);\n //wait for data:\n InputStream response = urlConnection.getInputStream();\n\n //JSON reading: Look at slide 26\n //Build the entire string response:\n BufferedReader reader = new BufferedReader(new InputStreamReader(response, \"UTF-8\"), 8);\n StringBuilder sb = new StringBuilder();\n\n String line;\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n String result = sb.toString(); //result is the whole string\n\n Log.i(\"Results from JSON: \", result);\n\n publishProgress(100);\n return result;\n\n } catch (Exception e) {\n }\n\n return \"Nothing\";\n }", "public static String sendRegData(String urls, String json) {\n\n String result = null;\n try {\n java.net.URL url = new URL(urls);//new AdIn().getURL());//\n\n\n URLConnection connection = url.openConnection();\n HttpURLConnection httpConnection = (HttpURLConnection) connection;\n\n httpConnection.setDoOutput(true);\n httpConnection.setChunkedStreamingMode(0);\n\n OutputStream out = new BufferedOutputStream(httpConnection.getOutputStream());\n // writeStream(out);\n out.write(json.getBytes());\n\n out.flush();\n out.close();\n\n InputStream in = new BufferedInputStream(httpConnection.getInputStream());\n //readStream(in);\n //finally {\n // httpConnection.disconnect();\n // }\n\n int responseCode = 0;\n responseCode = httpConnection.getResponseCode();\n\n if (responseCode == HttpURLConnection.HTTP_OK) {\n InputStream is = httpConnection.getInputStream();\n\n BufferedReader r = new BufferedReader(new InputStreamReader(in));\n result = r.readLine();\n } else {\n }\n } catch (MalformedURLException e) {\n } catch (IOException e1) {\n }\n return result;\n }", "@Override\n protected List<Flower> doInBackground(String... params) {\n // InputStream in = null;\n String content = HttpManager.getData(params[0]);\n flowerList = JSONParser.parserFeed(content);\n return flowerList;\n }", "public String processJSONStrings(String pJSONStringSet)\n {\n String processedString = \"\";\n try\n {\n JSONObject weatherDetailJO = new JSONObject(pJSONStringSet);\n String cityLocation = weatherDetailJO.getString(Constants.JSON_REQUEST_CITY_NAME);\n\n JSONArray weatherDataArray = weatherDetailJO.getJSONArray(Constants.JSON_REQUEST_WEATHER);\n String weather = weatherDataArray.getJSONObject(0).getString(Constants.JSON_REQUEST_WEATHER_MAIN);\n String weatherDescript = weatherDataArray.getJSONObject(0).getString(Constants.JSON_REQUEST_WEATHER_DESCRIPTION);\n String weatherIcon = weatherDataArray.getJSONObject(0).getString(Constants.JSON_REQUEST_WEATHER_ICON);\n\n JSONObject temperatureData = weatherDetailJO.getJSONObject(Constants.JSON_REQUEST_TEMP);\n String temperature = temperatureData.getString(Constants.JSON_REQUEST_TEMP_KELVIN);\n\n Log.i(TAG, \"cityLocation: \"+cityLocation);\n Log.i(TAG, \"weather: \"+weather);\n Log.i(TAG, \"weatherDescript: \"+weatherDescript);\n Log.i(TAG, \"weatherIcon: \"+weatherIcon);\n Log.i(TAG, \"temperature: \"+temperature);\n\n //[0, 1, 2, 3, 4]\n processedString = cityLocation+\"%\"+weather+\"%\"+weatherDescript+\"%\"+weatherIcon+\"%\"+temperature;\n\n }\n catch (JSONException e)\n {\n e.printStackTrace();\n }\n\n return processedString;\n }", "@Override\n protected String[] doInBackground(String... params) {\n if (params.length == 0) {\n return null;\n }\n\n String location = params[0];\n URL weatherRequestUrl = NetworkUtils.buildUrl(location);\n\n try {\n String jsonWeatherResponse = NetworkUtils\n .getResponseFromHttpUrl(weatherRequestUrl);\n\n String[] simpleJsonWeatherData = OpenWeatherJsonUtils\n .getSimpleWeatherStringsFromJson(MainActivity.this, jsonWeatherResponse);\n\n return simpleJsonWeatherData;\n\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "public void HttpWebCall(final String PreviousListViewClickedItem){\n\n class HttpWebCallFunction extends AsyncTask<String,Void,String> {\n\n @Override\n protected void onPreExecute() {\n super.onPreExecute();\n\n pDialog = ProgressDialog.show(ShowSingleRecordActivity.this,\"Loading Data\",null,true,true);\n }\n\n @Override\n protected void onPostExecute(String httpResponseMsg) {\n\n super.onPostExecute(httpResponseMsg);\n\n pDialog.dismiss();\n\n //Storing Complete JSon Object into String Variable.\n FinalJSonObject = httpResponseMsg ;\n\n //Parsing the Stored JSOn String to GetHttpResponse Method.\n new GetHttpResponse(ShowSingleRecordActivity.this).execute();\n\n }\n\n @Override\n protected String doInBackground(String... params) {\n\n ResultHash.put(\"StudentID\",params[0]);\n\n ParseResult = httpParse.postRequest(ResultHash, HttpURL);\n\n return ParseResult;\n }\n }\n\n HttpWebCallFunction httpWebCallFunction = new HttpWebCallFunction();\n\n httpWebCallFunction.execute(PreviousListViewClickedItem);\n }", "@Override\n protected String doInBackground(String... urls) {\n String response = \"\";\n HttpURLConnection urlConnection = null;\n for (String url : urls) {\n try {\n java.net.URL urlObject = new URL(url);\n urlConnection = (HttpURLConnection) urlObject.openConnection();\n urlConnection.addRequestProperty(\"user-key\",API_KEY );\n InputStream content = urlConnection.getInputStream();\n BufferedReader buffer = new BufferedReader(new InputStreamReader(content));\n String s;\n while ((s = buffer.readLine()) != null) {\n response += s;\n //Log.e(TAG,response);\n }\n } catch (Exception e) {\n response = \"Unable to add course, Reason: \"\n + e.getMessage();\n } finally {\n if (urlConnection != null)\n urlConnection.disconnect();\n }\n }\n //Log.i(TAG,response);\n return response;\n }", "@Override\n\t\t\tprotected String doInBackground(String... arg0) {\n\t\t\t\t\n\t\t\t\tList<NameValuePair> params=new ArrayList<NameValuePair>();\n\t\t\t\tparams.add(new BasicNameValuePair(\"tag\",tag));\n\t\t\t\t\n\t\t\t\tString json;\n\t\t\t\t\t\n\t\t\t\t\tjson=jsonParser.makeHttpRequest(url, \"POST\", params);\n\t\t\t\t\t\n\t\t\t\treturn json;\n\t\t\t\t\n\t\t\t}", "private String executeRequest(URL url, String json, boolean post) throws IOException{\n\t\tURLConnection urlConnection = url.openConnection();\n\t\turlConnection.setDoOutput(post); //false if post\n\t\turlConnection.setRequestProperty(\"Content-Type\", \"application/json; charset=utf-8\");\n\t\turlConnection.connect();\n\t\tOutputStream outputStream = urlConnection.getOutputStream();\n\t\toutputStream.write((json).getBytes(\"UTF-8\"));\n\t\toutputStream.flush();\n\t\t\n\t\t//Get Response\n InputStream in = urlConnection.getInputStream();\n BufferedReader rd = new BufferedReader(new InputStreamReader(in));\n String line;\n StringBuffer response = new StringBuffer();\n while((line = rd.readLine()) != null) {\n response.append(line);\n response.append('\\r');\n }\n rd.close();\n return response.toString();\n\t}", "private void getData(){\n StringRequest stringRequest = new StringRequest(\n Request.Method.GET,\n Constants.BOILER_URL+mechID+\"/\"+SharedPrefManager.getInstance(this).getUsertype(),\n\n new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n JSONObject j = null;\n try {\n //Parsing the fetched Json String to JSON Object\n j = new JSONObject(response);\n\n //Storing the Array of JSON String to our JSON Array\n JSONObject result = j.getJSONObject(\"response\");\n\n String address1=result.getString(\"address1\");\n String address2=result.getString(\"address2\");\n String inspname=result.getString(\"insname\");\n tvAddr1.setText(address1);\n tvAddr2.setText(address2);\n tvIns.setText(inspname);\n\n //Toast.makeText(getApplicationContext(),result.getString(\"equipments\"), Toast.LENGTH_LONG).show();\n // tvAddr2.setText(equipmentID);\n equip = result.getJSONArray(Constants.BOILER_ARRAY);\n\n //Calling method getEquipment to get the Equipments from the JSON Array\n getEquipment(equip);\n } catch (JSONException e) {\n\n e.printStackTrace();\n }\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n\n }\n });\n\n //Creating a request queue\n RequestQueue requestQueue = Volley.newRequestQueue(this);\n\n //Adding request to the queue\n requestQueue.add(stringRequest);\n\n }", "private void createLearnJSON(){\n json = new JSONObject();\n\n try {\n json.put(\"userID\", global.getUserID());\n StringBuilder p1 = new StringBuilder();\n for (String s: global.getWords()){\n p1.append(p1.toString().equals(\"\") ? s : (\" \" + s));\n }\n json.put(\"p1\", p1.toString());\n json.put(\"p2\", url);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "private String getResultByUrl(String url) {\r\n\r\n\t\tRequestConfig.Builder requestBuilder = RequestConfig.custom();\r\n\t\trequestBuilder = requestBuilder.setConnectTimeout(75000);\r\n\t\trequestBuilder = requestBuilder.setConnectionRequestTimeout(75000);\r\n\t\trequestBuilder.setSocketTimeout(75000);\r\n\r\n\t\tHttpClientBuilder builder = HttpClientBuilder.create();\r\n\t\tbuilder.setDefaultRequestConfig(requestBuilder.build());\r\n\t\tclient = builder.build();\r\n\r\n\t\trequest = new HttpGet(url);\r\n\t\trequest.addHeader(\"Accept\", \"application/json\");\r\n\r\n\t\tHttpResponse response = null;\r\n\t\tString r = \"\";\r\n\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < 7; i++) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.println(\"Sending request: \" + url);\r\n\t\t\t\t\tresponse = client.execute(request);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (ConnectionPoolTimeoutException e) {\r\n\t\t\t\t\tSystem.out.println(\"Connection timeout. Trying again...\");\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tTimeUnit.SECONDS.sleep(10);\r\n\t\t\t\t\t} catch (InterruptedException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Response Code : \"\r\n\t\t\t\t\t+ response.getStatusLine().getStatusCode());\r\n\r\n\t\t\tbr = new BufferedReader(new InputStreamReader(response.getEntity()\r\n\t\t\t\t\t.getContent()));\r\n\r\n\t\t\tStringBuffer result = new StringBuffer();\r\n\t\t\tString line = \"\";\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tresult.append(line);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(result + \"\\n\");\r\n\t\t\ttry {\r\n\t\t\t\tTimeUnit.SECONDS.sleep(1);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tr = result.toString();\r\n\t\t\tGson gson = new GsonBuilder().setPrettyPrinting().create();\r\n\r\n\t\t\tJsonObject jsonResult = gson.fromJson(result.toString(),\r\n\t\t\t\t\tJsonObject.class);\r\n\t\t\tif (jsonResult.get(\"backoff\") != null) {\r\n\t\t\t\tint backoff = (jsonResult.get(\"backoff\")).getAsInt();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.println(\"Received backoff. Waiting for \"\r\n\t\t\t\t\t\t\t+ backoff + \"seconds...\");\r\n\t\t\t\t\tTimeUnit.SECONDS.sleep(backoff + 5);\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} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn r;\r\n\t}", "public String[] readJson(String url) {\n InputStream is = null;\n String[] strArray ={\"\"} ;\n try {\n is = NetworkUtils.OpenHttpConnection(url, this);\n //leitura\n streamReader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\n jsonStrBuilder = new StringBuilder();\n Log.i(\"1° aqui\", \"ok\");\n String inputStr;\n //add ao StringBuilder\n while ((inputStr = streamReader.readLine()) != null) {\n jsonStrBuilder.append(inputStr);\n Log.i(\"@@@JSON :\", jsonStrBuilder.toString());\n }\n //transformado em JSONObject\n// JSONObject jObj = new JSONObject(jsonStrBuilder.toString());\n//\n// JSONArray jArray = jObj.getJSONArray(\"tasks\");\n// strArray = new String[jArray.length()];\n\n// for(int i = 0; i < jArray.length(); i++){\n// JSONObject jObject = jArray.getJSONObject(i);\n// strArray[i] = jObject.getString(\"title\");\n// }\n strArray[0] = jsonStrBuilder.toString();\n\n Log.i(\"@@@strArray :\", strArray.toString());\n }catch(IOException ie){\n Log.i(\"readJson\", ie.getLocalizedMessage());\n }\n\n return strArray;\n }", "@Override\n\t\tprotected String doInBackground(String... urls) {\n\n\t\t\tHttpClient httpclient = new DefaultHttpClient();\n\t\t\tHttpPost httppost = new HttpPost(urls[0]);\n\t\t\tHttpResponse response = null;\n\t\t\tHttpEntity entity = null;\n\t\t\tJSONObject json = new JSONObject();\n\t\t\ttry {\n\t\t\t\t// Add data\n\t\t\t\tString userId = HomePage.mUserId;\n\t\t\t\tjson.put(\"user_id\", userId);\n\t\t\t\tStringEntity se = new StringEntity(json.toString());\n\t\t\t\tse.setContentType(new BasicHeader(HTTP.CONTENT_TYPE,\n\t\t\t\t\t\t\"application/json\"));\n\t\t\t\thttppost.setEntity(se);\n\n\t\t\t\t// Execute HTTP Post Request\n\t\t\t\tresponse = httpclient.execute(httppost);\n\t\t\t\tentity = response.getEntity();\n\t\t\t} catch (ClientProtocolException e) {\n\t\t\t} catch (IOException e) {\n\t\t\t} catch (Exception e) {\n\t\t\t\tLog.e(\"ACW\", \"HomePage. Line 188, Exception e: \" + e);\n\t\t\t}\n\t\t\tif (null != entity) {\n\t\t\t\ttry {\n\n\t\t\t\t\treturn EntityUtils.toString(entity);\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\tLog.i(\"ACW\", \"MainActivity. Line 202. JSON Parse Exception\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLog.i(\"ACW\", \"MainActivity. Lin 207. IOException\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tLog.i(\"ACW\", \"MainActivity. Line 212. Request not parsed correctly\");\n\t\t\treturn \"get failed\";\n\t\t}", "public JSONArray getJSONFromUrl(String url) {\n HttpParams httpParameters = new BasicHttpParams();\n // Set the timeout in milliseconds until a connection is established.\n // The default value is zero, that means the timeout is not used.\n int timeoutConnection = 3000;\n HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);\n // Set the default socket timeout (SO_TIMEOUT)\n // in milliseconds which is the timeout for waiting for data.\n int timeoutSocket = 5000;\n HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);\n\n DefaultHttpClient httpclient = new DefaultHttpClient(httpParameters);\n HttpGet httpget = new HttpGet(url);\n\n // Depends on your web service\n httpget.setHeader(\"Content-type\", \"application/json\");\n InputStream inputStream = null;\n String result = null;\n try {\n HttpResponse response = httpclient.execute(httpget);\n HttpEntity entity = response.getEntity();\n\n inputStream = entity.getContent();\n BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, \"UTF-8\"), 8);\n StringBuilder sb = new StringBuilder();\n\n String line;\n while ((line = reader.readLine()) != null)\n {\n sb.append(line).append(\"\\n\");\n }\n result = sb.toString();\n\n } catch (Exception e) {\n // Oops\n Log.i(TAG,e.toString());\n Log.i(TAG,\"reader read line didn't work\");\n }\n finally {\n try{\n if(inputStream != null)inputStream.close();\n }\n catch(Exception squish){\n Log.i(TAG,squish.toString());\n Log.i(TAG,\"sqish! inputstream did not work!\");\n }\n }\n\n if(result == null){\n Log.i(TAG,\"result was NULL\");\n return null;\n }\n try {\n Log.i(TAG,\"WE fetched this data \"+result);\n\n // Send the url along with article data\n return new JSONArray(result);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n return null;\n\n }", "public static void main(String [] args)\n\t{\n\t\tString inline = \"\";\n\t\n\t\ttry\n\t\t{\n\t\t\tURL url = new URL(\"https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=GOOG&interval=5min&apikey=TBI2QUBXIJL1Z771\");\n\t\t\t//Parse URL into HttpURLConnection in order to open the connection in order to get the JSON data\n\t\t\tHttpURLConnection conn = (HttpURLConnection)url.openConnection();\n\t\t\t//Set the request to GET or POST as per the requirements\n\t\t\tconn.setRequestMethod(\"GET\");\n\t\t\t//Use the connect method to create the connection bridge\n\t\t\tconn.connect();\n\t\t\t//Get the response status of the Rest API\n\t\t\tint responsecode = conn.getResponseCode();\n\t\t\tSystem.out.println(\"Response code is: \" +responsecode);\n\t\t\t\n\t\t\t//Iterating condition to if response code is not 200 then throw a runtime exception\n\t\t\t//else continue the actual process of getting the JSON data\n\t\t\tif(responsecode != 200)\n\t\t\t\tthrow new RuntimeException(\"HttpResponseCode: \" +responsecode);\n\t\t\telse\n\t\t\t{\n\t\t\t\t//Scanner functionality will read the JSON data from the stream\n\t\t\t\tScanner sc = new Scanner(url.openStream());\n\t\t\t\twhile(sc.hasNext())\n\t\t\t\t{\n\t\t\t\t\tinline+=sc.nextLine();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"\\nJSON Response in String format\"); \n\t\t\t\tSystem.out.println(inline);\n\t\t\t\t//Close the stream when reading the data has been finished\n\t\t\t\tsc.close();\n\t\t\t}\n\t\t\t\n\t\t\t//JSONParser reads the data from string object and break each data into key value pairs\n\t\t\tJSONParser parse = new JSONParser();\n\t\t\t//Type caste the parsed json data in json object\n\t\t\tJSONObject jobj = (JSONObject)parse.parse(inline);\n\t\t\t//Store the JSON object in JSON array as objects (For level 1 array element i.e Results)\n\t\t\tJSONArray jsonarr_1 = (JSONArray) jobj.get(\"results\");\n\t\t\t//Get data for Results array\n\t\t\tfor(int i=0;i<jsonarr_1.size();i++)\n\t\t\t{\n\t\t\t\t//Store the JSON objects in an array\n\t\t\t\t//Get the index of the JSON object and print the values as per the index\n\t\t\t\tJSONObject jsonobj_1 = (JSONObject)jsonarr_1.get(i);\n\t\t\t\t//Store the JSON object in JSON array as objects (For level 2 array element i.e Address Components)\n\t\t\t\tJSONArray jsonarr_2 = (JSONArray) jsonobj_1.get(\"address_components\");\n\t\t\t\tSystem.out.println(\"Elements under results array\");\n\t\t\t\tSystem.out.println(\"\\nPlace id: \" +jsonobj_1.get(\"place_id\"));\n\t\t\t\tSystem.out.println(\"Types: \" +jsonobj_1.get(\"types\"));\n\t\t\t\t//Get data for the Address Components array\n\t\t\t\tSystem.out.println(\"Elements under address_components array\");\n\t\t\t\tSystem.out.println(\"The long names, short names and types are:\");\n\t\t\t\tfor(int j=0;j<jsonarr_2.size();j++)\n\t\t\t\t{\n\t\t\t\t\t//Same just store the JSON objects in an array\n\t\t\t\t\t//Get the index of the JSON objects and print the values as per the index\n\t\t\t\t\tJSONObject jsonobj_2 = (JSONObject) jsonarr_2.get(j);\n\t\t\t\t\t//Store the data as String objects\n\t\t\t\t\tString str_data1 = (String) jsonobj_2.get(\"long_name\");\n\t\t\t\t\tSystem.out.println(str_data1);\n\t\t\t\t\tString str_data2 = (String) jsonobj_2.get(\"short_name\");\n\t\t\t\t\tSystem.out.println(str_data2);\n\t\t\t\t\tSystem.out.println(jsonobj_2.get(\"types\"));\n\t\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\n\n\t\t\t//Disconnect the HttpURLConnection stream\n\t\t\tconn.disconnect();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\t\tprotected String doInBackground(String... params) {\n\t\t\ttry {\r\n\t\t\t\tjsonstr = getStringFromFile(filePath);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\treturn jsonstr;\r\n\t\t}", "@Override\r\n\t\tprotected String doInBackground(String... params) {\n\t\t\ttry {\r\n\t\t\t\tjsonstr = getStringFromFile(filePath);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\treturn jsonstr;\r\n\t\t}", "@Override\r\n\t\tprotected String doInBackground(String... params) {\n\t\t\ttry {\r\n\t\t\t\tjsonstr = getStringFromFile(filePath);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\treturn jsonstr;\r\n\t\t}", "public static String getValue( String str , Response [] previousJsonResponse){\n\t\tString temp = \"\";\n\t\tString ret_value = \"\";\nint ret_value_int = 0;\nint temp2 = 0 ;\n\t\tif(str.contains(Keywords.PREV_COOKIE)){\n\t\t\tString[] params = (str.split(\":\"));\n\t\t\tString result = params[0].substring((params[0].indexOf(\"[\")) + 1, (params[0].indexOf(\"]\")));\n\t\t\tint index = Integer.parseInt(result);\n\t\t\ttemp = (previousJsonResponse[(index-1)]).getCookie(params[1]);\n\t\t\tif(str.startsWith(\" \")) ret_value = \" \" + temp;\n\t\t\telse ret_value = temp;\n\t\t\tif(str.endsWith(\" \")) ret_value += \" \";\n\t\t}else if(str.contains(Keywords.PREV_HEADER)){\n\t\t\tString[] params = (str.split(\":\"));\n\t\t\tString result = params[0].substring((params[0].indexOf(\"[\")) + 1, (params[0].indexOf(\"]\")));\n\t\t\tint index = Integer.parseInt(result);\n\t\t\ttemp = (previousJsonResponse[(index-1)]).header(params[1]);\n\t\t\tif(str.startsWith(\" \")) ret_value = \" \" + temp;\n\t\t\telse ret_value = temp;\n\t\t\tif(str.endsWith(\" \")) ret_value += \" \";\n\t\t}else if(str.contains(Keywords.PREV_BODY)){\n\t\t\tString[] params = (str.split(\":\"));\n\t\t\tString result = params[0].substring((params[0].indexOf(\"[\")) + 1, (params[0].indexOf(\"]\")));\n\t\t\tint index = Integer.parseInt(result);\n\t\t\ttemp = (previousJsonResponse[(index-1)]).path(params[1]);\n\t\t\tif(str.startsWith(\" \")) ret_value = \" \" + temp;\n\t\t\telse ret_value = temp;\n\t\t\tif(str.endsWith(\" \")) ret_value += \" \";\n\t\t}\n\t\telse if(str.contains(Keywords.PREV_BODY_integer)){\n\t\t\tString[] params = (str.split(\":\"));\n\t\t\tString result = params[0].substring((params[0].indexOf(\"[\")) + 1, (params[0].indexOf(\"]\")));\n\t\t\tint index = Integer.parseInt(result);\n\t\t\ttemp2 = (previousJsonResponse[(index-1)]).path(params[1]);\n\t\t\tif(str.startsWith(\" \")) ret_value_int = temp2;\n\t\t\telse ret_value_int = temp2;\n\t\t\tret_value = Integer.toString(ret_value_int);\n\t\t\tif(str.endsWith(\" \")) ret_value += \" \";\n\t\t}\n\n\t\telse ret_value = str;\n\t\treturn ret_value;\n\t}", "public static void main(String[] args) {\n Map<String,String> params = new HashMap<String, String>();\n String[] aa = new String[3];\n aa[0]=\"1\";\n aa[1]=\"2\";\n aa[2]=\"3\";\n String.valueOf(aa);\n System.out.println(String.valueOf(aa));\n params.put(\"userIds\",\"22,33,44\");\n String[] resultArray = null;\n// String contacts = HttpClientsUtil.httpGet(\"http://127.0.0.1:8888/authority/user/contacts/list\",\"\",params);\n// JSONObject myJson = JSONObject.parseObject(contacts);\n /*if(\"success\".equals(myJson.get(\"code\"))){\n JSONArray userArrays =(JSONArray)myJson.get(\"content\");\n int size = userArrays.size();\n resultArray = new String[size];\n for(int i=0;i<size;i++){\n resultArray[i] = ((JSONObject)userArrays.get(i)).get(\"email\")+\"\";\n }\n }*/\n System.out.println(resultArray);\n }", "public JSONArray connectWSPut_Get_Data(String url, JSONObject json, String jsonName) {\n\t\t\n\t\tJSONArray jarr = null;\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// cach khac de thay vao entity __________________________________\n\t\t\tStringEntity se = new StringEntity(json.toString(), \"UTF-8\");\n\t\t\tInputStreamEntity ise = new InputStreamEntity(new ByteArrayInputStream(json.toString().getBytes(\"UTF-8\")), -1);\n\t\t\t// ---------------------------------------------------------------------\n\t\t\tHttpParams httpParams = new BasicHttpParams();\n\t\t\tHttpConnectionParams.setConnectionTimeout(httpParams, TIMEOUT_MILLISEC);\n\t\t\tHttpConnectionParams.setSoTimeout(httpParams, TIMEOUT_MILLISEC);\n\t\t\t// -----------------------\n\t\t\tHttpClient client = new DefaultHttpClient(httpParams);\n\n\t\t\tHttpPost request = new HttpPost(url);\n\t\t\t\n\t\t\t// set POST request\n\t\t\trequest.setEntity(new ByteArrayEntity(json.toString().getBytes(\"UTF-8\")));\n\t\t\t\t\t\t\t\n\t\t\tLog.d(\"fuck\", \"fuck\");\t// oh, this so fun :>\n\t\t\t\n\t\t\t///??????????????????????????????\n\t\t\t// it use for debug?\n\t\t\trequest.setHeader(\"json\", json.toString());\n\t\t\tLog.e(\"fuck\", json.toString());\n\t\t\t\n\t\t\tHttpResponse response = client.execute(request);\n\t\t\tHttpEntity entity = response.getEntity();\n\n\t\t\tInputStream instream = entity.getContent();\n\t\t\t\n\t\t\t// test\n\t\t\t// no connect to server\n\t\t\t// set hardstring to result :>\n\t\t\t//String result = \"{\\\"voucher\\\":[{\\\"_id\\\":38,\\\"code_id\\\":\\\"BSM840-12\\\",\\\"product_name\\\":\\\"BSTONE 12\\\",\\\"group_id\\\":\\\"12.00R20\\\",\\\"type_id\\\":\\\"PR18\\\",\\\"note\\\":\\\"abc\\\",\\\"accessory\\\":0,\\\"status\\\":1,\\\"type\\\":1,\\\"quantity\\\":1,\\\"create_date\\\":\\\"Apr 4 2014 12:00AM\\\",\\\"update_date\\\":\\\"Apr 4 2014 12:00AM\\\",\\\"flag\\\":1,\\\"barcode\\\":\\\"1340590100\\\"},{\\\"_id\\\":41,\\\"code_id\\\":\\\"BSM840-11\\\",\\\"product_name\\\":\\\"BSTONE 11\\\",\\\"group_id\\\":\\\"11.00R20\\\",\\\"type_id\\\":\\\"PR18\\\",\\\"note\\\":\\\"abc\\\",\\\"accessory\\\":0,\\\"status\\\":1,\\\"type\\\":1,\\\"quantity\\\":1,\\\"create_date\\\":\\\"Apr 4 2014 12:00AM\\\",\\\"update_date\\\":\\\"Apr 4 2014 12:00AM\\\",\\\"flag\\\":1,\\\"barcode\\\":\\\"1340590101\\\"},{\\\"_id\\\":43,\\\"code_id\\\":\\\"5555\\\",\\\"product_name\\\":\\\"55555\\\",\\\"group_id\\\":\\\"12.00R20\\\",\\\"type_id\\\":\\\"PR16\\\",\\\"note\\\":\\\"555555\\\",\\\"accessory\\\":0,\\\"status\\\":1,\\\"type\\\":1,\\\"quantity\\\":1,\\\"create_date\\\":\\\"Apr 22 2014 12:00AM\\\",\\\"update_date\\\":\\\"Apr 22 2014 12:00AM\\\",\\\"flag\\\":1,\\\"barcode\\\":\\\"1340590102\\\"},{\\\"_id\\\":44,\\\"code_id\\\":\\\"MVT101\\\",\\\"product_name\\\":\\\"BSBMW\\\",\\\"group_id\\\":\\\"12.00R20\\\",\\\"type_id\\\":\\\"PR20\\\",\\\"note\\\":null,\\\"accessory\\\":0,\\\"status\\\":1,\\\"type\\\":1,\\\"quantity\\\":1,\\\"create_date\\\":\\\"Apr 21 2014 4:52PM\\\",\\\"update_date\\\":\\\"Apr 21 2014 4:52PM\\\",\\\"flag\\\":1,\\\"barcode\\\":\\\"1340590103\\\"},{\\\"_id\\\":45,\\\"code_id\\\":\\\"LOPHONDA\\\",\\\"product_name\\\":\\\"CRB\\\",\\\"group_id\\\":\\\"11.00R18\\\",\\\"type_id\\\":\\\"PR18\\\",\\\"note\\\":null,\\\"accessory\\\":0,\\\"status\\\":1,\\\"type\\\":1,\\\"quantity\\\":1,\\\"create_date\\\":\\\"Apr 21 2014 4:55PM\\\",\\\"update_date\\\":\\\"Apr 21 2014 4:55PM\\\",\\\"flag\\\":1,\\\"barcode\\\":\\\"1340590104\\\"},{\\\"_id\\\":46,\\\"code_id\\\":\\\"MH01\\\",\\\"product_name\\\":\\\"CSTONE 22\\\",\\\"group_id\\\":\\\"11.00R18\\\",\\\"type_id\\\":\\\"PR18\\\",\\\"note\\\":\\\"fvssdsc\\\",\\\"accessory\\\":0,\\\"status\\\":1,\\\"type\\\":1,\\\"quantity\\\":1,\\\"create_date\\\":\\\"Apr 22 2014 8:49AM\\\",\\\"update_date\\\":\\\"Apr 22 2014 8:49AM\\\",\\\"flag\\\":1,\\\"barcode\\\":\\\"1340590105\\\"},{\\\"_id\\\":47,\\\"code_id\\\":\\\"123\\\",\\\"product_name\\\":\\\"acb123\\\",\\\"group_id\\\":\\\"12.00R20\\\",\\\"type_id\\\":\\\"PR13\\\",\\\"note\\\":\\\"fdff\\\",\\\"accessory\\\":0,\\\"status\\\":1,\\\"type\\\":1,\\\"quantity\\\":1,\\\"create_date\\\":\\\"Apr 22 2014 10:04AM\\\",\\\"update_date\\\":\\\"Apr 22 2014 10:04AM\\\",\\\"flag\\\":1,\\\"barcode\\\":\\\"1340590106\\\"},{\\\"_id\\\":48,\\\"code_id\\\":\\\"T555\\\",\\\"product_name\\\":\\\"555\\\",\\\"group_id\\\":\\\"thuoc ngoai\\\",\\\"type_id\\\":\\\"nhom ngoai\\\",\\\"note\\\":\\\"thuoc la\\\",\\\"accessory\\\":0,\\\"status\\\":1,\\\"type\\\":1,\\\"quantity\\\":1,\\\"create_date\\\":\\\"May 13 2014 12:00AM\\\",\\\"update_date\\\":\\\"May 13 2014 12:00AM\\\",\\\"flag\\\":1,\\\"barcode\\\":\\\" \\\"}]}\";\n\t\t\t\n\t\t\t\n\t\t\tString result = ConfigurationWSRestClient.convertStreamToString(instream);\n\t\t\t\n\t\t\t//test\n\t\t\tLog.e(\"json string result\", result);\n\t\t\t//Log.e(\"jsonName\", jsonName);\n\t\t\t\n\t\t\t\n\t\t\t// decode string to jsonobject\n\t\t\tJSONObject jobj = new JSONObject(result);\n\t\t\tjarr = jobj.getJSONArray(jsonName);\n\n\t\t} catch (Exception t) { }\n\t\t\n\t\t\n\t\treturn jarr;\n\t}", "@Override\n protected String doInBackground(String... params) {\n String content = HttpManager.getData(params[0],params[1],params[2]);\n return content;\n\n }", "public void parsing() throws JSONException {\r\n\t\ttry {\r\n\t\tHttpParams httpParameters = new BasicHttpParams();\r\n\t\tint timeoutConnection = 30000;\r\n\t\tHttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);\r\n\t\tint timeoutSocket = 31000;\r\n\t\tHttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);\r\n\t\tHttpClient client = new DefaultHttpClient(httpParameters);\r\n\t\tHttpPost httpost = new HttpPost(Url_Address.url_Home+\"/FetchPendingRideRequests\");//Url_Address.url_promocode);\r\n\t\tJSONObject json = new JSONObject();\r\n\t\t\r\n\t\tjson.put(\"Trigger\", \"FetchPendingRideRequests\");\r\n\t\t\r\n\t\tjson.put(\"Role\", \"Rider\");\r\n\t\tSystem.err.println(\"Rider\");\r\n\t\r\n\t\tjson.put(\"Id\", prefs.getString(\"userid\", null));\r\n\t\tSystem.err.println(prefs.getString(\"userid\", null));\r\n\t\t\r\n\t\tjson.put(\"Trigger\", \"queue\");\r\n\t\tSystem.err.println(\"rider queue\");\r\n\t //\t \r\n\t\thttpost.setEntity(new StringEntity(json.toString()));\r\n\t\thttpost.setHeader(\"Accept\", \"application/json\");\r\n\t\thttpost.setHeader(\"Content-type\", \"application/json\");\r\n\t\t\r\n\t\tHttpResponse response = client.execute(httpost);\r\n\t\tHttpEntity resEntityGet = response.getEntity();\r\n\t\tString jsonstr=EntityUtils.toString(resEntityGet);\r\n\t\tif(jsonstr!=null)\r\n\t\t{\r\n\t\t Log.i(tag,\" result-->>>>> \"+ jsonstr);\r\n\t\t}\r\n\t\tJSONObject obj=new JSONObject(jsonstr);\r\n\t\tString\tjsonResult=obj.getString(\"result\");\r\n\t\tString\tpending_jsonMessage=obj.getString(\"message\");\r\n\t\t\t\r\n\t\t\tString PendingRequestList=\tobj.getString(\"PendingRequestList\");\r\n\t\t\tLog.i(tag, \"PendingRequestList queue: \"+PendingRequestList);\r\n\t\t\t\r\n\t\t\tJSONArray jsonarray=obj.getJSONArray(\"PendingRequestList\");\r\n\t\r\n\t\t\t\r\n\t\tfor(int i=0;i<jsonarray.length();i++){\r\n\t\t\t\t\r\n\t\t\tJSONObject obj2=jsonarray.getJSONObject(i);\r\n\t\t\t\r\n\t\t\tString tripId=obj2.getString(\"tripId\");\r\n\t\t\tLog.i(tag, \"tripId: \"+tripId);\r\n\t\t\t\r\n\t\t\tString\triderId=\tobj2.getString(\"riderId\");\r\n\t\t\tLog.i(tag, \"riderId: \"+riderId);\r\n\t\t\t\r\n\t\t\tString driverId=\tobj2.getString(\"driverId\");\r\n\t\t\tLog.i(tag, \"driverId: \"+driverId);\r\n\t\t\t\r\n\t\t\tString driver_first=\tobj2.getString(\"driver_first\");\r\n\t\t\tLog.i(tag, \"driver_first: \"+driver_first);\r\n\t\t\t\r\n\t\t\tString driver_last=\tobj2.getString(\"driver_last\");\r\n\t\t\tLog.i(tag, \"driver_last: \"+driver_last);\r\n\t\t\t\r\n\t\t\tString trip_miles_est=\tobj2.getString(\"trip_miles_est\");\r\n\t\t\tLog.i(tag, \"trip_miles_est: \"+trip_miles_est);\r\n\t\t\t\r\n\t\t\tString trip_time_est=\tobj2.getString(\"trip_time_est\");\r\n\t\t\tLog.i(tag, \"trip_time_est: \"+trip_time_est);\r\n\t\t\t\r\n\t\t\tString start_loc=\tobj2.getString(\"start_loc\");\r\n\t\t\tLog.i(tag, \"start_loc: \"+start_loc);\r\n\t\t\t\r\n\t\t\tString destination_loc=\tobj2.getString(\"destination_loc\");\r\n\t\t\tLog.i(tag, \"destination_loc: \"+destination_loc);\r\n\t\t\t\r\n\t\t\tString request_type=\tobj2.getString(\"request_type\");\r\n\t\t\tLog.i(tag, \"request_type: \"+request_type);\r\n\t\t\t\r\n\t\t\tString trip_request_date=\tobj2.getString(\"trip_request_date\");\r\n\t\t\tLog.i(tag, \"request_type: \"+trip_request_date);\r\n\t\t\t\r\n\t\t\tString driver_image=\tobj2.getString(\"driver_image\");\r\n\t\t\tLog.i(tag, \"driver_image: \"+driver_image);\r\n\t\t\t\r\n\t\t\tString rider_image=\tobj2.getString(\"rider_image\");\r\n\t\t\tLog.i(tag, \"rider_image: \"+rider_image);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tString setfare=\tobj2.getString(\"setfare\");\r\n\t\t\tLog.i(tag, \"setfare: \"+setfare);\r\n\t\t\t\r\n\t\t\tString offered_fare=\tobj2.getString(\"offered_fare\");\r\n\t\t\tLog.i(tag, \"offered_fare: \"+offered_fare);\r\n\t\t\t\r\n\t\t\tString driver_rating=\tobj2.getString(\"driver_rating\");\r\n\t\t\tLog.i(\"tag:\", \"riderRating: \"+driver_rating);\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\tString status=\tobj2.getString(\"status\");\r\n\t\t\tLog.i(tag, \"status: \"+status);\r\n\t\t\t\r\n\t\t\tString vehicle_color=\tobj2.getString(\"vehicle_color\");\r\n\t\t\tLog.i(tag, \"vehicle_color: \"+vehicle_color);\r\n\t\t\t\r\n\t\t\tString vehicle_type=\tobj2.getString(\"vehicle_type\");\r\n\t\t\tLog.i(\"tag:\", \"vehicle_type: \"+vehicle_type);\r\n\t\t\t\r\n\t\t\tString vehicle_name=\tobj2.getString(\"vehicle_name\");\r\n\t\t\tLog.i(\"tag:\", \"vehicle_name: \"+vehicle_name);\r\n\r\n\t\t\t\t\r\n\t\t\tString vehicle_img=\tobj2.getString(\"vehicle_img\");\r\n\t\t\tLog.i(\"tag:\", \"vehicle_img: \"+vehicle_img);\r\n\t\t\r\n\t\t\tString vehicle_year=\tobj2.getString(\"vehicle_year\");\r\n\t\t\tLog.i(\"tag:\", \"vehicle_year: \"+vehicle_year);\r\n\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tLog.i(tag, \"Result: \"+jsonResult);\r\n\t\t\tLog.i(tag, \"Message :\"+pending_jsonMessage);\r\n\t\t\t\r\n\t\t\tarraylist_destination.add(destination_loc);\r\n\t\t\tarraylist_driverid.add(driverId);\r\n\t\t\tarraylist_riderid.add(riderId);\r\n\t\t\tarraylist_drivername.add(driver_first);\r\n\t\t\tarraylist_pickuptime.add(trip_request_date);\r\n\t\t\tarraylist_tripid.add(tripId);\r\n\t\t\tarraylist_driver_image.add(driver_image);\r\n\t\t\tarraylist_rider_image.add(rider_image);\r\n\t\t\tarraylist_distance.add(trip_miles_est);\r\n\t\t\tarraylist_requesttype.add(request_type);\r\n\t\t\tarraylist_start.add(start_loc);\r\n\t\t\tarraylist_actualfare.add(setfare);\r\n\t\t\tarraylist_suggestion.add(offered_fare);\r\n\t\t\tarraylist_eta.add(trip_time_est);\r\n\t\t\tarraylist_driverrating.add(driver_rating);\r\n\t\t\tarraylist_status.add(status);\r\n\t\t\tarraylist_vehicle_color.add(vehicle_color);\r\n\t\t\tarraylist_vehicle_type.add(vehicle_type);\r\n\t\t\tarraylist_vehicle_name.add(vehicle_name);\r\n\t\t\tarraylist_vehicle_img.add(vehicle_img);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tarraylist_vehicle_year.add(vehicle_year);\r\n\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t catch(Exception e){\r\n\t\t System.out.println(e);\r\n\t\t Log.d(tag, \"Error :\"+e); } \r\n\t\t\t}", "@Override\n protected String doInBackground(String... strings) {\n String response = \"\";\n try {\n URL url = new URL(strings[0]);\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\n con.setRequestMethod(\"GET\");\n con.setConnectTimeout(5000);\n con.setReadTimeout(5000);\n con.connect();\n\n BufferedReader in = new BufferedReader(\n new InputStreamReader(con.getInputStream()));\n\n String inputLine;\n StringBuffer content = new StringBuffer();\n while ((inputLine = in.readLine()) != null) {\n content.append(inputLine);\n }\n in.close();\n response = content.toString();\n parseValuesFromResponse(response, strings[1]);\n } catch (Exception e){\n e.printStackTrace();\n }\n return null;\n }", "public int processingContract(String json,List<Object[]> list);", "@Override\n protected String[] doInBackground(String... params) {\n\n /* If there's no zip code, there's nothing to look up. */\n if (params.length == 0) {\n return null;\n }\n\n String location = params[0];\n URL weatherRequestUrl = NetworkUtils.buildUrl(location);\n\n try {\n String jsonWeatherResponse = NetworkUtils\n .getResponseFromHttpUrl(weatherRequestUrl);\n\n String[] simpleJsonWeatherData = OpenWeatherJsonUtils\n .getSimpleWeatherStringsFromJson(MainActivity.this, jsonWeatherResponse);\n\n return simpleJsonWeatherData;\n\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n }", "@Override\n protected String doInBackground(String... params) {\n\n\n jsonResponseString = httpRequestProcessor.gETRequestProcessor(getproject);\n return jsonResponseString;\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n URL url = new URL(urls[0]);\n URLConnection connection = url.openConnection();\n\n String jsonString = \"\";\n try {\n InputStream inputStream = connection.getInputStream();\n BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));\n String line;\n\n while ((line = reader.readLine()) != null) {\n jsonString += line;\n }\n } catch (IOException e) {\n e.printStackTrace();\n Log.e(TAG, \"onCreate: IT CRASHED BECAUSE FILE NOT FOUND\");\n }\n //All Data is in jsonString at this point\n // start casting data into JsonObject\n\n JSONObject jsonObject = new JSONObject(jsonString);\n\n JSONArray jsonArray = jsonObject.optJSONObject(\"report\").optJSONObject(\"food\").optJSONArray(\"nutrients\");\n List<String> nutrientIdList = new ArrayList<>();\n if (jsonObject != null) {\n for (int i = 0; i < jsonArray.length(); i++) {\n JSONObject tempJsonObject = jsonArray.optJSONObject(i);\n nutrientIdList.add(i,tempJsonObject.optString(\"nutrient_id\"));\n }\n }\n\n Set<String> temp = new HashSet<String>(nutrientIdList);\n SharedPreferences.Editor editor = getContext().getApplicationContext().getSharedPreferences(\"nutrientIdList\",Context.MODE_PRIVATE).edit();\n editor.putStringSet(\"nutrientIdList\", temp);\n editor.putString(\"ndbno\",food.getNdbno());\n editor.apply();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n //Todo add food name and amount here\n return null;\n }" ]
[ "0.6533901", "0.62588054", "0.60686004", "0.60300475", "0.5999955", "0.5938868", "0.5911953", "0.5803443", "0.5786321", "0.572462", "0.56884307", "0.56583905", "0.56037074", "0.5547759", "0.55187356", "0.55131716", "0.55071443", "0.550429", "0.5484666", "0.5473916", "0.5442937", "0.5430161", "0.5428416", "0.542385", "0.5418077", "0.54083014", "0.54072404", "0.5382896", "0.53703713", "0.5365254", "0.5353088", "0.534717", "0.5343898", "0.533329", "0.5323226", "0.53219897", "0.531254", "0.53055274", "0.5299246", "0.528738", "0.5287158", "0.52837527", "0.5271332", "0.52668625", "0.5245518", "0.52450347", "0.52420026", "0.52285755", "0.52229375", "0.5222328", "0.52217335", "0.5212444", "0.5208976", "0.520813", "0.5205015", "0.52036077", "0.51972854", "0.5195503", "0.5180974", "0.51790136", "0.51756996", "0.5173044", "0.5170774", "0.51704943", "0.51652193", "0.51635444", "0.5161693", "0.51461035", "0.5140855", "0.5139992", "0.51352924", "0.5132291", "0.5120941", "0.5117266", "0.51132005", "0.51099104", "0.5107211", "0.5104706", "0.5102292", "0.509967", "0.50960875", "0.5075839", "0.50745606", "0.5072187", "0.50695103", "0.5065909", "0.5062799", "0.5061822", "0.5061822", "0.5061822", "0.50613534", "0.5058631", "0.5058254", "0.5056722", "0.5056422", "0.5056335", "0.5055244", "0.5054408", "0.50445074", "0.5041891" ]
0.5393398
27
Project: ExtendingInterface File: InterfaceA.java Date: Apr 14, 2017 Time: 12:33:48 PM
public interface InterfaceA { public void methodFromInterfaceA(); // Before Java 8, the interface only contains method signatures. // With Java 8 new feature Default Methods or Defender Methods, // you can include method body within the interface. default void defaultMethod() { System.out.println("from InterfaceA, default method..."); } static void someStaticMethod() { System.out.println("from InterfaceA static method..."); } /* * Why do we need to implement a method within the interface? * * Let's say you have an interface which has multiple methods, * and multiple classes are implementing this interface. One * of the method implementations can be common across the classes, * we can make that method as a default method, so that the * implementation is common for all classes. * * How to work with existing interfaces? * * Second scenario where you have already existing application, * for a new requirement we have to add a method to the existing * interface. If we add new method then we need to implement it * through out the implementation classes. By using the Java 8 * default method we can add a default implementation of that * method which resolves the problem. */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface a extends IInterface {\n}", "public interface AbstractC2502fH1 extends IInterface {\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "interface InterfaceA {\n\tint a = 5;\n\tvoid show();\n\tint display();\n}", "public interface B extends A {\n void b();\n}", "public interface InterfaceB extends SuperInterface{\n\n int getB();\n}", "public interface C16740s extends IInterface {\n /* renamed from: a */\n void mo43357a(C16726e eVar) throws RemoteException;\n}", "interface InterfaceA1 { // 1、接口。\n public String INFO = \"Hello world!\";\n\n public void print();\n}", "public interface C1250dr extends IInterface {\n /* renamed from: a */\n void mo12504a(brw brw, C0719a aVar);\n}", "interface Interface1 {\n\tpublic void getA();\n\n\tpublic void printA();\n}", "public interface InterB {\n String a = \"B\";\n}", "public interface a {\n }", "public interface InterfaceB {\n\tpublic String getB1();\n\n\tpublic String getB2();\n}", "public interface AInterface {\n\n public void say();\n\n}", "public interface C3222n extends IInterface {\n /* renamed from: a */\n void mo13025a() throws RemoteException;\n\n /* renamed from: b */\n void mo13026b() throws RemoteException;\n}", "public interface interfaceA extends LocationListener, SensorEventListener {\n}", "public interface AbstractC03680oI {\n}", "interface NewInterface extends Interface1,Interface2,Interface3{\n\n\tpublic void getD();\n\n}", "public interface IOverride extends IMeasurement_descriptor{\n\n\tpublic IRI iri();\n\n}", "public interface C46409a {\n}", "public interface AbstractC0211Dj0 {\n void a(int i);\n}", "public static interface .cart.interfaces.a.k\n extends b\n{\n\n public abstract void a();\n\n public abstract void a(CartProductShippingModeDetails cartproductshippingmodedetails);\n\n public abstract void a(k k);\n\n public abstract void b();\n}", "public interface C0385a {\n }", "public interface C1279b extends C1278a {\n}", "public interface C21597a {\n }", "public interface a {\n void a();\n }", "public interface a {\n void a();\n }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "public interface InterfaceB {\n public void display();\n}", "interface A {\n\t\tvoid displayA();\n\t}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface C0069a {\n void a();\n }", "public interface C0984b extends C0983a {\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public interface b {\n void a();\n }", "public interface b {\n void a();\n }", "public interface B{\n String getName();\n}", "interface C34503a {\n void bMl();\n }", "public void interfaceMethod() {\n\t\tSystem.out.println(\"overriden method from interface\");\t\t\r\n\t}", "public interface C43157d extends C1677a {\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface b {\n int a();\n }", "public interface Phoneextensions extends GeneratedPhoneextensions {\n \n \n}", "public interface C13719g {\n}", "public interface AbstractC1953c50 {\n}", "public interface TestInterface2 {\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "public interface XModule extends ru.awk.spb.xonec.XOneC.XModule\r\n{\r\n}", "public interface MessagesSuccessSelenium extends MessagesSuccess, SElement {\r\n\r\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "public interface AbstractC1008ba extends JQ {\n void AA9();\n}", "public interface C24717ak {\n}", "interface A {\n void a();\n}", "public interface b {\n}", "public interface b {\n}", "public interface PhrasingContent extends ContentInterface {\r\n\r\n}", "public interface C19588a {\n }", "public interface C32115a {\n}", "interface b {\n\n /* compiled from: CreditAccountContract */\n public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }\n\n /* compiled from: CreditAccountContract */\n public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }\n}", "public interface C22486a {\n void bGQ();\n\n void cMy();\n }", "public interface B\n{\n String foo();\n}", "public interface C22379d {\n}", "public interface IBaseModle {\n\n\n}", "@Override\n public boolean isInterface() { return false; }", "public interface A {\n void f();\n}", "public interface IFaci {\n}", "public interface SampleA {\n void operation1();\n void operation2();\n}", "public interface C0136c {\n }", "public interface zzo\n extends IInterface\n{\n\n public abstract void zze(AdRequestParcel adrequestparcel);\n}", "public interface C0425p {\n}", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "public interface IInventoryObject extends IID\n{\n}", "public interface Date extends Tipo_Dato {\r\n}", "public interface BInf {\n\n void hello();\n\n}", "public interface DriverExtMethods\r\n extends DriverExtMethodsStubI\r\n{\r\n\r\n\r\n}", "@Override\n\tpublic void common() {\n\t\tSystem.out.println(\"hello from common() for MyInterface2,MyInterface1 \");\n\t}", "public interface i {\n}", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface AbstractC2883ha {\n boolean a();\n}", "public interface InterfaceA {\n\n default String message() {\n return \"Message from Interface A\";\n }\n\n}", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "interface Interface2 {\n\tpublic void getB();\n\n\tpublic void printB();\n}", "interface a {\n int aadd();\n int sub();\n}", "public interface C9222a {\n }", "interface InterfaceChild extends InterfaceParent {\n default String introduce() {\n return \"InterfaceChild\";\n }\n}", "public Object _get_interface()\n {\n throw new NO_IMPLEMENT(reason);\n }", "public interface C3183a {\n}", "public interface Page358InterfaceB {\n public void something();\n}", "public interface bzt extends cdm {\n}", "public interface C11910c {\n}", "public interface SampleB {\n void operation1();\n void operation2();\n}", "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C8482e {\n}", "public interface AnInterface {\n void f();\n\n void g();\n\n void h();\n}", "public interface C31378a {\n /* renamed from: a */\n void mo80555a(MediaChooseResult mediaChooseResult);\n}", "public interface IMainModel extends IBaseModel {\n}", "interface A3 extends A1, A2{\r\n\t\r\n}", "public interface IBibliotheque {\n\t// Start of user code (user defined attributes for IBibliotheque)\n\n\t// End of user code\n\n\t/**\n\t * Description of the method listeDesEmpruntsEnCours.\n\t */\n\tpublic void listeDesEmpruntsEnCours();\n\n\t// Start of user code (user defined methods for IBibliotheque)\n\n\t// End of user code\n\n}", "@AssignableSubInterfaces(get={})\n\n@ImplementationClass(get=Brain.class)\n public interface IBrain\n extends ICentralNervousSystem{\n\n}" ]
[ "0.76261514", "0.75863343", "0.73357844", "0.7104458", "0.7080626", "0.7079362", "0.7035694", "0.7030901", "0.702816", "0.7014919", "0.6996861", "0.69687617", "0.695268", "0.6950941", "0.6891856", "0.68904155", "0.6879966", "0.68163383", "0.6790852", "0.6760945", "0.6758958", "0.6725355", "0.67217046", "0.67138827", "0.67133343", "0.67086434", "0.67086434", "0.6706315", "0.67016006", "0.6700582", "0.6684279", "0.6678466", "0.6663581", "0.66628474", "0.6654502", "0.6654502", "0.66528755", "0.6612873", "0.66124487", "0.6607004", "0.65993005", "0.65972245", "0.6591536", "0.6589075", "0.65883195", "0.6587761", "0.6579038", "0.6577335", "0.657042", "0.6570335", "0.65698576", "0.65570104", "0.65520626", "0.6544362", "0.65439117", "0.65439117", "0.65435416", "0.6537762", "0.6535438", "0.6532765", "0.65263027", "0.6521659", "0.6516931", "0.65011024", "0.64997625", "0.64980984", "0.649409", "0.64918864", "0.6489632", "0.64880705", "0.64787304", "0.64557105", "0.64537096", "0.64516985", "0.64483255", "0.64350426", "0.64326334", "0.6422315", "0.6411334", "0.6409488", "0.6393136", "0.63928324", "0.6391101", "0.63886327", "0.6384683", "0.6383591", "0.6382896", "0.63676214", "0.63667387", "0.636436", "0.6360091", "0.63582474", "0.6354932", "0.6352601", "0.6351097", "0.63486016", "0.6347917", "0.63426685", "0.6338012", "0.63359743" ]
0.69203234
14
Before Java 8, the interface only contains method signatures. With Java 8 new feature Default Methods or Defender Methods, you can include method body within the interface.
default void defaultMethod() { System.out.println("from InterfaceA, default method..."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "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}", "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}", "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}", "@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}", "public interface MyInterface2 {\n default void hello(){\n System.out.println(\"hello again\");\n }\n}", "public interface ITestInterface {\n\t\tdefault public void sayHello() {\n\t\t\tSystem.out.println(\"Hi World!\");\n\t\t}\n\t}", "interface A {\n default void m() {\n System.out.println(\"I am default method\");\n }\n}", "interface I4 {\n public default void m1() { // <- Modifier 'public' is redundant for interface methods\n System.out.println(\"I4.m1()\");\n } // public is redundant\n\n /**\n * it is public, but NOT abstract (error: Illegal combination of modifiers: 'abstract' and 'default')\n */\n default void m2() {\n System.out.println(\"I4.m2()\");\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 interface Interface {\n void doSomething();\n void somethingElse(String arg);\n}", "public interface A {\n default void oi(){\n System.out.println(\"Dentro do oi de A\");\n }\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 }", "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}", "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 InterfaceA {\n\n default String message() {\n return \"Message from Interface A\";\n }\n\n}", "default void helloDefault() {\n\t\tSystem.out.println(\"Hello from default method definitions from Java8 within interfaces\");\n\t}", "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 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}", "public interface HelloWorld {\n void sayHelloWorld();\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}", "public interface AnInterface {\n void f();\n\n void g();\n\n void h();\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}", "default void display1(){\n\t\tSystem.out.println(\"Default Method inside interface\");\n\t}", "public interface SimpleInterface {\n void f();\n}", "public interface a {\n void a();\n }", "public interface a {\n void a();\n }", "public interface Hello {\n\n String hello();\n}", "public interface Walk {\n\n public default void status() {\n System.out.println(\"Walking\");\n }\n}", "public interface MyInterface {\n\n String returnString(String string);\n\n default int returnInt() {\n return 105;\n }\n}", "public interface Hello {\n String sayHello();\n}", "public void interfaceMethod() {\n\t\tSystem.out.println(\"overriden method from interface\");\t\t\r\n\t}", "public interface IFruit {\n\n void say();\n}", "interface InterfaceChild extends InterfaceParent {\n default String introduce() {\n return \"InterfaceChild\";\n }\n}", "interface A {\n void a();\n}", "public interface HelloWorld {\r\n\r\n void sayHello(String name);\r\n}", "public interface A {\n void f();\n}", "public void method_1()\n {\n System.out.println(\"Interface method.\");\n }", "public interface test {\n void test();\n}", "public interface IFlyAminal {\n void fly();\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 interface FlyingAnimal extends Animal {\n @Override\n default String identifyMyself(){\n return \"I am an animal and I can fly\";\n }\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 def2 {\n default void go(){\n System.out.println(\"def2\");\n }\n}", "public interface i {\n int a();\n\n boolean b();\n\n void c();\n}", "public interface f {\n void a();\n}", "public void testCreateEmptyInterfaceMethod() {\n IDOMMethod method = this.domFactory.createMethod();\n method.setName(\"foo\");\n method.setBody(\";\\n\");\n assertSourceEquals(\"source code incorrect\", \"public void foo();\\n\", method.getContents());\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}", "interface InterfaceDemo {\n int age =0; //接口中变量都是公开静态常量\n String name =null;\n abstract void aa();\n\n public abstract void display(); //接口中方法都是抽象的\n}", "@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 }", "interface MyFunctionalInterface {\n\tpublic void execute();\n\n\tpublic default void print(String text) {\n\t\tSystem.out.println(text);\n\t}\n\n\tpublic static void print(String text, PrintWriter writer) throws IOException {\n\t\twriter.write(text);\n\t}\n}", "public interface SayHelloInterface {\n\n String sayHello(String text);\n}", "public interface SimpleInterface {\n String interfaceMethod(Integer value);\n}", "public void hello(){\n\t\tSystem.out.println(\"hello Interface\\n\");\n\t}", "interface InWriter { // In interface class, all methods are abstract. (You can't specify the body)\n // public abstract void write(); By default all methods are public and abstract\n void write();\n}", "public interface Greeting {\n void sayHello(String name);\n}", "public interface MyInterface {\n public void m1();\n public void m2();\n public void m3();\n public void m4();\n\n}", "public interface Work {\n default void doWork() {\n }\n}", "public interface MyInterface {\n void getDate(String name);\n}", "public interface b {\n void a();\n }", "public interface b {\n void a();\n }", "interface C34503a {\n void bMl();\n }", "public interface IBibliotheque {\n\t// Start of user code (user defined attributes for IBibliotheque)\n\n\t// End of user code\n\n\t/**\n\t * Description of the method listeDesEmpruntsEnCours.\n\t */\n\tpublic void listeDesEmpruntsEnCours();\n\n\t// Start of user code (user defined methods for IBibliotheque)\n\n\t// End of user code\n\n}", "interface Sayable{ \n void say(); \n}", "public interface Greeter {\n\t\n\tvoid sayHello();\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}", "interface Test4{\r\n\tpublic void m1();\r\n}", "interface Left {\n default void m1() {\n System.out.println(\"Left\");\n }\n}", "@FunctionalInterface\npublic interface MyFunctional01 {\n\tvoid method();\n\t// Error:(7, 1) java: Unexpected @FunctionalInterface annotation\n\t// ru.demi.java_examples.java_8.MyFunctional01 is not a functional interface\n\t// multiple non-overriding abstract methods found in interface ru.demi.java_examples.java_8.MyFunctional01\n\t// void method02();\n}", "@FunctionalInterface\npublic interface Functional_Interface {\n\t\n\tpublic void printMessage(String message);\n\t\n\tdefault void printDefaultMessage(String defaultMessage)\n\t{\n\t\tSystem.out.println(\"This is default message\"+\" \"+defaultMessage);\n\t}\n\t\n\tstatic void printStaticMessage(String staticMessage)\n\t{\n\t\tSystem.out.println(\"This is static message\"+\" \"+staticMessage);\n\t}\n\t\n\n}", "public interface Sayable {\n void say();\n}", "@Override\n public void defaultMethod() {\n I4.super.defaultMethod();\n }", "interface IFly {\n void fly();\n}", "public interface FlyBehevour {\n void fly();\n}", "public interface C22486a {\n void bGQ();\n\n void cMy();\n }", "public interface SampleA {\n void operation1();\n void operation2();\n}", "interface Greeting {\n public void greet(Greeter greeter);\n}", "private static interface Base {\n\n public void foo();\n }", "public interface d {\n void a();\n}", "public interface b {\n int a();\n }", "public interface i {\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}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "interface Printer {\n\n static void print(){\n System.out.println(\"print in interface\");\n }\n}", "interface StaticMethodInInterface {\n\t// abstract method\n\tpublic void square(int a);\n\n\t// static method\n\tstatic void show() {\n\t\tSystem.out.println(\"Static Method Executed\");\n\t}\n}", "interface I {}", "@Override\n\tpublic void method4() {\n\t\tSystem.out.println(\"Hello from MyInterface1 method4() \");\n\t}", "public interface Tweetable {\n /*\n Typically in an interface you put lists of methods with no code in them. They don't\n usually have constructors. How they work: like saying \"I promise to have these methods\". If\n I want to implement this interface I must have these methods. Like a checklist that\n classes need to check off. How to use: like a super class. Instead of 'extends' we use\n 'implements'\n */\n public String getText();\n public Date getDate();\n\n}", "interface Chicken {\n public void gobble();\n public void fly();\n}", "interface A {\n int summ(int x, int y);\n}", "interface ccf {\n void a();\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}", "public interface Citizen {\n public abstract void sayHello();\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 Service {\n void method1();\n void method2();\n}", "public interface C1061nc extends IInterface {\n /* renamed from: a */\n String mo2800a();\n\n /* renamed from: a */\n String mo2801a(String str);\n\n /* renamed from: a */\n void mo2802a(String str, boolean z);\n\n /* renamed from: a */\n boolean mo2803a(boolean z);\n}", "public interface Pasticcere {\r\n //No attributes\r\n public void accendiForno();\r\n}", "interface A9 {\r\n void test(int i, String s1); //test method is taking some argument\r\n}", "public interface m {\n void a(boolean z);\n}" ]
[ "0.7810409", "0.7798962", "0.7699293", "0.75252324", "0.7406081", "0.73538005", "0.7306378", "0.7274506", "0.72701526", "0.71884865", "0.7159974", "0.7108855", "0.7069239", "0.70610297", "0.70407957", "0.7005152", "0.6997123", "0.6979473", "0.6960497", "0.6875339", "0.68550193", "0.685395", "0.6848783", "0.68292385", "0.68020964", "0.6797733", "0.67834216", "0.67834216", "0.6716992", "0.6701842", "0.6698808", "0.66972244", "0.66930354", "0.668191", "0.66608584", "0.6660649", "0.66573375", "0.6648023", "0.66252977", "0.6595132", "0.6593857", "0.6541679", "0.65391654", "0.6537372", "0.6534322", "0.65335786", "0.65217084", "0.6494194", "0.64895517", "0.6483491", "0.6476693", "0.64751554", "0.64738077", "0.64688486", "0.6466028", "0.64566576", "0.6451271", "0.6445547", "0.64425665", "0.6437073", "0.6432293", "0.6432293", "0.6414879", "0.64139974", "0.64067614", "0.6394003", "0.6356018", "0.6341482", "0.63229537", "0.6320307", "0.631763", "0.6317155", "0.63024044", "0.62954813", "0.62898326", "0.62819225", "0.62662566", "0.6253979", "0.6247394", "0.6247199", "0.62448275", "0.62323415", "0.62292963", "0.62245953", "0.6206708", "0.6198579", "0.6177296", "0.6171636", "0.6167111", "0.616687", "0.61663944", "0.61610997", "0.6151846", "0.6150466", "0.61403364", "0.61392415", "0.61296487", "0.6112823", "0.6108155", "0.61053354" ]
0.7046971
14
/ renamed from: a
public E m58942a() { E b = m58945b(); m58944a(null); return b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: b
public E m58945b() { return this.f48622a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo2508a(bxb bxb);", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void b() {\n }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "@Override\n\tpublic void b() {\n\n\t}", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public bb b() {\n return a(this.a);\n }", "@Override\n\tpublic void b1() {\n\t\t\n\t}", "public void b() {\r\n }", "@Override\n\tpublic void bbb() {\n\t\t\n\t}", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public abstract void b(StringBuilder sb);", "public void b() {\n }", "public void b() {\n }", "protected b(int mb) {\n/* 87 */ this.b = mb;\n/* */ }", "public u(b paramb)\r\n/* 7: */ {\r\n/* 8: 9 */ this.a = paramb;\r\n/* 9: */ }", "public interface b {\n void H_();\n\n void I_();\n\n void J_();\n\n void a(C0063d dVar);\n\n void a(byte[] bArr);\n\n void b(boolean z);\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public void b() {\n ((a) this.a).b();\n }", "public np a()\r\n/* 33: */ {\r\n/* 34:49 */ return this.b;\r\n/* 35: */ }", "b(a aVar) {\n super(0);\n this.this$0 = aVar;\n }", "public t b() {\n return a(this.a);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "public static String a(int c) {\n/* 89 */ return b.a(c);\n/* */ }", "private void m678b(byte b) {\n byte[] bArr = this.f523r;\n bArr[0] = b;\n this.f552g.mo502b(bArr);\n }", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "public abstract T zzm(B b);", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public void b(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 27: */ {\r\n/* 28: 47 */ bcm localbcm = paramaqu.s(paramdt);\r\n/* 29: 48 */ if ((localbcm instanceof bdv)) {\r\n/* 30: 49 */ ((bdv)localbcm).h();\r\n/* 31: */ } else {\r\n/* 32: 51 */ super.b(paramaqu, paramdt, parambec);\r\n/* 33: */ }\r\n/* 34: */ }", "public abstract void zzc(B b, int i, int i2);", "public interface b {\n}", "public interface b {\n}", "private void m10263b(byte b) throws cf {\r\n this.f6483r[0] = b;\r\n this.g.m10347b(this.f6483r);\r\n }", "BSubstitution createBSubstitution();", "public void b(ahd paramahd) {}", "void b();", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "B database(S database);", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public abstract C0631bt mo9227aB();", "public an b() {\n return a(this.a);\n }", "protected abstract void a(bru parambru);", "static void go(Base b) {\n\t\tb.add(8);\n\t}", "void mo46242a(bmc bmc);", "public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }", "public interface bca extends bbn {\n bca a();\n\n bca a(String str);\n\n bca b(String str);\n\n bca c(String str);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public abstract BoundType b();", "public void b(amj paramamj)\r\n/* 538: */ {\r\n/* 539:579 */ this.f = paramamj;\r\n/* 540: */ }", "b(a aVar, com.bytedance.jedi.model.h.a aVar2) {\n super(aVar2);\n this.f21531a = aVar;\n this.f21532b = new com.bytedance.jedi.model.h.f(aVar);\n }", "private void b(int paramInt)\r\n/* 193: */ {\r\n/* 194:203 */ this.h.a(a(paramInt));\r\n/* 195: */ }", "public void b(ahb paramahb)\r\n/* 583: */ {\r\n/* 584:625 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 585:626 */ this.a[i] = amj.b(paramahb.a[i]);\r\n/* 586: */ }\r\n/* 587:628 */ for (i = 0; i < this.b.length; i++) {\r\n/* 588:629 */ this.b[i] = amj.b(paramahb.b[i]);\r\n/* 589: */ }\r\n/* 590:631 */ this.c = paramahb.c;\r\n/* 591: */ }", "interface b {\n\n /* compiled from: CreditAccountContract */\n public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }\n\n /* compiled from: CreditAccountContract */\n public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }\n}", "@Override\n\tpublic void visit(PartB partB) {\n\n\t}", "public abstract void zzb(B b, int i, long j);", "public abstract void zza(B b, int i, zzeh zzeh);", "int metodo2(int a, int b) {\r\n\r\n\t\tthis.a += 5; // se modifica el campo del objeto, el uso de la palabra reservada this se utiliza para referenciar al campo.\r\n\t\tb += 7;\r\n\t\treturn a; // modifica en la asignaci\\u00f3n\r\n\t}", "private void internalCopy(Board b) {\n for (int i = 0; i < SIDE * SIDE; i += 1) {\n set(i, b.get(i));\n }\n\n _directions = b._directions;\n _whoseMove = b._whoseMove;\n _history = b._history;\n }", "public int b()\r\n/* 69: */ {\r\n/* 70:74 */ return this.b;\r\n/* 71: */ }", "public void b(StringBuilder sb) {\n sb.append(this.a);\n sb.append(')');\n }", "public void b() {\n e$a e$a;\n try {\n e$a = this.b;\n }\n catch (IOException iOException) {\n return;\n }\n Object object = this.c;\n e$a.b(object);\n }", "public abstract void a(StringBuilder sb);", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public abstract void zzf(Object obj, B b);", "public interface bdp {\n\n /* renamed from: a */\n public static final bdp f3422a = new bdo();\n\n /* renamed from: a */\n bdm mo1784a(akh akh);\n}", "@Override\n\tpublic void parse(Buffer b) {\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public abstract void a(b paramb, int paramInt1, int paramInt2);", "public void mo1945a(byte b) throws cf {\r\n m10263b(b);\r\n }", "void mo83703a(C32456b<T> bVar);", "public void a(String str) {\n ((b.b) this.b).d(str);\n }", "public void selectB() { }", "BOperation createBOperation();", "void metodo1(int a, int b) {\r\n\t\ta += 5;//par\\u00e1metro con el mismo nombre que el campo.\r\n\t\tb += 7;\r\n\t}", "private static void m2196a(StringBuffer stringBuffer, byte b) {\n stringBuffer.append(\"0123456789ABCDEF\".charAt((b >> 4) & 15)).append(\"0123456789ABCDEF\".charAt(b & 15));\n }", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public void b(fv paramfv)\r\n/* 408: */ {\r\n/* 409:423 */ this.a = new amj[36];\r\n/* 410:424 */ this.b = new amj[4];\r\n/* 411:425 */ for (int i = 0; i < paramfv.c(); i++)\r\n/* 412: */ {\r\n/* 413:426 */ fn localfn = paramfv.b(i);\r\n/* 414:427 */ int j = localfn.d(\"Slot\") & 0xFF;\r\n/* 415:428 */ amj localamj = amj.a(localfn);\r\n/* 416:429 */ if (localamj != null)\r\n/* 417: */ {\r\n/* 418:430 */ if ((j >= 0) && (j < this.a.length)) {\r\n/* 419:431 */ this.a[j] = localamj;\r\n/* 420: */ }\r\n/* 421:433 */ if ((j >= 100) && (j < this.b.length + 100)) {\r\n/* 422:434 */ this.b[(j - 100)] = localamj;\r\n/* 423: */ }\r\n/* 424: */ }\r\n/* 425: */ }\r\n/* 426: */ }", "public void b(String str) {\n ((b.b) this.b).e(str);\n }", "public String b()\r\n/* 35: */ {\r\n/* 36:179 */ return a();\r\n/* 37: */ }", "public abstract void zza(B b, int i, T t);", "public Item b(World paramaqu, BlockPosition paramdt)\r\n/* 189: */ {\r\n/* 190:220 */ return null;\r\n/* 191: */ }", "public abstract void zza(B b, int i, long j);", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public abstract void mo9798a(byte b);", "public void mo9798a(byte b) {\n if (this.f9108f == this.f9107e) {\n mo9827i();\n }\n byte[] bArr = this.f9106d;\n int i = this.f9108f;\n this.f9108f = i + 1;\n bArr[i] = b;\n this.f9109g++;\n }", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "private void m676a(TField bkVar, byte b) {\n if (b == -1) {\n b = m687e(bkVar.f538b);\n }\n short s = bkVar.f539c;\n short s2 = this.f519n;\n if (s <= s2 || s - s2 > 15) {\n m678b(b);\n mo446a(bkVar.f539c);\n } else {\n m686d(b | ((s - s2) << 4));\n }\n this.f519n = bkVar.f539c;\n }", "private static void m831a(C0741g<?> gVar, C0747b bVar) {\n gVar.mo9477a(C0743i.f718b, (C0739e<? super Object>) bVar);\n gVar.mo9476a(C0743i.f718b, (C0738d) bVar);\n gVar.mo9474a(C0743i.f718b, (C0736b) bVar);\n }", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "private void j()\n/* */ {\n/* 223 */ c localc = this.b;\n/* 224 */ this.b = this.c;\n/* 225 */ this.c = localc;\n/* 226 */ this.c.b();\n/* */ }", "public lj ar(byte b) {\n throw new Runtime(\"d2j fail translate: java.lang.RuntimeException: can not merge I and Z\\r\\n\\tat com.googlecode.dex2jar.ir.TypeClass.merge(TypeClass.java:100)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeRef.updateTypeClass(TypeTransformer.java:174)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.provideAs(TypeTransformer.java:780)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.e1expr(TypeTransformer.java:496)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:713)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.enexpr(TypeTransformer.java:698)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:719)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.s1stmt(TypeTransformer.java:810)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.sxStmt(TypeTransformer.java:840)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.analyze(TypeTransformer.java:206)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer.transform(TypeTransformer.java:44)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.optimize(Dex2jar.java:162)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertCode(Dex2Asm.java:414)\\r\\n\\tat com.googlecode.d2j.dex.ExDex2Asm.convertCode(ExDex2Asm.java:42)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.convertCode(Dex2jar.java:128)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertMethod(Dex2Asm.java:509)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:406)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertDex(Dex2Asm.java:422)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.doTranslate(Dex2jar.java:172)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.to(Dex2jar.java:272)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:108)\\r\\n\\tat com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:288)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:32)\\r\\n\");\n }", "public interface AbstractC10485b {\n /* renamed from: a */\n void mo64153a(boolean z);\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.64558864", "0.6283203", "0.6252635", "0.6250949", "0.6244743", "0.6216273", "0.6194491", "0.6193556", "0.61641675", "0.6140157", "0.60993093", "0.60974354", "0.6077849", "0.6001867", "0.5997364", "0.59737104", "0.59737104", "0.5905105", "0.5904295", "0.58908087", "0.5886636", "0.58828026", "0.5855491", "0.584618", "0.5842517", "0.5824137", "0.5824071", "0.58097327", "0.5802052", "0.58012927", "0.579443", "0.5792392", "0.57902914", "0.5785124", "0.57718205", "0.57589084", "0.5735892", "0.5735892", "0.5734873", "0.5727929", "0.5720821", "0.5712531", "0.5706813", "0.56896514", "0.56543154", "0.5651059", "0.5649904", "0.56496733", "0.5647035", "0.5640965", "0.5640109", "0.563993", "0.5631903", "0.5597427", "0.55843794", "0.5583287", "0.557783", "0.55734867", "0.55733293", "0.5572254", "0.55683887", "0.55624336", "0.55540246", "0.5553985", "0.55480546", "0.554261", "0.5535739", "0.5529958", "0.5519634", "0.5517503", "0.55160624", "0.5511545", "0.5505353", "0.5500533", "0.5491741", "0.5486198", "0.5481978", "0.547701", "0.54725856", "0.5471632", "0.5463497", "0.5460805", "0.5454913", "0.5454885", "0.54519916", "0.5441594", "0.5436747", "0.5432453", "0.5425923", "0.5424724", "0.54189867", "0.54162544", "0.54051477", "0.53998184", "0.53945845", "0.53887725", "0.5388146", "0.5387678", "0.53858143", "0.53850687", "0.5384439" ]
0.0
-1
/ renamed from: a
public void m58944a(E e) { this.f48622a = e; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
public void m58943a(LinkedQueueNode<E> linkedQueueNode) { lazySet(linkedQueueNode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: c
public LinkedQueueNode<E> m58946c() { return (LinkedQueueNode) get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo5289a(C5102c c5102c);", "public static void c0() {\n\t}", "void mo57278c();", "private static void cajas() {\n\t\t\n\t}", "void mo5290b(C5102c c5102c);", "void mo80457c();", "void mo12638c();", "void mo28717a(zzc zzc);", "void mo21072c();", "@Override\n\tpublic void ccc() {\n\t\t\n\t}", "public void c() {\n }", "void mo17012c();", "C2451d mo3408a(C2457e c2457e);", "void mo88524c();", "void mo86a(C0163d c0163d);", "void mo17021c();", "public abstract void mo53562a(C18796a c18796a);", "void mo4874b(C4718l c4718l);", "void mo4873a(C4718l c4718l);", "C12017a mo41088c();", "public abstract void mo70702a(C30989b c30989b);", "void mo72114c();", "public void mo12628c() {\n }", "C2841w mo7234g();", "public interface C0335c {\n }", "public void mo1403c() {\n }", "public static void c3() {\n\t}", "public static void c1() {\n\t}", "void mo8712a(C9714a c9714a);", "void mo67924c();", "public void mo97906c() {\n }", "public abstract void mo27385c();", "String mo20731c();", "public int c()\r\n/* 74: */ {\r\n/* 75:78 */ return this.c;\r\n/* 76: */ }", "public interface C0939c {\n }", "void mo1582a(String str, C1329do c1329do);", "void mo304a(C0366h c0366h);", "void mo1493c();", "private String getString(byte c) {\n\t\treturn c==1? \"$ \": \" \";\n\t}", "java.lang.String getC3();", "C45321i mo90380a();", "public interface C11910c {\n}", "void mo57277b();", "String mo38972c();", "static int type_of_cnc(String passed){\n\t\treturn 1;\n\t}", "public static void CC2_1() {\n\t}", "static int type_of_cc(String passed){\n\t\treturn 1;\n\t}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public void mo56167c() {\n }", "public interface C0136c {\n }", "private void kk12() {\n\n\t}", "abstract String mo1748c();", "public abstract void mo70710a(String str, C24343db c24343db);", "public interface C0303q extends C0291e {\n /* renamed from: a */\n void mo1747a(int i);\n\n /* renamed from: a */\n void mo1749a(C0288c cVar);\n\n /* renamed from: a */\n void mo1751a(byte[] bArr);\n\n /* renamed from: b */\n void mo1753b(int i);\n\n /* renamed from: c */\n void mo1754c(int i);\n\n /* renamed from: d */\n void mo1755d(int i);\n\n /* renamed from: e */\n int mo1756e(int i);\n\n /* renamed from: g */\n int mo1760g();\n\n /* renamed from: g */\n void mo1761g(int i);\n\n /* renamed from: h */\n void mo1763h(int i);\n}", "C3577c mo19678C();", "public abstract int c();", "public abstract int c();", "public final void mo11687c() {\n }", "byte mo30283c();", "private java.lang.String c(java.lang.String r7) {\n /*\n r6 = this;\n r2 = \"\";\n r0 = r6.e;\t Catch:{ FileNotFoundException -> 0x0052 }\n if (r0 == 0) goto L_0x0050;\n L_0x0006:\n r0 = new java.lang.StringBuilder;\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = java.lang.String.valueOf(r7);\t Catch:{ FileNotFoundException -> 0x0052 }\n r0.<init>(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = \".\";\n r0 = r0.append(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = r6.e;\t Catch:{ FileNotFoundException -> 0x0052 }\n r0 = r0.append(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r0 = r0.toString();\t Catch:{ FileNotFoundException -> 0x0052 }\n L_0x001f:\n r1 = r6.d;\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = r1.openFileInput(r0);\t Catch:{ FileNotFoundException -> 0x0052 }\n L_0x0025:\n r3 = new java.io.BufferedReader;\n r4 = new java.io.InputStreamReader;\n r0 = r1;\n r0 = (java.io.InputStream) r0;\n r5 = \"UTF-8\";\n r5 = java.nio.charset.Charset.forName(r5);\n r4.<init>(r0, r5);\n r3.<init>(r4);\n r0 = new java.lang.StringBuffer;\n r0.<init>();\n L_0x003d:\n r4 = r3.readLine();\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n if (r4 != 0) goto L_0x0061;\n L_0x0043:\n r0 = r0.toString();\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x007d }\n r1.close();\t Catch:{ IOException -> 0x007d }\n r3.close();\t Catch:{ IOException -> 0x007d }\n L_0x004f:\n return r0;\n L_0x0050:\n r0 = r7;\n goto L_0x001f;\n L_0x0052:\n r0 = move-exception;\n r0 = r6.d;\t Catch:{ IOException -> 0x005e }\n r0 = r0.getAssets();\t Catch:{ IOException -> 0x005e }\n r1 = r0.open(r7);\t Catch:{ IOException -> 0x005e }\n goto L_0x0025;\n L_0x005e:\n r0 = move-exception;\n r0 = r2;\n goto L_0x004f;\n L_0x0061:\n r0.append(r4);\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n goto L_0x003d;\n L_0x0065:\n r0 = move-exception;\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x0070 }\n r1.close();\t Catch:{ IOException -> 0x0070 }\n r3.close();\t Catch:{ IOException -> 0x0070 }\n r0 = r2;\n goto L_0x004f;\n L_0x0070:\n r0 = move-exception;\n r0 = r2;\n goto L_0x004f;\n L_0x0073:\n r0 = move-exception;\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x007f }\n r1.close();\t Catch:{ IOException -> 0x007f }\n r3.close();\t Catch:{ IOException -> 0x007f }\n L_0x007c:\n throw r0;\n L_0x007d:\n r1 = move-exception;\n goto L_0x004f;\n L_0x007f:\n r1 = move-exception;\n goto L_0x007c;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.a.b.b.c(java.lang.String):java.lang.String\");\n }", "@Override\n\tpublic void compile(CodeBlock c, CompilerEnvironment environment) {\n\n\t}", "public interface C3196it extends C3208jc {\n /* renamed from: a */\n void mo30275a(long j);\n\n /* renamed from: b */\n C3197iu mo30281b(long j);\n\n /* renamed from: b */\n boolean mo30282b();\n\n /* renamed from: c */\n byte mo30283c();\n\n /* renamed from: c */\n String mo30285c(long j);\n\n /* renamed from: d */\n void mo30290d(long j);\n\n /* renamed from: e */\n int mo30291e();\n\n /* renamed from: f */\n long mo30295f();\n}", "public static void mmcc() {\n\t}", "java.lang.String getCit();", "public abstract C mo29734a();", "C15430g mo56154a();", "void mo41086b();", "@Override\n public void func_104112_b() {\n \n }", "public interface C9223b {\n }", "public abstract String mo11611b();", "void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);", "String getCmt();", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "interface C2578d {\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}", "double fFromC(double c) {\n return (c * 9 / 5) + 32;\n }", "void mo72113b();", "void mo1749a(C0288c cVar);", "public interface C0764b {\n}", "void mo41083a();", "String[] mo1153c();", "C1458cs mo7613iS();", "public interface C0333a {\n }", "public abstract int mo41077c();", "public interface C8843g {\n}", "public abstract void mo70709a(String str, C41018cm c41018cm);", "void mo28307a(zzgd zzgd);", "public static void mcdc() {\n\t}", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "C1435c mo1754a(C1433a c1433a, C1434b c1434b);", "public interface C0389gj extends C0388gi {\n}", "C5727e mo33224a();", "C12000e mo41087c(String str);", "public abstract String mo118046b();", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C0938b {\n }", "void mo80455b();", "public interface C0385a {\n }", "public interface C5527c {\n /* renamed from: a */\n int mo4095a(int i);\n\n /* renamed from: b */\n C5537g mo4096b(int i);\n}", "public interface C32231g {\n /* renamed from: a */\n void mo8280a(int i, int i2, C1207m c1207m);\n}", "public interface C11994b {\n /* renamed from: a */\n C11996a mo41079a(String str);\n\n /* renamed from: a */\n C11996a mo41080a(String str, C11997b bVar, String... strArr);\n\n /* renamed from: a */\n C11998c mo41081a(String str, C11999d dVar, String... strArr);\n\n /* renamed from: a */\n C12000e mo41082a(String str, C12001f fVar, String... strArr);\n\n /* renamed from: a */\n void mo41083a();\n\n /* renamed from: a */\n void mo41084a(C12018b bVar, ConnectionState... connectionStateArr);\n\n /* renamed from: b */\n C11996a mo41085b(String str);\n\n /* renamed from: b */\n void mo41086b();\n\n /* renamed from: c */\n C12000e mo41087c(String str);\n\n /* renamed from: c */\n C12017a mo41088c();\n\n /* renamed from: d */\n void mo41089d(String str);\n\n /* renamed from: e */\n C11998c mo41090e(String str);\n\n /* renamed from: f */\n C12000e mo41091f(String str);\n\n /* renamed from: g */\n C11998c mo41092g(String str);\n}" ]
[ "0.64592767", "0.644052", "0.6431582", "0.6418656", "0.64118475", "0.6397491", "0.6250796", "0.62470585", "0.6244832", "0.6232792", "0.618864", "0.61662376", "0.6152657", "0.61496663", "0.6138441", "0.6137171", "0.6131197", "0.6103783", "0.60983956", "0.6077118", "0.6061723", "0.60513836", "0.6049069", "0.6030368", "0.60263443", "0.60089093", "0.59970635", "0.59756917", "0.5956231", "0.5949343", "0.5937446", "0.5911776", "0.59034705", "0.5901311", "0.5883238", "0.5871533", "0.5865361", "0.5851141", "0.581793", "0.5815705", "0.58012", "0.578891", "0.57870495", "0.5775621", "0.57608724", "0.5734331", "0.5731584", "0.5728505", "0.57239383", "0.57130504", "0.57094604", "0.570793", "0.5697671", "0.56975955", "0.56911296", "0.5684489", "0.5684489", "0.56768984", "0.56749034", "0.5659463", "0.56589085", "0.56573", "0.56537443", "0.5651912", "0.5648272", "0.5641736", "0.5639226", "0.5638583", "0.56299245", "0.56297386", "0.56186295", "0.5615729", "0.56117755", "0.5596015", "0.55905765", "0.55816257", "0.55813104", "0.55723965", "0.5572061", "0.55696625", "0.5566985", "0.55633485", "0.555888", "0.5555646", "0.55525774", "0.5549722", "0.5548184", "0.55460495", "0.5539394", "0.5535825", "0.55300397", "0.5527975", "0.55183905", "0.5517322", "0.5517183", "0.55152744", "0.5514932", "0.55128884", "0.5509501", "0.55044043", "0.54984957" ]
0.0
-1
/ renamed from: a
LinkedQueueNode<T> m66550a() { return (LinkedQueueNode) this.f57344a.get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: a
LinkedQueueNode<T> m66551a(LinkedQueueNode<T> linkedQueueNode) { return (LinkedQueueNode) this.f57344a.getAndSet(linkedQueueNode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }", "interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }", "public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}", "public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }", "public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }", "public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }", "protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }", "public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }", "public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }", "public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }", "public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }", "public void a() {\n ((a) this.a).a();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }", "@Override\r\n\tpublic void a() {\n\t\t\r\n\t}", "public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}", "public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}", "interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}", "public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }", "@Override\n\tpublic void a() {\n\t\t\n\t}", "public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}", "public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }", "public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}", "public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}", "public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }", "public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}", "public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}", "public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}", "public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}", "public void acionou(int a){\n\t\t\tb=a;\n\t\t}", "public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}", "public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }", "public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}", "public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }", "public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }", "public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }", "public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }", "public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }", "public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}", "public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}", "public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}", "protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }", "public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }", "public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }", "public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }", "public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}", "public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }", "public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }", "interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }", "public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}", "public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }", "private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }", "interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064", "0.5794689", "0.57890314", "0.57838726", "0.5775679", "0.57694733", "0.5769128", "0.57526815", "0.56907034", "0.5677874", "0.5670547", "0.56666386", "0.56592244", "0.5658682", "0.56574154", "0.5654324", "0.5644676", "0.56399715", "0.5638734", "0.5630582", "0.56183887", "0.5615435", "0.56069666", "0.5605207", "0.56005067", "0.559501", "0.55910283", "0.5590222", "0.55736613", "0.5556682", "0.5554544", "0.5550076", "0.55493855", "0.55446684", "0.5538079", "0.5529058", "0.5528109", "0.552641", "0.5525864", "0.552186", "0.5519972", "0.5509587", "0.5507195", "0.54881203", "0.5485328", "0.54826045", "0.5482066", "0.5481586", "0.5479751", "0.54776895", "0.54671466", "0.5463307", "0.54505056", "0.54436916", "0.5440517", "0.5439747", "0.5431944", "0.5422869", "0.54217863", "0.5417556", "0.5403905", "0.5400223", "0.53998446", "0.5394735", "0.5388649", "0.5388258", "0.5374842", "0.5368887", "0.53591394", "0.5357029", "0.5355688", "0.535506", "0.5355034", "0.53494394", "0.5341044", "0.5326166", "0.53236824", "0.53199095", "0.53177035", "0.53112453", "0.5298229" ]
0.0
-1
/ renamed from: b
LinkedQueueNode<T> m66552b() { return (LinkedQueueNode) this.f57345b.get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo2508a(bxb bxb);", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void b() {\n }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "@Override\n\tpublic void b() {\n\n\t}", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public bb b() {\n return a(this.a);\n }", "@Override\n\tpublic void b1() {\n\t\t\n\t}", "public void b() {\r\n }", "@Override\n\tpublic void bbb() {\n\t\t\n\t}", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public abstract void b(StringBuilder sb);", "public void b() {\n }", "public void b() {\n }", "protected b(int mb) {\n/* 87 */ this.b = mb;\n/* */ }", "public u(b paramb)\r\n/* 7: */ {\r\n/* 8: 9 */ this.a = paramb;\r\n/* 9: */ }", "public interface b {\n void H_();\n\n void I_();\n\n void J_();\n\n void a(C0063d dVar);\n\n void a(byte[] bArr);\n\n void b(boolean z);\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public void b() {\n ((a) this.a).b();\n }", "public np a()\r\n/* 33: */ {\r\n/* 34:49 */ return this.b;\r\n/* 35: */ }", "b(a aVar) {\n super(0);\n this.this$0 = aVar;\n }", "public t b() {\n return a(this.a);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "public static String a(int c) {\n/* 89 */ return b.a(c);\n/* */ }", "private void m678b(byte b) {\n byte[] bArr = this.f523r;\n bArr[0] = b;\n this.f552g.mo502b(bArr);\n }", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "public abstract T zzm(B b);", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public void b(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 27: */ {\r\n/* 28: 47 */ bcm localbcm = paramaqu.s(paramdt);\r\n/* 29: 48 */ if ((localbcm instanceof bdv)) {\r\n/* 30: 49 */ ((bdv)localbcm).h();\r\n/* 31: */ } else {\r\n/* 32: 51 */ super.b(paramaqu, paramdt, parambec);\r\n/* 33: */ }\r\n/* 34: */ }", "public abstract void zzc(B b, int i, int i2);", "public interface b {\n}", "public interface b {\n}", "private void m10263b(byte b) throws cf {\r\n this.f6483r[0] = b;\r\n this.g.m10347b(this.f6483r);\r\n }", "BSubstitution createBSubstitution();", "public void b(ahd paramahd) {}", "void b();", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "B database(S database);", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public abstract C0631bt mo9227aB();", "public an b() {\n return a(this.a);\n }", "protected abstract void a(bru parambru);", "static void go(Base b) {\n\t\tb.add(8);\n\t}", "void mo46242a(bmc bmc);", "public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }", "public interface bca extends bbn {\n bca a();\n\n bca a(String str);\n\n bca b(String str);\n\n bca c(String str);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public abstract BoundType b();", "public void b(amj paramamj)\r\n/* 538: */ {\r\n/* 539:579 */ this.f = paramamj;\r\n/* 540: */ }", "b(a aVar, com.bytedance.jedi.model.h.a aVar2) {\n super(aVar2);\n this.f21531a = aVar;\n this.f21532b = new com.bytedance.jedi.model.h.f(aVar);\n }", "private void b(int paramInt)\r\n/* 193: */ {\r\n/* 194:203 */ this.h.a(a(paramInt));\r\n/* 195: */ }", "public void b(ahb paramahb)\r\n/* 583: */ {\r\n/* 584:625 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 585:626 */ this.a[i] = amj.b(paramahb.a[i]);\r\n/* 586: */ }\r\n/* 587:628 */ for (i = 0; i < this.b.length; i++) {\r\n/* 588:629 */ this.b[i] = amj.b(paramahb.b[i]);\r\n/* 589: */ }\r\n/* 590:631 */ this.c = paramahb.c;\r\n/* 591: */ }", "interface b {\n\n /* compiled from: CreditAccountContract */\n public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }\n\n /* compiled from: CreditAccountContract */\n public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }\n}", "@Override\n\tpublic void visit(PartB partB) {\n\n\t}", "public abstract void zzb(B b, int i, long j);", "public abstract void zza(B b, int i, zzeh zzeh);", "int metodo2(int a, int b) {\r\n\r\n\t\tthis.a += 5; // se modifica el campo del objeto, el uso de la palabra reservada this se utiliza para referenciar al campo.\r\n\t\tb += 7;\r\n\t\treturn a; // modifica en la asignaci\\u00f3n\r\n\t}", "private void internalCopy(Board b) {\n for (int i = 0; i < SIDE * SIDE; i += 1) {\n set(i, b.get(i));\n }\n\n _directions = b._directions;\n _whoseMove = b._whoseMove;\n _history = b._history;\n }", "public int b()\r\n/* 69: */ {\r\n/* 70:74 */ return this.b;\r\n/* 71: */ }", "public void b(StringBuilder sb) {\n sb.append(this.a);\n sb.append(')');\n }", "public void b() {\n e$a e$a;\n try {\n e$a = this.b;\n }\n catch (IOException iOException) {\n return;\n }\n Object object = this.c;\n e$a.b(object);\n }", "public abstract void a(StringBuilder sb);", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public abstract void zzf(Object obj, B b);", "public interface bdp {\n\n /* renamed from: a */\n public static final bdp f3422a = new bdo();\n\n /* renamed from: a */\n bdm mo1784a(akh akh);\n}", "@Override\n\tpublic void parse(Buffer b) {\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public abstract void a(b paramb, int paramInt1, int paramInt2);", "public void mo1945a(byte b) throws cf {\r\n m10263b(b);\r\n }", "void mo83703a(C32456b<T> bVar);", "public void a(String str) {\n ((b.b) this.b).d(str);\n }", "public void selectB() { }", "BOperation createBOperation();", "void metodo1(int a, int b) {\r\n\t\ta += 5;//par\\u00e1metro con el mismo nombre que el campo.\r\n\t\tb += 7;\r\n\t}", "private static void m2196a(StringBuffer stringBuffer, byte b) {\n stringBuffer.append(\"0123456789ABCDEF\".charAt((b >> 4) & 15)).append(\"0123456789ABCDEF\".charAt(b & 15));\n }", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public void b(fv paramfv)\r\n/* 408: */ {\r\n/* 409:423 */ this.a = new amj[36];\r\n/* 410:424 */ this.b = new amj[4];\r\n/* 411:425 */ for (int i = 0; i < paramfv.c(); i++)\r\n/* 412: */ {\r\n/* 413:426 */ fn localfn = paramfv.b(i);\r\n/* 414:427 */ int j = localfn.d(\"Slot\") & 0xFF;\r\n/* 415:428 */ amj localamj = amj.a(localfn);\r\n/* 416:429 */ if (localamj != null)\r\n/* 417: */ {\r\n/* 418:430 */ if ((j >= 0) && (j < this.a.length)) {\r\n/* 419:431 */ this.a[j] = localamj;\r\n/* 420: */ }\r\n/* 421:433 */ if ((j >= 100) && (j < this.b.length + 100)) {\r\n/* 422:434 */ this.b[(j - 100)] = localamj;\r\n/* 423: */ }\r\n/* 424: */ }\r\n/* 425: */ }\r\n/* 426: */ }", "public void b(String str) {\n ((b.b) this.b).e(str);\n }", "public String b()\r\n/* 35: */ {\r\n/* 36:179 */ return a();\r\n/* 37: */ }", "public abstract void zza(B b, int i, T t);", "public Item b(World paramaqu, BlockPosition paramdt)\r\n/* 189: */ {\r\n/* 190:220 */ return null;\r\n/* 191: */ }", "public abstract void zza(B b, int i, long j);", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public abstract void mo9798a(byte b);", "public void mo9798a(byte b) {\n if (this.f9108f == this.f9107e) {\n mo9827i();\n }\n byte[] bArr = this.f9106d;\n int i = this.f9108f;\n this.f9108f = i + 1;\n bArr[i] = b;\n this.f9109g++;\n }", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "private void m676a(TField bkVar, byte b) {\n if (b == -1) {\n b = m687e(bkVar.f538b);\n }\n short s = bkVar.f539c;\n short s2 = this.f519n;\n if (s <= s2 || s - s2 > 15) {\n m678b(b);\n mo446a(bkVar.f539c);\n } else {\n m686d(b | ((s - s2) << 4));\n }\n this.f519n = bkVar.f539c;\n }", "private static void m831a(C0741g<?> gVar, C0747b bVar) {\n gVar.mo9477a(C0743i.f718b, (C0739e<? super Object>) bVar);\n gVar.mo9476a(C0743i.f718b, (C0738d) bVar);\n gVar.mo9474a(C0743i.f718b, (C0736b) bVar);\n }", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "private void j()\n/* */ {\n/* 223 */ c localc = this.b;\n/* 224 */ this.b = this.c;\n/* 225 */ this.c = localc;\n/* 226 */ this.c.b();\n/* */ }", "public lj ar(byte b) {\n throw new Runtime(\"d2j fail translate: java.lang.RuntimeException: can not merge I and Z\\r\\n\\tat com.googlecode.dex2jar.ir.TypeClass.merge(TypeClass.java:100)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeRef.updateTypeClass(TypeTransformer.java:174)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.provideAs(TypeTransformer.java:780)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.e1expr(TypeTransformer.java:496)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:713)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.enexpr(TypeTransformer.java:698)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:719)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.s1stmt(TypeTransformer.java:810)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.sxStmt(TypeTransformer.java:840)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.analyze(TypeTransformer.java:206)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer.transform(TypeTransformer.java:44)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.optimize(Dex2jar.java:162)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertCode(Dex2Asm.java:414)\\r\\n\\tat com.googlecode.d2j.dex.ExDex2Asm.convertCode(ExDex2Asm.java:42)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.convertCode(Dex2jar.java:128)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertMethod(Dex2Asm.java:509)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:406)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertDex(Dex2Asm.java:422)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.doTranslate(Dex2jar.java:172)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.to(Dex2jar.java:272)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:108)\\r\\n\\tat com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:288)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:32)\\r\\n\");\n }", "public interface AbstractC10485b {\n /* renamed from: a */\n void mo64153a(boolean z);\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.64558864", "0.6283203", "0.6252635", "0.6250949", "0.6244743", "0.6216273", "0.6194491", "0.6193556", "0.61641675", "0.6140157", "0.60993093", "0.60974354", "0.6077849", "0.6001867", "0.5997364", "0.59737104", "0.59737104", "0.5905105", "0.5904295", "0.58908087", "0.5886636", "0.58828026", "0.5855491", "0.584618", "0.5842517", "0.5824137", "0.5824071", "0.58097327", "0.5802052", "0.58012927", "0.579443", "0.5792392", "0.57902914", "0.5785124", "0.57718205", "0.57589084", "0.5735892", "0.5735892", "0.5734873", "0.5727929", "0.5720821", "0.5712531", "0.5706813", "0.56896514", "0.56543154", "0.5651059", "0.5649904", "0.56496733", "0.5647035", "0.5640965", "0.5640109", "0.563993", "0.5631903", "0.5597427", "0.55843794", "0.5583287", "0.557783", "0.55734867", "0.55733293", "0.5572254", "0.55683887", "0.55624336", "0.55540246", "0.5553985", "0.55480546", "0.554261", "0.5535739", "0.5529958", "0.5519634", "0.5517503", "0.55160624", "0.5511545", "0.5505353", "0.5500533", "0.5491741", "0.5486198", "0.5481978", "0.547701", "0.54725856", "0.5471632", "0.5463497", "0.5460805", "0.5454913", "0.5454885", "0.54519916", "0.5441594", "0.5436747", "0.5432453", "0.5425923", "0.5424724", "0.54189867", "0.54162544", "0.54051477", "0.53998184", "0.53945845", "0.53887725", "0.5388146", "0.5387678", "0.53858143", "0.53850687", "0.5384439" ]
0.0
-1
/ renamed from: c
LinkedQueueNode<T> m66554c() { return (LinkedQueueNode) this.f57345b.get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo5289a(C5102c c5102c);", "public static void c0() {\n\t}", "void mo57278c();", "private static void cajas() {\n\t\t\n\t}", "void mo5290b(C5102c c5102c);", "void mo80457c();", "void mo12638c();", "void mo28717a(zzc zzc);", "void mo21072c();", "@Override\n\tpublic void ccc() {\n\t\t\n\t}", "public void c() {\n }", "void mo17012c();", "C2451d mo3408a(C2457e c2457e);", "void mo88524c();", "void mo86a(C0163d c0163d);", "void mo17021c();", "public abstract void mo53562a(C18796a c18796a);", "void mo4874b(C4718l c4718l);", "void mo4873a(C4718l c4718l);", "C12017a mo41088c();", "public abstract void mo70702a(C30989b c30989b);", "void mo72114c();", "public void mo12628c() {\n }", "C2841w mo7234g();", "public interface C0335c {\n }", "public void mo1403c() {\n }", "public static void c3() {\n\t}", "public static void c1() {\n\t}", "void mo8712a(C9714a c9714a);", "void mo67924c();", "public void mo97906c() {\n }", "public abstract void mo27385c();", "String mo20731c();", "public int c()\r\n/* 74: */ {\r\n/* 75:78 */ return this.c;\r\n/* 76: */ }", "public interface C0939c {\n }", "void mo1582a(String str, C1329do c1329do);", "void mo304a(C0366h c0366h);", "void mo1493c();", "private String getString(byte c) {\n\t\treturn c==1? \"$ \": \" \";\n\t}", "java.lang.String getC3();", "C45321i mo90380a();", "public interface C11910c {\n}", "void mo57277b();", "String mo38972c();", "static int type_of_cnc(String passed){\n\t\treturn 1;\n\t}", "public static void CC2_1() {\n\t}", "static int type_of_cc(String passed){\n\t\treturn 1;\n\t}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public void mo56167c() {\n }", "public interface C0136c {\n }", "private void kk12() {\n\n\t}", "abstract String mo1748c();", "public abstract void mo70710a(String str, C24343db c24343db);", "public interface C0303q extends C0291e {\n /* renamed from: a */\n void mo1747a(int i);\n\n /* renamed from: a */\n void mo1749a(C0288c cVar);\n\n /* renamed from: a */\n void mo1751a(byte[] bArr);\n\n /* renamed from: b */\n void mo1753b(int i);\n\n /* renamed from: c */\n void mo1754c(int i);\n\n /* renamed from: d */\n void mo1755d(int i);\n\n /* renamed from: e */\n int mo1756e(int i);\n\n /* renamed from: g */\n int mo1760g();\n\n /* renamed from: g */\n void mo1761g(int i);\n\n /* renamed from: h */\n void mo1763h(int i);\n}", "C3577c mo19678C();", "public abstract int c();", "public abstract int c();", "public final void mo11687c() {\n }", "byte mo30283c();", "private java.lang.String c(java.lang.String r7) {\n /*\n r6 = this;\n r2 = \"\";\n r0 = r6.e;\t Catch:{ FileNotFoundException -> 0x0052 }\n if (r0 == 0) goto L_0x0050;\n L_0x0006:\n r0 = new java.lang.StringBuilder;\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = java.lang.String.valueOf(r7);\t Catch:{ FileNotFoundException -> 0x0052 }\n r0.<init>(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = \".\";\n r0 = r0.append(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = r6.e;\t Catch:{ FileNotFoundException -> 0x0052 }\n r0 = r0.append(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r0 = r0.toString();\t Catch:{ FileNotFoundException -> 0x0052 }\n L_0x001f:\n r1 = r6.d;\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = r1.openFileInput(r0);\t Catch:{ FileNotFoundException -> 0x0052 }\n L_0x0025:\n r3 = new java.io.BufferedReader;\n r4 = new java.io.InputStreamReader;\n r0 = r1;\n r0 = (java.io.InputStream) r0;\n r5 = \"UTF-8\";\n r5 = java.nio.charset.Charset.forName(r5);\n r4.<init>(r0, r5);\n r3.<init>(r4);\n r0 = new java.lang.StringBuffer;\n r0.<init>();\n L_0x003d:\n r4 = r3.readLine();\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n if (r4 != 0) goto L_0x0061;\n L_0x0043:\n r0 = r0.toString();\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x007d }\n r1.close();\t Catch:{ IOException -> 0x007d }\n r3.close();\t Catch:{ IOException -> 0x007d }\n L_0x004f:\n return r0;\n L_0x0050:\n r0 = r7;\n goto L_0x001f;\n L_0x0052:\n r0 = move-exception;\n r0 = r6.d;\t Catch:{ IOException -> 0x005e }\n r0 = r0.getAssets();\t Catch:{ IOException -> 0x005e }\n r1 = r0.open(r7);\t Catch:{ IOException -> 0x005e }\n goto L_0x0025;\n L_0x005e:\n r0 = move-exception;\n r0 = r2;\n goto L_0x004f;\n L_0x0061:\n r0.append(r4);\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n goto L_0x003d;\n L_0x0065:\n r0 = move-exception;\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x0070 }\n r1.close();\t Catch:{ IOException -> 0x0070 }\n r3.close();\t Catch:{ IOException -> 0x0070 }\n r0 = r2;\n goto L_0x004f;\n L_0x0070:\n r0 = move-exception;\n r0 = r2;\n goto L_0x004f;\n L_0x0073:\n r0 = move-exception;\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x007f }\n r1.close();\t Catch:{ IOException -> 0x007f }\n r3.close();\t Catch:{ IOException -> 0x007f }\n L_0x007c:\n throw r0;\n L_0x007d:\n r1 = move-exception;\n goto L_0x004f;\n L_0x007f:\n r1 = move-exception;\n goto L_0x007c;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.a.b.b.c(java.lang.String):java.lang.String\");\n }", "@Override\n\tpublic void compile(CodeBlock c, CompilerEnvironment environment) {\n\n\t}", "public interface C3196it extends C3208jc {\n /* renamed from: a */\n void mo30275a(long j);\n\n /* renamed from: b */\n C3197iu mo30281b(long j);\n\n /* renamed from: b */\n boolean mo30282b();\n\n /* renamed from: c */\n byte mo30283c();\n\n /* renamed from: c */\n String mo30285c(long j);\n\n /* renamed from: d */\n void mo30290d(long j);\n\n /* renamed from: e */\n int mo30291e();\n\n /* renamed from: f */\n long mo30295f();\n}", "public static void mmcc() {\n\t}", "java.lang.String getCit();", "public abstract C mo29734a();", "C15430g mo56154a();", "void mo41086b();", "@Override\n public void func_104112_b() {\n \n }", "public interface C9223b {\n }", "public abstract String mo11611b();", "void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);", "String getCmt();", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "interface C2578d {\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}", "double fFromC(double c) {\n return (c * 9 / 5) + 32;\n }", "void mo72113b();", "void mo1749a(C0288c cVar);", "public interface C0764b {\n}", "void mo41083a();", "String[] mo1153c();", "C1458cs mo7613iS();", "public interface C0333a {\n }", "public abstract int mo41077c();", "public interface C8843g {\n}", "public abstract void mo70709a(String str, C41018cm c41018cm);", "void mo28307a(zzgd zzgd);", "public static void mcdc() {\n\t}", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "C1435c mo1754a(C1433a c1433a, C1434b c1434b);", "public interface C0389gj extends C0388gi {\n}", "C5727e mo33224a();", "C12000e mo41087c(String str);", "public abstract String mo118046b();", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C0938b {\n }", "void mo80455b();", "public interface C0385a {\n }", "public interface C5527c {\n /* renamed from: a */\n int mo4095a(int i);\n\n /* renamed from: b */\n C5537g mo4096b(int i);\n}", "public interface C32231g {\n /* renamed from: a */\n void mo8280a(int i, int i2, C1207m c1207m);\n}", "public interface C11994b {\n /* renamed from: a */\n C11996a mo41079a(String str);\n\n /* renamed from: a */\n C11996a mo41080a(String str, C11997b bVar, String... strArr);\n\n /* renamed from: a */\n C11998c mo41081a(String str, C11999d dVar, String... strArr);\n\n /* renamed from: a */\n C12000e mo41082a(String str, C12001f fVar, String... strArr);\n\n /* renamed from: a */\n void mo41083a();\n\n /* renamed from: a */\n void mo41084a(C12018b bVar, ConnectionState... connectionStateArr);\n\n /* renamed from: b */\n C11996a mo41085b(String str);\n\n /* renamed from: b */\n void mo41086b();\n\n /* renamed from: c */\n C12000e mo41087c(String str);\n\n /* renamed from: c */\n C12017a mo41088c();\n\n /* renamed from: d */\n void mo41089d(String str);\n\n /* renamed from: e */\n C11998c mo41090e(String str);\n\n /* renamed from: f */\n C12000e mo41091f(String str);\n\n /* renamed from: g */\n C11998c mo41092g(String str);\n}" ]
[ "0.64592767", "0.644052", "0.6431582", "0.6418656", "0.64118475", "0.6397491", "0.6250796", "0.62470585", "0.6244832", "0.6232792", "0.618864", "0.61662376", "0.6152657", "0.61496663", "0.6138441", "0.6137171", "0.6131197", "0.6103783", "0.60983956", "0.6077118", "0.6061723", "0.60513836", "0.6049069", "0.6030368", "0.60263443", "0.60089093", "0.59970635", "0.59756917", "0.5956231", "0.5949343", "0.5937446", "0.5911776", "0.59034705", "0.5901311", "0.5883238", "0.5871533", "0.5865361", "0.5851141", "0.581793", "0.5815705", "0.58012", "0.578891", "0.57870495", "0.5775621", "0.57608724", "0.5734331", "0.5731584", "0.5728505", "0.57239383", "0.57130504", "0.57094604", "0.570793", "0.5697671", "0.56975955", "0.56911296", "0.5684489", "0.5684489", "0.56768984", "0.56749034", "0.5659463", "0.56589085", "0.56573", "0.56537443", "0.5651912", "0.5648272", "0.5641736", "0.5639226", "0.5638583", "0.56299245", "0.56297386", "0.56186295", "0.5615729", "0.56117755", "0.5596015", "0.55905765", "0.55816257", "0.55813104", "0.55723965", "0.5572061", "0.55696625", "0.5566985", "0.55633485", "0.555888", "0.5555646", "0.55525774", "0.5549722", "0.5548184", "0.55460495", "0.5539394", "0.5535825", "0.55300397", "0.5527975", "0.55183905", "0.5517322", "0.5517183", "0.55152744", "0.5514932", "0.55128884", "0.5509501", "0.55044043", "0.54984957" ]
0.0
-1
/ renamed from: b
void m66553b(LinkedQueueNode<T> linkedQueueNode) { this.f57345b.lazySet(linkedQueueNode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo2508a(bxb bxb);", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void b() {\n }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "@Override\n\tpublic void b() {\n\n\t}", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public bb b() {\n return a(this.a);\n }", "@Override\n\tpublic void b1() {\n\t\t\n\t}", "public void b() {\r\n }", "@Override\n\tpublic void bbb() {\n\t\t\n\t}", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public abstract void b(StringBuilder sb);", "public void b() {\n }", "public void b() {\n }", "protected b(int mb) {\n/* 87 */ this.b = mb;\n/* */ }", "public u(b paramb)\r\n/* 7: */ {\r\n/* 8: 9 */ this.a = paramb;\r\n/* 9: */ }", "public interface b {\n void H_();\n\n void I_();\n\n void J_();\n\n void a(C0063d dVar);\n\n void a(byte[] bArr);\n\n void b(boolean z);\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public void b() {\n ((a) this.a).b();\n }", "public np a()\r\n/* 33: */ {\r\n/* 34:49 */ return this.b;\r\n/* 35: */ }", "b(a aVar) {\n super(0);\n this.this$0 = aVar;\n }", "public t b() {\n return a(this.a);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "public static String a(int c) {\n/* 89 */ return b.a(c);\n/* */ }", "private void m678b(byte b) {\n byte[] bArr = this.f523r;\n bArr[0] = b;\n this.f552g.mo502b(bArr);\n }", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "public abstract T zzm(B b);", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public void b(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 27: */ {\r\n/* 28: 47 */ bcm localbcm = paramaqu.s(paramdt);\r\n/* 29: 48 */ if ((localbcm instanceof bdv)) {\r\n/* 30: 49 */ ((bdv)localbcm).h();\r\n/* 31: */ } else {\r\n/* 32: 51 */ super.b(paramaqu, paramdt, parambec);\r\n/* 33: */ }\r\n/* 34: */ }", "public abstract void zzc(B b, int i, int i2);", "public interface b {\n}", "public interface b {\n}", "private void m10263b(byte b) throws cf {\r\n this.f6483r[0] = b;\r\n this.g.m10347b(this.f6483r);\r\n }", "BSubstitution createBSubstitution();", "public void b(ahd paramahd) {}", "void b();", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "B database(S database);", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public abstract C0631bt mo9227aB();", "public an b() {\n return a(this.a);\n }", "protected abstract void a(bru parambru);", "static void go(Base b) {\n\t\tb.add(8);\n\t}", "void mo46242a(bmc bmc);", "public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }", "public interface bca extends bbn {\n bca a();\n\n bca a(String str);\n\n bca b(String str);\n\n bca c(String str);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public abstract BoundType b();", "public void b(amj paramamj)\r\n/* 538: */ {\r\n/* 539:579 */ this.f = paramamj;\r\n/* 540: */ }", "b(a aVar, com.bytedance.jedi.model.h.a aVar2) {\n super(aVar2);\n this.f21531a = aVar;\n this.f21532b = new com.bytedance.jedi.model.h.f(aVar);\n }", "private void b(int paramInt)\r\n/* 193: */ {\r\n/* 194:203 */ this.h.a(a(paramInt));\r\n/* 195: */ }", "public void b(ahb paramahb)\r\n/* 583: */ {\r\n/* 584:625 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 585:626 */ this.a[i] = amj.b(paramahb.a[i]);\r\n/* 586: */ }\r\n/* 587:628 */ for (i = 0; i < this.b.length; i++) {\r\n/* 588:629 */ this.b[i] = amj.b(paramahb.b[i]);\r\n/* 589: */ }\r\n/* 590:631 */ this.c = paramahb.c;\r\n/* 591: */ }", "interface b {\n\n /* compiled from: CreditAccountContract */\n public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }\n\n /* compiled from: CreditAccountContract */\n public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }\n}", "@Override\n\tpublic void visit(PartB partB) {\n\n\t}", "public abstract void zzb(B b, int i, long j);", "public abstract void zza(B b, int i, zzeh zzeh);", "int metodo2(int a, int b) {\r\n\r\n\t\tthis.a += 5; // se modifica el campo del objeto, el uso de la palabra reservada this se utiliza para referenciar al campo.\r\n\t\tb += 7;\r\n\t\treturn a; // modifica en la asignaci\\u00f3n\r\n\t}", "private void internalCopy(Board b) {\n for (int i = 0; i < SIDE * SIDE; i += 1) {\n set(i, b.get(i));\n }\n\n _directions = b._directions;\n _whoseMove = b._whoseMove;\n _history = b._history;\n }", "public int b()\r\n/* 69: */ {\r\n/* 70:74 */ return this.b;\r\n/* 71: */ }", "public void b(StringBuilder sb) {\n sb.append(this.a);\n sb.append(')');\n }", "public void b() {\n e$a e$a;\n try {\n e$a = this.b;\n }\n catch (IOException iOException) {\n return;\n }\n Object object = this.c;\n e$a.b(object);\n }", "public abstract void a(StringBuilder sb);", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public abstract void zzf(Object obj, B b);", "public interface bdp {\n\n /* renamed from: a */\n public static final bdp f3422a = new bdo();\n\n /* renamed from: a */\n bdm mo1784a(akh akh);\n}", "@Override\n\tpublic void parse(Buffer b) {\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public abstract void a(b paramb, int paramInt1, int paramInt2);", "public void mo1945a(byte b) throws cf {\r\n m10263b(b);\r\n }", "void mo83703a(C32456b<T> bVar);", "public void a(String str) {\n ((b.b) this.b).d(str);\n }", "public void selectB() { }", "BOperation createBOperation();", "void metodo1(int a, int b) {\r\n\t\ta += 5;//par\\u00e1metro con el mismo nombre que el campo.\r\n\t\tb += 7;\r\n\t}", "private static void m2196a(StringBuffer stringBuffer, byte b) {\n stringBuffer.append(\"0123456789ABCDEF\".charAt((b >> 4) & 15)).append(\"0123456789ABCDEF\".charAt(b & 15));\n }", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public void b(fv paramfv)\r\n/* 408: */ {\r\n/* 409:423 */ this.a = new amj[36];\r\n/* 410:424 */ this.b = new amj[4];\r\n/* 411:425 */ for (int i = 0; i < paramfv.c(); i++)\r\n/* 412: */ {\r\n/* 413:426 */ fn localfn = paramfv.b(i);\r\n/* 414:427 */ int j = localfn.d(\"Slot\") & 0xFF;\r\n/* 415:428 */ amj localamj = amj.a(localfn);\r\n/* 416:429 */ if (localamj != null)\r\n/* 417: */ {\r\n/* 418:430 */ if ((j >= 0) && (j < this.a.length)) {\r\n/* 419:431 */ this.a[j] = localamj;\r\n/* 420: */ }\r\n/* 421:433 */ if ((j >= 100) && (j < this.b.length + 100)) {\r\n/* 422:434 */ this.b[(j - 100)] = localamj;\r\n/* 423: */ }\r\n/* 424: */ }\r\n/* 425: */ }\r\n/* 426: */ }", "public void b(String str) {\n ((b.b) this.b).e(str);\n }", "public String b()\r\n/* 35: */ {\r\n/* 36:179 */ return a();\r\n/* 37: */ }", "public abstract void zza(B b, int i, T t);", "public Item b(World paramaqu, BlockPosition paramdt)\r\n/* 189: */ {\r\n/* 190:220 */ return null;\r\n/* 191: */ }", "public abstract void zza(B b, int i, long j);", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public abstract void mo9798a(byte b);", "public void mo9798a(byte b) {\n if (this.f9108f == this.f9107e) {\n mo9827i();\n }\n byte[] bArr = this.f9106d;\n int i = this.f9108f;\n this.f9108f = i + 1;\n bArr[i] = b;\n this.f9109g++;\n }", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "private void m676a(TField bkVar, byte b) {\n if (b == -1) {\n b = m687e(bkVar.f538b);\n }\n short s = bkVar.f539c;\n short s2 = this.f519n;\n if (s <= s2 || s - s2 > 15) {\n m678b(b);\n mo446a(bkVar.f539c);\n } else {\n m686d(b | ((s - s2) << 4));\n }\n this.f519n = bkVar.f539c;\n }", "private static void m831a(C0741g<?> gVar, C0747b bVar) {\n gVar.mo9477a(C0743i.f718b, (C0739e<? super Object>) bVar);\n gVar.mo9476a(C0743i.f718b, (C0738d) bVar);\n gVar.mo9474a(C0743i.f718b, (C0736b) bVar);\n }", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "private void j()\n/* */ {\n/* 223 */ c localc = this.b;\n/* 224 */ this.b = this.c;\n/* 225 */ this.c = localc;\n/* 226 */ this.c.b();\n/* */ }", "public lj ar(byte b) {\n throw new Runtime(\"d2j fail translate: java.lang.RuntimeException: can not merge I and Z\\r\\n\\tat com.googlecode.dex2jar.ir.TypeClass.merge(TypeClass.java:100)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeRef.updateTypeClass(TypeTransformer.java:174)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.provideAs(TypeTransformer.java:780)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.e1expr(TypeTransformer.java:496)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:713)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.enexpr(TypeTransformer.java:698)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:719)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.s1stmt(TypeTransformer.java:810)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.sxStmt(TypeTransformer.java:840)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.analyze(TypeTransformer.java:206)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer.transform(TypeTransformer.java:44)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.optimize(Dex2jar.java:162)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertCode(Dex2Asm.java:414)\\r\\n\\tat com.googlecode.d2j.dex.ExDex2Asm.convertCode(ExDex2Asm.java:42)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.convertCode(Dex2jar.java:128)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertMethod(Dex2Asm.java:509)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:406)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertDex(Dex2Asm.java:422)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.doTranslate(Dex2jar.java:172)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.to(Dex2jar.java:272)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:108)\\r\\n\\tat com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:288)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:32)\\r\\n\");\n }", "public interface AbstractC10485b {\n /* renamed from: a */\n void mo64153a(boolean z);\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.64558864", "0.6283203", "0.6252635", "0.6250949", "0.6244743", "0.6216273", "0.6194491", "0.6193556", "0.61641675", "0.6140157", "0.60993093", "0.60974354", "0.6077849", "0.6001867", "0.5997364", "0.59737104", "0.59737104", "0.5905105", "0.5904295", "0.58908087", "0.5886636", "0.58828026", "0.5855491", "0.584618", "0.5842517", "0.5824137", "0.5824071", "0.58097327", "0.5802052", "0.58012927", "0.579443", "0.5792392", "0.57902914", "0.5785124", "0.57718205", "0.57589084", "0.5735892", "0.5735892", "0.5734873", "0.5727929", "0.5720821", "0.5712531", "0.5706813", "0.56896514", "0.56543154", "0.5651059", "0.5649904", "0.56496733", "0.5647035", "0.5640965", "0.5640109", "0.563993", "0.5631903", "0.5597427", "0.55843794", "0.5583287", "0.557783", "0.55734867", "0.55733293", "0.5572254", "0.55683887", "0.55624336", "0.55540246", "0.5553985", "0.55480546", "0.554261", "0.5535739", "0.5529958", "0.5519634", "0.5517503", "0.55160624", "0.5511545", "0.5505353", "0.5500533", "0.5491741", "0.5486198", "0.5481978", "0.547701", "0.54725856", "0.5471632", "0.5463497", "0.5460805", "0.5454913", "0.5454885", "0.54519916", "0.5441594", "0.5436747", "0.5432453", "0.5425923", "0.5424724", "0.54189867", "0.54162544", "0.54051477", "0.53998184", "0.53945845", "0.53887725", "0.5388146", "0.5387678", "0.53858143", "0.53850687", "0.5384439" ]
0.0
-1
/ select coffee of flavor A
public void selectA() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void select() {\n\t\tif (selected.equals(mealSelect) && !eating) {\n\t\t\tmakeMeal();\n\t\t} else if (selected.equals(snackSelect) && !eating) {\n\t\t\tmakeSnack();\n\t\t} else if (selected.equals(medicineSelect) && !eating){\n\t\t\tmakeMedicine();\n\t\t} else if (selected.equals(playSelect) && !eating){\n\t\t\tmakePlay();\n\t\t}\n\t\t\n\t}", "List<Dish> selectByExample(DishExample example);", "default Cocartesian<A, Choice2<A, B>, P> choose() {\n return this.<A>cocartesian().contraMap(Choice2::b);\n }", "private static List<DataFlavor> whichOnesWork(Transferable t) {\n\t\tList<DataFlavor> worked = new ArrayList<DataFlavor>();\n\n\t\t// On OSX, any data flavor that uses java.nio.ByteBuffer or an array of bytes\n\t\t// appears to output the object to the console (via System.out?). Geez, can't\n\t\t// Apple even run a frakkin' grep against their code before releasing it?!\n//\t\tPrintStream old = null;\n//\t\tif (MapTool.MAC_OS_X) {\n//\t\t\told = System.out;\n//\t\t\tsetOnOff(null);\n//\t\t}\n\t\tfor (DataFlavor flavor : t.getTransferDataFlavors()) {\n\t\t\tObject result = null;\n\t\t\ttry {\n\t\t\t\tresult = t.getTransferData(flavor);\n\t\t\t} catch (UnsupportedFlavorException ufe) {\n\t\t\t\tif (log.isDebugEnabled())\n\t\t\t\t\tlog.debug(\"Failed (UFE): \" + flavor.toString()); //$NON-NLS-1$\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tif (log.isDebugEnabled())\n\t\t\t\t\tlog.debug(\"Failed (IOE): \" + flavor.toString()); //$NON-NLS-1$\n\t\t\t} catch (Exception e) {\n//\t\t\t\tSystem.err.println(e);\n\t\t\t}\n\t\t\tif (result != null) {\n\t\t\t\tfor (Class<?> type : validTypes) {\n\t\t\t\t\tif (type.equals(result.getClass())) {\n\t\t\t\t\t\tworked.add(flavor);\n\t\t\t\t\t\tif (log.isInfoEnabled())\n\t\t\t\t\t\t\tlog.info(\"Possible: \" + flavor.toString() + \" (\" + result + \")\"); //$NON-NLS-1$\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\t\tif (MapTool.MAC_OS_X)\n//\t\t\tsetOnOff(old);\n\t\treturn worked;\n\t}", "public Set<String> getCoffeeSelection() {\n return coffeeSelection;\n }", "Optional<Pairof<X, MultiSet<X>>> choose();", "public Pizza makePizza(String newPizzaType){\n if(newPizzaType.equals(\"a\")){\r\n return new CheesePizza();\r\n }\r\n else if(newPizzaType.equals(\"b\")){\r\n return new VeggiePizza();\r\n }\r\n else if(newPizzaType.equals(\"c\")){\r\n return new ChickenPizza(); \r\n }\r\n else{ \r\n return null; \r\n }\r\n \r\n }", "public short selector()\n\t{\n\t\tboolean cont = true;\n\t\tshort select = -1;\n\t\t\n\t\twhile(cont)\n\t\t{\n\t\t\tswitch(select)\n\t\t\t{\n\t\t\t\tcase -1:\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\\nWhich subject would you like to run?\");\n\t\t\t\t\tSystem.out.println(\"1 - Create Some Fish! FISHIES!!!\");\n\t\t\t\t\tSystem.out.println(\"2 - More on Classes\");\n\t\t\t\t\tSystem.out.println(\"0 - Chose Another Chapter\");\n\t\t\t\t\tselect = in.nextShort();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 0:\n\t\t\t\t{\n\t\t\t\t\tcont = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1:\n\t\t\t\t{\n\t\t\t\t\tmakeFishies();\n\t\t\t\t\tselect = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 2:\n\t\t\t\t{\n\t\t\t\t\tclasses();\n\t\t\t\t\tselect = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\\nIncorrect input!\");\n\t\t\t\t\tselect = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "public Select getDrzava() {\n\t\treturn new Select(Utils.waitForElementPresence(driver, By.name(\"state\"), 10));\n\t}", "List<IceApp> selectByExample(IceAppExample example);", "public void selectB() { }", "public static void main(String[] args) {\n\n String selection = \"drink\"; // Snack\n String drinkItems = \"tea\"; // coke\n String snackItems = \"chips\"; // candy\n\n if(selection.equals(\"drink\")){\n System.out.println(\"drink option is selected\");\n if(drinkItems.equals(\"tea\")){\n System.out.println(\"tea is selected\");\n }\n else{\n System.out.println(\"coke is selected\");\n }\n }\n else if(selection.equals(\"snack\")){\n System.out.println(\"snack option is selected\");\n if(snackItems.equals(\"chips\")){\n System.out.println(\"chips item is selected\");\n }\n else{\n System.out.println(\"candy item is selected\");\n }\n }\n }", "public Boat memberSelectABoat(Boat boat){\n if(boat == null)\n throw new IllegalArgumentException(\"Boat could not be found\");\n return boat;\n }", "@Override\r\n\tpublic String getFood() {\n\t\treturn \"banana\";\r\n\t}", "@Override\n\tpublic Pizza getPizzaByName(String pizzaName) {\n\t\treturn mongoTemplate.findOne(Query.query(Criteria.where(\"name\").in(pizzaName)), Pizza.class);\n\t}", "Food getByType(String type);", "static void whatFlavors(int[] cost, int money) {\n Map<Integer, List<Integer>> priceVsIndexMap = new HashMap<>();\n for(int i = 0; i < cost.length; i++) {\n int price = cost[i];\n List<Integer> entry = priceVsIndexMap.get(price);\n if(entry == null) {\n entry = new ArrayList<>();\n priceVsIndexMap.put(price, entry);\n }\n entry.add(i);\n }\n for(int i = 0; i < cost.length; i++) {\n List<Integer> entry = priceVsIndexMap.get(cost[i]);\n if(entry.size() > 1) {\n if(cost[entry.get(0)] + cost[entry.get(1)] == money) {\n System.out.println((entry.get(0)+1) +\" \"+ (entry.get(1)+1));\n break;\n }\n } else {\n int diff = money - cost[entry.get(0)];\n if(priceVsIndexMap.containsKey(diff)) {\n List<Integer> otherEntry = priceVsIndexMap.get(diff);\n if(entry.get(0) != otherEntry.get(0)) {\n System.out.println((entry.get(0)+1) +\" \"+ (otherEntry.get(0)+1));\n break;\n }\n }\n\n }\n }\n\n }", "public interface CanteenSelector {\n String getCanteen();\n}", "public online.food.ordering.Food getSelectedFood()\n {\n return selectedFood;\n }", "public String getFlavor() {\n \t\treturn flavor == null ? \"tooling\" : flavor; //$NON-NLS-1$\n \t}", "private String _selectAdvisor() {\n int profType;\n int index;\n\n profType = _getRandomFromRange(CS_C_FULLPROF, CS_C_ASSTPROF);\n index = random_.nextInt(instances_[profType].total);\n return _getId(profType, index);\n }", "Category selectCategory(String name);", "public void select();", "@Override\r\n\tpublic List<Brand> selectBrand() {\n\t\treturn gd.selectBrand();\r\n\t}", "public RTTIClass select(ClassFilter filter);", "public void select() {}", "List<Abum> selectByExample(AbumExample example);", "public AoDai chooseFactory(){\n\t\treturn new ModernAoDai();\n\t}", "public void flavorChosen()\n {\n changeSubtotalTextField();\n }", "public boolean select(String entry);", "List<TCpySpouse> selectByExample(TCpySpouseExample example);", "@Override\r\n\tprotected Pizza createPizza(String type) {\n\t\tif(type.equals(\"cheese\")) {\r\n\t\t\treturn new NYStyleCheesePizza();\r\n\t\t}\r\n\t\telse return null;\r\n\t}", "List<Kaiwa> selectByExample(KaiwaExample example);", "List<Card> selectByExample(CardExample example);", "List<Cargo> selectByExample(CargoExample example);", "private Optional<ItemVenda> buscarItemPorCerveja(Cerveja cerveja) {\r\n\t\t// retorna somente ItemVenda iguais ao passado no parametro \r\n\t\treturn itens.stream()\r\n\t\t\t\t.filter(i -> i.getCerveja().equals(cerveja))\r\n\t\t\t\t.findAny();\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}", "String getSelector();", "@Override\n\tpublic Teatask selectByMore(Teatask ta)\n\t{\n\t\treturn teataskMapper.selectByMore(ta);\n\t}", "List<CCustomer> selectByExample(CCustomerExample example);", "public Pizza getPizza() {\n return this.pizzaType;\n }", "List<County> selectByExample(CountyExample example);", "public void chooseForMe() {\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Do you want food or drink? \");\n System.out.println(\"If your answer is food you want meal or snack? \");\n System.out.println(\"If your answer is drink you want soda or juice? \");\n String mainOption= scan.next();\n String secondaryOption = scan.next();\n\n if(mainOption.equalsIgnoreCase(\"food\")){\n System.out.println(\"You have selected food\");\n if(secondaryOption.equalsIgnoreCase(\"meal\")){\n System.out.println(\"You have selected meal\");\n }else if (secondaryOption.equalsIgnoreCase(\"snack\")) {\n System.out.println(\"You have selected snack\");\n }else if(mainOption.equalsIgnoreCase(\"drink\")){\n System.out.println(\"You have selected drink\");\n }else if(secondaryOption.equalsIgnoreCase(\"soda\")) {\n System.out.println(\"You have selected soda\");\n }else if(secondaryOption.equalsIgnoreCase(\"juice\")) {\n System.out.println(\"You have selected juice\");\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 }", "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}", "List<ActivityHongbaoPrize> selectByExample(ActivityHongbaoPrizeExample example);", "protected IPlanningGoal selectGoal(){ \n List<IPlanningGoal> relevantGoals = representation.getRelevantGoals(body);\n \n //If we have failed to find plans for high priority goals and environment has not changed, lets try some \n //lower priority ones\n if(numFailuresSinceLastImportantEnvChange < relevantGoals.size()){\n return relevantGoals.get(numFailuresSinceLastImportantEnvChange);\n } else {\n //tried all relevant goals but all failed, lets try it once more\n representation.setMarker(body);\n numFailuresSinceLastImportantEnvChange = 0;\n return relevantGoals.get(0);\n }\n }", "public static DealSetup pickOneAtRandom() {\n\t\tfinal Random r = ThreadLocalRandom.current();\n\t\tfinal int dex = r.nextInt(3);\n\t\treturn 0 == dex ? DealSetup.ALPHA : (1 == dex ? DealSetup.BETA\n\t\t\t\t: DealSetup.GAMMA);\n\t}", "public T caseChoise(Choise object) {\n\t\treturn null;\n\t}", "@Override\n\tpublic Powerup choosePowerup(List<Powerup> selectable) {\n\t\tJSONObject message = new JSONObject();\n\t\tmessage.put(\"function\", \"select\");\n\t\tmessage.put(\"type\", \"powerup\");\n\t\tJSONArray jArray = new JSONArray();\n\t\tselectable.forEach(s->jArray.add(s.toJSON()));\n\t\tmessage.put(\"list\", jArray);\n\t\tthis.sendInstruction(message);\n\n\t\tString selected = this.getResponse();\n\n\t\tif (selected == null || selectable.isEmpty()) return null;\n\t\tList<Powerup> matching = selectable.stream().filter(p->p.toJSON().toString().equals(selected))\n\t\t\t\t.collect(Collectors.toList());\n\t\treturn matching.isEmpty() ? null : matching.get(0);\n\t}", "public void pickSandwhich() {\n includedIngredients.clear();\n if(selectSandwhich.getValue().equals(\"Chicken\")){\n includedIngredients.appendText(\"Fried Chicken\\nSpicy Sauce\\nPickles\");\n sandwhich = new Chicken();\n\n }\n\n if(selectSandwhich.getValue().equals(\"Fish\")){\n includedIngredients.appendText(\"Grilled Snapper\\nCilantro\\nLime\");\n sandwhich = new Fish();\n }\n\n if(selectSandwhich.getValue().equals(\"Beef\")){\n includedIngredients.appendText(\"Roast Beef\\nProvolone Cheese\\nMustard\");\n sandwhich = new Beef();\n }\n orderPrice.clear();\n String price = new DecimalFormat(\"#.##\").format(sandwhich.price());\n orderPrice.appendText(\"$\"+price);\n }", "private static PizzaModel getCheapest(ArrayList<PizzaModel> pizzaGroup){\n\t\tPizzaModel cheapestPizza = pizzaGroup.get(0);\n\t\tfor(PizzaModel p : pizzaGroup){\n\t\t\tif(p.getPrice()<= cheapestPizza.getPrice())\n\t\t\t\tcheapestPizza = p;\n\t\t}\n\t\treturn cheapestPizza;\n\t}", "List<Prueba> selectByExample(PruebaExample example);", "List<SpecialCircumstance> selectByExample(SpecialCircumstanceExample example);", "public Set<String> getFirst(String A);", "public Pizza orderPizza(String type) {\n //hier wird Factory methode aufgerufen/ Code ändert sich öfters\n Pizza pizza = createPizza(type);\n\n if (pizza != null){\n System.out.printf(\"Making a \" + pizza.getName() + \"---------\");\n pizza.prepare();\n pizza.bake();\n pizza.cut();\n pizza.box();\n }\n\n return pizza;\n }", "List<SupplyNeed> selectByExample(SupplyNeedExample example);", "List<QtActivitytype> selectByExample(QtActivitytypeExample example);", "protected abstract Optional<T> getSingleSelection();", "List<Province> selectByExample(ProvinceExample example);", "public Cafe getCafe() {\n return cafe;\n }", "private void chooseAddItemsToJcb() {\n if (animalFamilyType.contains(\"Terr\")) {\n addItemJcb(terAnimals);\n } else if (animalFamilyType.contains(\"Air\")) {\n addItemJcb(airAnimals);\n } else if (animalFamilyType.contains(\"Water\")) {\n addItemJcb(waterAnimals);\n }\n }", "protected abstract void select();", "public interface FruitFactory {\n\n Fruit getApple();\n\n Fruit getBanana();\n}", "List<Category> selectByExample(CategoryExample example);", "@Override\n\tpublic void chocoContraPared() {}", "List<Forumpost> selectByExample(ForumpostExample example);", "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 }", "List<PrefecturesMt> selectByExample(PrefecturesMtExample example);", "SelectAlternative getSelectAlternative();", "public void selectDeal() {\n\t}", "TCpySpouse selectOneByExample(TCpySpouseExample example);", "@Test\n public void test () throws IOException\n {\n CacheList clist = new CacheList(new Scanner(\n \"GCABCD\\tAs The World Turns\\tbunny\\t1\\t1\\tN40 45.875\\tW111 48.986\\nGCRQWK\\tOld Three Tooth\\tgeocadet\\t3.5\\t3\\tN40 45.850\\tW111 48.045\\n\"));\n clist.setTitleConstraint(\"Turns\");\n ArrayList<Cache> selected = clist.select();\n assertEquals(1, selected.size());\n assertEquals(\"GCABCD\", selected.get(0).getGcCode());\n }", "public Pizza createPizza(String type) {\n\t\tPizza pizza = null;\n\t\tif(type.equals(\"cheese\")) {\n\t\t\tpizza = new CheesePizza();\n\t\t}\n\t\telse if(type.equals(\"pepperoni\")) {\n\t\t\tpizza = new PepperoniPizza();\n\t\t}\n\t\treturn pizza;\n\t}", "List<InspectionAgency> selectByExample(InspectionAgencyExample example);", "public K select(int k);", "public NaturalSelector get(final int a_index) {\n return (NaturalSelector) m_selectors.get(a_index);\n }", "@Override\n default @NotNull Option<E> find(@NotNull Predicate<? super E> predicate) {\n return firstOption(predicate);\n }", "public IAnswer select() throws NoPossibleAnswersException;", "public void selectProductColor(String color){\n Select select = new Select(colorSelect);\n select.selectByVisibleText(color);\n }", "public static @Nonnull BDD pickRepresentative(BDD bdd, List<BDD> preference) {\n if (bdd.isZero()) {\n return bdd;\n }\n\n BDD curBDD = bdd.id(); // clone so we can free.\n for (BDD preferredBDD : preference) {\n BDD newBDD = preferredBDD.and(curBDD);\n if (newBDD.isZero()) {\n continue;\n }\n curBDD.free();\n curBDD = newBDD;\n }\n\n return curBDD.satOne();\n }", "@Test\n\tpublic void testEspresso() throws CoffeeException {\n\t\tMap<CoffeeSelection, CoffeeBean> beans = new HashMap<CoffeeSelection, CoffeeBean>();\n\t\tbeans.put(CoffeeSelection.ESPRESSO, new CoffeeBean(\"My favorite espresso bean\", 1000));\n\t\tbeans.put(CoffeeSelection.FILTER_COFFEE, new CoffeeBean(\"My favorite filter coffee bean\", 1000));\n\t\t\n\t\t// get a new CoffeeMachine object\n\t\tPremiumCoffeeMachine machine = new PremiumCoffeeMachine(beans);\n\t\t// brew a fresh coffee\n\t\tCoffee espresso = machine.brewCoffee(CoffeeSelection.ESPRESSO);\n\t\t\n\t\tAssert.assertEquals(CoffeeSelection.ESPRESSO, espresso.getSelection());\n\t\tAssert.assertEquals(28d, espresso.getQuantity(), 0.01);\n\t}", "List<CraftAdvReq> selectByExample(CraftAdvReqExample example);", "CustomerOption getByCode(MerchantStore store, String optionCode);", "public AbstractPokemon.Type selectType()\n {\n JOptionPane typeSelector = new JOptionPane();\n Object message = \"Select which Pokemon this trainer is willing to capture:\";\n Object[] options = {AbstractPokemon.Type.FIRE_TYPE, AbstractPokemon.Type.WATER_TYPE, AbstractPokemon.Type.GRASS_TYPE, AbstractPokemon.Type.ANY_TYPE};\n int type = typeSelector.showOptionDialog(null, message, \"Selection\",\n JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, \n options[3]);\n AbstractPokemon.Type faveType;\n switch(type)\n {\n case 0: faveType = AbstractPokemon.Type.FIRE_TYPE; break;\n case 1: faveType = AbstractPokemon.Type.WATER_TYPE; break;\n case 2: faveType = AbstractPokemon.Type.GRASS_TYPE; break;\n case 3: faveType = AbstractPokemon.Type.ANY_TYPE; break;\n default: faveType = AbstractPokemon.Type.ANY_TYPE; break;\n }\n return faveType;\n }", "public abstract void select(boolean select);", "List<Dress> selectByExample(DressExample example);", "List<BaseCountract> selectByExample(BaseCountractExample example);", "private String getFlavorableSupertype(Element element, List<String> flavorables) {\n\t\tfor (TypeMirror directSuperType : mTypeUtils.directSupertypes(element.asType())) {\n\t\t\tList<TypeMirror> allSuperTypes = new ArrayList<>(mTypeUtils.directSupertypes(directSuperType));\n\t\t\tallSuperTypes.add(directSuperType);\n\t\t\tfor (TypeMirror superType : allSuperTypes) {\n\t\t\t\tfor (String flavorable : flavorables) {\n//\t\t\t\tProcessorLog.warn(element, \"AAAA \" + flavorable);\n\t\t\t\t\tif (flavorable.equals(superType.toString())) {\n\t\t\t\t\t\treturn flavorable;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tProcessorLog.error(element,\n\t\t\t\t\"Element %s does not extend the %s type.\",\n\t\t\t\telement.getSimpleName(), Flavorable.class.getSimpleName(),\n\t\t\t\tFlavored.class.getSimpleName());\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\tPizza p =new Pizza.Builder()\r\n\t\t\t\t .size(12)\r\n\t\t\t\t .olives(true)\r\n\t\t\t\t .extra_cheese(true)\r\n\t\t\t\t .boiled_egg(true)\r\n\t\t\t\t .anchovi(true)\r\n\t\t\t\t .build();\r\n\t\t\r\n\t\tSystem.out.println(\"p\");\r\n\t\tSystem.out.println(\" Size? \"+p.getSize());\r\n\t\tSystem.out.println(\" Extra cheese? \"+p.hasExtra_Cheese());\r\n\t\tSystem.out.println(\" Pepperoni? \"+p.hasPepperoni());\r\n\t\t\r\n\t\t\r\n\t\tPizza p1 = new PizzaMenu(TypePizza.Maison, PizzaSize.large).getPizza();\r\n\t\tSystem.out.println(\"p1\");\r\n\t\tSystem.out.println(\" Size? \"+p1.getSize());\r\n\t\tSystem.out.println(\" Extra cheese? \"+p1.hasExtra_Cheese());\r\n\t\tSystem.out.println(\" Pepperoni? \"+p1.hasPepperoni());\r\n\t\t\r\n\t\tPizza p3 = new PizzaMenu(TypePizza.Pepperoni, PizzaSize.large).getPizza();\r\n\t\tSystem.out.println(\"p3\");\r\n\t\tSystem.out.println(\" Size? \"+p3.getSize());\r\n\t\tSystem.out.println(\" Extra cheese? \"+p3.hasExtra_Cheese());\r\n\t\tSystem.out.println(\" Pepperoni? \"+p3.hasPepperoni());\r\n\t\t\r\n\t\tPizzaMenu[]p2=new PizzaPromo(PizzaPromotion.PromoPepperoni).getPromo();\r\n\t\tSystem.out.println(\"p2[0]\");\r\n\t\tSystem.out.println(\" Size? \"+p2[0].getPizza().getSize());\r\n\t\tSystem.out.println(\" Type = \"+p2[0].getType());\r\n\t\tSystem.out.println(\" Extra cheese? \"+p2[0].getPizza().hasExtra_Cheese());\r\n\t\tSystem.out.println(\" Pepperoni? \"+p2[0].getPizza().hasPepperoni());\r\n\t\tSystem.out.println(\"p2[1]\");\r\n\t\tSystem.out.println(\" Size? \"+p2[1].getPizza().getSize());\r\n\t\tSystem.out.println(\" Type = \"+p2[1].getType());\r\n\t\tSystem.out.println(\" Extra cheese? \"+p2[1].getPizza().hasExtra_Cheese());\r\n\t\tSystem.out.println(\" Pepperoni? \"+p2[1].getPizza().hasPepperoni());\r\n\t\t\r\n\t\t\r\n\r\n\t}", "protected DataFlavor getImportFlavor(DataFlavor[] flavors, JTextComponent c) {\n DataFlavor plainFlavor = null;\n DataFlavor refFlavor = null;\n DataFlavor stringFlavor = null;\n\n if (c instanceof JEditorPane) {\n for (int i = 0; i < flavors.length; i++) {\n String mime = flavors[i].getMimeType();\n if (mime.startsWith(((JEditorPane)c).getEditorKit().getContentType())) {\n return flavors[i];\n } else if (plainFlavor == null && mime.startsWith(\"text/plain\")) {\n plainFlavor = flavors[i];\n } else if (refFlavor == null && mime.startsWith(\"application/x-java-jvm-local-objectref\")\n && flavors[i].getRepresentationClass() == java.lang.String.class) {\n refFlavor = flavors[i];\n } else if (stringFlavor == null && flavors[i].equals(DataFlavor.stringFlavor)) {\n stringFlavor = flavors[i];\n }\n }\n if (plainFlavor != null) {\n return plainFlavor;\n } else if (refFlavor != null) {\n return refFlavor;\n } else if (stringFlavor != null) {\n return stringFlavor;\n }\n return null;\n }\n\n\n for (int i = 0; i < flavors.length; i++) {\n String mime = flavors[i].getMimeType();\n if (mime.startsWith(\"text/plain\")) {\n return flavors[i];\n } else if (refFlavor == null && mime.startsWith(\"application/x-java-jvm-local-objectref\")\n && flavors[i].getRepresentationClass() == java.lang.String.class) {\n refFlavor = flavors[i];\n } else if (stringFlavor == null && flavors[i].equals(DataFlavor.stringFlavor)) {\n stringFlavor = flavors[i];\n }\n }\n if (refFlavor != null) {\n return refFlavor;\n } else if (stringFlavor != null) {\n return stringFlavor;\n }\n return null;\n }", "@Override\n\tpublic String getFruit() {\n\t\treturn \"Orange\";\n\t}", "public String getChoice1(int a){\n String choice0 = choices[a][0];\n return choice0;\n }", "List<Pet> selectByExample(PetExample example);", "public void selectCategory() {\n\t\t\r\n\t}", "List<TbaDeliveryinfo> selectByExample(TbaDeliveryinfoCriteria example);", "public Pokeball selectBall()\n {\n JOptionPane ballSelector = new JOptionPane();\n Object[] options2 = {new Pokeball(), new Greatball(), new Ultraball(), new Masterball()};\n int ball = ballSelector.showOptionDialog(null, \"Select which Pokeball this trainer will use:\", \"Selection\",\n JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options2, \n options2[3]);\n Pokeball pokeball;\n switch(ball)\n {\n case 0: pokeball = new Pokeball(); break;\n case 1: pokeball = new Greatball(); break;\n case 2: pokeball = new Ultraball(); break;\n case 3: pokeball = new Masterball(); break;\n default: pokeball = new Pokeball(); break;\n }\n return pokeball;\n }", "private List<CatalogPieceOfFurniture> getSelectedFurniture() {\n List<CatalogPieceOfFurniture> selectedFurniture = new ArrayList<CatalogPieceOfFurniture>();\r\n TreePath [] selectionPaths = getSelectionPaths(); \r\n if (selectionPaths != null) {\r\n for (TreePath path : selectionPaths) {\r\n if (path.getPathCount() == 3) {\r\n selectedFurniture.add((CatalogPieceOfFurniture)path.getLastPathComponent());\r\n }\r\n }\r\n } \r\n return selectedFurniture;\r\n }", "public String getFlavor(WeaponFlavor flavorKey) {\n\t\t\treturn flavors.get(flavorKey);\n\t\t}", "@Test\n\tpublic void generateApples() throws Exception {\n\t\tappleList.stream().filter(apple -> apple.getColor().equals(\"green\")).\n\t\t\t\tfilter(apple -> apple.getWeight() > 5).\n\t\t\t\tlimit(7).\n\t\t\t\tforEach(System.out::print);\n\t}" ]
[ "0.5478433", "0.5377722", "0.52951473", "0.523389", "0.5211489", "0.520234", "0.5175973", "0.51738834", "0.5082764", "0.50752556", "0.50686204", "0.5054971", "0.5000083", "0.49855918", "0.49841398", "0.4966026", "0.4900955", "0.4859021", "0.48385715", "0.4837721", "0.4832078", "0.48171186", "0.48073727", "0.48007464", "0.47939014", "0.47926173", "0.47813323", "0.47800234", "0.47791243", "0.47581592", "0.4742342", "0.47297364", "0.47241297", "0.4712079", "0.47018245", "0.46972087", "0.46930552", "0.4690511", "0.46895212", "0.4672645", "0.4672417", "0.46702445", "0.46608818", "0.46600223", "0.4656846", "0.46530032", "0.46486083", "0.46456656", "0.46449268", "0.46192536", "0.46028826", "0.45988107", "0.45807394", "0.45686138", "0.45642722", "0.45642585", "0.4562627", "0.45599663", "0.4553402", "0.45533237", "0.45501718", "0.4539021", "0.45294422", "0.45229003", "0.45214227", "0.45198303", "0.45193237", "0.4516632", "0.4514751", "0.4508456", "0.4501867", "0.44985992", "0.4498456", "0.4493741", "0.4493123", "0.4489352", "0.44891873", "0.44853458", "0.44852054", "0.44802982", "0.44796592", "0.4474737", "0.44718054", "0.4471378", "0.446965", "0.44671494", "0.4460534", "0.44596222", "0.44565925", "0.44560862", "0.44548517", "0.44526827", "0.4448135", "0.444409", "0.44437885", "0.4443639", "0.4434095", "0.44273832", "0.4427332", "0.4427249" ]
0.53808624
1
/ select coffee of flavor B
public void selectB() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default Cocartesian<A, Choice2<A, B>, P> choose() {\n return this.<A>cocartesian().contraMap(Choice2::b);\n }", "private void select() {\n\t\tif (selected.equals(mealSelect) && !eating) {\n\t\t\tmakeMeal();\n\t\t} else if (selected.equals(snackSelect) && !eating) {\n\t\t\tmakeSnack();\n\t\t} else if (selected.equals(medicineSelect) && !eating){\n\t\t\tmakeMedicine();\n\t\t} else if (selected.equals(playSelect) && !eating){\n\t\t\tmakePlay();\n\t\t}\n\t\t\n\t}", "@Override\r\n\tpublic List<Brand> selectBrand() {\n\t\treturn gd.selectBrand();\r\n\t}", "public Boat memberSelectABoat(Boat boat){\n if(boat == null)\n throw new IllegalArgumentException(\"Boat could not be found\");\n return boat;\n }", "public static @Nonnull BDD pickRepresentative(BDD bdd, List<BDD> preference) {\n if (bdd.isZero()) {\n return bdd;\n }\n\n BDD curBDD = bdd.id(); // clone so we can free.\n for (BDD preferredBDD : preference) {\n BDD newBDD = preferredBDD.and(curBDD);\n if (newBDD.isZero()) {\n continue;\n }\n curBDD.free();\n curBDD = newBDD;\n }\n\n return curBDD.satOne();\n }", "private static List<DataFlavor> whichOnesWork(Transferable t) {\n\t\tList<DataFlavor> worked = new ArrayList<DataFlavor>();\n\n\t\t// On OSX, any data flavor that uses java.nio.ByteBuffer or an array of bytes\n\t\t// appears to output the object to the console (via System.out?). Geez, can't\n\t\t// Apple even run a frakkin' grep against their code before releasing it?!\n//\t\tPrintStream old = null;\n//\t\tif (MapTool.MAC_OS_X) {\n//\t\t\told = System.out;\n//\t\t\tsetOnOff(null);\n//\t\t}\n\t\tfor (DataFlavor flavor : t.getTransferDataFlavors()) {\n\t\t\tObject result = null;\n\t\t\ttry {\n\t\t\t\tresult = t.getTransferData(flavor);\n\t\t\t} catch (UnsupportedFlavorException ufe) {\n\t\t\t\tif (log.isDebugEnabled())\n\t\t\t\t\tlog.debug(\"Failed (UFE): \" + flavor.toString()); //$NON-NLS-1$\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tif (log.isDebugEnabled())\n\t\t\t\t\tlog.debug(\"Failed (IOE): \" + flavor.toString()); //$NON-NLS-1$\n\t\t\t} catch (Exception e) {\n//\t\t\t\tSystem.err.println(e);\n\t\t\t}\n\t\t\tif (result != null) {\n\t\t\t\tfor (Class<?> type : validTypes) {\n\t\t\t\t\tif (type.equals(result.getClass())) {\n\t\t\t\t\t\tworked.add(flavor);\n\t\t\t\t\t\tif (log.isInfoEnabled())\n\t\t\t\t\t\t\tlog.info(\"Possible: \" + flavor.toString() + \" (\" + result + \")\"); //$NON-NLS-1$\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\t\tif (MapTool.MAC_OS_X)\n//\t\t\tsetOnOff(old);\n\t\treturn worked;\n\t}", "public Set<String> getCoffeeSelection() {\n return coffeeSelection;\n }", "public Pizza makePizza(String newPizzaType){\n if(newPizzaType.equals(\"a\")){\r\n return new CheesePizza();\r\n }\r\n else if(newPizzaType.equals(\"b\")){\r\n return new VeggiePizza();\r\n }\r\n else if(newPizzaType.equals(\"c\")){\r\n return new ChickenPizza(); \r\n }\r\n else{ \r\n return null; \r\n }\r\n \r\n }", "List<Dish> selectByExample(DishExample example);", "public static void main(String[] args) {\n\n String selection = \"drink\"; // Snack\n String drinkItems = \"tea\"; // coke\n String snackItems = \"chips\"; // candy\n\n if(selection.equals(\"drink\")){\n System.out.println(\"drink option is selected\");\n if(drinkItems.equals(\"tea\")){\n System.out.println(\"tea is selected\");\n }\n else{\n System.out.println(\"coke is selected\");\n }\n }\n else if(selection.equals(\"snack\")){\n System.out.println(\"snack option is selected\");\n if(snackItems.equals(\"chips\")){\n System.out.println(\"chips item is selected\");\n }\n else{\n System.out.println(\"candy item is selected\");\n }\n }\n }", "public String getFlavor() {\n \t\treturn flavor == null ? \"tooling\" : flavor; //$NON-NLS-1$\n \t}", "private void chooseAddItemsToJcb() {\n if (animalFamilyType.contains(\"Terr\")) {\n addItemJcb(terAnimals);\n } else if (animalFamilyType.contains(\"Air\")) {\n addItemJcb(airAnimals);\n } else if (animalFamilyType.contains(\"Water\")) {\n addItemJcb(waterAnimals);\n }\n }", "public void flavorChosen()\n {\n changeSubtotalTextField();\n }", "public Select getDrzava() {\n\t\treturn new Select(Utils.waitForElementPresence(driver, By.name(\"state\"), 10));\n\t}", "@Override\r\n\tpublic String getFood() {\n\t\treturn \"banana\";\r\n\t}", "Optional<Pairof<X, MultiSet<X>>> choose();", "public Pokeball selectBall()\n {\n JOptionPane ballSelector = new JOptionPane();\n Object[] options2 = {new Pokeball(), new Greatball(), new Ultraball(), new Masterball()};\n int ball = ballSelector.showOptionDialog(null, \"Select which Pokeball this trainer will use:\", \"Selection\",\n JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options2, \n options2[3]);\n Pokeball pokeball;\n switch(ball)\n {\n case 0: pokeball = new Pokeball(); break;\n case 1: pokeball = new Greatball(); break;\n case 2: pokeball = new Ultraball(); break;\n case 3: pokeball = new Masterball(); break;\n default: pokeball = new Pokeball(); break;\n }\n return pokeball;\n }", "public void selectA() { }", "static void whatFlavors(int[] cost, int money) {\n Map<Integer, List<Integer>> priceVsIndexMap = new HashMap<>();\n for(int i = 0; i < cost.length; i++) {\n int price = cost[i];\n List<Integer> entry = priceVsIndexMap.get(price);\n if(entry == null) {\n entry = new ArrayList<>();\n priceVsIndexMap.put(price, entry);\n }\n entry.add(i);\n }\n for(int i = 0; i < cost.length; i++) {\n List<Integer> entry = priceVsIndexMap.get(cost[i]);\n if(entry.size() > 1) {\n if(cost[entry.get(0)] + cost[entry.get(1)] == money) {\n System.out.println((entry.get(0)+1) +\" \"+ (entry.get(1)+1));\n break;\n }\n } else {\n int diff = money - cost[entry.get(0)];\n if(priceVsIndexMap.containsKey(diff)) {\n List<Integer> otherEntry = priceVsIndexMap.get(diff);\n if(entry.get(0) != otherEntry.get(0)) {\n System.out.println((entry.get(0)+1) +\" \"+ (otherEntry.get(0)+1));\n break;\n }\n }\n\n }\n }\n\n }", "public void pickSandwhich() {\n includedIngredients.clear();\n if(selectSandwhich.getValue().equals(\"Chicken\")){\n includedIngredients.appendText(\"Fried Chicken\\nSpicy Sauce\\nPickles\");\n sandwhich = new Chicken();\n\n }\n\n if(selectSandwhich.getValue().equals(\"Fish\")){\n includedIngredients.appendText(\"Grilled Snapper\\nCilantro\\nLime\");\n sandwhich = new Fish();\n }\n\n if(selectSandwhich.getValue().equals(\"Beef\")){\n includedIngredients.appendText(\"Roast Beef\\nProvolone Cheese\\nMustard\");\n sandwhich = new Beef();\n }\n orderPrice.clear();\n String price = new DecimalFormat(\"#.##\").format(sandwhich.price());\n orderPrice.appendText(\"$\"+price);\n }", "public short selector()\n\t{\n\t\tboolean cont = true;\n\t\tshort select = -1;\n\t\t\n\t\twhile(cont)\n\t\t{\n\t\t\tswitch(select)\n\t\t\t{\n\t\t\t\tcase -1:\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\\nWhich subject would you like to run?\");\n\t\t\t\t\tSystem.out.println(\"1 - Create Some Fish! FISHIES!!!\");\n\t\t\t\t\tSystem.out.println(\"2 - More on Classes\");\n\t\t\t\t\tSystem.out.println(\"0 - Chose Another Chapter\");\n\t\t\t\t\tselect = in.nextShort();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 0:\n\t\t\t\t{\n\t\t\t\t\tcont = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1:\n\t\t\t\t{\n\t\t\t\t\tmakeFishies();\n\t\t\t\t\tselect = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 2:\n\t\t\t\t{\n\t\t\t\t\tclasses();\n\t\t\t\t\tselect = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\\nIncorrect input!\");\n\t\t\t\t\tselect = -1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn -1;\n\t}", "Food getByType(String type);", "protected DataFlavor getImportFlavor(DataFlavor[] flavors, JTextComponent c) {\n DataFlavor plainFlavor = null;\n DataFlavor refFlavor = null;\n DataFlavor stringFlavor = null;\n\n if (c instanceof JEditorPane) {\n for (int i = 0; i < flavors.length; i++) {\n String mime = flavors[i].getMimeType();\n if (mime.startsWith(((JEditorPane)c).getEditorKit().getContentType())) {\n return flavors[i];\n } else if (plainFlavor == null && mime.startsWith(\"text/plain\")) {\n plainFlavor = flavors[i];\n } else if (refFlavor == null && mime.startsWith(\"application/x-java-jvm-local-objectref\")\n && flavors[i].getRepresentationClass() == java.lang.String.class) {\n refFlavor = flavors[i];\n } else if (stringFlavor == null && flavors[i].equals(DataFlavor.stringFlavor)) {\n stringFlavor = flavors[i];\n }\n }\n if (plainFlavor != null) {\n return plainFlavor;\n } else if (refFlavor != null) {\n return refFlavor;\n } else if (stringFlavor != null) {\n return stringFlavor;\n }\n return null;\n }\n\n\n for (int i = 0; i < flavors.length; i++) {\n String mime = flavors[i].getMimeType();\n if (mime.startsWith(\"text/plain\")) {\n return flavors[i];\n } else if (refFlavor == null && mime.startsWith(\"application/x-java-jvm-local-objectref\")\n && flavors[i].getRepresentationClass() == java.lang.String.class) {\n refFlavor = flavors[i];\n } else if (stringFlavor == null && flavors[i].equals(DataFlavor.stringFlavor)) {\n stringFlavor = flavors[i];\n }\n }\n if (refFlavor != null) {\n return refFlavor;\n } else if (stringFlavor != null) {\n return stringFlavor;\n }\n return null;\n }", "public RTTIClass select(ClassFilter filter);", "@Override\n\tpublic Pizza getPizzaByName(String pizzaName) {\n\t\treturn mongoTemplate.findOne(Query.query(Criteria.where(\"name\").in(pizzaName)), Pizza.class);\n\t}", "public static List<Bunny> getListOfVeryCuteBunniesNamedSteve() {\n String selectionString = \"name='steve' AND cuteValue > 66\";\n// Long time = Calendar.getInstance().getTimeInMillis();\n QueryResultIterable<Bunny> iterable =\n cupboard().withDatabase(db).query(Bunny.class).withSelection(selectionString).query();\n List<Bunny> list = getListFromQueryResultIterator(iterable);\n return list;\n }", "@Override\r\n\tpublic void setFlavor() {\n\t\thasFlavor = false;\r\n\t\tsetChanged();\r\n\t\tnotifyObservers(OBSERVABLE_EVENT_SET_FLAVOR);\r\n\t}", "List<IceApp> selectByExample(IceAppExample example);", "Cone orderCone(Flavor[]balls) {\n\t \n }", "public String getFlavor(WeaponFlavor flavorKey) {\n\t\t\treturn flavors.get(flavorKey);\n\t\t}", "Category selectCategory(String name);", "public interface IFireBrigadeTargetSelector {\n /**\n * @return a FireBrigadeTarget represent the target building\n */\n FireBrigadeTarget selectTarget(Cluster targetCluster);\n}", "private void selectLine(JComboBox combob)\n\t{\n\t\tint i = table.getSelectedRow();\n\t\ttxtiname.setText(table.getValueAt(i, 0).toString());\n\t\ttxticode.setText(table.getValueAt(i, 1).toString());\n\t\ttxtstock.setText(table.getValueAt(i, 2).toString());\n\t\ttxtprice.setText(table.getValueAt(i, 3).toString());\n\t\t\n\t\tString sec=table.getValueAt(i, 4).toString();\n\t\t\n\t\tcombob.setSelectedItem(sec.equals(\"Kitchen Essentials\")? sec: sec.equals(\"Fashion Store\")? sec: sec.equals(\"Kids Section\")? sec: sec.equals(\"Electronics\")? sec: \"Hardware\");\n\t}", "public void chooseForMe() {\n }", "@Override\n\tpublic CustomerBrowse selectByBrowse(CustomerBrowse browse) {\n\t\treturn customerBrowseMapper.selectByBrowse(browse);\n\t}", "List<TCpySpouse> selectByExample(TCpySpouseExample example);", "@Override\r\n\tprotected Pizza createPizza(String type) {\n\t\tif(type.equals(\"cheese\")) {\r\n\t\t\treturn new NYStyleCheesePizza();\r\n\t\t}\r\n\t\telse return null;\r\n\t}", "List<County> selectByExample(CountyExample example);", "public void select() {}", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Do you want food or drink? \");\n System.out.println(\"If your answer is food you want meal or snack? \");\n System.out.println(\"If your answer is drink you want soda or juice? \");\n String mainOption= scan.next();\n String secondaryOption = scan.next();\n\n if(mainOption.equalsIgnoreCase(\"food\")){\n System.out.println(\"You have selected food\");\n if(secondaryOption.equalsIgnoreCase(\"meal\")){\n System.out.println(\"You have selected meal\");\n }else if (secondaryOption.equalsIgnoreCase(\"snack\")) {\n System.out.println(\"You have selected snack\");\n }else if(mainOption.equalsIgnoreCase(\"drink\")){\n System.out.println(\"You have selected drink\");\n }else if(secondaryOption.equalsIgnoreCase(\"soda\")) {\n System.out.println(\"You have selected soda\");\n }else if(secondaryOption.equalsIgnoreCase(\"juice\")) {\n System.out.println(\"You have selected juice\");\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 }", "public char select_withdraw() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tchar type;\n\t\tdo {\n\t\t\tSystem.out.println(\"Would you like to withdraw from (c)hecking balance or (s)aving balance?\");\n\t\t\ttype = scan.next().charAt(0);\n\t\t\ttype = Character.toLowerCase(type);\n\t\t} while(!(type != 'c' || type != 's'));\n\t\t\n\t\treturn type;\n\t}", "List<TbaDeliveryinfo> selectByExample(TbaDeliveryinfoCriteria example);", "public interface CanteenSelector {\n String getCanteen();\n}", "protected IPlanningGoal selectGoal(){ \n List<IPlanningGoal> relevantGoals = representation.getRelevantGoals(body);\n \n //If we have failed to find plans for high priority goals and environment has not changed, lets try some \n //lower priority ones\n if(numFailuresSinceLastImportantEnvChange < relevantGoals.size()){\n return relevantGoals.get(numFailuresSinceLastImportantEnvChange);\n } else {\n //tried all relevant goals but all failed, lets try it once more\n representation.setMarker(body);\n numFailuresSinceLastImportantEnvChange = 0;\n return relevantGoals.get(0);\n }\n }", "public T caseChoise(Choise object) {\n\t\treturn null;\n\t}", "public void hasA(Bike b)\n {\n\t\tSystem.out.println(\"bike cc is: \"+b.getCc());\n\t\tSystem.out.println(\"bike colour is: \"+b.getColour());\n\t}", "@Override\n\tpublic String getFruit() {\n\t\treturn \"Orange\";\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 select();", "List<SupplyNeed> selectByExample(SupplyNeedExample example);", "private String getFlavorableSupertype(Element element, List<String> flavorables) {\n\t\tfor (TypeMirror directSuperType : mTypeUtils.directSupertypes(element.asType())) {\n\t\t\tList<TypeMirror> allSuperTypes = new ArrayList<>(mTypeUtils.directSupertypes(directSuperType));\n\t\t\tallSuperTypes.add(directSuperType);\n\t\t\tfor (TypeMirror superType : allSuperTypes) {\n\t\t\t\tfor (String flavorable : flavorables) {\n//\t\t\t\tProcessorLog.warn(element, \"AAAA \" + flavorable);\n\t\t\t\t\tif (flavorable.equals(superType.toString())) {\n\t\t\t\t\t\treturn flavorable;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tProcessorLog.error(element,\n\t\t\t\t\"Element %s does not extend the %s type.\",\n\t\t\t\telement.getSimpleName(), Flavorable.class.getSimpleName(),\n\t\t\t\tFlavored.class.getSimpleName());\n\t\treturn null;\n\t}", "public abstract void select(boolean select);", "List<CCustomer> selectByExample(CCustomerExample example);", "public online.food.ordering.Food getSelectedFood()\n {\n return selectedFood;\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 }", "@Override\r\n\tpublic boolean isHasFlavor() {\n\t\treturn true;\r\n\t}", "List<Abum> selectByExample(AbumExample example);", "public static FlavorSet union(FlavorSet a, FlavorSet b) {\n if (a.isEmpty()) {\n return b;\n } else if (b.isEmpty()) {\n return a;\n } else {\n return new FlavorSet(\n Stream.concat(a.flavors.stream(), b.flavors.stream())\n .collect(ImmutableSortedSet.toImmutableSortedSet(FLAVOR_ORDERING)));\n }\n }", "private void chooseBreedToBeIdentified() {\n Random r = new Random();\n int questionBreedIndex = r.nextInt(3);\n\n questionCarMake = displayingCarMakes.get(questionBreedIndex);\n carMakeNameTitle.setText(questionCarMake);\n }", "@Override\n\tpublic Powerup choosePowerup(List<Powerup> selectable) {\n\t\tJSONObject message = new JSONObject();\n\t\tmessage.put(\"function\", \"select\");\n\t\tmessage.put(\"type\", \"powerup\");\n\t\tJSONArray jArray = new JSONArray();\n\t\tselectable.forEach(s->jArray.add(s.toJSON()));\n\t\tmessage.put(\"list\", jArray);\n\t\tthis.sendInstruction(message);\n\n\t\tString selected = this.getResponse();\n\n\t\tif (selected == null || selectable.isEmpty()) return null;\n\t\tList<Powerup> matching = selectable.stream().filter(p->p.toJSON().toString().equals(selected))\n\t\t\t\t.collect(Collectors.toList());\n\t\treturn matching.isEmpty() ? null : matching.get(0);\n\t}", "public boolean select(String entry);", "List<Cargo> selectByExample(CargoExample example);", "public static void main(String[] args) {\n\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",\"D:\\\\seleniumJars\\\\geckodriver.exe\");\n\t\t\n\t\tFirefoxDriver driver = new FirefoxDriver();\n\t\n\t\tdriver.get(\"https://www.ebay.ca/\");\n\t\t\n\t\tWebElement obj = driver.findElement(By.id(\"gh-cat\"));\n\t\tList<WebElement> allList = obj.findElements(By.tagName(\"option\"));\n\t\t\n\t\t//driver.findElement(By.id(\"gh-cat\")).click();\n\t\t//List<WebElement> allList = driver.findElements(By.xpath(\"//div[@id='gh-cat-box']/select/option\"));\n\t\t\n\t\tSystem.out.println(allList.size());\n\t\t\n\t\tfor(WebElement a:allList)\n\t\t{\n\t\t\tSystem.out.println(a.getText()+\"----\"+a.isSelected()); //gives you a boolean value of a selected text whether it is selected or not\n\t\t}\t\n\t\t\n\t\tSelect s = new Select(obj);\n\t\ts.selectByIndex(2);\n\t\ts.selectByValue(\"6000\");\n\t\ts.selectByVisibleText(\"Books\");\n\t\t\n\t\tSystem.out.println(\"----------------After selection.......\");\n\t\t\n\t\tfor(WebElement a:allList)\n\t\t{\n\t\t\tSystem.out.println(a.getText()+\"----\"+a.isSelected()); //gives you a boolean value of a selected text whether it is selected or not\n\t\t}\t\n\t\t\n\t}", "public interface CutAndChooseSelectionBuilder {\n\t\n\t/**\n\t * Selects the circuits to be checked or evaluated.\n\t * @param numCircuits The total circuits number.\n\t * @return The selection.\n\t */\n\tpublic CutAndChooseSelection build(int numCircuits);\n}", "private static PizzaModel getCheapest(ArrayList<PizzaModel> pizzaGroup){\n\t\tPizzaModel cheapestPizza = pizzaGroup.get(0);\n\t\tfor(PizzaModel p : pizzaGroup){\n\t\t\tif(p.getPrice()<= cheapestPizza.getPrice())\n\t\t\t\tcheapestPizza = p;\n\t\t}\n\t\treturn cheapestPizza;\n\t}", "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}", "List<ActivityHongbaoPrize> selectByExample(ActivityHongbaoPrizeExample example);", "CabinClassModel findCabinClass(String cabinCode);", "private void goPredicate() {\n\t\t\n\t\tSurinamBananas sb = new SurinamBananas();\n\t\t\n\t\tCardboardBox<Musa,Integer> cb = sb.boxSupplier.get();\n\t\t\n\t\t// 3 bananas\n\t\tcb.add(new Basjoo()); // cb.add(new Basjoo()); cb.add(new Basjoo());\n\t\t\n\t\tPredicate< CardboardBox<Musa,Integer> > predIsEmpty = (c) -> c.size() == 0;\n\t\t\n\t\tPredicate< CardboardBox<Musa,Integer> > predLessThan3 = (c) -> c.size() < 3;\n\t\tPredicate< CardboardBox<Musa,Integer> > predMoreThan2 = (c) -> c.size() > 2;\n\t\tPredicate< CardboardBox<Musa,Integer> > predMoreThan6 = (c) -> c.size() > 6;\n\t\t\n\t\tPredicate< CardboardBox<Musa,Integer> > notEmptyAndMoreThan2 = predIsEmpty.negate().and(predMoreThan2);\n\t\t\n\t\tPredicate< CardboardBox<Musa,Integer> > lessThanThreeOrMoreThan6 = (predIsEmpty.negate().and(predLessThan3)) .or(predIsEmpty.negate().and(predMoreThan6) );\n\t\t\n\t\t//System.out.println( \"notEmptyAndMoreThan2: \" + notEmptyAndMoreThan2.test(cb) );\n\t\tSystem.out.println( \"lessThanThreeOrMoreThan6: \" + lessThanThreeOrMoreThan6.test(cb) );\n\t\t\n\t}", "private StandardFlavors()\r\n\t{\r\n\t}", "public interface FruitFactory {\n\n Fruit getApple();\n\n Fruit getBanana();\n}", "public K select(int k);", "public abstract void select(BEAN oldBean, BEAN newBean);", "public static DealSetup pickOneAtRandom() {\n\t\tfinal Random r = ThreadLocalRandom.current();\n\t\tfinal int dex = r.nextInt(3);\n\t\treturn 0 == dex ? DealSetup.ALPHA : (1 == dex ? DealSetup.BETA\n\t\t\t\t: DealSetup.GAMMA);\n\t}", "Batiment choixBatiment(Partie partie, int nbDoublon, Plateau plateau);", "private static int getCombo() {\n return generator.nextInt(COMBOS) + 1;\n }", "String getFamily();", "String getFamily();", "private Optional<ItemVenda> buscarItemPorCerveja(Cerveja cerveja) {\r\n\t\t// retorna somente ItemVenda iguais ao passado no parametro \r\n\t\treturn itens.stream()\r\n\t\t\t\t.filter(i -> i.getCerveja().equals(cerveja))\r\n\t\t\t\t.findAny();\r\n\t}", "CabinClassModel findCabinClass(Integer cabinClassIndex);", "public void selectProductColor(String color){\n Select select = new Select(colorSelect);\n select.selectByVisibleText(color);\n }", "public void chocoContraBomba(Bomba bomba){}", "public IcecreamCone(){\n this.flavors = new ArrayList(Arrays.asList(\"chocolate\", \"vanilla\", \"strawberry\", \n \"cookies and cream\", \"rocky road\", \n \"cookie dough\", \"butter pecan\", \"coffee\", \n \"cotton candy\", \"peanutbutter cup\", \"moose tracks\",\n \"mint chocolate chip\", \"salted caramel\", \"rum raisin\",\n \"cake batter\", \"butterscotch\", \"bubblegum\", \n \"orange serbert\", \"rainbow\", \"tutti frutti\", \n \"cinnamon toast crunch\", \"cilantro lime\"));\n }", "List<SpecialCircumstance> selectByExample(SpecialCircumstanceExample example);", "public String getFlavorText() {\n return flavorText;\n }", "public Card chooseCard(Hand h, Trick t);", "@Test\n public void testCPG() {\n Query query = new Query().search(\"shampoo\");\n ReadResponse resp = factual.fetch(\"products-cpg\", query);\n assertOk(resp);\n\n // Same search as above, but filter the search results to include only the\n // brand \"pantene\"\n query = new Query().search(\"shampoo\").field(\"brand\").isEqual(\"pantene\");\n resp = factual.fetch(\"products-cpg\", query);\n assertOk(resp);\n\n // Same search as above, with added filter for products that are 12.6 oz.\n query = new Query().search(\"shampoo\").field(\"brand\").isEqual(\"pantene\")\n .field(\"size\").search(\"12.6 oz\");\n resp = factual.fetch(\"products-cpg\", query);\n assertOk(resp);\n\n // Search on UPC\n query = new Query().field(\"upc\").isEqual(\"052000131512\");\n resp = factual.fetch(\"products-cpg\", query);\n assertTrue(resp.getData().size() == 1);\n assertOk(resp);\n\n // Find all beverages (filter by category)\n query = new Query().field(\"category\").isEqual(\"beverages\");\n resp = factual.fetch(\"products-cpg\", query);\n assertOk(resp);\n\n // Count all beverage products\n query = new Query().field(\"category\").isEqual(\"lip makeup\").includeRowCount();\n resp = factual.fetch(\"products-cpg\", query);\n assertOk(resp);\n }", "public static boolean selectCategory(String category, String flowerKind) {\r\n\r\n\t\tboolean valid = false;\r\n\t\t//checks in the natural flower category if user mentioned for it\r\n\t\tif (category == \"Natural\") {\r\n\t\t\tArrayList<String> flowerTypes = new ArrayList<String>();\r\n\t\t\tflowerTypes.add(\"Flowers\");\r\n\t\t\tflowerTypes.add(\"Floral Boquets\");\r\n\t\t\tflowerTypes.add(\"Floral Decoration\");\r\n \r\n\t\t\t//returns true if the mention flower is available in the mentioned category else returns false\r\n\t\t\tfor (String flowerType : flowerTypes) {\r\n\t\t\t\tif (flowerKind.equals(flowerType)) {\r\n\t\t\t\t\tvalid = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse {\r\n\t\t\t\t\tvalid = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(category + \" \" + flowerKind + \" Available\");\r\n\t\t\treturn valid;\r\n\t\t}\r\n\r\n\t\t//checks in the artificial flower category if user mentioned for it\r\n\t\telse if (category == \"Artificial\") {\r\n\t\t\tArrayList<String> flowerTypes = new ArrayList<String>();\r\n\t\t\tflowerTypes.add(\"Flowers\");\r\n\t\t\tflowerTypes.add(\"Floral Boquets\");\r\n\t\t\tflowerTypes.add(\"Floral Decoration\");\r\n\r\n\t\t\t//returns true if the mention flower is available in the mentioned category else returns false\r\n\t\t\tfor (String flowerType : flowerTypes) {\r\n\r\n\t\t\t\tif (flowerKind.equals(flowerType)) {\r\n\t\t\t\t\tvalid = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse {\r\n\t\t\t\t\tvalid = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tSystem.out.println(category + \" \" + flowerKind + \" Available\");\r\n\t\t\treturn valid;\r\n\t\t}\r\n\r\n\t\t//returns false if the mentioned category is not available\r\n\t\telse {\r\n\t\t\tSystem.out.println(category + \" \" + flowerKind + \" Not Available\");\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\t}", "public void selectDeal() {\n\t}", "public Bahnhof getBahnhof(String bahnhof) {\n Bahnhof[] liste = new Bahnhof[bhfs];\n Bahnhof bhf = null;\n for (int i = 0; i < getBahnhofListe().length; i++) {\n if (liste[i].getName().equals(bahnhof)) {\n bhf = liste[i];\n }\n }\n return bhf;\n }", "public String getFoodType() {\n return \"Carnivore\";\n }", "@Test\n\tpublic void testEspresso() throws CoffeeException {\n\t\tMap<CoffeeSelection, CoffeeBean> beans = new HashMap<CoffeeSelection, CoffeeBean>();\n\t\tbeans.put(CoffeeSelection.ESPRESSO, new CoffeeBean(\"My favorite espresso bean\", 1000));\n\t\tbeans.put(CoffeeSelection.FILTER_COFFEE, new CoffeeBean(\"My favorite filter coffee bean\", 1000));\n\t\t\n\t\t// get a new CoffeeMachine object\n\t\tPremiumCoffeeMachine machine = new PremiumCoffeeMachine(beans);\n\t\t// brew a fresh coffee\n\t\tCoffee espresso = machine.brewCoffee(CoffeeSelection.ESPRESSO);\n\t\t\n\t\tAssert.assertEquals(CoffeeSelection.ESPRESSO, espresso.getSelection());\n\t\tAssert.assertEquals(28d, espresso.getQuantity(), 0.01);\n\t}", "List<Kaiwa> selectByExample(KaiwaExample example);", "public DataFlavor[] getTransferDataFlavors() {\n\t\treturn flavors;\n\t}", "@Override\r\n public int SelectBrandOfConnection(int brand) {\n if(brand == 1){\r\n System.out.println(\"Dialog\");\r\n return Reload_Interface.dialog;\r\n }\r\n else if(brand == 2){\r\n System.out.println(\"Mobitel\");\r\n return Reload_Interface.mobitel;\r\n } \r\n else if(brand == 3){\r\n System.out.println(\"Hutch\");\r\n return Reload_Interface.hutch;\r\n } \r\n else if(brand == 4){\r\n System.out.println(\"Airtel\");\r\n return Reload_Interface.airtel;\r\n } \r\n else{\r\n System.out.println(\"Invalid Input ...!\");\r\n }\r\n\t\treturn 0; \r\n }", "public Recognition findSkytone() {\n List<Recognition> recogs = this.findBricks();\n boolean one_seen = false;\n Recognition skystone = null;\n for (Recognition recog : recogs) {\n if (recog.getLabel() == \"Skystone\") {\n if (one_seen) {\n return null;\n } //if this is the second we're seeing, return null\n else {\n one_seen = true;\n skystone = recog;\n }\n }\n }\n return skystone; //will be null if we never saw a skystone, or defined if not\n }", "List<BasCounties> selectByExample(BasCountiesExample example);", "List<ResourcePojo> selectByBktName(String bktName);", "private FeatureSet extractFeatureSet() {\n if (accountTypeGuestJRadioButton.isSelected()) {\n return FeatureSet.FREE;\n } else if (accountTypeStandardJRadioButton.isSelected()) {\n return FeatureSet.PREMIUM;\n } else {\n throw Assert.createUnreachable(\"Unknown account type selected.\");\n }\n }", "public Bike removeBike () {\n categorizeBikes(); // categorize all bikes based on their status\n Scanner in = new Scanner(System.in);\n System.out.println(\"\\nBikes with following numbers are available: \" + availableBikeIDs);\n System.out.print(\"\\nEnter the bike number you want to rent: \");\n System.out.println();\n int selectedID = in.nextInt();\n int ind = 0;\n for (Bike b : availableBikes) {\n if (b.getBikeID() == selectedID) {\n ind = this.bikes.indexOf(b); // get the index of selected bike\n //availableBikes.remove(b); // remove selected bike from available bikes\n }\n }\n\n return this.bikes.remove(ind); // remove and return selected bike\n }" ]
[ "0.527008", "0.52698696", "0.524057", "0.5223746", "0.51484984", "0.51447755", "0.5130769", "0.5125749", "0.51056904", "0.5040523", "0.50168765", "0.5009976", "0.49892262", "0.4977164", "0.4975657", "0.49361765", "0.493396", "0.48516387", "0.48231938", "0.48164552", "0.48102936", "0.47544813", "0.4742958", "0.47353336", "0.4730349", "0.47281948", "0.46960637", "0.46653867", "0.4661296", "0.46484166", "0.46398726", "0.45983544", "0.45979905", "0.45903838", "0.45810217", "0.45798787", "0.45796365", "0.45737222", "0.45675033", "0.45627183", "0.45618767", "0.45563322", "0.45562875", "0.45561892", "0.45355675", "0.45314863", "0.453068", "0.4525324", "0.4524977", "0.45109072", "0.45105204", "0.450521", "0.44923398", "0.4488573", "0.4485615", "0.44846418", "0.4481995", "0.44798693", "0.4475816", "0.4475612", "0.44754994", "0.4474317", "0.4467198", "0.44607514", "0.4458306", "0.4454148", "0.44507384", "0.44498667", "0.44413418", "0.44401306", "0.44315153", "0.44300845", "0.44210887", "0.44147843", "0.44093716", "0.44088608", "0.44024792", "0.44024792", "0.44021884", "0.44004467", "0.43993625", "0.43938723", "0.43938684", "0.4387032", "0.43772212", "0.43762", "0.43757313", "0.4373527", "0.43669313", "0.4363088", "0.43594667", "0.43575618", "0.43566835", "0.43553188", "0.43547285", "0.4352584", "0.43501842", "0.43486014", "0.43477234", "0.43463993" ]
0.5585474
0
System.out.println("Key pressed code=" + e.getKeyCode() + ", char=" + e.getKeyChar());
public void keyTyped(KeyEvent e) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "char getKeyPressChar();", "public void keyPressed(KeyEvent e) { }", "public void keyPressed( KeyEvent e ) { }", "public void keyPressed(KeyEvent e) {}", "@Override\n\tpublic void keyTyped(KeyEvent e) {\n\t\tchar letra= e.getKeyChar();\n\t\tSystem.out.println(letra);\n\t\n\t}", "public void keyPressed(KeyEvent e) {\n System.out.println(\"keyPressed\");\n }", "public void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tSystem.out.println(e.getKeyChar()+\" ta precionando a tecla igual um idiota\");\n\t\t\t\tSystem.out.println(e.getKeyCode());\n\t\t\t}", "@Override\n public void keyPressed(KeyEvent e) {\n\n }", "@Override\n public void keyPressed(KeyEvent e) {\n\n }", "public void keyPressed(KeyEvent e) {\n \n }", "public void keyPressed(KeyEvent e) {\n \n }", "public void keyPressed(KeyEvent e) {\n \n }", "@Override\n public void keyPressed(KeyEvent e) {}", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\r\n public void keyPressed(KeyEvent e) {\n }", "public void keyPressed(KeyEvent e) \r\n { \r\n keyUser = e.getKeyCode();\r\n }", "public void onKeyPress(int key, char c);", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\r\n public void keyPressed(KeyEvent e) {\n\r\n }", "public void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\t\t\t\t\t\t\t\t\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t\t\t\t\t\t\t\t\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\t\t\t}", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "void keyPressed(String code);", "@Override\n public void keyPressed(KeyEvent e) {\n\n\n }", "void keyPressed(int keyCode);", "@Override\r\n public void keyPressed(KeyEvent e) {\n \r\n }", "@Override\n public void keyPressed(KeyEvent e) {\n \n \n }", "void keyPressed(int keycode);", "@Override\r\n\t\tpublic void keyPressed(KeyEvent e) {\n\t\t}", "int getKeyCode();", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\t\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n\tpublic void keyPressed(KeyEvent e)\n\t\t{\n\t\t\t\n\t\t}", "@Override\r\n public void keyPressed(KeyEvent e) {\r\n\r\n }", "public void keyPressed(KeyEvent e) {\n }", "public void keyPressed(KeyEvent event){\r\n\t\t\tchar input = event.getKeyChar();\r\n\t\t\tSystem.out.println(event.getExtendedKeyCode());\r\n\t\t\tif(event.getExtendedKeyCode()== 10){\r\n\t\t\t equals.doClick();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tswitch(input){\r\n\t\t\t\tcase '0': button0.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '1': button1.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '2': button2.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '3': button3.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '4': button4.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '5': button5.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '6': button6.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '7': button7.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '8': button8.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '9': button9.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '.': dot.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '+': plus.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '-': minus.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '/': divide.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '*': multiply.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '=': equals.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '\b': del.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '\u001b': clear.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'c': clear.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tdefault: break;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t}", "public boolean keyPressed(KeyEvent e);", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void keyPressed() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}" ]
[ "0.81076646", "0.79259557", "0.7881503", "0.7873582", "0.77672195", "0.77543", "0.7662576", "0.76613426", "0.7571282", "0.7571282", "0.7535061", "0.7535061", "0.7535061", "0.75241816", "0.750966", "0.750966", "0.750966", "0.7503464", "0.7493192", "0.747914", "0.7477473", "0.74686784", "0.74686784", "0.74686784", "0.74686784", "0.74686784", "0.74686784", "0.74686784", "0.74686784", "0.74686784", "0.7459079", "0.74565876", "0.74539655", "0.74539655", "0.74539655", "0.74539655", "0.7450879", "0.7450839", "0.7450839", "0.74443334", "0.74434316", "0.74434316", "0.743127", "0.743127", "0.743127", "0.743127", "0.743127", "0.743127", "0.743127", "0.7423583", "0.7417951", "0.7417951", "0.7417951", "0.7417951", "0.7417951", "0.7417951", "0.7417951", "0.7417951", "0.74119335", "0.74031526", "0.7379257", "0.73752606", "0.7368918", "0.73616827", "0.7361113", "0.7358098", "0.7350302", "0.7350302", "0.7350302", "0.734574", "0.734574", "0.734574", "0.7342149", "0.7342149", "0.7342149", "0.7342149", "0.7326645", "0.7285196", "0.72802794", "0.72634023", "0.7240736", "0.72323364", "0.72232956", "0.721333", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366", "0.72083366" ]
0.0
-1
System.out.println("Key pressed code=" + e.getKeyCode() + ", char=" + e.getKeyChar());
public void keyReleased(KeyEvent e) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "char getKeyPressChar();", "public void keyPressed(KeyEvent e) { }", "public void keyPressed( KeyEvent e ) { }", "public void keyPressed(KeyEvent e) {}", "@Override\n\tpublic void keyTyped(KeyEvent e) {\n\t\tchar letra= e.getKeyChar();\n\t\tSystem.out.println(letra);\n\t\n\t}", "public void keyPressed(KeyEvent e) {\n System.out.println(\"keyPressed\");\n }", "public void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tSystem.out.println(e.getKeyChar()+\" ta precionando a tecla igual um idiota\");\n\t\t\t\tSystem.out.println(e.getKeyCode());\n\t\t\t}", "@Override\n public void keyPressed(KeyEvent e) {\n\n }", "@Override\n public void keyPressed(KeyEvent e) {\n\n }", "public void keyPressed(KeyEvent e) {\n \n }", "public void keyPressed(KeyEvent e) {\n \n }", "public void keyPressed(KeyEvent e) {\n \n }", "@Override\n public void keyPressed(KeyEvent e) {}", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\r\n public void keyPressed(KeyEvent e) {\n }", "public void keyPressed(KeyEvent e) \r\n { \r\n keyUser = e.getKeyCode();\r\n }", "public void onKeyPress(int key, char c);", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\r\n public void keyPressed(KeyEvent e) {\n\r\n }", "public void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\n\t\t\t\t\t\t\t\t\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t\t\t\t\t\t\t\t\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\t\t\t}", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "void keyPressed(String code);", "@Override\n public void keyPressed(KeyEvent e) {\n\n\n }", "void keyPressed(int keyCode);", "@Override\r\n public void keyPressed(KeyEvent e) {\n \r\n }", "@Override\n public void keyPressed(KeyEvent e) {\n \n \n }", "void keyPressed(int keycode);", "@Override\r\n\t\tpublic void keyPressed(KeyEvent e) {\n\t\t}", "int getKeyCode();", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\t\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n\tpublic void keyPressed(KeyEvent e)\n\t\t{\n\t\t\t\n\t\t}", "@Override\r\n public void keyPressed(KeyEvent e) {\r\n\r\n }", "public void keyPressed(KeyEvent e) {\n }", "public void keyPressed(KeyEvent event){\r\n\t\t\tchar input = event.getKeyChar();\r\n\t\t\tSystem.out.println(event.getExtendedKeyCode());\r\n\t\t\tif(event.getExtendedKeyCode()== 10){\r\n\t\t\t equals.doClick();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tswitch(input){\r\n\t\t\t\tcase '0': button0.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '1': button1.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '2': button2.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '3': button3.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '4': button4.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '5': button5.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '6': button6.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '7': button7.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '8': button8.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '9': button9.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '.': dot.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '+': plus.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '-': minus.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '/': divide.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '*': multiply.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '=': equals.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '\b': del.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '\u001b': clear.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'c': clear.doClick();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tdefault: break;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t}", "public boolean keyPressed(KeyEvent e);", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void keyPressed() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}" ]
[ "0.8107658", "0.79258585", "0.78813684", "0.78734213", "0.7767288", "0.7754341", "0.76626796", "0.76614106", "0.7571343", "0.7571343", "0.75350934", "0.75350934", "0.75350934", "0.7524203", "0.7509737", "0.7509737", "0.7509737", "0.7503435", "0.7493203", "0.74788034", "0.74775535", "0.7468843", "0.7468843", "0.7468843", "0.7468843", "0.7468843", "0.7468843", "0.7468843", "0.7468843", "0.7468843", "0.74589944", "0.7456656", "0.74541104", "0.74541104", "0.74541104", "0.74541104", "0.74510235", "0.74510235", "0.74509287", "0.7444461", "0.74435663", "0.74435663", "0.74314475", "0.74314475", "0.74314475", "0.74314475", "0.74314475", "0.74314475", "0.74314475", "0.7423523", "0.74180335", "0.74180335", "0.74180335", "0.74180335", "0.74180335", "0.74180335", "0.74180335", "0.74180335", "0.7411469", "0.74031174", "0.73788047", "0.7375178", "0.7368959", "0.736128", "0.73611706", "0.7357872", "0.7350473", "0.7350473", "0.7350473", "0.7345723", "0.7345723", "0.7345723", "0.73422986", "0.73422986", "0.73422986", "0.73422986", "0.732671", "0.7285322", "0.7280318", "0.72633606", "0.72402567", "0.72319204", "0.72234285", "0.72133803", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525", "0.7208525" ]
0.0
-1
Default Key Fields Constructor for class News
public News ( Long in_newsId ) { this.setNewsId(in_newsId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Generated\n public NewsModel() {\n }", "public ContentKey() {}", "public MultiKey() {}", "public ArticleData() {\r\n\t\tid = Constants.EMPTY_STRING;\r\n\t\tname = Constants.EMPTY_STRING;\r\n\t\turl = Constants.EMPTY_STRING;\r\n\t\tdesc = Constants.EMPTY_STRING;\r\n\t\tlevels = Constants.EMPTY_STRING;\r\n\t\twebSiteId = Constants.EMPTY_STRING;\r\n\t\tmatched = Constants.EMPTY_STRING;\r\n\t\tcreateBy = Constants.EMPTY_STRING;\r\n\t\tcreateDate = Constants.EMPTY_STRING;\r\n\t\tlastUpdateBy = Constants.EMPTY_STRING;\r\n\t\tlastUpdateDate = Constants.EMPTY_STRING;\r\n\t\tenabled = Constants.EMPTY_STRING;\r\n\t\tpostTableName = Constants.EMPTY_STRING;\r\n\t\treturnPage = Constants.EMPTY_STRING;\r\n\t\twebSiteShowName = Constants.EMPTY_STRING;\r\n\t\treturnDirect = Constants.EMPTY_STRING;\r\n\t\tkeyWordTableName = Constants.EMPTY_STRING;\r\n\t\ttitle = Constants.EMPTY_STRING;\r\n\t\ttitleCounter = Constants.EMPTY_STRING;\r\n\t\tbufferStartCounter = Constants.EMPTY_STRING;\r\n\t\tbufferEndCounter = Constants.EMPTY_STRING;\r\n\t\tcatId = Constants.EMPTY_STRING;\r\n\t\tpostUrl = Constants.EMPTY_STRING;\r\n\t}", "public Init(String key, String desc) {\n super(key, desc);\n }", "public NewsParamPanel() {\n initComponents();\n titleAnalyzer.setFieldName(\"TITLE\");\n dateAnalyzer.setFieldName(\"DATE\");\n sourceExtractor.setFieldName(\"SOURCENAME\");\n authorExtractor.setFieldName(\"AUTHOR\");\n commentsExtractor.setFieldName(\"COMMENT_COUNT\");\n clicksExtractor.setFieldName(\"CLICK_COUNT\");\n transmitExtractor.setFieldName(\"TRANSMIT_COUNT\");\n summaryExtractor.setFieldName(\"SUMMARY\");\n chnlExtractor.setFieldName(\"CHANNEL\");\n contentExtractor.setFieldName(\"CONTENT\");\n }", "public Key()\n {\n name = \"\";\n fields = new Vector<String>();\n options = new Vector<String>();\n isPrimary = false;\n isUnique = false;\n }", "News(String title, String section, String storyUrl, String thumbnailUrl, String date) {\n\t\tthis.mTitle = title;\n\t\tthis.mSection = section;\n\t\tthis.mStoryUrl = storyUrl;\n\t\tthis.mThumbnailUrl = thumbnailUrl;\n\t\tthis.mDate = date;\n\t}", "private DataKeys(String pKey) {\n key = pKey;\n }", "public I13nDateSavingKey() {\n\tsuper();\n}", "private NewsWriter() {\n }", "public Article() {\n\t}", "public ClassKey(final Class<?> classe) {\n super(classe);\n }", "public KeyedEntry() { }", "public Sitedoc2SplaceKey() {\n\tsuper();\n}", "private ConfigurationKeys() {\n // empty constructor.\n }", "public City(Integer aKey)\r\n {\r\n label = \" \";\r\n key = aKey;\r\n }", "public Article() {\n\t\tthis.nom=\"VIDE\";\n\t\tthis.prix=0.0;\n\t\tthis.categorie= null;\n\t}", "public NewsExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public NewsItem(String newsHeadline, String newsSection, String newsDate, String newsAuthor, String url) {\n mHeadline = newsHeadline;\n mSection = newsSection;\n mDate = newsDate;\n mAuthor = newsAuthor;\n mUrl = url;\n }", "public PaymentRecordKey() {\n super();\n }", "public Article() {\n }", "public FuncTestKey() {\n super();\n }", "public void initializeDefault() {\n\t\tthis.numAuthorsAtStart = 5;\n\t\tthis.numPublicationsAtStart = 20;\n\t\tthis.numCreationAuthors = 0;\n\t\tthis.numCreationYears = 10;\n\n\t\tyearInformation = new DefaultYearInformation();\n\t\tyearInformation.initializeDefault();\n\t\tpublicationParameters = new DefaultPublicationParameters();\n\t\tpublicationParameters.initializeDefault();\n\t\tpublicationParameters.setYearInformation(yearInformation);\n\t\tauthorParameters = new DefaultAuthorParameters();\n\t\tauthorParameters.initializeDefault();\n\t\ttopicParameters = new DefaultTopicParameters();\n\t\ttopicParameters.initializeDefault();\n\t}", "public News(String title, String section, String webUrl, String author, String date) {\r\n mWebTitle = title;\r\n mSection = section;\r\n mWebUrl = webUrl;\r\n mDate = date;\r\n mAuthor = author;\r\n }", "public ContentKj () {\n\t\tsuper();\n\t}", "public Key(int type)\n {\n this.type = type;\n this.columns = new ArrayList<Column>();\n }", "@Test\n\tpublic void testCid32ConstructorEmbeddedTwoNews() throws Exception {\n\t}", "public ShopArticle() {\r\n\t\tsuper();\r\n\t}", "public Identity()\n {\n super( Fields.ARGS );\n }", "public PIEBankPlatinumKey() {\n\tsuper();\n}", "private PSSearchField()\n {\n super(new PSKey(new String []\n {KEY_COL_FIELDNAME, KEY_COL_SEARCHID}));\n }", "public CacheTagImpl(String key) {\n this(key, ANY);\n }", "public Pasien() {\r\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"News [newsId=\" + newsId + \", title=\" + title + \", author=\" + author + \", description=\" + description\n\t\t\t\t+ \", content=\" + content + \", publishedAt=\" + publishedAt + \"]\";\n\t}", "private Notes() {}", "public Kullanici() {}", "public City(Integer aKey, String aLabel)\r\n {\r\n label = aLabel;\r\n key = aKey;\r\n }", "public DozentPublikation(){}", "public MyKeyAdapter() {\r\n super();\r\n }", "public Knuckels(){\n super(\"Knuckels\",10);\n }", "public Pitonyak_09_02() {\r\n }", "public Kurama(){\n super(\"Kurama\",3,800,800,\"n\",19,5);\n }", "public Node(Key key, int N) {\n this.key = key;\n this.N = N;\n }", "public GenericDomainObject() {\n\tkeys = new LinkedHashMap<String, Object>();\n\tattributes = new LinkedHashMap<String, Object>();\n }", "public IDataKey(String key) {\n this(key, false);\n }", "public Key(final Class<?> classe) {\n this(classe.getName());\n valueClass = classe;\n }", "public KeypointNode()\r\n {\r\n keys = new LinkedList();\r\n }", "public KeyEncryptionKeyInfo() {\n }", "public Book () {\n\t\tsuper ();\n\t\t_title = \"\";\n\t\t_text = \"\";\n\t\t_publisher = null;\n\t\t_oid = 0;\n\t\t_author = null;\n\t\t_Isbn = \"\";\n\t}", "protected Book() {\n this.title = \"Init\";\n this.author = \"Init\";\n this.bookCategories = new HashSet<>(10);\n }", "private Default()\n {}", "defaultConstructor(){}", "public Mannschaft() {\n }", "public Menu_perfilKey() {\n\t}", "public DiscoveryItem(String key) {\n this(key, null, 0, 0, null);\n }", "public Kendaraan() {\n }", "public Keyword() {\n\t}", "Article() {\n\t\tthis.title = \"\";\n\t\tthis.firstPage = 0;\n\t\tthis.lastPage = 0;\n\t}", "private IDataKey(Queue<Part> parts) {\n super(parts);\n }", "public TopicObject() {\n super();\n }", "public TmKabupaten() {\n\t}", "private com.hps.july.persistence.CarKey keyFromFields ( int f0 ) {\n com.hps.july.persistence.CarKey keyClass = new com.hps.july.persistence.CarKey();\n keyClass.car = f0;\n return keyClass;\n }", "public StudentCourse() {\n this(\"student_course\", null);\n }", "public SeoProfileRecord() {\n super(SeoProfile.SEO_PROFILE);\n }", "public AntrianPasien() {\r\n\r\n }", "private EncryptionKey() {\n }", "public ArticleDao() {\n super(Article.ARTICLE, cn.edu.kmust.flst.domain.flst.tables.pojos.Article.class);\n }", "public AuthorRecord() {\n super(Author.AUTHOR);\n }", "private void init() {\n FieldWrapper id = new FieldWrapper();\n id.fieldDescription = new HashMap<String, Object>();\n id.fieldDescription.put(\"fullName\", \"Id\");\n id.fieldDescription.put(\"type\", \"Text\");\n\n FieldWrapper name = new FieldWrapper();\n name.fieldDescription = new HashMap<String, Object>();\n name.fieldDescription.put(\"fullName\", \"Name\");\n\n FieldWrapper createdBy = new FieldWrapper();\n createdBy.fieldDescription = new HashMap<String, Object>();\n createdBy.fieldDescription.put(\"fullName\", \"CreatedBy\");\n createdBy.fieldDescription.put(\"type\", \"Lookup\");\n\n FieldWrapper lastModifiedBy = new FieldWrapper();\n lastModifiedBy.fieldDescription = new HashMap<String, Object>();\n lastModifiedBy.fieldDescription.put(\"fullName\", \"LastModifiedBy\");\n lastModifiedBy.fieldDescription.put(\"type\", \"Lookup\");\n\n FieldWrapper owner = new FieldWrapper();\n owner.fieldDescription = new HashMap<String, Object>();\n owner.fieldDescription.put(\"fullName\", \"Owner\");\n owner.fieldDescription.put(\"type\", \"Lookup\");\n\n fieldDescribe = new HashMap<String, FieldWrapper>();\n\n fieldDescribe.put((String) id.fieldDescription.get(\"fullName\"), id);\n fieldDescribe.put((String) name.fieldDescription.get(\"fullName\"), name);\n fieldDescribe.put((String) createdBy.fieldDescription.get(\"fullName\"), createdBy);\n fieldDescribe.put((String) lastModifiedBy.fieldDescription.get(\"fullName\"), lastModifiedBy);\n fieldDescribe.put((String) owner.fieldDescription.get(\"fullName\"), owner);\n }", "public CardTrackKey() {\n\tsuper();\n}", "public Achterbahn() {\n }", "public NhanVien()\n {\n }", "private Bookmarks() {}", "public FilmCategoryId() {\n super();\n }", "public Bean_article() {\n }", "public Constructor(){\n\t\t\n\t}", "public TopicImpl() {\n\n super(false); // don't generate UUID\n }", "public MarketplaceRatingPK(){\n\t}", "public MijnKlasse()\r\n\t\t{\r\n\t\t\tmijnMethode();\r\n\t\t}", "private Public() {\n super(\"public\", null);\n }", "private com.hps.july.persistence.SuperRegionAccKey keyFromFields ( int f0 ) {\n com.hps.july.persistence.SuperRegionAccKey keyClass = new com.hps.july.persistence.SuperRegionAccKey();\n keyClass.accessid = f0;\n return keyClass;\n }", "public DefaultAuthor() {\n\t\ttopic = null;\n\t}", "public ListaPorMenuPK() {\r\n\t}", "public Book() {\n this.bookName = \"Five Point Someone\";\n this.bookAuthorName = \"Chetan Bhagat\";\n this.bookIsbnNumber = \"9788129104595\";\n\n }", "public Note() {\n }", "Constructor() {\r\n\t\t \r\n\t }", "public _355() {\n\n }", "void DefaultConstructor(){}", "public Documento() {\n\n\t}", "private CollationKey() { }", "public Field(){\n\n // this(\"\",\"\",\"\",\"\",\"\");\n }", "public NodeData(int key) {\n this.key = key;\n this.neighborEdges = new HashMap<>();\n this.edgesConnectedToThisNode = new HashMap<>();\n this.weight = Double.MAX_VALUE;\n this.info = \"WHITE\";\n this.tag = -1;\n this.location = new Location(0, 0, 0);\n }", "private Posts() {\n }", "@Override\n default String getKey(){\n return key();\n }", "private NoValue(K key) {\n this.key = key;\n }", "public Note() {\n\t\tsuper();\n\t}", "private void validateConstructor () throws ModelValidationException\n\t\t\t{\n\t\t\t\t// no constructor or no arg constructor\n\t\t\t\tModel model = getModel();\n\t\t\t\tboolean hasConstr = model.hasConstructor(keyClassName);\n\t\t\t\tObject noArgConstr = \n\t\t\t\t\tmodel.getConstructor(keyClassName, Model.NO_ARGS);\n\t\t\t\tint modifiers = model.getModifiers(noArgConstr);\n\n\t\t\t\tif (hasConstr && \n\t\t\t\t\t((noArgConstr == null) || !Modifier.isPublic(modifiers)))\n\t\t\t\t{\n\t\t\t\t\tthrow new ModelValidationException(keyClass,\n\t\t\t\t\t\tI18NHelper.getMessage(getMessages(), \n\t\t\t\t\t\t\"util.validation.key_class_constructor\", //NOI18N\n\t\t\t\t\t\tkeyClassName, getClassName()));\n\t\t\t\t}\n\t\t\t}", "public BookInfoDO() {\n super();\n }", "public Book() {\n\t\t// Default constructor\n\t}" ]
[ "0.66236645", "0.6494774", "0.62801445", "0.62124354", "0.6116499", "0.6092313", "0.60685086", "0.6025565", "0.59951556", "0.594239", "0.5933515", "0.59246105", "0.59106505", "0.59094924", "0.5900762", "0.5877653", "0.58612865", "0.5834462", "0.58305895", "0.5828652", "0.58047086", "0.5786381", "0.57372135", "0.5713662", "0.5691317", "0.56843394", "0.56685776", "0.56418437", "0.5637187", "0.5606128", "0.5595352", "0.55891913", "0.5586841", "0.5568792", "0.5520731", "0.5509117", "0.55012447", "0.54960984", "0.5485242", "0.5480957", "0.5472865", "0.5469502", "0.5469054", "0.5454084", "0.5453363", "0.54509264", "0.5445742", "0.5432226", "0.54275286", "0.54245514", "0.542229", "0.54154706", "0.54063654", "0.5400775", "0.53981817", "0.5380568", "0.53718865", "0.53695035", "0.53659797", "0.53617775", "0.53513634", "0.53478855", "0.53467345", "0.53392047", "0.5337207", "0.53302944", "0.5321636", "0.5319958", "0.53160685", "0.53152126", "0.5292285", "0.5286395", "0.5273291", "0.526724", "0.5265124", "0.52632993", "0.5259049", "0.5245232", "0.52405125", "0.5240133", "0.52400136", "0.5239319", "0.5232059", "0.52285624", "0.522257", "0.52209127", "0.521956", "0.5219098", "0.52182823", "0.52141124", "0.52114046", "0.520646", "0.52040035", "0.5193857", "0.5192106", "0.5191662", "0.5189851", "0.5189456", "0.5180397", "0.5179216" ]
0.60065645
8
Constructs one individual. Takes Simulation class as parameter. By using world, it has access to shared properties of world. Initialize individual with random values. Initial current state is moving state. When individual is created, it is healthy, so set state to healthy and inform world to you are healthy.
public Individual(Simulation world) { moving = new Moving(this); inConversation = new InConversation(this); inHospital = new InHospital(this); dead = new Dead(this); currentState = moving; speed = random.nextInt(25)+1; xSpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed * Math.cos(Math.PI/4)); ySpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed * Math.cos(Math.PI/4)); socialDistance = random.nextInt(10); conversationTime = random.nextInt(5) + 1; double[] maskChoice = {0.2, 1}; maskIndicator = maskChoice[random.nextInt(2)]; individualSize = 5; healthStatus = HealthStatus.HEALTHY; this.world = world; x = random.nextInt(world.getSIMULATION_WIDTH() - individualSize); y = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize); timerList = new ArrayList<>(); hospitalNeed = new Thread(new Runnable() { @Override public void run() { try { world.getHospital().acceptIndividual(); synchronized (this) { currentState.goHospital(); } } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); world.healthy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MyAgent(World world)\n {\n w = world; \n }", "public Simulation(String simulationName) {\n LOG.info(\"New simulation: \" + simulationName);\n initState(simulationName);\n }", "protected Individual(Infrastructure infra)\n\t\t{\tint num_genes = 0;\n\t\t\tfor(int i=0;i<num_nodes;i++) {\n\t\t\t\tnum_genes += tld[i].length;\n\t\t\t}\n\t\t\t\n\t\t\tgenes = new float[num_genes];\n\t\t\tfor(int i=0;i<num_genes;i++)\n\t\t\t\tgenes[i] = random.nextFloat();\n\t\t\t\t\n\t\t\tcreateMe();\n\t\t\twait = 0;\n\t\t\tmove = 0;\n\t\t}", "public simulation() {\n\n }", "public Population InitSinglePopulation(int NumberOfAgents) {\n \n SinglePopulation TempPopulation = new SinglePopulation();\n \n TempPopulation.setPopulationID(0);\n\n for(int j = 0; j < NumberOfAgents; j++){\n\n SinglePopulationAgent TempAgentS = new SinglePopulationAgent(j,rand.nextDouble());\n boolean InitAction = (rand.nextDouble() < TempAgentS.getStrategy()) ? true : false;\n TempAgentS.setAction(InitAction);\n \n TempPopulation.AgentList.add(TempAgentS);\n }\n \n TempPopulation.setStrategyList();\n TempPopulation.setActionList();\n return TempPopulation;\n }", "public MyAgent(World world) {\n w = world;\n agent = new QLearningAgent();\n currentPosition = new Position(w.getPlayerX(), w.getPlayerY());\n }", "public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n \n Player player = new Player();\n Point point0 = new Point();\n Point point1 = new Point();\n Point point2 = new Point();\n Point point3 = new Point();\n Point point4 = new Point();\n Danger danger0 = new Danger();\n Danger danger1 = new Danger();\n addObject(player, getWidth()/2, getHeight()/2);\n \n addObject(point0,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point1,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point2,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point3,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point4,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n \n addObject(danger0,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(danger1,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n }", "public gameWorld()\n { \n // Create a new world with 600x600 cells with a cell size of 1x1 pixels.\n super(600, 600, 1); \n \n addObject(new winSign(), 310, 300);\n addObject(new obscureDecorative(), 300, 400);\n addObject(new obscureDecorative(), 300, 240);\n \n for(int i = 1; i < 5; i++) {\n addObject(new catchArrow(i * 90), 125 * i, 100);\n }\n for (int i = 0; i < 12; i++) {\n addObject(new damageArrowCatch(), 50 * i + 25, 50); \n }\n \n \n //Spawning Interval\n\n if(timerInterval >= 10) {\n arrowNumber = Greenfoot.getRandomNumber(3);\n }\n if(arrowNumber == 0) {\n addObject(new upArrow(directionOfArrow[0], imageOfArrow[0]), 125, 590);\n arrowNumber = 5;\n }\n if(arrowNumber == 1) {\n addObject(new upArrow(directionOfArrow[1], imageOfArrow[1]), 125 * 2, 590);\n arrowNumber = 5;\n }\n if(arrowNumber == 2) {\n addObject(new upArrow(directionOfArrow[2], imageOfArrow[2]), 125 * 3, 590);\n arrowNumber = 5;\n }\n if( arrowNumber == 3) {\n addObject(new upArrow(directionOfArrow[3], imageOfArrow[3]), 125 * 4, 590);\n arrowNumber = 5;\n }\n \n \n\n \n }", "Individual createIndividual();", "public void initWorld()\n\t{\n\t\tgrid = new Creature[numRows][numColumns];\n\t\t\n\t\t//place a Species1 object in the top half of the grid\n\t\tint topRowInit = (int)(Math.random()*(numRows/2));\n\t\tint topColInit = (int)(Math.random()*(numColumns));\n\t\tgrid[topRowInit][topColInit] = new Species1(this, topRowInit, topColInit);\n\t\tgrid[topRowInit][topColInit].live();\n\t\t\n\t\t//place a Species2 object in the bottom half of the grid\n\t\tint bottomRowInit = (int)(Math.random()*(numRows/2))+(numRows/2);\t\t\n\t\tint bottomColInit = (int)(Math.random()*(numColumns));\t\t\t\t\n\t\tgrid[bottomRowInit][bottomColInit] = new Species2(this, bottomRowInit, bottomColInit);\n\t\tgrid[bottomRowInit][bottomColInit].live();\n\t\t\n\t}", "public SaboWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1);\n addObject(counter, 100, 380); //Add the scoreboard\n addObject(healthBar, 300, 370); //Add the health bar\n addObject(turret, getWidth()/2-5, getHeight()-turret.getImage().getWidth()); \n }", "public abstract World create(World world);", "public WorldState ()\n\t{\n\t\tproperties = new HashMap<String, WorldStateProperty>();\n\t}", "public Critter1() {\r\n\t\tnumberSpawned = 0;\r\n\t\twhile (fearfullness < 50) {//at minimum fearfullness is 50%\r\n\t\t\tfearfullness = getRandomInt(100);\r\n\t\t}\r\n\t}", "public GameManager(){\r\n init = new Initialisation();\r\n tower=init.getTower();\r\n courtyard=init.getCourtyard();\r\n kitchen=init.getKitchen();\r\n banquetHall=init.getBanquetHall();\r\n stock=init.getStock();\r\n throneHall=init.getThroneHall();\r\n vestibule=init.getVestibule();\r\n stables=init.getStables();\r\n\r\n this.player = new Player(tower);\r\n\r\n push(new IntroductionState());\r\n\t}", "public World()\n\t{\n\t\tinitWorld();\t\n\t}", "public Individual()\r\n\t{\r\n\t}", "public Simulation() {\n\t\tstation = new Station();\n\t\ttaxis = new Taxi[NR_OF_TAXIS];\n\t\tfor (int i = 0; i < NR_OF_TAXIS; i++) {\n\t\t\ttaxis[i] = i < NR_OF_SMALL_TAXIS ? new Taxi(i + 1, CAPACITY_SMALL, TIME_SMALL, station)\n\t\t\t\t\t: new Taxi(i + 1, CAPACITY_LARGE, TIME_LARGE, station);\n\t\t}\n\t\ttrain = new Train(station);\n\t}", "public PunchingMonster(int health, Random random) {\r\n\t\tsuper(75);\r\n\t\tif (random == null) {\r\n\t\t\tthrow new IllegalArgumentException(\"Invalid random number\");\r\n\t\t}\t\t\r\n\r\n\t\tthis.randomObject = random;\r\n\t}", "public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1000, 600, 1);\n planets();\n stars();\n }", "public RobotWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(800, 600, 1); \n prepare();\n }", "protected Agent(){\n\t\trand = SeededRandom.getGenerator();\n\t}", "public void create () {\n // TODO random generation of a ~100 x 100 x 100 world\n }", "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 }", "public InanimateObject(Vector position, World world) throws IllegalArgumentException {\r\n\t\tsuper(position, world);\r\n\t\tthis.setWeight(new Random().nextInt(41) + 10);\r\n\t}", "private static void spawnAtRandomLocation(World world, GameObject gameObject) {\n spawnAtRandomLocation(world, gameObject, 0.5);\n }", "public void setupSimulation() {\n final Timer timerStatus = new Timer();\n\n TimerTask taskUpdateFood = new TimerTask() {\n @Override\n public void run() {\n terrain.toggleFood();\n }\n };\n timerStatus.schedule(taskUpdateFood, 0, 1000);\n\n startTime = System.currentTimeMillis();\n }", "protected Individual(float[] _genes)\n\t\t{\tgenes = _genes;\n\t\t\tcreateMe();\n\t\t\twait = 0;\n\t\t\tmove = 0;\n\t\t}", "public void begin(GameState init_state) {\n rand = new Random();\n }", "public void spawnFirstCreature(){\n\n\t\tif(spawnType.equalsIgnoreCase(\"worm\")){\n\t\t\tRuntimeObjectFactory.getObjectFromPool(\"worm\"+spawnId);\n\t\t}else if(spawnType.equalsIgnoreCase(\"antorc\"))\n\t\t\tRuntimeObjectFactory.getObjectFromPool(\"antorc\"+spawnId);\n\t\t\n\t\t//Add new event into pool which will spawn the rest of the worms ( -1 because this method already spawned one )\n\t\tEventPool.addEvent(new tEvent(this,\"spawnCreature\",sleepTime,spawnCount-1));\n\t}", "public GridSimRandom() {\n // empty\n }", "public Asteroid() {\n\t\t// create, seed random number\n\t\trandomNumber = new Random();\n\n\t\t// random location\n\t\tlocation = new Tuple(\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE);\n\n\t\t// random movement vector\n\t\tmovement = new Tuple(\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED,\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED);\n\t\t\n\t\t// random radius\n\t\tsize = randomNumber.nextInt() % 20 + 1;\n\t\t\n\t\t// create Sphere\n\t\tsphere = new Sphere(size, location);\n\n\t}", "public Scenario() {\n Room ninjaRoom, weaponroom, meetingRoom, zenTemple, stealthRoom, restRoom, masterRoom, ninjaTransporter;\n\n // create the rooms\n ninjaRoom = new Room(\"in the main enterence to the camp. You'll need to walk 10000 steps to get to the next room.\");\n weaponroom = new Room(\"in the Weapon's room. Normally this is where you go to grab your Nunchaku, but not today.\");\n meetingRoom = new Room(\"in the Meeting room. This is where classes are normally held. We will be here tomorrow to be sure\");\n zenTemple = new Room(\"in the Meditation room. When done for the day, this is where you clear your head.\");\n stealthRoom = new Room(\"in the Stealth training room. Ninja are made here, slow but steady will keep you alive.\");\n restRoom = new Room(\"in the Barracks. When I am done for th day, I will come back here for some rest.\");\n masterRoom = new Room(\"in the Master's room. Master is current meditating right now. Better leave him alone.\");\n ninjaTransporter = new TransporterRoom(\"in the secret Shumpo room...with this I can teleport anywhere\", this);\n\n weaponroom.addItem(new Item(\"Katana\", 3));\n weaponroom.addItem(new Item(\"Nunchaku\", 1));\n weaponroom.addItem(new Item(\"Bo\", 2));\n weaponroom.addItem(new Item(\"Sai\", 2));\n ninjaRoom.addItem(new Item(\"Master's Keys\", 1));\n meetingRoom.addItem(new Item(\"Secret Plans\", 1));\n zenTemple.addItem(new Item(\"Prayer beads\", 1));\n stealthRoom.addItem(new Item(\"Throwing Star\", 2));\n restRoom.addItem(new Item(\"Risque magazines\", 1));\n masterRoom.addItem(new Item(\"Ancient Shinobi Scroll\", 5));\n\n // initialise room exits\n ninjaRoom.setExits(\"north\", ninjaTransporter);\n\n ninjaTransporter.setExits(\"north\", weaponroom);\n ninjaTransporter.setExits(\"south\", ninjaRoom);\n\n weaponroom.setExits(\"north\", meetingRoom);\n weaponroom.setExits(\"south\", ninjaTransporter);\n\n meetingRoom.setExits(\"north\", stealthRoom);\n meetingRoom.setExits(\"east\", restRoom);\n meetingRoom.setExits(\"south\", weaponroom);\n meetingRoom.setExits(\"west\", zenTemple);\n\n zenTemple.setExits(\"east\", meetingRoom);\n\n stealthRoom.setExits(\"south\", meetingRoom);\n\n restRoom.setExits(\"east\", masterRoom);\n restRoom.setExits(\"west\", meetingRoom);\n\n masterRoom.setExits(\"west\", restRoom);\n\n // Set the start room\n startRoom = ninjaRoom; // start game @ ninjaRoom\n\n rooms = new ArrayList();\n rooms.add(ninjaRoom);\n rooms.add(weaponroom);\n rooms.add(meetingRoom);\n rooms.add(zenTemple);\n rooms.add(stealthRoom);\n rooms.add(restRoom);\n rooms.add(masterRoom);\n rooms.add(ninjaTransporter);\n\n random = new Random();\n }", "Stone create();", "public MyWorld()\n { \n // Create a new world with 600x550 cells with a cell size of 1x1 pixels.\n super(600, 550, 1);\n // Set the order in which Actors are drawn on the screen in this World\n setPaintOrder ( Counter.class, HighScore.class, Fader.class);\n // Counter\n counter = new Counter (\"Score: \");\n addObject (counter, 50, 30);\n // Initialize the player\n player = new Player ();\n addObject (player, 300, 530); \n platforms = new Platform[10]; \n startingPlatform = new Platform();\n addObject (startingPlatform, 300, 550);\n // Loop through as many Meteors as there are on this level\n for (int i = 0; i < platforms.length; i++)\n {\n // Initialize a new Platform object for each spot in the array\n platforms[i] = new Platform ();\n // Add each platform at a random position anywhere on the X axis and at intervals of 15 on the Y axis\n addObject (platforms[i], Greenfoot.getRandomNumber(600), platformCounter);\n platformCounter = platformCounter - 55;\n }\n }", "private IWorld worldCreator(){\n if (gameWorld == GameWorld.NORMAL) return\n new Normal();\n else return\n new Nether();\n }", "public HealthyWorld()\n { \n // Create a new wolrd with 800x400 cells and a cell size of 1x1 pixels\n super(800, 400, 1);\n healthLevel = 10;\n time = 2000;\n showHealthLevel();\n showTime();\n // Create a kid in the middle of the screen\n Kid theKid = new Kid();\n this.addObject(theKid, 400, 350);\n }", "public Health(String name, String description, Point worldLocation, Point tileLocation, int amount, int size,\r\n\t\t\tint regenAmount) {\r\n\t\tsuper(name, description, worldLocation, tileLocation, amount, size);\r\n\t\tthis.regenAmount = regenAmount;\r\n\t}", "public Main()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 600, 1); \n\n prepare();\n }", "public City(){\n this.x = (int)(Math.random()*200);\n this.y = (int)(Math.random()*200);\n }", "public Agent(Grid<Agent> grid){\n\t\tthis.grid=grid;\n\t\tthis.alive=true;\n\t}", "public void setupGame() {\n\t\t// Re-spawn the appropriate number of sheep\n\t\tint numSheep = 31;\n\t\t\n\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\tnumSheep = 1;\n\t\t}\n\t\t\n\t\t// It takes half the sheep to win.\n\t\t_scoreToWin = numSheep / 2;\n\t\tp(\"It takes \" + _scoreToWin + \" sheep to win.\");\n\t\t\n\t\t_hasBeenWon = false;\n\t\t\n\t\t// Non-infrastructural entities.\n\t\t//////////////////////////\n\t\t\n\t\t// Don't create this stuff if I'm replaying.\n\t\tint mod = 1;\n\t\tfor (int i = 0; i < numSheep; i++) {\n\t\t\t//int x = _generator.nextInt(40) - 20;\n\t\t\t//int z = _generator.nextInt(80) - 40;\n\t\t\tmod *= -1;\n\t\t\tint x = i/2 * mod;\n\t\t\tint z = 0;\n\n\t\t\tSheep s = new Sheep(\"sheep-\" + i + \"[\" + _sheepID + \"]\", x, 2, z);\n\t\t\t\n\t\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\t\ts.setBehaviorActive(false);\n\t\t\t}\n\t\t\t\n\t\t\t_sheepID++;\n\t\t}\n\t\t\n\t\t// Add a wubble for testing.\n\t\tif (!_isJimboSpawned && !SheepPhysicsState.PRODUCTION) {\n\t\t\tSystem.out.println(\"Adding Jimbo.\");\n\t\t\t_isJimboSpawned = true;\n\t\t\taddWubble(\"Jimbo\", (short)100, (Integer)1);\n\t\t\taddSidekick(\"Jimbo\");\n\t\t\t//addWubble(\"Bimbo\", (short)101, (Integer)0);\n\t\t}\n\t\t\n\t\t//////////////////////////\n\n\t\t// Add some wrenches in the appropriate spots.\n\t\tnew Wrench(\"blueWrench1\", -8, 5, -20);\n\t\tnew Wrench(\"blueWrench2\", 8, 5, -20);\n\t\tnew Wrench(\"redWrench1\", -8, 5, 20);\n\t\tnew Wrench(\"redWrench2\", 8, 5, 20);\n\t\t\n\t\t// Save the start of the me.\n\t\t_gameStart = System.currentTimeMillis();\n\t\tSystem.out.println(\"Started game at \" + _gameStart);\n\t\t\n\t\t// Make some predicates.\n\t\t//Predicate p = new Predicate(\"baseClassPred\");\n\t\t//GoPred g = new GoPred(\"derivedGoClass\", 1);\n\t\t\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.SPEEDY, new Vector3f(0, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpE\", -1, PowerUpInfo.PowerUpType.EATER, new Vector3f(2, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.STICKY, new Vector3f(2, 0.4f, 2));\n\t}", "public Simulation() {\n ecosystem = new Ecosystem();\n weeksElapsed = 0;\n }", "City(){\n x_coordinate = (int)(Math.random()*200);\n y_coordinate = (int)(Math.random()*200);\n }", "public Agent(Point2D.Double coords, double viewHeading, PApplet p,\n\t\tGeneticObject genObj, boolean Neat, World world) {\n\t\tsuper(coords);\n\t\tthis.parent = p;\n\t\tthis.viewHeading = viewHeading;\n\t\tthis.geneticObject = genObj;\n\t\tthis.neat = Neat;\n\t\tif (this.neat) { \n\t\t\tcreateNeuralNet();\n\t\t} else {\n\t\t\tcreateBrain();\n\t\t}\n\t\tcalculateNetworkPositions(false);\n\t\tthis.world = world;\n\t\tsetupBox2d();\n\t\tthrust(1);\n\t}", "public Critter(){\n\tthis.x_location = (int) (Math.random()*99);\n\tthis.y_location = (int) (Math.random()*99);\n\tthis.wrap();\n\t}", "public GameWorld(){\r\n\t\t\r\n\t}", "@Override\n\tpublic void onAdd() {\n\t\tsuper.onAdd();\n\n\t\tsetIdleAnimation(4527);\n\t\tsetNeverRandomWalks(true);\n\t\tsetWalkingHomeDisabled(true);\n\n\t\tthis.region = Stream.of(AbyssalSireRegion.values()).filter(r -> r.getSire().getX() == getSpawnPositionX()\n\t\t && r.getSire().getY() == getSpawnPositionY()).findAny().orElse(null);\n\n\t\tRegion region = Region.getRegion(getSpawnPositionX(), getSpawnPositionY());\n\n\t\tif (region != null) {\n\t\t\tregion.forEachNpc(npc -> {\n\t\t\t\tif (npc instanceof AbyssalSireTentacle) {\n\t\t\t\t\tif (!npc.isDead()) {\n\t\t\t\t\t\tnpc.setDead(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tList<Position> tentaclePositions = Arrays.asList(\n\t\t\t\tthis.region.getTentacleEast(),\n\t\t\t\tthis.region.getTentacleWest(),\n\t\t\t\tthis.region.getTentacleNorthEast(),\n\t\t\t\tthis.region.getTentacleNorthWest(),\n\t\t\t\tthis.region.getTentacleSouthEast(),\n\t\t\t\tthis.region.getTentacleSouthWest()\n\t\t );\n\n\t\ttentaclePositions.forEach(position -> {\n\t\t\ttentacles.add(NpcHandler.spawnNpc(5909, position.getX(), position.getY(), position.getZ()));\n\t\t});\n\n\t\tList<Position> respiratoryPositions = Arrays.asList(\n\t\t\t\tthis.region.getRespiratorySystemNorthEast(),\n\t\t\t\tthis.region.getRespiratorySystemNorthWest(),\n\t\t\t\tthis.region.getRespiratorySystemSouthEast(),\n\t\t\t\tthis.region.getRespiratorySystemSouthWest()\n\t\t );\n\n\t\trespiratoryPositions.forEach(position -> respiratorySystems.add(\n\t\t\t\tNpcHandler.spawnNpc(5914, position.getX(), position.getY(), position.getZ())));\n\t}", "private static void spawn(Actor actor, ActorWorld world)\n {\n Random generator = new Random();\n int row = generator.nextInt(10);\n int col = generator.nextInt(10);\n Location loc = new Location(row, col);\n while(world.getGrid().get(loc) != null)\n {\n row = generator.nextInt(10);\n col = generator.nextInt(10);\n loc = new Location(row, col);\n }\n world.add(loc, actor);\n }", "public Simulator(){}", "public Human(String name) { // constructor method for set values on the variables while object is initialized.\r\n\t\t\r\n\t\tRandom _rand = new Random();\r\n\t\t\r\n\t\t_weight = _rand.nextInt((5 - 2) + 1) + 2 + ( _rand.nextInt(99) / 100 );\r\n\t\t_height = _rand.nextInt((25 - 15) + 1) + 15 + ( _rand.nextInt(99) / 100 );\r\n\t\t_fullname = name;\r\n\t\tSystem.out.println(\"Hello everyone, i am \" + _fullname + \" it is nice to meet you all.\");\r\n\t\tSystem.out.println(\"My height is \" + _height);\r\n\t\tSystem.out.println(\"My weight is \" + _weight);\r\n\t\r\n\t}", "@Override\r\n public void initCreature() \r\n {\n \t\r\n if ( worldObj.provider.dimensionId == 1 && worldObj.rand.nextInt( 5 ) == 0 )\r\n \t{\r\n \tsetCarried( Block.whiteStone.blockID );\r\n \tsetCarryingData( 0 );\r\n \t}\r\n }", "public Population InitSinglePopulation\n (int PopulationID, int NumberOfAgents, double MixedStrategy){\n \n MultiPopulation TempPopulation = new MultiPopulation();\n\n TempPopulation.setPopulationID(PopulationID);\n TempPopulation.setInitMixedStrategy(MixedStrategy);\n\n for(int j = 0; j < NumberOfAgents; j++){\n\n double TempDraw = rand.nextDouble();\n boolean TempAction = (TempDraw < MixedStrategy) ? true : false;\n MultiPopulationAgent TempAgentM = \n new MultiPopulationAgent(j,PopulationID,TempAction);\n \n TempPopulation.AgentList.add(TempAgentM);\n \n }\n \n TempPopulation.setActionList();\n return TempPopulation;\n }", "public GoLRandomInitializer() {\n Random randomLifeOrDeath = new Random();\n \n // Give life to random cells in the board\n for (int row = 0; row < this.NUM_ROWS; row++)\n for (int column = 0; column < this.NUM_COLUMNS; column++)\n this.gameBoard[row][column] = new \n GoLCell(randomLifeOrDeath.nextBoolean());\n }", "public void makeHero()\r\n { \r\n maxHealth = 100;\r\n health = maxHealth;\r\n }", "public Game() { \n // Create the new environment. Must be done in the same\n // method as the game loop\n env = new Env();\n \n // Sets up the camera\n env.setCameraXYZ(25, 50, 55);\n env.setCameraPitch(pitch);\n\n // Turn off the default controls\n env.setDefaultControl(false);\n\n // Make the room 50 x 50.\n env.setRoom(new Room());\n creatures = new ArrayList<Creature>();\n }", "public City() {\r\n\t\tthis.x = (int) (Math.random() * 200);\r\n\t\tthis.y = (int) (Math.random() * 200);\r\n\t}", "public Asteroid makeAsteroid() {\r\n\t\tAsteroid asteroid = new AsteroidImpl(startBounds.x, random(startBounds.y,startBounds.height)\r\n\t\t\t\t\t\t\t\t\t\t\t, random(10,40), random(10,40)\r\n\t\t\t\t\t\t\t\t\t\t\t, random(1,4));\r\n\t\treturn asteroid;\r\n\t}", "public Simulator() {\n\t\t// create event chain\n\t\tec = new SortableQueue();\n\t\tsims = new SimulationStudy(this);\n\t\tstate = new SimulationState(sims);\n\t\t// push the first customer arrival at t = 0\n\t\tpushNewEvent(new CustomerArrivalEvent(state, 0));\n\t\t// push the termination event at the simulationTime (max duration of simulation)\n\t\tpushNewEvent(new SimulationTerminationEvent(sims.simulationTime));\n\t}", "public WorldGenerator getRandomWorldGenForGrass(Random par1Random)\n {\n return new WorldGenTallGrass(Blocks.tallgrass, 1);\n }", "SimulatedAnnealing() {\n generator = new Random(System.currentTimeMillis());\n }", "public GameInstance(int gameID, World world) {\r\n this.gameID = gameID;\r\n this.world = world;\r\n }", "public World() {\n\t\tblockIDArray = new byte[WORLD_SIZE][WORLD_HEIGHT][WORLD_SIZE];\n\t\tentities\t = new ArrayList<Entity>();\n\t\trand\t\t = new Random();\n\t\t\n new GravityThread(this);\n\t\t\t\t\n\t\tgenerateWorld();\n\t}", "public Person(ElevatorControllerGUI elevatorController){\n this.id = idGenerator.getAndIncrement();\n this.arrivalTime = random.nextInt((30-1)+1)+1; \n this.arrivalFloor = random.nextInt((4-2)+1)+2; \n\t\t this.destinationFloor = random.nextInt((10-5)+1)+5; \n\t\t this.baggageWeight = setLuggageWeight();\n this.personWeight = setPassengerWeight();\n this.random = new Random();\n this.elevatorControllerGUI = elevatorController;\n }", "public Simulator(Scenario scenario) {\r\n\t\tthis.scenario = scenario;\r\n\t}", "private void init(){\n \tdimension.set(0.5f, 0.5f);\n \tsetAnimation(Assets.instance.goldCoin.animGoldCoin);\n \tstateTime = MathUtils.random(0.0f,1.0f);\n \t\n \t//regGoldCoin = Assets.instance.goldCoin.goldCoin;\n \t // Set bounding box for collision detection\n \tbounds.set(0,0,dimension.x, dimension.y);\n \tcollected = false;\n }", "public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1078, 672, 1); \n preparePlayer1();\n preparePlayer2();\n prepareTitle();\n //playmusic();\n }", "public Program7()\n { \n _tc = new TravelingCreature( 200, 200 );\n }", "public GameLogic() {\n this.display = createScreen();\n playerShipHealth = 30;\n enemyShipHealth = 20;\n playerShield = 1;\n enemyShield = 1;\n playerMissile = 10;\n enemyMissile = 5;\n\n isPlayerPilotDamaged = false;\n isPlayerGunLDamaged = false;\n isPlayerGunMDamaged = false;\n isPlayerShieldDamaged = false;\n isPlayerEngineDamaged = false;\n\n isEnemyPilotDamaged = false;\n isEnemyGunLDamaged = false;\n isEnemyGunMDamaged = false;\n isEnemyShieldDamaged = false;\n isEnemyEngineDamaged = false;\n\n playerEvasionPercent = .3;\n enemyEvasionPercent = .3;\n\n }", "public Boss() {\n\t\tlife = 3;\n\t\timage = new Image(\"/Model/boss3.png\", true);\n\t\tboss = new ImageView(image);\n\t\tRandom r = new Random();\n\t\tboss.setTranslateX(r.nextInt(900));\n\t\tboss.setTranslateY(0);\n\t\tisAlive = true;\n\t}", "public void initialize(int x, int y){\n\t\t\thealth = 300; \n\t\t\tthis.x=x; \n\t\t\tthis.y=100; \n\t\t\tthis.xmoving=-.03; \n\t\t\t//this.tmp=random.nextInt(200)+700; \n\t}", "public IndividualHolder (GAIndividual i) {\n individual = i;\n }", "public void spawn()\n\t{\n\t\tsynchronized(this)\n\t\t{\n\t\t\t// Set the x,y,z position of the L2Object spawn and update its _worldregion\n\t\t\tsetVisible(true);\n\t\t\tsetWorldRegion(WorldManager.getInstance().getRegion(getWorldPosition()));\n\n\t\t\t// Add the L2Object spawn in the _allobjects of L2World\n\t\t\tWorldManager.getInstance().storeObject(object);\n\n\t\t\t// Add the L2Object spawn to _visibleObjects and if necessary to _allplayers of its L2WorldRegion\n\t\t\tregion.addVisibleObject(object);\n\t\t}\n\n\t\t// this can synchronize on others instancies, so it's out of\n\t\t// synchronized, to avoid deadlocks\n\t\t// Add the L2Object spawn in the world as a visible object\n\t\tWorldManager.getInstance().addVisibleObject(object, region);\n\n\t\tobject.onSpawn();\n\t}", "public void generateIndividual() {\n // Loop through all our destination cities and add them to our tour\n for (int cityIndex = 0; cityIndex < TourManager.numberOfCities(); cityIndex++) {\n setCity(cityIndex, TourManager.getCity(cityIndex));\n }\n // Randomly reorder the tour\n Collections.shuffle(tour);\n }", "public boolean randomCreate() {\n\t\t// Generates a random genetic code\n\t\t_geneticCode = new GeneticCode();\n\t\t// it has no parent\n\t\t_parentID = -1;\n\t\t_generation = 1;\n\t\t_growthRatio = 16;\n\t\t// initial energy\n\t\t_energy = Math.min(Utils.INITIAL_ENERGY,_world.getCO2());\n\t\t_world.decreaseCO2(_energy);\n\t\t_world.addO2(_energy);\n\t\t// initialize\n\t\tcreate();\n\t\tsymmetric();\n\t\t// put it in the world\n\t\treturn placeRandom();\n\t}", "public Simulation createSimulation (GridOfCells gridOfCells) {\n Simulation newSimulation = mySimulationParser.createSimWithRules(gridOfCells);\n return newSimulation;\n }", "public Cenario1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(900, 600, 1);\n adicionar();\n \n }", "public Overall(ArrayList<Entity> enemies, int generationSize){\n //initialize this.students with actual proper values, mutate them, and create their network\n for (int i = 0; i < generationSize; i++) {\n Entity player = spawn(\"Player\", new SpawnData(Game.getScreenWidth()/2.0,\n Game.getScreenHeight()/2.0).put(\"mode\", 2).put(\"bads\", enemies));\n Student s = new Student(enemies, i, false, player, false);\n s.getBrain().mutate(innovationHistory);\n s.getBrain().generateNetwork();\n students.add(s);\n player.getComponent(PlayerComponent.class).setStudent(s);\n }\n }", "public Agent generateAgent(){\r\n\r\n\t\t\tlogger.info(\"generateAgent method\");\r\n\r\n\t\t\tPatch currentPatch = randPatch();\r\n\r\n\t\t\tlogger.info(\"random patch: x = \" + currentPatch.getX()\r\n\t\t\t\t\t\t+ \" y = \" + currentPatch.getY());\r\n\r\n\r\n\t\t\tAgent agent= new Agent(currentPatch, false);\r\n\r\n\t\t\tcurrentPatch.setPerson(agent);\r\n\r\n\t\t\treturn agent;\r\n\t\t}", "public State(GameStateManager gameStateManager){ //constructor\n this.gameStateManager = gameStateManager;\n camera = new OrthographicCamera();\n mouse = new Vector3();\n }", "public Game() \n {\n parser = new Parser();\n name = new String();\n player = new Player();\n ai = new AI();\n createRooms();\n rand = -1;\n enemyPresent = false;\n wantToQuit = false;\n alive = true;\n createItems();\n createWeapons();\n createEnemy();\n setEnemy();\n setItems();\n setWeapons();\n setExits();\n }", "public CurrentRobotState() {\r\n currentPos = new RobotCoordinates();\r\n motorState = new Motor();\r\n reInitialize();\r\n }", "public BattleWorld(int enemyPokemonID)\r\n {\r\n wildPokemon = false;\r\n isBattleOver = false;\r\n initWorld(\"\", 0, enemyPokemonID);\r\n }", "public Othello() {\n\t\tmyBoard = new Board(8);\n\t\tplayerBlack = spawnPlayer(Color.BLACK);\n\t\tplayerWhite = spawnPlayer(Color.WHITE);\n\t\tpropertySupport = new PropertyChangeSupport(this);\n\t\tinitialisationBoard();\n\t\tcurrentPlayer = playerBlack;\n\t\tfoeHasPlay = true;\n\t\taiPlay = false;\n\t}", "public Food()\n {\n x = (int) Math.floor(Math.random() * RANGEX)*20;\n y = (int) Math.floor(Math.random() * RANGEY)*20;\n isEaten = false;\n }", "@Override\n protected void init() {\n lastHorizontalDirection = direction = Math.random() < 0.5 ? Direction.LEFT : Direction.RIGHT;\n lastVerticalDirection = Direction.UP;\n setBody(new PolygonShape(BODY_WIDTH2, BODY_HEIGHT2), Body.Mode.CHARACTER);\n body().restitution = 0.0;\n size().set(WIDTH, HEIGHT);\n\n this.addAnimation(\"walk\")\n .addFrames(\"smick\", 4, 5, 0, 2)\n .setSpeed(10)\n .loop(true);\n this.addAnimation(\"eatRadish\")\n .addFrames(\"smick\", 4, 5, 8, 9)\n .setSpeed(10)\n .loop(true);\n this.addAnimation(\"eatHector\")\n .addFrames(\"smick\", 4, 5, 10, 10)\n .setSpeed(10)\n .loop(true);\n this.addAnimation(\"jump\")\n .addFrames(\"smick\", 4, 5, 11, 11)\n .setSpeed(10)\n .loop(false);\n this.addAnimation(\"climb\")\n .addFrames(\"smick\", 4, 5, 12, 13)\n .setSpeed(10)\n .loop(false);\n this.addAnimation(\"eatHectorOnRope\")\n .addFrames(\"smick\", 4, 5, 14, 14)\n .setSpeed(10)\n .loop(false);\n this.addAnimation(\"crushing\")\n .addFrames(\"smick\", 4, 5, 16, 16)\n .setSpeed(10)\n .loop(false);\n }", "private Monster getRandomMonster() {\r\n Random gen = new Random();\r\n int num = gen.nextInt(monsters.size());\r\n return (Monster) monsters.get(num).clone();\r\n }", "public void startSimulation();", "public Actor(PhysicsComponent physics, VisualComponent visuals, HpComponent health) {\n this.addComponent(physics); //add physics\n this.addComponent(visuals); //add texture\n this.addComponent(health); //add hp\n }", "public MyWorld()\n { \n super(1200, 600, 1); \n prepare();\n bienvenida();\n instrucciones();\n sonido();\n }", "public static void main(String[] args) {\n\n int gridWidth, gridHeight, humanNumber, goblinNumber, positionX, positionY, strength;\n ArrayList<Player> humanList = new ArrayList<>();\n ArrayList<Player> goblinList = new ArrayList<>();\n Scanner input = new Scanner(System.in);\n\n System.out.println(\" Welcome to Human vs. Goblin\");\n System.out.println();\n\n // Get the size of the grid\n System.out.print(\"Width of the grid (1-500): \");\n gridWidth = input.nextInt();\n if (gridWidth<1 || gridWidth>500) {\n gridWidth = 10; // In case input is wrong, set 10 as default;\n }\n\n System.out.print(\"Height of the grid (1-500): \");\n gridHeight = input.nextInt();\n if (gridHeight<1 || gridHeight>500)\n gridHeight = 10; // In case input is wrong, set 10 as default;\n\n // Init Grid\n World grid = new World(gridWidth, gridHeight);\n System.out.println();\n\n // Get the number of Players\n System.out.print(\"Number of human (0-\"+grid.getArea()+\"): \");\n humanNumber = input.nextInt();\n\n if (humanNumber<0 || humanNumber>grid.getArea()){\n humanNumber = grid.getArea()/3; // In case input is wrong, set one third as default;\n }\n\n System.out.print(\"Number of goblin (0-\"+(grid.getArea())+\"): \");\n goblinNumber = input.nextInt();\n if (goblinNumber<0 || goblinNumber>grid.getArea()){\n goblinNumber = grid.getArea()/3; // In case input is wrong, set one third as default;\n }\n\n Coordinates coordinates = new Coordinates(ThreadLocalRandom.current().nextInt(grid.getArea() -1,grid.getArea()), ThreadLocalRandom.current().nextInt(grid.getArea() -1,grid.getArea()));\n // Fill Grid with creatures\n for(int i=0;i<humanNumber;i++){\n do {\n positionX = ThreadLocalRandom.current().nextInt(0,grid.getWidth()-1);\n positionY = ThreadLocalRandom.current().nextInt(0,grid.getHeight()-1);\n strength = ThreadLocalRandom.current().nextInt(1,10);\n Human human = new Human(\"human\",strength,1, coordinates);\n humanList.add(human);\n\n } while (grid.addPlayer(positionX, positionY, humanList.get(i)));\n }\n for(int i=0;i<goblinNumber;i++){\n do {\n positionX = ThreadLocalRandom.current().nextInt(0,grid.getWidth()-1);\n positionY = ThreadLocalRandom.current().nextInt(0,grid.getHeight()-1);\n strength = ThreadLocalRandom.current().nextInt(1,10);\n Goblin goblin = new Goblin(\"goblin\",strength,1, coordinates);\n goblinList.add(goblin);\n\n } while (grid.addPlayer(positionX, positionY, goblinList.get(i)));\n }\n\n System.out.println();\n System.out.print(\"You have just created Human vs Goblin grid size of \"+grid.getSizeString()+\" \");\n System.out.println(\"with \"+humanNumber+\" humans and \"+goblinNumber+\" Goblins!\");\n System.out.println();\n Timer timer = new Timer();\n timer.schedule(new PlayGame(grid, timer),0,500);\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}", "public void populateRandomly(final EVGameState state)\n \t{\n \t\tfor (int i = 0; i < 6; i++) {\n \t\t\tfinal int width = MathUtils.getRandomIntBetween(32, 128);\n \t\t\tfinal int height = MathUtils.getRandomIntBetween(24, 72);\n \t\t\tfinal Point3D origin = getRandomSolarPoint(Math.max(width, height));\n \t\t\tfinal SolarSystem tSolar = SolarSystem.randomSolarSystem(width, height, origin, state);\n \t\t\taddSolarSystem(tSolar);\n \t\t}\n\t\tfor (int i = 0; i < 10; i++) {\n \t\t\tfinal SolarSystem ss1 = (SolarSystem) MathUtils.getRandomElement(aSolarSystems.values());\n \t\t\tfinal SolarSystem ss2 = (SolarSystem) MathUtils.getRandomElement(aSolarSystems.values());\n \t\t\tif (ss1.equals(ss2)) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\tfinal Portal portal1 = new Portal(state.getNextPropID(), state.getNullPlayer(), ss1.getWormholeLocation(), ss1, ss2);\n \t\t\tfinal Portal portal2 = new Portal(state.getNextPropID() + 1, state.getNullPlayer(), ss2.getWormholeLocation(), ss2,\n \t\t\t\t\tss1);\n \t\t\tfinal Wormhole tempWorhmhole = new Wormhole(portal1, portal2, ss1.getPoint3D().distanceTo(ss2.getPoint3D()), state);\n \t\t\taddWormhole(tempWorhmhole, state);\n \t\t}\n \t}", "public static GameState createInstance() {\n\t\treturn new GameState();\n\t}", "public OverWorld()\n { \n // Create a new world with 800x600 cells with a cell size of 1x1 pixels.\n super(1024, 600, 1, false);\n Setup();\n }", "@BeforeClass\n\tpublic static void setup() {\n\t\tbaseWorld = new BaseWorld(1000 ,1500);\n \tGameManager.get().setWorld(new BaseWorld(1000, 1500));\n\t}", "public TankSimulation() {\n\t\tthis.initialHealth = 1;\n\t\tthis.projectileRange = 40;\n\t\tthis.initialObstacles = 0;\n\t\tgameType = GameType.TANK_SIMULATION;\n\t\tprojectiles = new ArrayList<Projectile>();\n\t\tinitVariables();\n\t}", "public RandomIA() {\n\t\trandom = new Random();\n\t}", "public Hero createHero() {\r\n\t\t// Creates hero with the defines statistics\r\n\t\tHero hero = new Hero(getTotalHealth(), getIllusion(), getHealing(), getHaggling());\r\n\t\t\r\n\t\treturn hero;\r\n\t\t\r\n\t}", "public Game() {\n\t\tthis.setMode(this.gameModes[0]);\n\t\tthis.SIZE = this.mode.getSize();\n\t\tint x = Random.nextInt(0, 5);\n\t\tSystem.out.println(x);\n\t\tthis.newCandy();\n\t}" ]
[ "0.60829633", "0.59133697", "0.5908927", "0.5853801", "0.57904965", "0.5769797", "0.57522225", "0.5689441", "0.56709635", "0.5637154", "0.561743", "0.5606852", "0.56043106", "0.55612385", "0.55589086", "0.55507576", "0.5542658", "0.55337113", "0.55173385", "0.54830205", "0.548031", "0.54491824", "0.544356", "0.5433176", "0.5422729", "0.54167724", "0.5412604", "0.5410531", "0.54087543", "0.5405705", "0.54049313", "0.5400618", "0.5398866", "0.53932965", "0.5391139", "0.53889906", "0.5377694", "0.5376016", "0.5371434", "0.5371391", "0.5358813", "0.5350504", "0.53447026", "0.534039", "0.53208125", "0.53191423", "0.530986", "0.53088397", "0.5308267", "0.5304406", "0.52919537", "0.5290278", "0.5278926", "0.52748597", "0.5271834", "0.5264097", "0.52627015", "0.5243559", "0.523909", "0.52314556", "0.52249515", "0.52236134", "0.52197623", "0.5218203", "0.52161163", "0.5213256", "0.52092737", "0.5206802", "0.5206745", "0.52035934", "0.52001345", "0.51960236", "0.51945", "0.51944673", "0.5187367", "0.5170926", "0.5169145", "0.51682544", "0.51616305", "0.51559234", "0.5155593", "0.5147931", "0.51466256", "0.5142514", "0.51338667", "0.5131985", "0.51268977", "0.5126854", "0.51226914", "0.5120626", "0.51150936", "0.51130235", "0.51119643", "0.5109559", "0.51056254", "0.5103206", "0.5103121", "0.51027745", "0.51024157", "0.5094811" ]
0.78637385
0
This is update function of individual. This function called by simulation map view. Every update of GUI, if current state of individual is "moving", it is position increased by x and y speeds. If individual reaches edge of map dimension, it changes its direction against current direction, if individual already exceeds dimension, it return back to visible place. Also this swing timer update, timer list timers so, individual can change state according to this timer updates. Also this update method broadcast to world its location update and world uses that information to check any collision with another individual.
public void update() { if(currentState == moving) { x += xSpeed; y += ySpeed; if(x < 0 || x > world.getSIMULATION_WIDTH() - individualSize) randomizeDirection(); if(y < 0 || y > world.getSIMULATION_HEIGHT() - individualSize) randomizeDirection(); if(x < 0) x = 0; if(x > world.getSIMULATION_WIDTH() - individualSize) x = world.getSIMULATION_WIDTH() - individualSize; if(y < 0) y = 0; if(y > world.getSIMULATION_HEIGHT() - individualSize) y = world.getSIMULATION_HEIGHT() - individualSize; } for(PlayPauseTimer timer: timerList) timer.update(); world.locationUpdate(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 update()\n\t{\n\t\tgameTime++;\n\t\tfor(int i = 0; i<gameObj.length; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < gameObj[i].size(); j++)\n\t\t\t{\n\t\t\t\t/*If the object implements movable\n\t\t\t\t * call the move method in each object\n\t\t\t\t */\n\t\t\t\tif(gameObj[i].get(j) instanceof Imovable)\n\t\t\t\t\t((MovableObject)gameObj[i].get(j)).move();\n\t\t\t\t/*call CheckBlink() method in SpaceStation\n\t\t\t\t * if the time % blinkRate == 0\n\t\t\t\t * the visibility with be switched\n\t\t\t\t */\n\t\t\t\tif(gameObj[i].get(j) instanceof SpaceStation)\n\t\t\t\t\t((SpaceStation)gameObj[i].get(j)).checkBlink(gameTime);\n\t\t\t\t/*check if missiles are out of fuel\n\t\t\t\tand remove if fuel = 0\n\t\t\t\t*/\n\t\t\t\tif(gameObj[i].get(j) instanceof Missile)\n\t\t\t\t\tif(((Missile)gameObj[i].get(j)).getFuel() <= 0)\n\t\t\t\t\t\tgameObj[i].remove(j);\n\t\t\t}\n\t\t}\t\t\n\t\tSystem.out.println(\"World updated\");\n\t}", "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 update()\n {\n // update the grid square panels\n Component[] components = pnlIsland.getComponents();\n for ( Component c : components )\n {\n // all components in the panel are GridSquarePanels,\n // so we can safely cast\n GridSquarePanel gsp = (GridSquarePanel) c;\n gsp.update();\n }\n \n // update player information\n int[] playerValues = game.getPlayerValues();\n txtPlayerName.setText(game.getPlayerName());\n progPlayerStamina.setMaximum(playerValues[Game.MAXSTAMINA_INDEX]);\n progPlayerStamina.setValue(playerValues[Game.STAMINA_INDEX]);\n progBackpackWeight.setMaximum(playerValues[Game.MAXWEIGHT_INDEX]);\n progBackpackWeight.setValue(playerValues[Game.WEIGHT_INDEX]);\n progBackpackSize.setMaximum(playerValues[Game.MAXSIZE_INDEX]);\n progBackpackSize.setValue(playerValues[Game.SIZE_INDEX]);\n \n //Update Kiwi and Predator information\n txtKiwisCounted.setText(Integer.toString(game.getKiwiCount()) );\n txtPredatorsLeft.setText(Integer.toString(game.getPredatorsRemaining()));\n \n // update inventory list\n listInventory.setListData(game.getPlayerInventory());\n listInventory.clearSelection();\n listInventory.setToolTipText(null);\n btnUse.setEnabled(false);\n btnDrop.setEnabled(false);\n \n // update list of visible objects\n listObjects.setListData(game.getOccupantsPlayerPosition());\n listObjects.clearSelection();\n listObjects.setToolTipText(null);\n btnCollect.setEnabled(false);\n btnCount.setEnabled(false);\n \n // update movement buttons\n btnMoveNorth.setEnabled(game.isPlayerMovePossible(MoveDirection.NORTH));\n btnMoveEast.setEnabled( game.isPlayerMovePossible(MoveDirection.EAST));\n btnMoveSouth.setEnabled(game.isPlayerMovePossible(MoveDirection.SOUTH));\n btnMoveWest.setEnabled( game.isPlayerMovePossible(MoveDirection.WEST));\n }", "@Override\n public void update(){\n getNextPosition();\n checkTileMapCollision();\n setPosition(xtemp, ytemp);\n animation.update();\n }", "public void update(boolean updateWorld) {\n println(\"GUI\", \"Updating the UI...\");\n Player p = ToF.getWorld().getPlayer();\n \n if(updateWorld)\n ToF.getWorld().nextTick();\n \n move(p, NORTH, (Shape) MoveNorth);\n move(p, SOUTH, (Shape) MoveSouth);\n move(p, EAST, (Shape) MoveEast);\n move(p, WEST, (Shape) MoveWest);\n move(p, UP, ButtonUpstairs);\n move(p, DOWN, ButtonDownstairs);\n updateMap();\n updateBars();\n updateInventory();\n \n if(ToF.getWorld().getPlayer().isDead())\n ifLose();\n \n UnderAttack.setVisible(ToF.getWorld().getPlayer().getOpponent().isPresent());\n UnderAttack.setText(\"Under Attack \" + ToF.getWorld().selectEntities(\n e -> ToF.getWorld().getPlayer().getLocation().equals(e.getLocation())\n ).count());\n if(p.getOpponent().isPresent()){\n ToF.getWorld().selectEntities(\n e -> ToF.getWorld().getPlayer().getLocation().equals(e.getLocation())\n ).forEach(e -> ToF.getWorld().newMessage(new Message()\n .add(\"Your opponent\")\n .add(e.getName())\n .add(\"has\")\n .add(e.getHealthBar().getCurrent() + \"HP\"))\n );\n }\n \n if(ToF.getWorld().isFullyExplored())\n ifWin();\n \n Message msg;\n while((msg = ToF.getWorld().getNextMessage()) != null){\n Text.setText(msg.toStringSimple() + \"\\n\" + Text.getText()\n .substring(0, min(1000, Text.getText().length())));\n }\n }", "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}", "public void update() {\n\t\tif (screen.scale != newScale) \n\t\t\tscreen = new Screen(Game.width/newScale, Game.height/newScale, newScale);\n\t\t\n\t\tif (screen.width != Game.width || screen.height != Game.height) {\n\t\t\t\n\t\t\tscreen = new Screen(Game.width/newScale, Game.height/newScale, newScale);\n\t\t}\n\t\t\n\t\tfor (Terrain t : terrainObjs) {\n\t\t\tt.update();\n\t\t}\n\t\t\n\t\tif (backgroundMain != null) {\n\t\t\tbackgroundMain.update();\n\t\t}\n\t\t\n\t\txPos += xMoving;\n\t\tyPos += yMoving;\n\t}", "@Override\n\tpublic void update(MyAIController controller) {\n\t\t// Update Map\n\t\tmap.update(controller.getView());\n\t\tWorldSpatial.Direction orientation = controller.getOrientation();\n\t\tCoordinate pos = new Coordinate(controller.getPosition());\n\n\t\tSystem.out.println(state);\n\n\t\tswitch (state) {\n\t\tcase NORMAL:\n\t\t\tupdateNormal(controller, pos, orientation);\n\t\t\tbreak;\n\t\tcase WALL_FOLLOWING:\n\t\t\tupdateWallFollowing(controller, pos, orientation);\n\t\t\tbreak;\n\t\t// Checks car has moved tiles before going back to WALL_FOLLOWING state\n\t\tcase JUST_TURNED_LEFT:\n\t\t\tupdateJustTurnedLeft(controller, pos, orientation);\n\t\t\tbreak;\n\t\tcase PASSING_TRAP:\n\t\t\tupdatePassingTrap(controller, pos, orientation);\n\t\t\tbreak;\n\t\t}\n\t}", "public void update(){\n\t\tsetChanged();\n\t\trender();\n\t\tprintTimer();\n\t}", "public void update()\n {\n if (frames_since_update++ < UPDATE_AFTER_FRAMES)\n return;\n frames_since_update = 0;\n\n //For each vehicle in the world, determine which station is the closest.\n Actor[] actors = world.getActors();\n for (Actor actor: actors)\n {\n if (!(actor instanceof Vehicle))\n continue;\n Vehicle vehicle = (Vehicle) actor;\n\n //Iterate over each station until the closest one is found.\n Station closest_station = null;\n float closest_station_distance = Float.MAX_VALUE;\n for (Station station : stations)\n {\n if (station == null)\n continue;\n\n float new_distance = vehicle.distance(station);\n if (new_distance < closest_station_distance)\n {\n closest_station = station;\n closest_station_distance = new_distance;\n }\n }\n\n vehicle.setClosestStation(closest_station);\n }\n }", "public void update()\n\t{\n\t\tgrid.draw();\n\t\tmonsterSpawner.update();\n\t\tjewelSpawner.update();\n\t\t\n\t\tint numOnCenter = 0;\n\t\tfor (Player player : players)\n\t\t\tif (player.getSprite().onCenterArea())\n\t\t\t\tnumOnCenter++;\n\t\tfor (Player player : players) {\n\t\t\tif (numOnCenter < 2 && player.getSprite().onCenterArea())\n\t\t\t\tplayer.addScore(Clock.getSeconds());\n\t\t\tplayer.update();\n\t\t}\n\t\tfor (Iterator<Projectile> iterator = projectiles.iterator(); iterator.hasNext();) {\n\t\t\tProjectile projectile = iterator.next();\n\t\t\tif (!projectile.exists())\n\t\t\t\titerator.remove();\n\t\t\telse\n\t\t\t\tprojectile.update();\n\t\t}\n\t\t\n\t\tui.update();\n\t\tfor (int i = traps.size() - 1; i >= 0; i--)\n\t\t{\n\t\t\tTrap trap = traps.get(i);\n\t\t\ttrap.update();\n\t\t\tif (!trap.exists())\n\t\t\t{\n\t\t\t\ttraps.remove(i);\n\t\t\t\tgrid.removeEntity(trap.getCurrentTile());\n\t\t\t}\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}", "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}", "public void update() {\n\t\tupdateController();\n\t\tupdateTimer();\n\t\tupdateTrifecta();\n\t\tupdateGyro();\n\t\tupdateGameTime();\n\t\t//updateTilt();\n\t}", "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() {\n if (_isRunning) {\n //System.out.println(\"update()#\" + _aiOwner.getName() + \"#\" + AIServiceProvider.getInstance().getDeltaTime());\n _states.get(_currentStateHandler).update(AIServiceProvider.getInstance().getDeltaTime());\n }\n }", "public void updatemove() {\n\t\tmove = new Movement(getX(), getY(),dungeon,this);\n\t\t//System.out.println(\"Updated\");\n\t\tnotifys();\n\t\tif(this.getInvincible()) {\n\t\t\tsteptracer++;\n\t\t}\n\t\tdungeon.checkGoal();\n\t}", "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 update()\r\n\t{\r\n\t\tAndroidGame.camera.update(grid, player);\r\n\t\tplayer.update(grid);\r\n\t\tplayButton.update(player, grid);\r\n\t\tmenu.update(grid);\r\n\t\tgrid.update();\r\n\t\tif(grid.hasKey())\r\n\t\t\tgrid.getKey().update(player, grid.getFinish());\r\n\t\tif(levelEditingMode)//checking if the make button is clicked\r\n\t\t{\r\n\t\t\tif(makeButton.getBoundingRectangle().contains(Helper.PointerX(), Helper.PointerY()))\r\n\t\t\t{\r\n\t\t\t\tgrid.makeLevel();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdoorBubble.update();\r\n\t\t\tif(hasKey)\r\n\t\t\t\tkeyBubble.update();\r\n\t\t}\r\n\t}", "public void update(MazeEventWon e) {\r\n }", "public void updateState() {\n\n // After each frame, the unit has a slight morale recovery, but only up to the full base morale.\n morale = Math.min(morale + GameplayConstants.MORALE_RECOVERY, GameplayConstants.BASE_MORALE);\n\n if (morale < GameplayConstants.PANIC_MORALE) {\n state = UnitState.ROUTING;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.ROUTING);\n }\n } else if (state == UnitState.ROUTING && morale > GameplayConstants.RECOVER_MORALE) {\n this.repositionTo(averageX, averageY, goalAngle);\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.MOVING);\n }\n }\n\n // Update the state of each single and the average position\n double sumX = 0;\n double sumY = 0;\n double sumZ = 0;\n int count = 0;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.updateState();\n sumX += single.getX();\n sumY += single.getY();\n sumZ += single.getZ();\n count += 1;\n }\n averageX = sumX / count;\n averageY = sumY / count;\n averageZ = sumZ / count;\n\n // Updating soundSink\n soundSink.setX(averageX);\n soundSink.setY(averageY);\n soundSink.setZ(averageZ);\n\n // Update the bounding box.\n updateBoundingBox();\n\n // Update stamina\n updateStamina();\n }", "@Override\n\tpublic void update() {\n\t\tworld.update();\n\t}", "@Override\n\tpublic void update() {\n\t\tthis.setBounds(obstacle.getCoords().getX() * 64, obstacle.getCoords().getY() * 64, 64, 64);\n\t}", "public void update() {\n\t\t// shooting and moving! This results in a slower movement, and unit self-targeting.\n\t\tif (action == 3 && !(this instanceof Grenadier) && !(this instanceof Sniper)) { // can't be a tank\n\t\t\tif (stop()) { // the method stop detects if we have arrived at correct position or reached max distance\n\t\t\t\txa = 0;\n\t\t\t\tya = 0;\n\t\t\t} else move(xa - xa / 8 * 5, ya - ya / 8 * 5); // SLOWS DOWN MOVEMENT\n\n\t\t\tUnit u = target(); // this is the enemy unit it is targeting.\n\t\t\tif (u != null) {\n\t\t\t\tdir = Math.atan2(u.getY() - y, u.getX() - x);\n\t\t\t\tupdateShooting();\n\t\t\t}\n\t\t}\n\n\t\t// shooting only\n\t\telse if (action == 2) {\n\t\t\tupdateShooting();\n\t\t}\n\t\t\n\t\t// moving only\n\t\telse if (action == 1) {\n\t\t\tif (unitType.equals(\"Assassin\") || unitType.equals(\"Zombie\")) { // these are units that deal with collisions!\n\t\t\t\tunitCollision(); // these three units have methods that specialize in collision\n\t\t\t}\n\n\t\t\tif (stop()) { // the method stop detects if we have arrived at correct position!\n\t\t\t\txa = 0;\n\t\t\t\tya = 0;\n\t\t\t\taction = 0;\n\t\t\t} else move(xa, ya); // YOU MUST ROUND TO A CERTAIN NUMBER OF DECIMAL PLACES IN ORDER TO REDUCE CHOPPINESS OF MOVEMENT\n\t\t}\n\t\tupdateAnimation();\n\n\t}", "public void update() {\n if (isActive()) {\n updatePosition(dx, dy);\n }\n }", "protected abstract void update(double deltaTime);", "public void update(long timeElapsed, UpdateListener ful)\n\t{\n\t\tbyte x = (byte) (int) Math.floor(getX());\n\t\tbyte y = (byte) (int) Math.floor(getY());\n\t\t\n\t\tCell currentlyOn = ful.getCell(x, y);\n\t\t\n\t\tbyte dX = 0;\n\t\tbyte dY = 0;\n\t\t\n\t\tswitch(getState())\n\t\t{\n\t\t\tcase PlayerState.RUNNING_N:\n\t\t\tcase PlayerState.RUNNING_N2:\n\t\t\t\tdY = -1;\n\t\t\tbreak;\n\t\t\tcase PlayerState.RUNNING_E:\n\t\t\tcase PlayerState.RUNNING_E2:\n\t\t\t\tdX = +1;\n\t\t\tbreak;\n\t\t\tcase PlayerState.RUNNING_S:\n\t\t\tcase PlayerState.RUNNING_S2:\n\t\t\t\tdY = +1;\n\t\t\tbreak;\n\t\t\tcase PlayerState.RUNNING_W:\n\t\t\tcase PlayerState.RUNNING_W2:\n\t\t\t\tdX = -1;\n\t\t\tbreak;\n\t\t\tcase PlayerState.IDLE:\n\t\t\tcase PlayerState.IDLE2:\n\n\t\t\t\tbreak;\n\t\t\tcase PlayerState.PLACING_BOMB:\n\n\t\t\t\tcurrentlyOn.handleWalkOn(this, ful);\n\t\t\t\tdidChange = true;\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\t\t\n\t\tif((getState() | 0x1) != 11)\n\t\t{\n\t\t\tfinal float isle_width = 0.1f;\n\t\t\tfinal float proximity = 0.5f - isle_width;\n\n\t\t\tCell nextCellA = ful.getCell((byte) Math.floor(getX() + dX * proximity + dY * isle_width), (byte) Math.floor(getY() + dY * proximity + dX * isle_width));\n\t\t\tCell nextCellB = ful.getCell((byte) Math.floor(getX() + dX * proximity - dY * isle_width), (byte) Math.floor(getY() + dY * proximity - dX * isle_width));\n\n\t\t\tif(nextCellA.canWalkOn() && nextCellB.canWalkOn())\n\t\t\t{\n\t\t\t\tfloat movedist = getSpeed() * timeElapsed / 1000.0F;\n\t\t\t\t\n\t\t\t\tif(movedist > 0.5F)\n\t\t\t\t{\n\t\t\t\t\tmovedist = 0.5F;\n\t\t\t\t}\n\t\t\t\tif(dX == 0)\n\t\t\t\t{\n\t\t\t\t\tsetY(getY() + dY * movedist);\n\t\t\t\t\t\n\t\t\t\t\tdidChange = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsetX(getX() + dX * movedist);\n\t\t\t\t\t\n\t\t\t\t\tdidChange = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tanimationTimer += timeElapsed;\n\t\tif(animationTimer > GameConsts.ANIMATION_TIME)\n\t\t{\n\t\t\tsetState((byte) (getState() ^ 1)); // Hampeln\n\t\t\tanimationTimer = 0;\n\t\t\tdidChange = true;\n\t\t}\n\t\t\n\t\tcurrentlyOn.handleWalkOn(this, ful); // die in fire, pick up Specials\n\t}", "@Override\n\tpublic void update() {\n\t\tmove();\n\t\tplace();\n\t}", "@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}", "public void update(MazeEventTeleported e) {\r\n }", "@Override\n\tpublic void update(float delta) {\n\t\tHashMap<Coordinate, MapTile> currentView = getView();\n\t\tcheckStateChange();\n\t\tfor(Coordinate i : currentView.keySet()) {\n\t\t\t\n\t\t\t//Building up wholeMap with data from currentView\n\t\t\tif(i.x >= 0 && i.y >= 0 && i.x < World.MAP_WIDTH && i.y < World.MAP_HEIGHT ) {\n\t\t\t\twholeMap.put(i, currentView.get(i));\n\t\t\t}\n\t\n\t\t}\n//\t\tif(getSpeed() > CAR_SPEED/2f){\n//\t\t\tapplyBrake();\n//\t\t}\n\n//\t\tif(checkWallAhead(getOrientation(), currentView)){\n//\t\t\tisReversing = true;\n//\t\t}\n//\t\tif(checkRightWall(getOrientation(), currentView)){\n//\t\t\tisTurningLeft = true;\n//\t\t}\n//\t\tif(checkLeftWall(getOrientation(), currentView)){\n//\t\t\tisTurningRight = true;\n//\t\t}\n\n\n\n\t\tdebugPrint(\"STATES: A: \" + isAccelerating +\" Rv: \"+ isReversing +\n\t\t\" L: \"+ isTurningLeft + \" R: \"+isTurningRight);\n\n\n\t\t//Handles Steering\n\t\tif(isTurningLeft){\n\t\t\tdebugPrint(\"TRYING TO TURN LEFT\");\n\t\t\tapplySafeLeftTurn(delta);\n\t\t} else if(isTurningRight){\n\t\t\tdebugPrint(\"TRYING TO TURN RIGHT\");\n\t\t\tapplySafeRightTurn(delta);\n\t\t}\n\t\tif(isAccelerating){\n\t\t\tdebugPrint(\"No\");\n\t\t\tapplySafeForwardAcceleration();\n\t\t}\n\n\t\tif(isReversing){\n\t\t\tapplySafeReverseAcceleration();\n//\t\t\tisReversing = false;\n\n\t\t}\n\n\n\n\n\n\t\t//\n\t\tif(hasReachedNextDest) {\n\t\t\tdebugPrint(\"Recalculating Route.\");\n\t\t\tList<Node> result =exploreDijkstras(new Coordinate(carrrr.getPosition()));\n\t\t\tresult.add(new Node(\"1,2\"));\n\t\t\tpathList.add(result);\n\t\t\thasReachedNextDest = false;\n\t\t}\n\n\n\n\n\t\t//Car movement code-----------------------------------------------------------------------------------\n\t\t//If there's a path in the path array to follow\n\t\tif(pathList.size() > 0 || processing) {\n\t\t\tif(processing) {\n\t\t\t\tcheckStateChange();\n\n\t\t\t\t//Identify if target tile is N,S,E or W.\n\t\t\t\ttry {\n\t\t\t\t\tpath.get(counter+1);\n\t\t\t\t}\n\t\t\t\tcatch(Exception e) {\n\t\t\t\t\tdebugPrint(\"Starting new path\");\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tprocessing = false;\n\t\t\t\t\thasReachedNextDest = true;\n\t\t\t\t}\n\n\n\n\t\t\t\tCoordinate currPos = new Coordinate (getPosition());\n\t\t\t\tCoordinate targetPos = new Coordinate(path.get(counter).getName());\n\n\t\t\t\tif(!coordList.contains(currPos)){\n\t\t\t\t\tdebugPrint(\"Recalculating Route (Not on route).\");\n\t\t\t\t\tList<Node> result =exploreDijkstras(new Coordinate(getPosition()));\n\t\t\t\t\tresult.add(new Node(\"99,99\")); //This is just to make sure something is there.\n\t\t\t\t\tpathList.add(result);\n\t\t\t\t\tprocessing = false;\n\t\t\t\t\tdebugPrint(result);\n\t\t\t\t\tcounter = 0;\n\t\t\t\t}\n\n\n\t\t\t\tWorldSpatial.Direction dir = getDirection(currPos, targetPos);\n\n\t\t\t\tboolean isFacingTarget = false;\n\n\t\t\t\tSystem.out.println(\"-----------------\");\n\t\t\t\tdebugPrint(\"currPos: \"+ currPos);\n\t\t\t\tdebugPrint(\"targetPos: \"+ targetPos);\n\t\t\t\tSystem.out.println(\"-----------------\");\n\n\t\t\t\t// If we are on the target, move on to next.\n\t\t\t\tif(currPos.equals(targetPos)) {\n\t\t\t\t\tcounter++;\n\t\t\t\t\tcurrPos = targetPos;\n\t\t\t\t\ttargetPos = new Coordinate(path.get(counter).getName());\n\n\n\n\t\t\t\t\tif(!isFacingTarget){\n//\t\t\t\t\t\tisTurningSoon = true;\n\t\t\t\t\t\trotateAntiClockwise(delta);\n\n\t\t\t\t\t}\n\t\t\t\t\tdir = getDirection(currPos, targetPos);\n\t\t\t\t\tSystem.out.println(\"dir: \"+ dir);\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\tSystem.out.println(\"dir: \"+ dir + \"|| carFront: \" + getOrientation());\n\t\t\t\t\tisFacingTarget = dir.equals(getOrientation());\n\n\t\t\t\t\tif(dir.equals(oppositeOfOrientation(getOrientation()))){\n\t\t\t\t\t\tisReversing = true;\n\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Not on target yet.\n\t\t\t\t\tif(!isFacingTarget && isReversing) {\n\t\t\t\t\t\t//If not moving in Direction of target Coord:\n\t\t\t\t\t\tif(leftOrRight(dir) == null){\n\t\t\t\t\t\t\t//this is bad.\n\t\t\t\t\t\t\tdebugPrint(\"Not left or right?\");\n\t\t\t\t\t\t\tdebugPrint(\"UTURN REQUIRED\");\n\t\t\t\t\t\t\trotateAntiClockwise(delta);\n\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisReversing = false;\n\t\t\t\t\t\t\tdebugPrint(\"leftOrRight: \" + leftOrRight(dir));\n\t\t\t\t\t\t\tlastTurnDirection = leftOrRight(dir);\n\t\t\t\t\t\t\tint targetDegree = directionToDegree(dir);\n\n\t\t\t\t\t\t\tdebugPrint(\"PEEK: \"+peek(getVelocity(), targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().toString());\n\n\t\t\t\t\t\t\tif(peek(getVelocity(), targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().equals(currPos)){\n\t\t\t\t\t\t\t\t//isAccelerating = true;\n//\t\t\t\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(lastTurnDirection.equals(WorldSpatial.RelativeDirection.RIGHT)){\n\t\t\t\t\t\t\t\tif(peek(getVelocity(),targetDegree, WorldSpatial.RelativeDirection.RIGHT, delta).getCoordinate().equals(targetPos)){\n\t\t\t\t\t\t\t\t\tdebugPrint(\"RIGHT TURN SAFE\");\n\t\t\t\t\t\t\t\t\tisTurningRight = true;\n\t\t\t\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tisTurningRight = false;\n\t\t\t\t\t\t\t\t\tisAccelerating = true;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else{\n\t\t\t\t\t\t\t\tif(peek(getVelocity(),targetDegree, WorldSpatial.RelativeDirection.LEFT, delta).getCoordinate().equals(targetPos)) {\n\t\t\t\t\t\t\t\t\tdebugPrint(\"LEFT TURN SAFE\");\n\n\t\t\t\t\t\t\t\t\tisTurningLeft = true;\n\t\t\t\t\t\t\t\t\tisAccelerating = false;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t\t\t\t\t\tisAccelerating = 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\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\treadjust(lastTurnDirection, delta);\n\t\t\t\t\t\t//If moving in right direction,\n\t\t\t\t\t\t//Accelerate if not traveling at max speed\n\t\t\t\t\t\tfloat x = CAR_SPEED;\n\t\t\t\t\t\tif(isTurningSoon) {\n\t\t\t\t\t\t\tx = CAR_SPEED/4f;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(getSpeed() < x){\n\t\t\t\t\t\t\tisTurningSoon = false;\n\t\t\t\t\t\t\t//isAccelerating = true;\n//\t\t\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tif(useTestPath){\n\t\t\t\t\tmakeTestPath();\n\t\t\t\t\tpath = testpath;\n\t\t\t\t} else {\n\t\t\t\t\tpath = pathList.poll();\n\t\t\t\t\t//Populate coordList\n\t\t\t\t\tfor(Node n: path){\n\t\t\t\t\t\tcoordList.add(new Coordinate(n.getName()));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tdebugPrint(path);\n\t\t\t\tprocessing = true; \n\t\t\t\t\n\t\t\t}\n\t\n\t\t\t\n\t\t} else {\n\t\t\tdebugPrint(\"End of path list\");\n\t\t}\n\n\n\n\n\n\n\n/*\t\t// If you are not following a wall initially, find a wall to stick to!\n\t\tif(!isFollowingWall){\n\t\t\tif(getSpeed() < CAR_SPEED){\n\t\t\t\tapplyForwardAcceleration();\n\t\t\t}\n\t\t\t// Turn towards the north\n\t\t\tif(!getOrientation().equals(WorldSpatial.Direction.NORTH)){\n\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.LEFT;\n\t\t\t\tapplyLeftTurn(getOrientation(),delta);\n\t\t\t}\n\t\t\tif(checkNorth(currentView)){\n\t\t\t\t// Turn right until we go back to east!\n\t\t\t\tif(!getOrientation().equals(WorldSpatial.Direction.EAST)){\n\t\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.RIGHT;\n\t\t\t\t\tapplyRightTurn(getOrientation(),delta);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tisFollowingWall = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Once the car is already stuck to a wall, apply the following logic\n\t\telse{\n\n\t\t\t// Readjust the car if it is misaligned.\n\t\t\treadjust(lastTurnDirection,delta);\n\n\t\t\tif(isTurningRight){\n\t\t\t\tapplyRightTurn(getOrientation(),delta);\n\t\t\t}\n\t\t\telse if(isTurningLeft){\n\t\t\t\t// Apply the left turn if you are not currently near a wall.\n\t\t\t\tif(!checkFollowingWall(getOrientation(),currentView)){\n\t\t\t\t\tapplyLeftTurn(getOrientation(),delta);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tisTurningLeft = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Try to determine whether or not the car is next to a wall.\n\t\t\telse if(checkFollowingWall(getOrientation(),currentView)){\n\t\t\t\t// Maintain some velocity\n\t\t\t\tif(getSpeed() < CAR_SPEED){\n\t\t\t\t\tapplyForwardAcceleration();\n\t\t\t\t}\n\t\t\t\t// If there is wall ahead, turn right!\n\t\t\t\tif(checkWallAhead(getOrientation(),currentView)){\n\t\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.RIGHT;\n\t\t\t\t\tisTurningRight = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// This indicates that I can do a left turn if I am not turning right\n\t\t\telse{\n\t\t\t\tlastTurnDirection = WorldSpatial.RelativeDirection.LEFT;\n\t\t\t\tisTurningLeft = true;\n\t\t\t}\n\t\t}\n\n\t\t*/\n\n\t}", "public abstract void objectUpdate(int x,int y, int delta);", "public void update(){\n\t\tupdatePlayerPosition();\n\t\thandleCollisions();\n\t}", "public void updatePosition(){\n\t\t//maps the position to the closest \"grid\"\n\t\tif(y-curY>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY+GameSystem.GRID_SIZE;\n\t\t\tyGridNearest++;\n\t\t}\n\t\telse if(curX-x>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX-GameSystem.GRID_SIZE;\n\t\t\txGridNearest--;\n\t\t}\n\t\telse if(x-curX>=GameSystem.GRID_SIZE/2){\n\t\t\tcurX=curX+GameSystem.GRID_SIZE;\n\t\t\txGridNearest++;\n\t\t}\n\t\telse if(curY-y>=GameSystem.GRID_SIZE/2){\n\t\t\tcurY=curY-GameSystem.GRID_SIZE;\n\t\t\tyGridNearest--;\n\t\t}\n\t\t//sets the last completely arrived location grid\n\t\tif(y-yTemp>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp+GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY++;\n\t\t}\n\t\telse if(xTemp-x>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp-GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX--;\n\t\t}\n\t\telse if(x-xTemp>=GameSystem.GRID_SIZE){\n\t\t\txTemp=xTemp+GameSystem.GRID_SIZE;\n\t\t\tx=xTemp;\n\t\t\tlastX++;\n\t\t}\n\t\telse if(yTemp-y>=GameSystem.GRID_SIZE){\n\t\t\tyTemp=yTemp-GameSystem.GRID_SIZE;\n\t\t\ty=yTemp;\n\t\t\tlastY--;\n\t\t}\n\t\t//only updates nextX and nextY when the move buttons are being pressed down\n\t\t/*\n\t\tif(movable){\n\t\t\tif(direction.equals(\"right\")){\n\t\t\t\t\tnextX=lastX+1;\n\t\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"left\")){\n\t\t\t\tnextX=lastX-1;\n\t\t\t\tnextY=lastY;\n\t\t\t}\n\t\t\telse if(direction.equals(\"up\")){\n\t\t\t\tnextY=lastY-1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t\telse if(direction.equals(\"down\")){\n\t\t\t\tnextY=lastY+1;\n\t\t\t\tnextX=lastX;\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t\n\t}", "public void update()\n\t{\n\t\t//\tTHE WORLD HAS ENDED DO NOT EXECUTE FURTHER\n\t\tif( end )\n\t\t{\n\t\t\tsafeEnd = true;\n\t\t\treturn;\n\t\t}\n\n\t\t//Plot graphics\n\t\tif(plot){\n\t\t\thealthyFunction.show(infectedFunction, healthyFunction);\n\t\t\tbusFunction.show(infectedFunction, seasFunction, busFunction, colFunction, ellFunction, smpaFunction, lawFunction);\n\t\t\tplot = false;\n\t\t}\n\n\t\t//\tsafe point to manage human/zombie ratios\n\t\t//\tTODO: Modify infect to also switch zombies to humans\n\t\tinfect();\n\t\tgetWell();\n\t\taddFromQueue();\n\n\t\t//\tupdate all entities\n\t\tfor( Zombie z: zombies )\n\t\t{\n\t\t\tz.update(zombiesPaused);\n\t\t}\n\t\tfor( Entity h: humans )\n\t\t{\n\t\t\th.update(humansPaused);\n\t\t}\n\n\t\tif( zc!=zombies.size() || hc!=humans.size() )\n\t\t{\n\t\t\tzc = zombies.size();\n\t\t\thc = humans.size();\n\t\t\tSystem.out.println(zc+\"/\"+hc);\n\t\t}\n\n\t\t//Add points to our functions\n\t\thealthyFunction.add(time,humans.size());\n\t\tinfectedFunction.add(time,zombies.size());\n\t\tseascount = smpacount = ellcount = lawcount = buscount = colcount = 0;\n\t\tfor (int i = 0; i < humans.size(); i++) {\n\t\t\tEntity curr = humans.get(i);\n\t\t\tif (curr instanceof SEAS) {\n\t\t\t\tseascount++;\n\t\t\t} else if (curr instanceof SMPA) {\n\t\t\t\tsmpacount++;\n\t\t\t} else if (curr instanceof Elliot) {\n\t\t\t\tellcount++;\n\t\t\t} else if (curr instanceof Law) {\n\t\t\t\tlawcount++;\n\t\t\t} else if (curr instanceof Business) {\n\t\t\t\tbuscount++;\n\t\t\t} else if (curr instanceof Columbian) {\n\t\t\t\tcolcount++;\n\t\t\t}\n\t\t}\n\t\tbusFunction.add(time, buscount);\n\t\tcolFunction.add(time, colcount);\n\t\tellFunction.add(time, ellcount);\n\t\tlawFunction.add(time, lawcount);\n\t\tsmpaFunction.add(time, smpacount);\n\t\tseasFunction.add(time, seascount);\n\t\ttime++;\n\t}", "@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}", "void update();", "void update();", "void update();", "void update();", "void update();", "void update();", "void update();", "void update();", "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 }", "public void onUpdate()\n {\n this.prevPosX = this.posX;\n this.prevPosY = this.posY;\n this.prevPosZ = this.posZ;\n this.motionX = 0.0D;\n this.motionY = 0.0D;\n this.motionZ = 0.0D;\n this.onGround = false;\n\n if (this.wallPos != null)\n {\n this.xPosition = this.wallPos[0];\n this.yPosition = this.wallPos[1];\n this.zPosition = this.wallPos[2];\n\n if (!this.onValidSurface() && !this.isDead)\n {\n this.entityDropItem(this.mapStack, 0.0F);\n this.setDead();\n }\n }\n\n ++this.updateCount;\n\n if (this.updateCount > 400)\n {\n this.updateCount = 0;\n mod_HangableMaps.instance.sendMapIDPacket(this);\n }\n }", "public void update(Observable arg0, Object arg1) {\n\t\tboolean gameOver= theGame.isGameOver();\r\n\t\tboolean gameWon= theGame.isWon();\r\n\t\tString gameType=theGame.getGameType();\r\n\t\tif(gameType.equals(\"timed\"));\r\n\t\t//update the remaining time\r\n\t\tlblLeft.setText(theGame.getRemainingTime());\r\n\t\t\r\n\t\t//first update the tiles from the model\r\n\t\tInteger [][]modelTiles= theGame.getTiles();\r\n\t\tfor(int i=0;i<tiles.length;i++){\r\n\t\t\tfor(int j=0;j<tiles[i].length;j++){\r\n\t\t\t\tString text=modelTiles[i][j].toString();\r\n\t\t\t\tif(text.equals(\"-1\")){\r\n\t\t\t\t\ttiles[i][j].setText(\"\");\r\n\t\t\t\t\ttiles[i][j].setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\ttiles[i][j].setText(modelTiles[i][j].toString());\r\n\t\t\t\t\ttiles[i][j].setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//update queue of tiles from the model\r\n\t\tQueue<Integer> modelQueueTiles = theGame.getTilesQueue();\r\n\t\tif(gameWon||gameOver){\r\n\t\t\tfor(int i=0;i<queueTiles.length-1;i++){\r\n\t\t\t\tqueueTiles[i].setText(modelQueueTiles.getElement(i).toString());\r\n\t\t\t}\r\n\t\t\tqueueTiles[4].setText(\"\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//Queue<Integer> modelQueueTiles = theGame.getTilesQueue();\r\n\t\t\tfor(int i=0;i<queueTiles.length;i++){\r\n\t\t\tqueueTiles[i].setText(modelQueueTiles.getElement(i).toString());\r\n\t\t\t}\r\n\t\t}\r\n\t\t//update the score board\r\n\t\tint modelScore= theGame.getScore();\r\n\t\tlblScore.setText(Integer.toString(modelScore));\r\n\t\tif(gameType.equals(\"untimed\")){\r\n\t\t\t//update the moves left\r\n\t\t\tint modelMovesLeft= theGame.getRemainingMoves();\r\n\t\t\tlblLeft.setText(Integer.toString(modelMovesLeft));\r\n\t\t}\r\n\t\t\r\n\t\tif(gameOver){\r\n\t\t\tfor(int i=0;i<tiles.length;i++){\r\n\t\t\t\tfor(int j=0;j<tiles[i].length;j++){\r\n\t\t\t\t\ttiles[i][j].setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlblGameStatus.setText(\"Game Over! Loser!\");\r\n\t\t\tlblGameStatus.setForeground(Color.RED);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse if(gameWon){\r\n\t\t\tfor(int i=0;i<tiles.length;i++){\r\n\t\t\t\tfor(int j=0;j<tiles[i].length;j++){\r\n\t\t\t\t\ttiles[i][j].setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlblGameStatus.setText(\"Game Won! Legend!\");\r\n\t\t\tlblGameStatus.setForeground(Color.GREEN);\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "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 update(){\r\n\t\tupdateTurnLabel();\r\n\t\tupdateCanvas();\r\n\t}", "public void update(){\n\t\tx+=xspeed; \n\t\ty+=yspeed;\t\n\t}", "public abstract void update(GameContainer gc, float dt);", "@Override\n\tpublic void update(long elapsed_time, LevelData levelData, Rectangle animation_bounds)\n\t{\n\t}", "@Override\n\tpublic void updatePosition()\n\t{\n\t\tif(!fired && !pathfinding)\n\t\t{\n\t\t\tif(x == destX && y == destY)\n\t\t\t{\n\t\t\t\tfired = true;\n\t\t\t\tvehicle.msgAnimationDestinationReached();\n\t\t\t\tcurrentDirection = MovementDirection.None;\n\t\t\t\t\n\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\tif(cIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t\t{\n\t\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(nextIntersection == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(Pathfinder.isCrossWalk(current,city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t{\n\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(current.y).get(current.x);\n\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile(guiList.contains(this))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tguiList.remove(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(allowedToMove || drunk)\n\t\t\t{\n\t\t\t\tswitch(currentDirection)\n\t\t\t\t{\n\t\t\t\t\tcase Right:\n\t\t\t\t\t\tx++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Up:\n\t\t\t\t\t\ty--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Down:\n\t\t\t\t\t\ty++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Left:\n\t\t\t\t\t\tx--;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(x % CityPanel.GRID_SIZE == 0 && y % CityPanel.GRID_SIZE == 0 && !moves.isEmpty())\n\t\t\t{\t\n\t\t\t\tif(allowedToMove || drunk)\n\t\t\t\t{\n\t\t\t\t\tcurrentDirection = moves.pop();\n\t\t\t\t\n\t\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\t\t\n\t\t\t\t\tif(current != next)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(cIntersection == null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcity.permissions[current.y][current.x].release();\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\tif(nextIntersection == null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************ADDED**************************//\n\t\t\t\t\t\tif(Pathfinder.isCrossWalk(current,city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(current.y).get(current.x);\n\t\t\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twhile(guiList.contains(this))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tguiList.remove(this);\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\t//**************************END ADDED**************************//\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcurrent = next;\n\t\t\t\t\t\n\t\t\t\t\tswitch(currentDirection)\n\t\t\t\t\t{\n\t\t\t\t\tcase Down:next = new Point(current.x,current.y + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Left:next = new Point(current.x - 1,current.y);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Right:next = new Point(current.x + 1,current.y);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Up:next = new Point(current.x,current.y - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:next = current;\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\t\n\t\t\t\t\n\n\t\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\t\n\t\t\t\tif(nextIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(city.permissions[next.y][next.x].tryAcquire())\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(cIntersection == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//**************************ADDED**************************//\n\t\t\t\t\t\tList<Gui> guiList = city.crosswalkPermissions.get(next.y).get(next.x);\n\t\t\t\t\t\tsynchronized(guiList)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(Pathfinder.isCrossWalk(next, city.getWalkingMap(), city.getDrivingMap()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor(Gui g : guiList)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(g instanceof PassengerGui)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tallowedToMove = false;\n\t\t\t\t\t\t\t\t\t\treturn;\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\tif(nextIntersection.acquireIntersection())\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tnextIntersection.acquireAll();\n\t\t\t\t\t\t\t\t\tallowedToMove = true;\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{\n\t\t\t\t\t\t\t\t\tallowedToMove = false;\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\tguiList.add(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//**************************END ADDED**************************//\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tallowedToMove = true;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!allowedToMove && drunk)\n\t\t{\n\t\t\tcity.addGui(new ExplosionGui(x,y));\n\t\t\tSystem.out.println(\"DESTROYING\");\n\t\t\tcity.removeGui(this);\n\t\t\tvehicle.stopThread();\n\t\t\tsetPresent(false);\n\t\t\t\n\t\t\tIntersection nextIntersection = city.getIntersection(next);\n\t\t\tIntersection cIntersection = city.getIntersection(current);\n\t\t\t\n\t\t\tif(cIntersection == null)\n\t\t\t{\n\t\t\t\tif(city.permissions[current.y][current.x].tryAcquire() || true)\n\t\t\t\t{\n\t\t\t\t\tcity.permissions[current.y][current.x].release();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(nextIntersection == null)\n\t\t\t\t{\n\t\t\t\t\tif(!cIntersection.acquireIntersection())\n\t\t\t\t\t{\n\t\t\t\t\t\tcIntersection.releaseAll();\n\t\t\t\t\t}\n\t\t\t\t\tcIntersection.releaseIntersection();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void update(double elapsedTime, Dimension bounds) {\n\t\tsuper.update(elapsedTime, bounds);\n\t}", "public void update(MazeEvent e) {\r\n\r\n }", "public void update() {\n\t\tint xa = 0, ya = 0; \n\t\tif(game.getPlayer().x < 0){\n\t\t\txa -= 2;\n\t\t}else if(game.getPlayer().x + 32 > game.getScreen().width){\n\t\t\txa += 2;\n\t\t}\n\t\tif(game.getPlayer().y < 0){\n\t\t\tya -= 2;\n\t\t}else if(game.getPlayer().y + 32 > game.getScreen().height){\n\t\t\tya +=2;\n\t\t}\n\t\t\n\t\tif (xa != 0 || ya!= 0) move(xa, ya);\n\t\t\n\t\t//detects if the mouse is clicking on the interface\n\t\t/*if(Mouse.getButton() == 1 && Mouse.getX() >= 0 && Mouse.getX() <= 1200 && Mouse.getY() > 525 && Mouse.getY() < 675) {\n\t\t\tclicked = true;\n\t\t} else {\n\t\t\tclicked = false;\n\t\t}*/\n\t\t\n\t\treturn;\n\t}", "public abstract void update(float deltaTime);", "public abstract void update(float deltaTime);", "public abstract void update(float deltaTime);", "public abstract void update(float dt);", "public abstract void update(float dt);", "public abstract void update(float dt);", "@Override\n public void Update()\n {\n\n activity.runOnUiThread(new Runnable()\n {\n @Override\n public void run()\n {\n if(geoTarget == null)\n {\n txtInstructions.setVisibility(VISIBLE);\n txtFlightTime.setVisibility(GONE);\n }\n else\n {\n GeoCoord geoFrom = bFromPlayer ? game.GetOurPlayer().GetPosition() : game.GetMissileSite(lSiteID).GetPosition();\n float fltDistance = geoFrom.DistanceTo(geoTarget);\n\n txtFlightTime.setText(context.getString(R.string.flight_time_target, TextUtilities.GetTimeAmount(game.GetTimeToTarget(geoFrom, geoTarget, game.GetConfig().GetMissileSpeed(missileType.GetSpeedIndex())))));\n txtInstructions.setVisibility(GONE);\n txtFlightTime.setVisibility(VISIBLE);\n txtOutOfRange.setVisibility(fltDistance > game.GetConfig().GetMissileRange(missileType.GetRangeIndex()) ? VISIBLE : GONE);\n imgTracking.setVisibility(bTrackPlayer ? VISIBLE : GONE);\n\n //Update trajectory.\n List<LatLng> points = new ArrayList<LatLng>();\n points.add(Utilities.GetLatLng(bFromPlayer ? game.GetOurPlayer().GetPosition() : game.GetMissileSite(lSiteID).GetPosition()));\n\n if(bTrackPlayer)\n {\n geoTarget = game.GetPlayer(lTrackPlayerID).GetPosition();\n }\n\n points.add(Utilities.GetLatLng(geoTarget));\n\n targetTrajectory.setPoints(points);\n }\n }\n });\n }", "@Override\n public void update() {\n animate();\n if (alive == false) {\n afterKill();\n return;\n }\n if (alive) {\n calculateMove();\n }\n }", "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 }", "public void update(MazeEventWalked e) {\r\n }", "@Override\n\tpublic void update_logic()\n\t{\n\t\tArrayList<Double> angleList = new ArrayList<Double>();\n\t\tfor(GameObject item : sightList)\n\t\t{\n\t\t\tangleList.add(ALL.point_direction(x, y, item.getX(), item.getY()));\n\t\t}\n\t\t\n\t\t// only if there is something to run from\n\t\tif (angleList.size() > 0)\n\t\t{\n\t\t\trunFromOthers(angleList);\n\t\t} else {\n\t\t\tmotion_set(direction, 0);\n\t\t}\n\t\t\n\t\t// show a debug message\n\t\tdebugString = Integer.toString(resources);\n\n\t}", "public void updateWorld() {\n\t\t/*\n\t\t * The particles are created during the simulation, this prevents some strange behaviors\n\t\t * that rises when all the particles are added at the start of a simulation, for example \n\t\t * the it was noticed that the random generation for the position followed some sort of pattern\n\t\t * and this influenced the formation the DLA cluster, resulting in an unxpected formation\n\t\t * */\n\t\tif( elements < getInitialParticleNumber() ){\n\t\t\tcreateParticleOutsideOfBB();\t\t\n\t\t\telements++;\n\t\t}\n\t\t//now for the each particles that are still floating a movement update is made,\n\t\t//according to the type of movement\n\t\tfor(int i=0; i<particleCollection.size(); i++){\n\t\t\tif( particleCollection.get(i).isFloating() == false ){\n\t\t\t\tparticleCollection.remove(i);\n\t\t\t}\n\t\t\t//If the particle has gone outside of the boundaries then \n\t\t\t//a new one is created to replace it, this can happen only if the movementType is 2 or 3 (balistic or square spiral)\n\t\t\telse if( particleCollection.get(i).isOutsideOfTheWorld() == true ){\n\t\t\t\tparticleCollection.remove(i);\n\t\t\t\tcreateParticleOutsideOfBB();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tswitch(movementType){\n\t\t\t\tcase 0:\n\t\t\t\t\t/*\n\t\t\t\t\t * each movement method return a boolean if it's false it mean that the particle ha moved and\n\t\t\t\t\t * the collided to the cluster and so the static particle counter il incremented by one\n\t\t\t\t\t * */\n\t\t\t\t\tif( particleCollection.get(i).snowFlakeFallMove() == false ){\n\t\t\t\t\t\tcollisionIteration.add(new Integer(particleCollection.get(i).getIterationNumber()));\n\t\t\t\t\t\tupdateBB(i);\n\t\t\t\t\t\tstaticParticles++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: \n\t\t\t\t\tif( particleCollection.get(i).randomMove() == false ){\n\t\t\t\t\t\tcollisionIteration.add(new Integer(particleCollection.get(i).getIterationNumber()));\n\t\t\t\t\t\tupdateBB(i);\n\t\t\t\t\t\tstaticParticles++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tif( particleCollection.get(i).straightMove() == false ){\n\t\t\t\t\t\tcollisionIteration.add(new Integer(particleCollection.get(i).getIterationNumber()));\n\t\t\t\t\t\tupdateBB(i);\n\t\t\t\t\t\tstaticParticles++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tif( particleCollection.get(i).squareSpiralMove() == false ){\n\t\t\t\t\t\tcollisionIteration.add(new Integer(particleCollection.get(i).getIterationNumber()));\n\t\t\t\t\t\tupdateBB(i);\n\t\t\t\t\t\tstaticParticles++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void update() {\n\t\t\n\t\tVector size = new Vector(Main.frame.getContentPane().getWidth() + 64, 64 + 64);\n\t\tposition = new Vector(0, Main.frame.getContentPane().getHeight() - 40);\n\t\t\n\t\tRectangle rect = new Rectangle(position, size);\n\t\t\n\t\tif (rect.contains(Mouse.getVector())) {\n\t\t\troom.isMouseOverGUI = true;\n\t\t}\n\t}", "public void update() {\r\n\t\tif (!isPaused && !noclip)\r\n\t\t\tcollision();\r\n\t\tif (!isPaused)\r\n\t\t\tsideScroll();\r\n\r\n\t\t/*\r\n\t\t * Call the update , act(), method from each individual object if game\r\n\t\t * is not paused\r\n\t\t */\r\n\t\tif (!isPaused) {\r\n\t\t\tfor (CosmosEntity obj : level.getLevelEnemyObjects())\r\n\t\t\t\tif (obj.isAlive())\r\n\t\t\t\t\tobj.act(); // act if object is alive\r\n\r\n\t\t\tfor (CosmosEntity obj : level.getLevelInteractiveObjects())\r\n\t\t\t\tif (obj.isAlive())\r\n\t\t\t\t\tobj.act();\r\n\r\n\t\t\tfor (CosmosEntity obj : level.getLevelTextureObjects())\r\n\t\t\t\tobj.act();\r\n\r\n\t\t}\r\n\r\n\t\tfor (CosmosEntity anim : level.getlevelConstantObjects())\r\n\t\t\tif (anim.isAlive())\r\n\t\t\t\tanim.act();\r\n\r\n\t\tif (!isPaused)\r\n\t\t\tplayer.act(); // calls player act method, results in animation\r\n\r\n\t}", "void selfUpdate();", "public void update(){\n\t\t\t//Key listener for keyboard input \n\t\t\taddKeyListener(new KeyAdapter(){\n\t\t\t\t\n\n\t\t\t\t@Override\n\t\t\t\tpublic void keyPressed(KeyEvent e)\n\t\t\t\t{\t\t\t\n\t\t\t\t\t \t// Moving on the x axis.\n\t\t\t\t if((e.getKeyCode() == KeyEvent.VK_D) || e.getKeyCode() == (KeyEvent.VK_RIGHT))\n\t\t\t\t pl.moveXspeed += pl.accelXspeed;\n\t\t\t\t \t\t\n\t\t\t\t else if(e.getKeyCode() == (KeyEvent.VK_A) || e.getKeyCode() == (KeyEvent.VK_LEFT))\n\t\t\t\t pl.moveXspeed -= pl.accelXspeed;\n\t\t\t\t \n\t\t\t\t // Moving on the y axis.\n\t\t\t\t if(e.getKeyCode() == (KeyEvent.VK_W) || e.getKeyCode() == (KeyEvent.VK_UP))\n\t\t\t\t pl.moveYspeed -= pl.accelYspeed;\n\t\t\t\t else if(e.getKeyCode() == (KeyEvent.VK_S) || e.getKeyCode() == (KeyEvent.VK_DOWN))\n\t\t\t\t pl.moveYspeed += pl.accelYspeed;\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t \t \n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t if (GameOn == true){\n\t\t\t\t \t\n\t\t\t\t }\n\t\t\t\t else if (GameOn == false )\n\t\t\t\t {\n\t\t\t\t \t repaint(); \n\t\t\t\t \t \n\t\t\t\t \t \t\t\t\t\t\t\t\n\t\t\t\t\t\tData = \" Number of rockets remaining: \" + pl.NumRockets \n\t\t\t\t\t\t\t+ \"Number of bullets remaining: \" +pl.NumBullets\n\t\t\t\t\t\t\t+ \" Remaining health: \" +pl.Health\n\t\t\t\t\t\t\t+\" Number of runway enemies: \" + RunAwayEnemies\n\t\t\t\t\t\t\t+ \" Number of destroyed enemies: \" +DestroyedEnemies;\n\t\t\t\t \n\t\t\t\t \t Email = new EmailGUI(Data); \n\t\t\t\t \t \n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t /* else if (WinsState == true )\n\t\t\t\t {\n\t\t\t\t \t repaint(); \n\t\t\t\t \t //*******************stoip game here and send email with game details\n\t\t\t\t \t Data = \" Number of rockets remaining: \" + pl.NumRockets +\",\" \n\t\t\t\t\t\t\t\t\t+ \" Number of bullets remaining: \" +pl.NumBullets+\",\"\n\t\t\t\t\t\t\t\t\t+ \" Remaining health: \" +pl.Health+\",\"\n\t\t\t\t\t\t\t\t\t+ \" Number of destroyed enemies: \" +DestroyedEnemies+\",\"\n\t\t\t\t\t\t\t\t\t+\" Number of runway enemies: \" + RunAwayEnemies;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t \t Email = new EmailGUI(Data); \n\t\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\t\n\t\t\t});\n\t\t\t\n\t\t\t//mouse listener for mouse input \n\t\t\taddMouseListener(new MouseListener()\n\t\t\t{\n\t\t\t\t@Override\n\t\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\t//actions performed when mouse button 1 is pressed \t\n\t\t\t\tif (e.getButton() == MouseEvent.BUTTON1)\n\t\t\t\t{\n\t\t\t\t\tif (pl.NumBullets > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t\t//creates shoot and adds the to the list\n\t\t\t\t\t\t\tpl.Shoot(); \n\t\t\t\t\t\t\tBulletFired = true; \n\t\t\t\t\t\t\tbul = new Bullet(pl.GetXCoord() + 240,pl.GetYCoord() + 70); \n\t\t\t\t\t\t\tBulletList.add(bul); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (pl.NumBullets <= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tGameOn = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//actions performed when mouse button 2 is pressed \t\n\t\t\t\t\t if (e.getButton() == MouseEvent.BUTTON3)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif (pl.NumRockets > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//creates rockets and adds the to the list\n\t\t\t\t\t\t\tpl.FireRocket(); \n\t\t\t\t\t\t\tRocketFired = true; \n\t\t\t\t\t\t\trock = new Rocket(pl.GetXCoord() + 200,pl.GetYCoord() + 60); \n\t\t\t\t\t\t\tRocketList.add(rock); \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void mousePressed(MouseEvent e) {\t\t\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void mouseReleased(MouseEvent e) {\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void mouseEntered(MouseEvent e) {\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void mouseExited(MouseEvent e) {\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}); \n\t\t\n\t\t}", "public void update() ;", "public void updateCell() {\n alive = !alive;\n simulator.getSimulation().changeState(xPosition, yPosition);\n setColor();\n }", "@Override\n\tpublic void update() {\n\t\tmouseMove(gm.mouseY);\n\t\tmoveCollider();\n\t}", "public void update()\r\n {\r\n try\r\n {\r\n Thread.sleep(DELAY);\r\n }\r\n catch (InterruptedException delayException)\r\n {\r\n System.out.println(\"Uh-oh, unexpected exception occured\");\r\n System.out.println(\"This is probably the result of a unruly delay\");\r\n System.out.println(delayException);\r\n } // end of catch (InterruptedException delayException)\r\n\r\n //checkCellStatus(); \r\n\r\n checkCellStatus();\r\n \r\n System.out.print(\"\\f\");\r\n for (int columns = 0; columns < LOWER_BOUND; columns ++)\r\n {\r\n for (int rows = 0; rows < RIGHT_BOUND; rows ++)\r\n {\r\n if (cellGrid[columns][rows].isToBeAlive())\r\n {\r\n cellGrid[columns][rows].setAlive(true);\r\n }\r\n else\r\n {\r\n cellGrid[columns][rows].setAlive(false);\r\n } // end of if (cellGrid[columns][rows].isToBeAlive())\r\n } // end of for (int rows = 0; rows < RIGHT_BOUND; rows ++)\r\n System.out.print(\"\\n\");\r\n } // end of for (int columns = 0; columns < LOWER_BOUND; columns ++)\r\n }", "public void update(World world, Target target);", "public void update();", "public void update();", "public void update();", "public void update();", "public void update();", "public void update();", "public void update();", "@Override\n public void run() {\n updateMovement();\n }", "public void update(float delta){\n\t//\tdebugLabel.setText(\"Delta time: \"+delta);\n\t\tfor (Actor actor: this.getActors()){\n\t\t\tif(actor instanceof CubeNod)\n\t\t\t\t((CubeNod)actor).update(delta);\n\t\t\tif(actor instanceof LogicContainer)\n\t\t\t\t((LogicContainer)actor).update(delta);\t\n\t\t}\n\t\t\t\n\t}", "@Override\r\n\tpublic void updateScreen() {\r\n\t\tsuper.updateScreen();\r\n\t\t_resolutionResolver = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);\r\n\t\tthis.width = _resolutionResolver.getScaledWidth();\r\n\t\tthis.height = _resolutionResolver.getScaledHeight();\r\n\r\n\t\t// Handle when the player clicked on a cell\r\n\t\tif (_selectedCell != -1) {\r\n\t\t \r\n\t\t\t// make sure we have our player or otherwise we will\r\n\t\t // not be able to set the correct position for the player\r\n\t\t\tif (HubbyUtils.getServerPlayer() != null) {\r\n\t\t\t\tint cellIndex = _startCell + _selectedCell;\r\n\t\t\t\tif (cellIndex < UltraTeleportWaypoint.getWaypointCount()) {\r\n\t\t\t\t UltraTeleportWaypoint p = UltraTeleportWaypoint.getWaypoints().get(cellIndex);\r\n\t\t\t\t double posX = p.getPos().getX();\r\n\t\t\t\t double posY = p.getPos().getY();\r\n\t\t\t\t double posZ = p.getPos().getZ();\r\n\t\t\t\t float yaw = p.getRotationY();\r\n\t\t\t\t float pitch = p.getRotationX();\r\n\r\n\t\t\t\t // Get the client world to be able to find the proper block for teleporting\r\n\t\t\t\t World world = HubbyUtils.getClientWorld();\r\n\t\t\t\t if (world != null) {\r\n\t\t\t\t while (true) {\r\n\t\t\t\t \tBlockPos pos = new BlockPos(posX, posY, posZ);\r\n\t\t\t\t if (world.isAirBlock(pos)) {\r\n\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t posY += 1.0d;\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\r\n\t\t\t\t // Update the player's location on the server and then\r\n\t\t\t\t // that will pass down to the client player and update his\r\n\t\t\t\t // position as well\r\n\t\t\t\t HubbyUtils.getServerPlayer().playerNetServerHandler.setPlayerLocation(posX, posY, posZ, yaw, pitch);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t_selectedCell = -1;\r\n\t\t}\r\n\r\n\t\t// update selected list\r\n for (int i = 0; i < UltraTeleportWaypoint.getWaypointCount(); ++i) {\r\n if (i >= _selectedList.size()) {\r\n _selectedList.add(false);\r\n }\r\n }\r\n\r\n // Only show delete button when we have something selected\r\n if (getSelectedCount() > 0) {\r\n this.buttonList.add(_deleteButton);\r\n }\r\n else {\r\n this.buttonList.clear();\r\n }\r\n\t}", "@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}", "public abstract void update(float time);", "@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 update() {\n\t\tif (!uiDone)\n\t\t\tinitializeUI();\n\t\t\n Vehicle vehicle = (Vehicle) unit;\n\n // Update driver button if necessary.\n boolean driverChange = false;\n if (driverCache == null) {\n if (vehicle.getOperator() != null) driverChange = true;\n }\n else if (!driverCache.equals(vehicle.getOperator())) driverChange = true;\n if (driverChange) {\n driverCache = vehicle.getOperator();\n if (driverCache == null) {\n driverButton.setVisible(false);\n }\n else {\n driverButton.setVisible(true);\n driverButton.setText(driverCache.getOperatorName());\n }\n }\n\n // Update status label\n if (!vehicle.sameStatusTypes(statusCache, vehicle.getStatusTypes())) {\n statusCache = vehicle.getStatusTypes();\n statusLabel.setText(vehicle.printStatusTypes());\n }\n\n // Update beacon label\n if (beaconCache != vehicle.isBeaconOn()) {\n \tbeaconCache = vehicle.isBeaconOn();\n \tif (beaconCache) beaconLabel.setText(\"On\");\n \telse beaconLabel.setText(\"Off\");\n }\n\n // Update speed label\n if (speedCache != vehicle.getSpeed()) {\n speedCache = vehicle.getSpeed();\n speedLabel.setText(\"\" + formatter.format(speedCache) + \" km/h\");\n }\n\n // Update elevation label if ground vehicle.\n if (vehicle instanceof GroundVehicle) {\n GroundVehicle gVehicle = (GroundVehicle) vehicle;\n double currentElevation = gVehicle.getElevation();\n if (elevationCache != currentElevation) {\n elevationCache = currentElevation;\n elevationLabel.setText(formatter.format(elevationCache) + \" km\");\n }\n }\n\n Mission mission = missionManager.getMissionForVehicle(vehicle);\n \n boolean hasDestination = false;\n \t\t\n if ((mission != null) && (mission instanceof VehicleMission)\n && ((VehicleMission) mission).getTravelStatus().equals(TravelMission.TRAVEL_TO_NAVPOINT)) {\n \tNavPoint destinationPoint = ((VehicleMission) mission).getNextNavpoint();\n \t\n \thasDestination = true;\n \t\n \tif (destinationPoint.isSettlementAtNavpoint()) {\n \t\t// If destination is settlement, update destination button.\n \t\tif (destinationSettlementCache != destinationPoint.getSettlement()) {\n \t\t\tdestinationSettlementCache = destinationPoint.getSettlement();\n \t\t\tdestinationButton.setText(destinationSettlementCache.getName());\n \t\t\taddDestinationButton();\n \t\t\tdestinationTextCache = \"\";\n \t\t}\n \t}\n \telse {\n// \t\tif (destinationTextCache != \"\") {\n \t\t\t// If destination is coordinates, update destination text label.\n \t\t\tdestinationTextCache = Conversion.capitalize(destinationPoint.getDescription());//\"A Navpoint\";\n \t\t\tdestinationTextLabel.setText(destinationTextCache);\n \t\t\taddDestinationTextLabel();\n destinationSettlementCache = null;\n// \t\t}\n \t}\n }\n \n if (!hasDestination) {\n \t// If destination is none, update destination text label.\n \tif (destinationTextCache != \"\") {\n \t\tdestinationTextCache = \"\";\n \t\tdestinationTextLabel.setText(destinationTextCache);\n \t\taddDestinationTextLabel();\n \t\tdestinationSettlementCache = null;\n \t}\n }\n \n\n // Update latitude and longitude panels if necessary.\n if ((mission != null) && (mission instanceof VehicleMission)\n && ((VehicleMission) mission).getTravelStatus().equals(TravelMission.TRAVEL_TO_NAVPOINT)) {\n VehicleMission vehicleMission = (VehicleMission) mission;\n \tif (destinationLocationCache == null)\n \t\tdestinationLocationCache = new Coordinates(vehicleMission.getNextNavpoint().getLocation());\n \telse \n \t\tdestinationLocationCache.setCoords(vehicleMission.getNextNavpoint().getLocation());\n destinationLatitudeLabel.setText(\"\" +\n destinationLocationCache.getFormattedLatitudeString());\n destinationLongitudeLabel.setText(\"\" +\n destinationLocationCache.getFormattedLongitudeString());\n }\n else {\n \tif (destinationLocationCache != null) {\n \t\tdestinationLocationCache = null;\n destinationLatitudeLabel.setText(\"\");\n destinationLongitudeLabel.setText(\"\");\n \t}\n }\n\n // Update distance to destination if necessary.\n if ((mission != null) && (mission instanceof VehicleMission)) {\n VehicleMission vehicleMission = (VehicleMission) mission;\n \ttry {\n \t\tif (distanceCache != vehicleMission.getCurrentLegRemainingDistance()) {\n \t\t\tdistanceCache = vehicleMission.getCurrentLegRemainingDistance();\n \t\t\tdistanceLabel.setText(\"\" + formatter.format(distanceCache) + \" km\");\n \t\t}\n \t}\n \tcatch (Exception e) {\n \t\tlogger.log(Level.SEVERE,\"Error getting current leg remaining distance.\");\n \t\t\te.printStackTrace(System.err);\n \t}\n }\n else {\n \tdistanceCache = 0D;\n \tdistanceLabel.setText(\"\");\n }\n\n // Update ETA if necessary\n if ((mission != null) && (mission instanceof VehicleMission)) {\n VehicleMission vehicleMission = (VehicleMission) mission;\n if (vehicleMission.getLegETA() != null) {\n if (!etaCache.equals(vehicleMission.getLegETA().toString())) {\n etaCache = vehicleMission.getLegETA().toString();\n etaLabel.setText(\"\" + etaCache);\n }\n }\n }\n else {\n \tetaCache = \"\";\n \tetaLabel.setText(\"\");\n }\n\n // Update direction display\n directionDisplay.update();\n\n // Update terrain display\n terrainDisplay.update();\n }", "public void updatePlayerLocation() {requires new property on gamestate object\n //\n }", "public void updateLocation();", "public void updatePosition() {\n \t\r\n \tx += dx;\r\n \ty += dy;\r\n \t\r\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}", "private void updatePosition(){\n updateXPosition(true);\n updateYPosition(true);\n }", "public void update(double delta){\n \tthis.av.update();\n \t\n \t//checar� a cada update se haver� colis�o\n \tfor(int i=0;i<10;i++){\n \t\t//se houver colis�o entre Avatar e os lixos normais, ser�o acrescidos 10 pontos ao player\n\t\t\tif(this.lixo[i].collision(av, lixo[i])){\n\t\t\t\tScorePanel.score += 10;\n\t\t\t}\n\t\t}\n \t\n \t//Checa se todos os lixos Foram coletados\n<<<<<<< HEAD\n \tif(ScorePanel.getScore() == 100 && telaConcluida == false){\n \t\ttelaConcluida = true;\n \t\t//JOptionPane.showMessageDialog(null, \"Fase 1 conclu�da!!!\");\n \t\t//ScorePanel.setScoreToZero();\n=======\n \tif(Garbage.getScore() == 100){\n \t\tJOptionPane.showMessageDialog(null, \"Fase 1 conclu�da!!!\");\n \t\tGarbage.setScoreToZero();\n>>>>>>> c1516bff6596a16ab28a02b04aa726b8350d9899\n \t}\n \t\n \t//se houver colis�o entre Avatar e o lixo especial, ser�o acrescidos 10 segundos a mais para o player\n \tif(lixoEspecial.collision(av, lixoEspecial)){\n \t\tTimerGameplay.tempo += 10; \n \t}\n }\n \n //atualiza renderização\n public void draw(){\n \tthis.repaint();\n }\n\t\n\t@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t/*/limites do campo e coordenadas\n\t\tSystem.out.println(\"ACTION EVENT\");\n\t\t\n\t\tif(this.av.x<0){\n\t\t\tthis.av.vx = 0;\n\t\t\tthis.av.x = 0;\n\t\t}\n\t\t\n\t\tif(this.av.x> 800){\n\t\t\tthis.av.vx = 0;\n\t\t\tthis.av.x = 800;\n\t\t}\n\t\t\n\t\tif(this.av.y<0){\n\t\t\tthis.av.vy = 0;\n\t\t\tthis.av.y = 0;\n\t\t}\n\t\t\n\t\tif(this.av.y> 570){\n\t\t\tthis.av.vy = 0;\n\t\t\tthis.av.y = 570;\n\t\t}\n\t\tthis.av.x = this.av.x + this.av.vx;\n\t\tthis.av.y = this.av.y + this.av.vy;\n\t\t\n\t\t//repaint();//*/\n\t}//*/\n\n\t@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\tthis.av.keyPressed(e);\n\t}\n\n\t@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\tthis.av.keyReleased(e);\n\t}\n\n\t@Override\n\tpublic void keyTyped(KeyEvent e) {}", "public void update(MazeEventWalkedDrowned e) {\r\n }", "private void update() {\n gsm.update();\n }" ]
[ "0.6973446", "0.6676728", "0.6561598", "0.6466679", "0.638319", "0.6360021", "0.63518935", "0.626477", "0.62259406", "0.6223419", "0.62178177", "0.62144595", "0.62123525", "0.62083304", "0.61644584", "0.61291957", "0.6107186", "0.6096032", "0.60908324", "0.6090447", "0.6086286", "0.60817343", "0.60630524", "0.6055476", "0.6054001", "0.6052607", "0.6047738", "0.6040757", "0.6036435", "0.603114", "0.6026464", "0.6020292", "0.6015107", "0.6002545", "0.60020196", "0.5987276", "0.5985816", "0.5982042", "0.5982042", "0.5982042", "0.5982042", "0.5982042", "0.5982042", "0.5982042", "0.5982042", "0.5980594", "0.59765995", "0.59536403", "0.59486395", "0.59368664", "0.59323895", "0.59164524", "0.5907303", "0.5903491", "0.5900542", "0.58942246", "0.5890409", "0.58877856", "0.58877856", "0.58877856", "0.5887197", "0.5887197", "0.5887197", "0.58857775", "0.58817255", "0.5881074", "0.58726126", "0.5842982", "0.5841855", "0.5833209", "0.5831427", "0.5822869", "0.581961", "0.58141136", "0.5812142", "0.5811334", "0.5810398", "0.580261", "0.5795541", "0.5795541", "0.5795541", "0.5795541", "0.5795541", "0.5795541", "0.5795541", "0.5792353", "0.5787181", "0.5785476", "0.57851636", "0.57847077", "0.5782602", "0.5777809", "0.57754177", "0.5773853", "0.57714236", "0.57683367", "0.57575625", "0.57567877", "0.57516325", "0.5746438" ]
0.7305059
0
This function used check any collision with another individual. It uses rectangle bound of individual and using rectangle method intersects to check collision.
public boolean collision(Individual otherIndividual) { Rectangle other = otherIndividual.bounds(); if(this.bounds().intersects(other)) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Rectangle getCollisionBox();", "public void checkCollision() {}", "Rectangle getCollisionRectangle();", "Rectangle getCollisionRectangle();", "public abstract boolean collisionWith(CollisionObject obj);", "void checkCollision(Entity other);", "private boolean collision1() {\n return game.racket1.getBounds1().intersects(getBounds()); // returns true if the two rectangles intersect\r\n }", "@Override\n\tpublic boolean collidesWithRectangle(Rectangle rectangle) {\n\t\treturn false;\n\t}", "public abstract boolean hit(Rectangle2D r);", "private static boolean doBoundingBoxesIntersect(Rectangle a, Rectangle b) {\r\n\t return a.getMinX() <= b.getMaxX() \r\n\t && a.getMaxX() >= b.getMinX() \r\n\t && a.getMinY() <= b.getMaxY()\r\n\t && a.getMaxY() >= b.getMinY();\r\n\t}", "public boolean intersects(BaseGameObject other) {\r\n return (other.getPosx() - this.getPosx())\r\n * (other.getPosx() - this.getPosx())\r\n + (other.getPosy() - this.getPosy())\r\n * (other.getPosy() - this.getPosy())\r\n < (other.bound + this.bound) * (other.bound + this.bound);\r\n }", "public void checkCollision(Enemy enemy){\r\n if(collidingEntity!=null && collidingEntity!=enemy){\r\n return;\r\n }\r\n FloatRect x = enemy.getRect ();\r\n\r\n if (rect1==null || x==null){\r\n return;\r\n }\r\n\r\n FloatRect ins = rect1.intersection (x);\r\n\r\n if(ins!=null) {\r\n this.collidingEntity= enemy;\r\n collide=true;\r\n checkRightCollision (x);\r\n checkLeftCollision (x);\r\n bounce(enemy);\r\n } else {\r\n noCollision ();\r\n }\r\n }", "public void checkCollision()\r\n\t{\r\n\t\t//for Bullets against Avatar and Enemy\r\n\t\tfor(int bulletIndex = 0; bulletIndex < bullets.size(); bulletIndex++)\r\n\t\t{\r\n\t\t\tBullet b = bullets.get(bulletIndex);\r\n\t\t\tif (b instanceof AvatarBullet)\r\n\t\t\t{\r\n\t\t\t\t@SuppressWarnings(\"unused\")\r\n\t\t\t\tboolean collided = false;\r\n\t\t\t\tfor (int enemyIndex = 0; enemyIndex < enemy.size(); enemyIndex++)\r\n\t\t\t\t{\r\n\t\t\t\t\tEnemy e = enemy.get(enemyIndex);\r\n\t\t\t\t\tif(((AvatarBullet) b).collidedWith(e))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbullets.remove(bulletIndex);\r\n\t\t\t\t\t\tbulletIndex--;\r\n\t\t\t\t\t\tenemy.remove(enemyIndex);\r\n\t\t\t\t\t\tenemyIndex --;\r\n\t\t\t\t\t\tcollided = true;\r\n\t\t\t\t\t\tint score = getScore()+1;\r\n\t\t\t\t\t\tsetScore(score);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (b instanceof EnemyBullet)\r\n\t\t\t{\r\n\t\t\t\tif (((EnemyBullet) b).collidedWith(avatar))\r\n\t\t\t\t{\r\n\t\t\t\t\tbullets.remove(bulletIndex);\r\n\t\t\t\t\tbulletIndex--;\r\n\t\t\t\t\tint health = Avatar.getLives()-1;\r\n\t\t\t\t\tavatar.setLives(health);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int platformIndex = 0; platformIndex < platforms.size(); platformIndex++)\r\n\t\t{\r\n\t\t\tPlatforms p = platforms.get(platformIndex);\r\n\t\t\tif (p instanceof Platforms)\r\n\t\t\t{\r\n\t\t\t\t//boolean collided = false;\r\n\t\t\t\t//Avatar a = avatar.get(enemyIndex);\r\n\t\t\t\tif(((Platforms) p).collidedWith(avatar))\r\n\t\t\t\t{\r\n\t\t\t\t\tsetAlive(true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tsetAlive(false);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void checkCollision(Box box){\r\n if(collidingEntity2!=null && collidingEntity2!=box){\r\n return;\r\n }\r\n FloatRect x = box.getRect ();\r\n\r\n if (rect1==null || x==null){\r\n return;\r\n }\r\n\r\n FloatRect ins = rect1.intersection (x);\r\n\r\n if(ins!=null) {\r\n this.collidingEntity2= box;\r\n collide=true;\r\n checkTopCollision (x);\r\n if(collidedTop==false) {\r\n checkRightCollision (x);\r\n checkLeftCollision (x);\r\n }\r\n } else {\r\n noCollision ();\r\n }\r\n }", "public void checkCollisions(ArrayList<Collidable> other);", "public void checkCollision(Actor a) {\r\n\t\tif (a.equals(this))\r\n\t\t\treturn;\r\n\r\n\t\tPolygon otherPoly = a.basePoly;\r\n\t\tint distance = 1;\r\n\r\n\t\tif (otherPoly != null && basePoly != null) {\r\n\t\t\t// Calculate distance using the formula x^2 + y^2 = z^2\r\n\t\t\tint x = otherPoly.getBounds().x - basePoly.getBounds().x;\r\n\t\t\tint y = otherPoly.getBounds().y - basePoly.getBounds().y;\r\n\t\t\tdistance = (int) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\r\n\t\t}\r\n\t\tif (distance > 150 || a instanceof Particle)\r\n\t\t\treturn;\r\n\r\n\t\tfor (int i = 0; i < basePoly.npoints; i++) {\r\n\t\t\tif (otherPoly.contains(new Point(basePoly.xpoints[i],\r\n\t\t\t\t\tbasePoly.ypoints[i]))) {\r\n\t\t\t\tonCollision(a);\r\n\t\t\t\ta.onCollision(a);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void checkForCollisions()\r\n\t{\r\n\t\t//collision detection\r\n\t\tfor(PolygonD obj : objects)\r\n\t\t{\r\n\t\t\t//find points in character that intersected with the scene\r\n\t\t\tfor(PointD p : aSquare.getBoundary().getVerts())\r\n\t\t\t{\r\n\t\t\t\tif(obj.contains(p)){\r\n\t\t\t\t\t//find side that intersected\r\n\t\t\t\t\tdouble minDist = Double.MAX_VALUE;\r\n\t\t\t\t\tPointD prev = obj.getVerts().get(obj.getVerts().size()-1);\r\n\t\t\t\t\tPointD closestPoint = null;\r\n\t\t\t\t\tfor(PointD vert : obj.getVerts())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tDouble d = distanceToLine(new Vector(prev, vert), p);\r\n\t\t\t\t\t\tif(d != null && d < minDist)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tminDist = d;\r\n\t\t\t\t\t\t\tclosestPoint = getNearestPointOnLine(new Vector(prev, vert),p);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tprev = vert;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tVector offset = new Vector(p, closestPoint);\r\n\t\t\t\t\taSquare.translate(offset);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//find points in scene that intersected with the character\r\n\t\t\tfor(PointD p : obj.getVerts())\r\n\t\t\t{\r\n\t\t\t\tif(aSquare.getBoundary().contains(p)){\r\n\t\t\t\t\t//find side that intersected\r\n\t\t\t\t\tdouble minDist = Double.MAX_VALUE;\r\n\t\t\t\t\tPointD prev = aSquare.getBoundary().getVerts().get(aSquare.getBoundary().getVerts().size()-1);\r\n\t\t\t\t\tPointD closestPoint = null;\r\n\t\t\t\t\tfor(PointD vert : aSquare.getBoundary().getVerts())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tDouble d = distanceToLine(new Vector(prev, vert), p);\r\n\t\t\t\t\t\tif(d != null && d < minDist)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tminDist = d;\r\n\t\t\t\t\t\t\tclosestPoint = getNearestPointOnLine(new Vector(prev, vert),p);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tprev = vert;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//get the angle of object by 'feeling' it\r\n\t\t\t\t\tint numVerts = obj.verts.size();\r\n\t\t\t\t\tint objI = obj.verts.indexOf(p);\r\n\t\t\t\t\tint lastI = (objI - 1) % numVerts;\r\n\t\t\t\t\tif(lastI == -1)\r\n\t\t\t\t\t\tlastI = numVerts - 1;\r\n\t\t\t\t\tint nextI = (objI + 1) % numVerts;\r\n\t\t\t\t\t\r\n\t\t\t\t\tint angle = (int)Math.round((new Vector(obj.verts.get(objI), obj.verts.get(lastI))).angleBetween(new Vector(obj.verts.get(objI), obj.verts.get(nextI))));\r\n\t\t\t\t\t\r\n\t\t\t\t\taSquare.sendMsg(new Msg(aSquare, \"Felt Vertex: \" + angle + \"deg\"));//null means status message\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t//reverse direction to make aSquare move out of wall\r\n\t\t\t\t\tVector offset = new Vector(closestPoint, p);\r\n\t\t\t\t\taSquare.translate(offset);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\taSquare.getCenter();\r\n\t}", "public boolean collidesWith(ICollider other);", "public boolean collides(Ball ball) //collision detection\n {\n if( ( position.y+height ) > ball.getPosY()-8 )\n {\n if( position.y+10 < ( ball.getPosY()-8 ) )\n {\n if(\n !((\n (ball.getPosX()-12 < ( position.x)+width ) &&\n (ball.getPosX()+12 < (position.x+width) ) &&\n (ball.getPosX()-12 < position.x ) &&\n (ball.getPosX()+12 < position.x )\n )||\n (\n (ball.getPosX()-12 > ( position.x+width )) &&\n (ball.getPosX()+12 > (position.x+width) ) &&\n (ball.getPosX()-12 > ( position.x )) &&\n (ball.getPosX()+12 > position.x )\n ))\n ){return true;}\n }\n\n }\n\n return false;\n\n /*\n if(position.y > (ball.getPosY() - 77 ) ) //should be ball.getheight\n {\n\n return Intersector.overlaps(ball.getCircle(), rect);\n }\n */\n\n }", "@Override\n\tpublic boolean checkCollision() {\n\t\treturn true;\n\t}", "public void collision(Collidable collider);", "@Override\n public Rectangle intersects( Rectangle boundingBox )\n {\n return null;\n }", "public boolean intersects(Obstacle v){\n \treturn box.intersects(v.getBox()); \t\r\n }", "public void checkCollision(){\r\n\r\n\t\t\t\tsmile.updateVelocity();\r\n\r\n\t\t\t\tsmile.updatePosition();\r\n\r\n\t\t\t\tif (smile.updateVelocity() > 0){\r\n\r\n\t\t\t\t\tfor (int k = 0; k < arrayPlat.size(); k++){\r\n\r\n\t\t\t\t\t\tif (smile.getNode().intersects(arrayPlat.get(k).getX(), arrayPlat.get(k).getY(), Constants.PLATFORM_WIDTH, Constants.PLATFORM_HEIGHT)){\r\n\r\n\t\t\t\t\t\t\tsmile.setVelocity(Constants.REBOUND_VELOCITY);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t}", "final protected boolean checkCollision(Rectangle otherBoundingBox, int pixelTolerance)\n {\n return (boundingBox.intersects(otherBoundingBox.x + pixelTolerance, otherBoundingBox.y + pixelTolerance,\n otherBoundingBox.width - pixelTolerance, otherBoundingBox.height - pixelTolerance));\n }", "@Override\n\tpublic boolean intersects(Rectangle2D arg0) {\n\t\treturn false;\n\t}", "public boolean isIntersecting(GameObject other){\n if(other.isSolid()&&this.solid){\n return RectF.intersects(other.getHitBox(),this.hitBox);//|| hitBox.contains(other.getHitBox())||other.getHitBox().contains(this.hitBox)\n }\n return false;\n }", "public static void checkCollisions() {\n\t \n\t\tfor (Ball b1 : Panel.balls) {\n\t\t\tfor (Ball b2 : Panel.balls) {\n\t\t\t\tif (b1.Bounds().intersects(b2.Bounds()) && !b1.equals(b2)) {\t\t\t//checking for collision and no equals comparisions\n\t\t\t\t\tint vX = b1.getxVelocity();\n\t\t\t\t\tint vY = b1.getyVelocity();\n\t\t\t\t\tb1.setxVelocity(b2.getxVelocity());\t\t\t\t\t\t\t\t//reversing velocities of each Ball object\n\t\t\t\t\tb1.setyVelocity(b2.getyVelocity());\n\t\t\t\t\tb2.setxVelocity(vX);\n\t\t\t\t\tb2.setyVelocity(vY);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void updateOptimalCollisionArea();", "public void checkCollisions(int xH, int yH) {\n Rectangle r1 = new Rectangle(xH, yH, 50, 50);\n Rectangle r2 = new Rectangle(zombie.x, zombie.y, 50, 50);\n if (r1.intersects(r2)) {\n zombieWins = true; \n }\n }", "public abstract void collide(InteractiveObject obj);", "@Override\n public boolean detectedCollision(int xCoordinate, int yCoordinate) {\n return xCoordinate >= x && xCoordinate <= x + width\n && yCoordinate >= y && yCoordinate <= y + height;\n }", "@Override\n public void checkCollision( Sprite obj )\n {\n \n }", "private void checkCollision() {\n for (int i = snakeSize; i > 0; i--) {\n if (i>4 && x[0] == x[i] && y[0] == y[i]){\n isInGame=false;\n }\n }\n\n if (x[0] > FIELD_SIZE) {\n isInGame=false;\n }\n\n if (x[0] < 0) {\n isInGame=false;\n }\n\n if (y[0] > FIELD_SIZE) {\n isInGame=false;\n }\n\n if (y[0] < 0) {\n isInGame=false;\n }\n\n\n }", "private boolean collision2() {\n return game.racket2.getBounds2().intersects(getBounds()); // returns true if the two rectangles intersect\r\n }", "@Override\n public boolean isCollided(gameObject obj){\n return Rect.intersects(obj.getastRect(), getRectplayer1())||\n Rect.intersects(obj.getastRect(), getRectplayer2()) ||\n Rect.intersects(obj.getastRect(), getRectplayer3()) ||\n Rect.intersects(obj.getastRect(), getRectplayer4());\n }", "public void collideWith(Rigidbody obj) {\n\t\t\r\n\t}", "public void collision(){\r\n\t\tif(currX < 0 || currX > 1000-width || currY < 0 || currY > 700-height){\r\n\t\t\tinGame=false;\r\n\t\t}\r\n\t\t/*\r\n\t\tI start at 1 because tail[0] will constantly be taking the position\r\n\t\tof the snake's head, so if i start at 0, the game would end immediately.\r\n\t\t*/\r\n\t\tfor(int i=1; i < numOranges; i++){\r\n\t\t\tRectangle currOrangeRect = new Rectangle(tail[i].getXcoords(), tail[i].getYcoords(), OrangeModel.getWidth(), OrangeModel.getHeight());\r\n\t\t\tif(new Rectangle(currX, currY, width, height).intersects(currOrangeRect)){\r\n\t\t\t\tinGame=false;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void collision(ArrayList<Game_Object> obj) {\n for (int i = 0; i < obj.size(); i++) {\n \tif(collidesWith(obj.get(i)) && (obj.get(i) instanceof Unit)) {\n \t\tUnit unit = (Unit) obj.get(i);\n \t\tdamage(unit.getColDamage());\n \t}\n }\n }", "static boolean intersectsRect(R2Vector a, R2Vector b, R2Rect rect) {\n // First check whether the bound of AB intersects \"rect\".\n R2Rect bound = R2Rect.fromPointPair(a, b);\n if (!rect.intersects(bound)) {\n return false;\n }\n\n // Otherwise AB intersects \"rect\" if and only if all four vertices of \"rect\"\n // do not lie on the same side of the extended line AB. We test this by\n // finding the two vertices of \"rect\" with minimum and maximum projections\n // onto the normal of AB, and computing their dot products with the edge\n // normal.\n R2Vector n = R2Vector.sub(b, a).ortho();\n int i = (n.x >= 0) ? 1 : 0;\n int j = (n.y >= 0) ? 1 : 0;\n double max = n.dotProd(R2Vector.sub(rect.getVertex(i, j), a));\n double min = n.dotProd(R2Vector.sub(rect.getVertex(1 - i, 1 - j), a));\n return (max >= 0) && (min <= 0);\n }", "public void checkCollision() {\n\t\tfor(SolidObject i : solidObjects) {\r\n\t\t\tif(getBounds().intersects(i.getBounds())) {\r\n\t\t\t\t//Increments the KillCount\r\n\t\t\t\tif(i.onAttack(damage, flipped)) {\r\n\t\t\t\t\tkillCount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected void onCollision(Actor other) {\r\n\r\n\t}", "private static void checkCollisions() {\n ArrayList<Entity> bulletsArray = bullets.entities;\n ArrayList<Entity> enemiesArray = enemies.entities;\n for (int i = 0; i < bulletsArray.size(); ++i) {\n for (int j = 0; j < enemiesArray.size(); ++j) {\n if (j < 0) {\n continue;\n }\n if (i < 0) {\n break;\n }\n Entity currentBullet = bulletsArray.get(i);\n Entity currentEnemy = enemiesArray.get(j);\n if (Collision.boxBoxOverlap(currentBullet, currentEnemy)) {\n ++player.hiScore;\n if (currentBullet.collided(currentEnemy)) {\n --i;\n }\n if (currentEnemy.collided(currentBullet)) {\n --j;\n }\n }\n }\n }\n textHiScore.setString(\"HISCORE:\" + player.hiScore);\n\n // Check players with bonuses\n ArrayList<Entity> bonusArray = bonus.entities;\n for (int i = 0; i < bonusArray.size(); ++i) {\n Entity currentBonus = bonusArray.get(i);\n if (Collision.boxBoxOverlap(player, currentBonus)) {\n if (currentBonus.collided(player)) {\n --i;\n player.collided(currentBonus);\n }\n }\n }\n }", "private void checkCollision()\n {\n if(isTouching(Rocket.class))\n {\n removeTouching(Rocket.class);\n Level1 level1 = (Level1)getWorld(); \n isSwordscore = false;\n notifyObservers(-20);\n }\n else if(isTouching(Fire.class))\n {\n removeTouching(Fire.class);\n Level1 level1 = (Level1)getWorld(); \n isSwordscore = false;\n notifyObservers(-20);\n }\n else if(isTouching(Sword.class))\n { \n removeTouching(Sword.class);\n Level1 level1 = (Level1)getWorld();\n isSwordscore = false;\n notifyObservers(-20);\n }\n \n else if(isTouching(Star.class))\n { \n removeTouching(Star.class);\n Level1 level1 = (Level1)getWorld();\n isSwordscore = false;\n count++;\n boost();\n }\n }", "private void checkCollision() {\n\n for(int b = 1; b < snakeLength; b++){\n if(xLength[b] == xLength[0] && yLength[b] == yLength[0]) {\n right = false;\n left = false;\n down = false;\n up = false;\n gameOver = true;\n }\n }\n\n if(right){\n if(xLength[0] >= 825) {\n gameOver = true;\n }\n }\n if(left){\n if(xLength[0] <= 50) {\n gameOver = true;\n }\n }\n if(down){\n if(yLength[0] >= 600) {\n gameOver = true;\n }\n }\n if(up){\n if(yLength[0] <= 100) {\n gameOver = true;\n }\n }\n }", "boolean collideWithVehicles(Vehicle v);", "public void collision(Ball b){\n float cir_center_X = b.getCenterX();\r\n float cir_center_Y = b.getCenterY();\r\n \r\n // aabb half extent\r\n float extent_X = (this.p4[0]-this.p1[0])/2; //half width\r\n float extent_Y = (this.p3[1]-this.p4[1])/2; // half height\r\n // rec center \r\n float rec_center_X = this.p1[0]+extent_X;\r\n float rec_center_Y = this.p1[1]+extent_Y;\r\n \r\n // difference between center : vector D = Vector Cir_center-Rec-center\r\n float d_X =cir_center_X-rec_center_X;\r\n float d_Y = cir_center_Y-rec_center_Y;\r\n \r\n //\r\n float p_X =Support_Lib.clamp(d_X,-extent_X,extent_X);\r\n float p_Y =Support_Lib.clamp(d_Y,-extent_Y,extent_Y);\r\n \r\n\r\n \r\n float closest_point_X = rec_center_X +p_X;\r\n float closest_point_Y = rec_center_Y +p_Y; \r\n \r\n \r\n d_X = closest_point_X -cir_center_X;\r\n d_Y = closest_point_Y -cir_center_Y;\r\n \r\n \r\n \r\n float length = (float)Math.sqrt((d_X*d_X)+(d_Y*d_Y));\r\n \r\n if(length+0.001 <=b.getRadius()){\r\n\r\n \r\n float ratio =(closest_point_X-rec_center_X)/(extent_X*2);\r\n b.accelartion(ratio);\r\n b.updateVelocity(Support_Lib.direction(d_X,d_Y));\r\n \r\n }\r\n \r\n \r\n }", "public void handleCollision(Collision c);", "public void collisionDetection(){\r\n\t\tif( this.isActiv() ){\r\n\t\t\tif( this.isCollided() ){\r\n\t\t\t\tthis.onCollision();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean collidesWith(double x, double y) {\n\t\tdouble leftBound = owner.getX() + this.offsetX - (width/2);\n\t\tdouble upBound = owner.getY() + this.offsetY - (height/2);\n\t\treturn x <= leftBound + width && x >= leftBound && y <= upBound + height && y >= upBound;\n\t}", "private void checkForCollisionWithSelf() {\r\n if (isInSnake(snake[0].row,snake[0].column,true)) {\r\n gameOver();\r\n }\r\n }", "private boolean collides(GameObject gameObject1) {\n return collides(gameObject1, 0.5);\n }", "public boolean isIntersecting(RectF other){\n return RectF.intersects(other,this.hitBox);//|| hitBox.contains(other.getHitBox())||other.getHitBox().contains(this.hitBox)\n }", "public abstract void onCollision();", "@Override\n public void checkCollision( Sprite obj )\n {\n\n }", "@Test\n public void isCollidingTestCollision(){\n TileMap tileMap = new TileMap(24, 24, new byte[][]{{1,1},{1,1},{1,1},{1,1}},new byte[][]{{1,1},{1,1},{1,1},{1,1}}, tilepath);\n Rect cBox = new Rect(24,24,24,24);\n assertTrue(tileMap.isColliding(cBox));\n assertEquals(true, tileMap.isColliding(cBox));\n }", "@Override\n public boolean canMove(double x, double y) {\n double xRec=rectangle.getX();\n double yRec=rectangle.getY();\n rectangle.setLocation((int)(xRec+x*1),(int)(yRec+y*1));\n\n List<Rectangle> staticRectangles= board.getStaticRectangles();\n List<Creature> creatures=board.getCreatures();\n Iterator<Rectangle> itr1=staticRectangles.iterator();\n\n while(itr1.hasNext()){\n Rectangle tmpRectangle =itr1.next();\n if(rectangle.intersects(tmpRectangle)) {\n return false;\n }\n }\n Iterator<Creature> itr2=creatures.iterator();\n while(itr2.hasNext()){\n Creature creature=itr2.next();\n if(creature==this){\n continue;\n }\n else{\n if(rectangle.intersects(creature.getRectangle()))\n return false;\n }\n\n }\n\n return true;\n }", "public void unitCollision() {\n\t}", "public void intersections(){\n\n \tif (ball.intersect(paddle.getX(), paddle.getY(), paddle.getWidth(), paddle.getHeight())){\n\t\t\tball.bouncePaddle(paddle.getX(),paddle.getY(),paddle.getWidth(),paddle.getHeight());\n\t\t}\n\n\t\t//WHEN POWERUP HITS PADDLE\n\n\t\tfor (int i = 0; i < powerups.size(); i++){\n\t\t\tif (paddle.intersect(powerups.get(i).getX(), powerups.get(i).getY(), powerups.get(i).getWidth(), powerups.get(i).getHeight())) {\n\t\t\t\tif (powerups.get(i).getType() != 4){\n\t\t\t\t\tpaddle.setType(powerups.get(i).getType());\n\t\t\t\t}else{\n\t\t\t\t\tball.setType(1);\n\t\t\t\t}\n\t\t\t\tpowerups.remove(i);\n\t\t\t}\n\t\t}\n\n\t\t//WHEN LASER HITS BRICK\n\n\t\tfor (int i = 0; i < lasers.size() ; i++){\n\t\t\tfor (int j = 0; j < bricks.size(); j++){\n\n\t\t\t\tif (lasers.size() != 0 && lasers.get(i).intersect(bricks.get(j).getX(), bricks.get(j).getY(), bricks.get(j).getWidth(), bricks.get(j).getHeight())){\n\t\t\t\t\tbricks.get(j).hit(0);\n\t\t\t\t\tlasers.remove(i);\n\t\t\t\t\tif (i > 0){\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\n\t\t//BRICKS\n\t\tfor (int i = 0; i < bricks.size(); i++){\n\t\t\t//WHEN BALL HITS BRICK\n\t\t\tif (ball.intersect(bricks.get(i).getX(), bricks.get(i).getY(), bricks.get(i).getWidth(), bricks.get(i).getHeight())){\n\t\t\t\t\n\t\t\t\tball.bounceBrick(ball.hitOnSide(bricks.get(i).getX(), bricks.get(i).getY(), bricks.get(i).getWidth(), bricks.get(i).getHeight()));\n\t\t\t\tball.move();\n\n\n\t\t\t\tbricks.get(i).hit(ball.getType());\n\t\t\t\tif (ball.getType() == 1){\n\t\t\t\t\tfor (int j = 0; j < bricks.size(); j++){\n\t\t\t\t\t\tif (bricks.get(j).getX() > ball.getX()-50 && bricks.get(j).getX() < ball.getX()+50){\n\t\t\t\t\t\t\tif (bricks.get(j).getY() > ball.getY()-75 && bricks.get(j).getY() < ball.getY()+75){\n\t\t\t\t\t\t\t\tbricks.get(j).hit(1);\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\tball.setType(0);\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t//WHEN BRICK DIES\n\t\tfor (int i = bricks.size()-1; i>=0; i--){\n\t\t\tif (bricks.get(i).isDead()){\n\t\t\t\tif (bricks.get(i).spawnPowerup()){\n\t\t\t\t\tpowerups.add(new Powerup(bricks.get(i).getX(), bricks.get(i).getY(), paddle));\n\t\t\t\t}\n\t\t\t\tbricks.remove(i);\n\t\t\t}\n\t\t}\n\n }", "public void controlla_collisioni() {\n\n for (int i = punti; i > 0; i--) {\n\n if ((i > 4) && (x[0] == x[i]) && (y[0] == y[i])) {\n in_gioco = false;\n }\n }\n\n if (y[0] >= ALTEZZA+85) { //devo aggungere +85 perche' l'area di gioco comincia dal punto 100,100\n in_gioco = false;\n }\n\n if (y[0] <= 100) {\n in_gioco = false;\n }\n\n if (x[0] >= LARGHEZZA+85) {\n in_gioco = false;\n }\n\n if (x[0] <= 100) {\n in_gioco = false;\n }\n }", "public void checkCollisions(List<Entity> listOfCloseObjects){\n\n for(Entity first : listOfCloseObjects){\n for(Entity second : listOfCloseObjects){\n if(first!=second) {\n\n String typeOfCollision = \"\";\n\n //check for a collision between the bounding boxes\n if (first.getBoundingBox().intersects(second.getBoundingBox())) {\n if(first.getEntityType().equals(EntityType.WALL) && second.getEntityType().equals(EntityType.PLAYER)) {\n typeOfCollision = \"playerWithWall\";\n }\n else if(first.getEntityType().equals(EntityType.FLOOR_HAZARD) && second.getEntityType().equals(EntityType.PLAYER)){\n typeOfCollision = \"playerWithHazard\";\n }\n else if(first.getEntityType().equals(EntityType.MELEE_WEAPON) && second.getEntityType().equals(EntityType.ENEMY)){\n typeOfCollision = \"swordWithEnemy\";\n }\n else if(first instanceof Bullet && second.getEntityType().equals(EntityType.WALL)){\n typeOfCollision = \"bulletWithWall\";\n }\n else if(first.getEntityType().equals(EntityType.ENEMY) && second.getEntityType().equals(EntityType.WALL)){\n typeOfCollision = \"enemyWithWall\";\n }\n else if((first.getEntityType().equals(EntityType.DEFAULT_BULLET) || first.getEntityType().equals(EntityType.SHOTGUN_BULLET) || first.getEntityType().equals(EntityType.FAST_BULLET)) && second.getEntityType().equals(EntityType.ENEMY)){\n typeOfCollision = \"enemyWithBullet\";\n }\n else if(first.getEntityType().equals(EntityType.ENEMY) && second.getEntityType().equals(EntityType.ENEMY)){\n typeOfCollision = \"enemyWithEnemy\";\n }\n else if(first.getEntityType().equals(EntityType.ENEMY) && second.getEntityType().equals(EntityType.PLAYER)){\n typeOfCollision = \"enemyWithPlayer\";\n }\n else if((first.getEntityType().equals(EntityType.SWORD) || first.getEntityType().equals(EntityType.SHOTGUN) || first.getEntityType().equals(EntityType.PISTOL) || first.getEntityType().equals(EntityType.ASSAULT_RIFLE) ||\n first.getEntityType().equals(EntityType.SHIELD) || first.getEntityType().equals(EntityType.SPEEDBOOST) || first.getEntityType().equals(EntityType.HEART))\n && second.getEntityType().equals(EntityType.PLAYER)){\n typeOfCollision = \"itemWithPlayer\";\n }\n\n if(!typeOfCollision.isEmpty())\n collide(typeOfCollision, first, second);\n }\n }\n }\n }\n\n }", "public boolean intersects(GraphicalFigure fig) {\n\n\t\t// Get the distance between the 2 figures on the x axis\n\t\tint xDist = pos.xCoord() - fig.getOffset().xCoord();\n\n\t\t// Get the distance on the y axis\n\t\tint yDist = pos.yCoord() - fig.getOffset().xCoord();\n\n\t\t// All if's allow for if the x's are the same\n\t\t// Check to see if the figure is on the right and overlaps\n\t\tif (xDist >= 0 && xDist < fig.getWidth()) {\n\n\t\t\t// For loop variables\n\t\t\tint initial = 0;\n\t\t\tint compare = 0;\n\t\t\tBoolean loopCheck = false;\n\n\t\t\t// All if's allow for if the y's are the same\n\t\t\t// Check if it's above the object and within range\n\t\t\tif (yDist >= 0 && xDist < fig.getHeight()) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = pos.yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = pos.yCoord() + fig.getHeight() - yDist;\n\t\t\t}\n\n\t\t\t// Check if it's below the object and within range\n\t\t\telse if (yDist <= 0 && xDist < height) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = fig.getOffset().yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = fig.getOffset().yCoord() + fig.getHeight() + yDist;\n\t\t\t}\n\n\t\t\t// If the loop check is true, do a for loop\n\t\t\tif (loopCheck) {\n\n\t\t\t\t// Create a location variable\n\t\t\t\tLocation loc;\n\t\t\t\t// Loop through the intersecting rectangle\n\t\t\t\t// Loop Horizontally\n\t\t\t\tfor (int i = pos.xCoord(); i < pos.xCoord() + fig.getWidth() - xDist; i++) {\n\t\t\t\t\t// Loop through vertically\n\t\t\t\t\tfor (int j = initial; j < compare; j++) {\n\t\t\t\t\t\t// Create a location for the new pixel\n\t\t\t\t\t\tloc = new Location(i, j);\n\n\t\t\t\t\t\t// Check for overlap, return true\n\t\t\t\t\t\tif (findPixel(loc) && fig.findPixel(loc)) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// All if's allow for if the x's are the same\n\t\t// Check if the figure is on the left and overlaps\n\t\telse if (xDist >= 0 && xDist < width) {\n\t\t\t// For loop variables\n\t\t\tint initial = 0;\n\t\t\tint compare = 0;\n\t\t\tBoolean loopCheck = false;\n\n\t\t\t// All if's allow for if the y's are the same\n\t\t\t// Check if it's above the object and within range\n\t\t\tif (yDist >= 0 && xDist < fig.getHeight()) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = pos.yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = pos.yCoord() + fig.getHeight() - yDist;\n\t\t\t}\n\n\t\t\t// Check if it's below the object and within range\n\t\t\telse if (yDist <= 0 && xDist < height) {\n\n\t\t\t\t// Set loopCheck to true\n\t\t\t\tloopCheck = true;\n\n\t\t\t\t// For loop variables\n\t\t\t\t// Set initial to the location of the y coordinate\n\t\t\t\tinitial = fig.getOffset().yCoord();\n\n\t\t\t\t// Set the compare value to the location of the y + the height of the figure -\n\t\t\t\t// the y distance\n\t\t\t\tcompare = fig.getOffset().yCoord() + fig.getHeight() + yDist;\n\t\t\t}\n\n\t\t\t// If the loop check is true, do a for loop\n\t\t\tif (loopCheck) {\n\n\t\t\t\t// Create a location variable\n\t\t\t\tLocation loc;\n\t\t\t\t// Loop through the intersecting rectangle\n\t\t\t\t// Loop Horizontally\n\t\t\t\tfor (int i = fig.getOffset().xCoord(); i < fig.getOffset().xCoord() + width + xDist; i++) {\n\t\t\t\t\t// Loop through vertically\n\t\t\t\t\tfor (int j = initial; j < compare; j++) {\n\t\t\t\t\t\t// Create a location for the new pixel\n\t\t\t\t\t\tloc = new Location(i, j);\n\n\t\t\t\t\t\t// Check for overlap, return true\n\t\t\t\t\t\tif (findPixel(loc) && fig.findPixel(loc)) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If no intersection found, return false\n\t\treturn false;\n\t}", "private void handleObjectCollision() {\n \tGObject obstacle = getCollidingObject();\n \t\n \tif (obstacle == null) return;\n \tif (obstacle == message) return;\n \t\n\t\tvy = -vy;\n\t\t\n\t\tSystem.out.println(\"ball x: \" + ball.getX() + \" - \" + (ball.getX() + BALL_RADIUS * 2) );\n\t\tSystem.out.println(\"paddle x: \" + paddleXPosition + \" - \" + (paddleXPosition + PADDLE_WIDTH) );\n\t\tif (obstacle == paddle) {\n\t\t\tpaddleCollisionCount++;\n\t\t\t\n\t\t\t// if we're hitting the paddle's side, we need to also bounce horizontally\n\t\t\tif (ball.getX() >= (paddleXPosition + PADDLE_WIDTH) || \n\t\t\t\t(ball.getX() + BALL_RADIUS * 2) <= paddleXPosition ) {\n\t\t\t\tvx = -vx;\t\t\t\t\n\t\t\t}\n\t\t} else {\n \t\t// if the object isn't the paddle, it's a brick\n\t\t\tremove(obstacle);\n\t\t\tnBricksRemaining--;\n\t\t}\n\t\t\n\t\tif (paddleCollisionCount == 7) {\n\t\t\tvx *= 1.1;\n\t\t}\n }", "public abstract void processCollisions();", "private void collide() {\n int collisionRange;\n \n if(isObstacle) {\n for(Thing thg: proximity) {\n if(\n thg.isObstacle\n &&\n !thg.equals(this)\n ) {\n collisionRange = (thg.size + this.size)/2;\n deltaA = this.distance(thg);\n \n if( \n Math.abs(deltaA[0]) <= collisionRange\n &&\n Math.abs(deltaA[1]) <= collisionRange\n ){\n if(deltaA[0] > deltaA[1]) {\n if(Math.abs(deltaA[0]) > Math.abs(deltaA[1])) {\n if(dA[0] == 1) {\n dA[0] = 0;\n }\n }\n if(Math.abs(deltaA[0]) < Math.abs(deltaA[1])) {\n if(dA[1] == -1) {\n dA[1] = 0;\n }\n }\n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n if(dA[0] != 0) {\n dA[1] = dA[0];\n }\n if(dA[1] != 0) {\n dA[0] = dA[1];\n }\n }\n }\n \n if(deltaA[0] < deltaA[1]) {\n if(Math.abs(deltaA[0]) > Math.abs(deltaA[1])) {\n if(dA[0] == -1) {\n dA[0] = 0;\n }\n } \n if(Math.abs(deltaA[0]) < Math.abs(deltaA[1])) {\n if(dA[1] == 1) {\n dA[1] = 0;\n }\n } \n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n dA[0] = 1 - 2*(int) (Math.random()*2);\n dA[1] = dA[0];\n }\n }\n \n if(Math.abs(deltaA[0]) == Math.abs(deltaA[1])) {\n dA[0] = 1 - 2*(int) (Math.random()*2);\n dA[1] = -dA[0];\n }\n }\n }\n }\n }\n }", "public boolean collision( Point cur, ArrayList<Point> bounds ) {\n\t\t\n\t\tfor ( int i = 0; i < bounds.size(); i++ )\n\t\t\tif ( cur.equals( bounds.get(i) ) )\n\t\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}", "public abstract void collideWith(Entity entity);", "public boolean collision(Object a, Object b) {\n if (Rect.intersects(a.getRect(), b.getRect())) { //if the two objects hitboxes colide\n return true;\n }\n return false;\n }", "public boolean intersects(BoundingBox other) {\r\n\t\treturn !(other.left > getRight()\r\n\t\t\t || other.getRight() < left\r\n\t\t\t || other.top > getBottom()\r\n\t\t\t || other.getBottom() < top);\r\n\t}", "private void setCollision(){\n\t\tMapObjects mapObjects = map.getLayers().get(\"COLLISION\").getObjects();\n\t\tfor (int ii = 0; ii < mapObjects.getCount(); ++ii){\n\t\t\tRectangleMapObject rectangle_map_object = (RectangleMapObject) mapObjects.get(ii);\n\t\t\tareaCollision.add(new Rectangle(rectangle_map_object.getRectangle()));\n\t\t}\n\t}", "public abstract boolean overlap(Catcher catcher, FallingObject object);", "private void collision(GameObjectContainer<GameObject> object) {\n \tGameObject renderObject = null;\r\n\t\tfor (int i = 0; i < object.getSize(); i++) {\r\n\t\t\trenderObject = object.iterator().next();\r\n\r\n\t\t\tif (renderObject.getType() == \"BLOCK\") {\r\n\t\t\t\tif (this.getBoundsInParent().intersects(renderObject.getBoundsInParent())) {\r\n\t\t\t\t\tSystem.out.println(\"intersected\");\r\n\t\t\t\t\tthis.setTranslateY(renderObject.getTranslateY() - renderObject.getHeight());\r\n\t\t\t\t\tfalling = false;\r\n\t\t\t\t\tjump = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfalling = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif (renderObject.getType() == \"NURSE\") {\r\n\t\t\t\tif (this.getBoundsInParent().intersects(renderObject.getBoundsInParent())) {\r\n\t\t\t\t\tSystem.out.println(\"nurse\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}else {\r\n\t\t\t\tfalling = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n }", "@Override\n public boolean checkCollideSingle(GameObject gameObject, int x, int y) {\n if (!(gameObject instanceof Player) || !isAlive())\n return false;\n\n boolean result = super.withinRange(x, y);\n\n if (result) {\n if (prev + (hitInterval * 10) < System.currentTimeMillis()) {\n prev = System.currentTimeMillis();\n startHitTime = prev + 300;\n startHit = true;\n }\n }\n\n if (result) {\n if (startHitTime < System.currentTimeMillis() && startHit) {\n HUD.getInstance().removeHealth(getDamage());\n setStatus(PlayerStatus.FIGHTING);\n startHit = false;\n }\n }\n\n return result;\n }", "private void CheckWorldCollision() {\n\t\tfor(WorldObj obj : World.CurrentWorld.SpawnedObjects) {\n\t\t\tif(bounds.overlaps(obj.bounds))\n\t\t\t\tobj.OnCollision(this);\n\t\t\tif(MapRenderer.CurrentRenderer.ItemAnimation != null) {\n\t\t\t\tif(obj.ai != null) {\n\t\t\t\t\tif(dir == LEFT)\n\t\t\t\t\tAttackBounds.set(pos.x+(dir*1.35f)+0.5f,pos.y,1.35f,1);\n\t\t\t\t\telse\n\t\t\t\t\t\tAttackBounds.set(pos.x+0.5f,pos.y,1.35f,1);\n\t\t\t\t\tif(obj.healthBarTimer > 0.4f)\n\t\t\t\tif(AttackBounds.overlaps(obj.bounds)) {\n\t\t\t\t\tif(!Terrain.CurrentTerrain.isSolid((int)(pos.x+0.5f+(0.3f*dir)), (int)(pos.y+0.5f)))\n\t\t\t\t\tobj.ai.onDamaged(this, UsedItem, GetATK());\n\t\t\t\t\tHitTimer = 0;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(obj.damageable) {\n\t\t\t\t\tif(AttackBounds.overlaps(obj.bounds)) {\n\t\t\t\t\t\tobj.onDamaged(this, UsedItem, GetATK());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private boolean boundsChecker(Road road, Rectangle wholeGrid) {\n\t\tif(!Inclusive2DIntersectionVerifier.intersects(road, wholeGrid)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "@Override\n\tpublic boolean hasCollide(Entity e) {\n\t\treturn rect.intersects(e.getRectangle());\n\t}", "public boolean checkCollision(int x, int y){\n return x<=xEnd&&x>=xStart&&y<=yEnd&&y>=yStart;\n }", "public boolean isColliding(){\n for(int i = 0; i < eng.getIDManager().getObjectsWithID(\"GameObject\").size(); i++){\n GameObject temp = eng.getIDManager().getObjectsWithID(\"GameObject\").get(i);\n \n if(temp.getHitBox().getBounds().intersects(rect.getBounds()) &&\n temp.getHitBox() != this){\n currentCollidingObject = temp;\n return true;\n }\n }\n \n return false;\n }", "public void CheckCollision(Ball b){\n\n if( b.getDirX() < 0f ){\n if( (b.getPosX() - b.getSizeX() ) < px + sx){\n //if we're in the upper \n if( b.getPosY() > py+sy/2 && b.getPosY() < py+sy){\n b.setDirX(-b.getDirX());\n b.setDirY(b.getDirY() + .25f);\n }\n //if we are in the lower\n else if( b.getPosY() < py-sy/2 && b.getPosY() > py-sy){\n b.setDirX(-b.getDirX());\n b.setDirY(b.getDirY() - .25f); \n }\n else if( b.getPosY() > py-sy && b.getPosY() < py+sy)\n b.setDirX(-b.getDirX());\n b.setVelocity(b.getVelocity() * 1.10f);\n } \n }else{\n if( (b.getPosX() + b.getSizeX() ) > px - sx){\n //if we're in the upper \n if( b.getPosY() > py+sy/2 && b.getPosY() < py+sy){\n b.setDirX(-b.getDirX());\n b.setDirY(b.getDirY() + .25f);\n }\n //if we are in the lower\n else if( b.getPosY() < py-sy/2 && b.getPosY() > py-sy){\n b.setDirX(-b.getDirX());\n b.setDirY(b.getDirY() - .25f); \n }\n else if( b.getPosY() > py-sy && b.getPosY() < py+sy)\n b.setDirX(-b.getDirX());\n b.setVelocity(b.getVelocity() * 1.10f);\n }\n }\n }", "private boolean checkCollision(int x, int y) {\r\n\t\tRectangle r = new Rectangle(); // Location Rectangle\r\n\t\tr.width = Tile.TILEWIDTH;\r\n\t\tr.height = Tile.TILEHEIGHT;\r\n\t\tr.x = x * Tile.TILEWIDTH;\r\n\t\tr.y = y * Tile.TILEHEIGHT;\r\n\t\tfor(Nonmoving n : handler.getWorld().getEntityManager().getNonmoving()) {\r\n\t\t\tif(n.getCollisionBounds(0, 0).intersects(r)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(Objects o : handler.getWorld().getEntityManager().getObjects()) {\r\n\t\t\tif(o.getCollisionBounds(0, 0).intersects(r)) {\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 void checkBounds() {\n // check that paddles stay within boundaries\n playerOnePaddle.boundCheck(topWall, bottomWall);\n playerTwoPaddle.boundCheck(topWall, bottomWall);\n\n // check if ball hits walls/paddles/goals\n if (!ball.boundCheck(playerOnePaddle.getBoundsInParent(), playerTwoPaddle.getBoundsInParent(), topWall, bottomWall.getBoundsInParent())) {\n if (ball.getBoundsInParent().intersects(leftWall.getBoundsInParent())) {\n playerTwo.newPoint();\n if (playerTwo.getPoints() < 10) {\n setVisibleScore(rightScoreGroup, playerTwo.getPoints());\n }\n reset();\n } else if (ball.getBoundsInParent().intersects(rightWall.getBoundsInParent())) {\n playerOne.newPoint();\n if (playerTwo.getPoints() < 10) {\n setVisibleScore(leftScoreGroup, playerOne.getPoints());\n }\n reset();\n }\n }\n }", "private void testCollisions () \n\t{\n\t r1.set(level.bird.position.x, level.bird.position.y,\n\t \t\t level.bird.bounds.width+.03f, level.bird.bounds.height);\n\t \n\t // Test collision: Pipes\n\t for (Pipe pipe : level.pipes) \n\t {\n\t \t r2.set(pipe.position.x, pipe.position.y, pipe.bounds.width,\n\t \t\t\t pipe.bounds.height);\n\t \t if (!r1.overlaps(r2)) continue;\n\t \t \n\t \t onCollisionBirdWithPipe(pipe);\n\t }\n\t \n\t // Test collision: GoldCoins\n\t for (GoldCoin goldcoin : level.goldcoins)\n\t {\n\t \t if (goldcoin.collected) continue;\n\t \t r2.set(goldcoin.position.x, goldcoin.position.y,\n\t \t\t\t goldcoin.bounds.width, goldcoin.bounds.height);\n\t \t if (!r1.overlaps(r2)) continue;\n\t \t onCollisionBirdWithGoldCoin(goldcoin);\n\t \t break;\n\t }\n\t \n\t // Test collision: Dp\n\t for (DoublePoint doublepoint : level.doublepoints) \n\t {\n\t \t if (doublepoint.collected) continue;\n\t \t r2.set(doublepoint.position.x, doublepoint.position.y,\n\t \t\t\t doublepoint.bounds.width, doublepoint.bounds.height);\n\t \t if (!r1.overlaps(r2)) continue;\n\t \t onCollisionBirdWithDoublePoint(doublepoint);\n\t \t break;\n\t }\n\t \n\t // Test collision: Goal\n\t for (Goal goal : level.goals)\n\t {\n\t \t r2.set(goal.position.x, goal.position.y,\n\t \t\t\t goal.bounds.width, goal.bounds.height);\n\t \t if (!r1.overlaps(r2)) continue;\n\t \t onCollisionBirdWithGoal(goal);\n\t \t break;\n\t }\n\t \n\t // Test collision: Brick\n\t for (Brick brick : level.bricks) \n\t {\n\t \t r2.set(brick.position.x, brick.position.y, brick.bounds.width,\n\t \t\t\t brick.bounds.height);\n\t \t if (!r1.overlaps(r2)) continue;\n\t \t \n\t \t onCollisionBirdWithBrick(brick);\n\t }\n\t }", "boolean intersects( Geometry gmo );", "@Override\n\tpublic void doCollision(CollisionResult c) {\n\t\t\n\t}", "private boolean intersects(int x, int y, int size){\n count++;\n return(!(\n x > this.x + this.width ||\n x + size < this.x ||\n y > this.y + this.height ||\n y + size < this.y\n ));\n }", "private boolean checkCollisions(int X, int Y){\n\t\tint hitBoxSizeX = 105;\n\t\tint hitBoxSizeY = 80;\n\t\tfor(int i=0;i<enemy_num;i++){\n\t\t\tif(X<enemy[i][0]+hitBoxSizeX && X>enemy[i][0]){\n\t\t\t\tif(Y<enemy[i][1]+hitBoxSizeY && Y>enemy[i][1]){\n\t\t\t\t\tremoveEnemy(i);\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 abstract boolean intersect(BoundingBox bbox);", "@Test\n public void isCollidingTestBodyOfInnerFor(){\n TileMap tileMap = new TileMap(24, 24, new byte[][]{},new byte[][]{{1,0},{1,1}}, tilepath);\n Rect cBox = new Rect(2,2,2,200);\n assertTrue(tileMap.isColliding(cBox));\n assertEquals(true, tileMap.isColliding(cBox));\n }", "private void checkCollisionwithMonster() {\n\t\tr1.set(this.getX(),this.getY(),this.getWidth(),this.getHeight());\r\n\t\t\r\n\t\t//check collision with monsters\t\t\r\n\t\tif(Math.ceil(this.getColor().a) == 1 && System.nanoTime() - oldTime >= cdTime){\r\n\t\t\tfor(TreeMonster treeMon : treeMonArray){\r\n\t\t\t\tif(treeMon.isVisible()){\r\n\t\t\t\t\tr2.set(treeMon.getCollisionBox());\r\n\t\t\t\t\tif (!r1.overlaps(r2)) continue;\r\n\t\t\t\t\toldTime = System.nanoTime();\r\n\t\t\t\t\tsetHealth(health-1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(Math.ceil(this.getColor().a) == 1 && System.nanoTime() - oldTime >= cdTime){\r\n\t\t\tfor(SlimeMonster slimeMon : slimeMonArray){\r\n\t\t\t\tif(slimeMon.isVisible()){\r\n\t\t\t\t\tr2.set(slimeMon.getCollisionBox());\r\n\t\t\t\t\tif (!r1.overlaps(r2)) continue;\r\n\t\t\t\t\toldTime = System.nanoTime();\r\n\t\t\t\t\tsetHealth(health-1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(Math.ceil(this.getColor().a) == 1 && System.nanoTime() - oldTime >= cdTime){\r\n\t\t\tfor(FireMonster fireMon : fireMonArray){\r\n\t\t\t\tif(fireMon.isVisible()){\r\n\t\t\t\t\tr2.set(fireMon.getCollisionBox());\r\n\t\t\t\t\tif (!r1.overlaps(r2)) continue;\r\n\t\t\t\t\toldTime = System.nanoTime();\r\n\t\t\t\t\tsetHealth(health-1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "boolean overlaps(MyRectangle2D r) {\r\n\t\t//cordinates of the first corner of the parametar's rectangle\r\n\t\tdouble x1 = r.getX() - (r.getWidth() / 2);\r\n\t\tdouble y1 = r.getY() + (r.getHeight() / 2);\r\n\r\n\t\t//cordinates of the second corner of the parametar's rectangle\r\n\t\tdouble x2 = r.getX() + (r.getWidth() / 2);\r\n\t\tdouble y2 = r.getY() - (r.getHeight() / 2);\r\n\r\n\t\t//cordinates of the third corner of the parametar's rectangle\r\n\t\tdouble x3 = r.getX() - (r.getWidth() / 2);\r\n\t\tdouble y3 = r.getY() - (r.getHeight() / 2);\r\n\r\n\t\t//cordinates of the fourth corner of the parametar's rectangle\r\n\t\tdouble x4 = r.getX() + (r.getWidth() / 2);\r\n\t\tdouble y4 = r.getY() + (r.getHeight() / 2);\r\n\r\n\t\t//checking if calling rectangle has any of the corners inside itself\r\n\t\tboolean corner1Overlaps = this.contains(x1, y1);\r\n\t\tboolean corner2Overlaps = this.contains(x2, y2);\r\n\t\tboolean corner3Overlaps = this.contains(x3, y3);\r\n\t\tboolean corner4Overlaps = this.contains(x4, y4);\r\n\r\n\t\t//if it does contain any of the corners they overlap\r\n\t\treturn corner1Overlaps || corner2Overlaps || corner3Overlaps\r\n\t\t\t\t|| corner4Overlaps ? true : false;\r\n\t}", "public boolean isCollision(Ball ob) { // Kollisionsabfrage\r\n\t\t\r\n\t\tdX = posX - ob.getPosX();\r\n\t\tdY = posY - ob.getPosY();\r\n\t\tfloat vector = dX * dX + dY * dY;\r\n\t\tfloat hypo = radius * radius * 4;\r\n\t\tif (hypo >= vector) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Override\n\tpublic boolean collidesWith(GameObject otherObject) {\n\t\tboolean result = false;\n\t\tdouble thisCenterX = this.getX();\n\t\tdouble thisCenterY = this.getY();\n\n\t\tdouble otherCenterX = (otherObject).getX();\n\t\tdouble otherCenterY = (otherObject).getY();\n\n\t\tdouble dx = thisCenterX - otherCenterX;\n\t\tdouble dy = thisCenterY - otherCenterY;\n\n\t\tdouble distBetweenCentersSqr = (dx * dx + dy * dy);\n\n\t\tint thisRadius= this.getSize() / 2;\n\t\t\n\t\tint otherRadius;\n\t\t\n\t\tif(otherObject instanceof Base) {\n\t\t\totherRadius= (otherObject).getSize();\n\t\t}else {\n\t\t\totherRadius= (otherObject).getSize() / 2;\n\t\t}\n\n\t\tint radiiSqr= (thisRadius * thisRadius + 2 * thisRadius * otherRadius + otherRadius * otherRadius);\n\n\t\tif (distBetweenCentersSqr <= radiiSqr) { result = true ; }\n\n\t\treturn result;\n\t}", "private void checkCastleCollisions() {\n\t\t\n\t}", "public int check4CollisionWithBlue(Player player)\n {\n int number_of_collisions = 0;\n int x_cord = getMidPoint(player.x_cordinate);\n int y_cord = getMidPoint(player.y_cordinate);\n int blux1 = getMidPoint(getBlue_player1().x_cordinate);//blue_player1.x_cordinate;\n int blux2 = getMidPoint(getBlue_player2().x_cordinate);\n int blux3 = getMidPoint(getBlue_player3().x_cordinate);//blue_player3.x_cordinate;\n int blux4 = getMidPoint(getBlue_player4().x_cordinate);//blue_player4.x_cordinate;\n int bluy1 = getMidPoint(getBlue_player1().y_cordinate);//blue_player1.y_cordinate;\n int bluy2 = getMidPoint(getBlue_player2().y_cordinate);//blue_player2.y_cordinate;\n int bluy3 = getMidPoint(getBlue_player3().y_cordinate);//blue_player3.y_cordinate;\n int bluy4 = getMidPoint(getBlue_player4().y_cordinate);//blue_player4.y_cordinate;\n number_of_collisions += collisionDetection(x_cord, y_cord, blux1, bluy1);\n number_of_collisions += collisionDetection(x_cord, y_cord, blux2, bluy2);\n number_of_collisions += collisionDetection(x_cord, y_cord, blux3, bluy3);\n number_of_collisions += collisionDetection(x_cord, y_cord, blux4, bluy4);\n return number_of_collisions;\n }", "private void checkCollision()\n {\n if (gameOverBool==false)\n { \n Actor a = getOneIntersectingObject(Wall.class);\n if (a != null||isAtEdge())\n {\n setImage(\"gone.png\");//laat de helicopter verdwijnen\n //greenfoot.GreenfootSound.stop(\"helisound.wav\");\n World world = getWorld();\n world.addObject(new Explosion(), getX(), getY());\n Greenfoot.playSound(\"heliExplosion.wav\");\n world.addObject( new Gameover(), 600, 300 );\n gameOverBool = true; \n }\n } \n }", "private boolean detectCollisions(GameState mGaemState,ArrayList<GameObject> objects,SoundEngine se,ParticleSystem ps){\n boolean playerHit = false;\n for (GameObject go1:objects){\n if (go1.checkActive()){\n //the 1st object is active\n //so worth checking\n\n for (GameObject go2:objects){\n if (go2.checkActive()){\n //the 2nd object is active\n //so worth checking\n if (RectF.intersects(go1.getTransform().getCollider(),go2.getTransform().getCollider())){\n\n //switch goes here\n //there has been a collision\n //but does it matter?\n switch (go1.getTag() + \" with \" + go2.getTag()){\n case \"Player with Alien Laser\":\n playerHit = true;\n mGaemState.lostLife(se);\n\n break;\n\n case \"Player with Alien\":\n playerHit =true;\n mGaemState.lostLife(se);\n\n break;\n\n case \"Player Laser with Alien\":\n mGaemState.increaseScore();\n //respawn the alien\n ps.emitParticles(new PointF(go2.getTransform().getLocation().x,go2.getTransform().getLocation().y));\n go2.setInactive();\n go2.spawn(objects.get(Level.PLAYER_INDEX).getTransform());\n go1.setInactive();\n se.playAlienExplode();\n\n break;\n\n default:\n break;\n }\n\n }\n }\n }\n }\n }\n return playerHit;\n }", "public abstract void collision(SpaceThing thing);", "public void applyEntityCollision(Entity entityIn) {\n }", "public void isIntersects(WorldObject worldObject) {\n Area areaFromThisObject = new Area(this.getShape());\n Area areaFromWorldObject = new Area(worldObject.getShape());\n areaFromThisObject.intersect(areaFromWorldObject);\n this.collided = !areaFromThisObject.isEmpty();\n }", "public boolean detectCollision(int x, int y) {\n\t\tif(this.x <= x && this.y <= y && this.x + width >= x && this.y + height >= y) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.6818854", "0.6762192", "0.66404384", "0.66404384", "0.6639898", "0.66057354", "0.6597147", "0.64562595", "0.64539206", "0.6441223", "0.6425566", "0.64243746", "0.63832504", "0.63758713", "0.6360161", "0.63296413", "0.6268443", "0.6262487", "0.61970085", "0.6173882", "0.61727333", "0.6152158", "0.61481506", "0.61315376", "0.6128416", "0.6123842", "0.61137384", "0.6111828", "0.6109185", "0.61078", "0.6077325", "0.60768676", "0.606645", "0.6061226", "0.6055747", "0.60426384", "0.60350394", "0.6033601", "0.60319936", "0.60256314", "0.6022404", "0.60193104", "0.6012003", "0.6003942", "0.59955215", "0.59942806", "0.59939045", "0.5991037", "0.5987654", "0.5986525", "0.59836197", "0.5978136", "0.5954592", "0.59484905", "0.5947339", "0.5937722", "0.5936577", "0.59319395", "0.59269834", "0.59269506", "0.59259087", "0.59216195", "0.59205955", "0.5910482", "0.5901365", "0.5897225", "0.58956754", "0.58902407", "0.588327", "0.5882033", "0.5878878", "0.58784425", "0.58758783", "0.5873706", "0.5872397", "0.5868083", "0.5867857", "0.5862045", "0.5856395", "0.5854065", "0.58538234", "0.58435035", "0.58417106", "0.5840053", "0.58284897", "0.5819013", "0.58177334", "0.58166295", "0.5809561", "0.5808509", "0.5807579", "0.5804955", "0.58017313", "0.57755405", "0.57747954", "0.57739425", "0.5759531", "0.57571304", "0.5757063", "0.57557094" ]
0.6965447
0
Gets bounds of current individual
public Rectangle bounds() { return (new Rectangle(x, y, 10, 10)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Bounds getBounds () { return (bounds); }", "Rectangle getBounds();", "public int getBound();", "public Rectangle getBounds();", "public Rectangle getBounds();", "public final BoundingBox getBounds() {\n\t\tif (bounds==null) {\n\t\t\tint srsID =( (Geometry)this.get(0).getDefaultGeometry()).getSRID();\n\t\t\tBoundingBox re = new BoundingBoxImpl(\"\"+srsID);\n\t\t\tfor (SimpleFeature f : this) {\n\t\t\t\tre.include(f.getBounds());\n\t\t\t}\n\t\t\tbounds = re;\n\t\t}\n\t\treturn bounds;\n\t}", "public Rect getBound() {\n return new Rect((int) (x - radius), (int) (y - radius), (int) (x + radius), (int) (y + radius));\n }", "public Rectangle getBounds() {\r\n return bounds;\r\n }", "public Rectangle getBounds() {\n\treturn new Rectangle((int)x,(int)y,32,32);\n\t}", "@Override\r\n\tpublic Rectangle getBound() {\n\t\treturn new Rectangle((int)x, (int)y, (int)width, (int)height);\r\n\t}", "public Rectangle getBounds()\n {\n return new Rectangle ((int)x,(int)y,32,32);\n }", "public abstract Rectangle getBounds();", "public abstract Rectangle getBounds();", "public abstract Rectangle getBounds();", "public Rectangle getBounds(){\r\n return new Rectangle(x, y, w, w);\r\n }", "public float[] getBounds() {\r\n\t\tfloat[] bounds = {x_ - width_/ 2, x_ + width_ / 2, y_ - height_ / 2, y_ + height_ / 2};\r\n\t\treturn bounds;\r\n\t}", "public Rectangle getBounds() {\r\n return new Rectangle(x, y, 55, 51);\r\n }", "public Rectangle get_bounds() {\n return new Rectangle(x,y, width-3, height-3);\n }", "RectangleLatLng getBounds();", "protected Rectangle determineBounds() {\n return getNetTransform().createTransformedShape( _bounds ).getBounds();\n }", "public Rectangle getBounds() {\n return new Rectangle(x, y, 32, 32);\n }", "public Bounds getBounds() {\n\t\treturn boss.getBoundsInParent();\n\t}", "int getBoundsX();", "public String getRectangleBounds() {\n checkAvailable();\n return impl.getRectangle();\n }", "public Bounds get() {\n\treturn bounds;\n }", "public Rectangle getBounds()\r\n\t{\r\n\t\treturn new Rectangle(x, y, w, h);\r\n\t}", "@Override\n\tpublic GRectangle getBounds() {\n\t\tif (isEmpty()) {\n\t\t\treturn new GRectangle();\n\t\t} else {\n\t\t\tGPoint p0 = points.get(0);\n\t\t\tdouble minX = p0.getX();\n\t\t\tdouble maxX = minX;\n\t\t\tdouble minY = p0.getY();\n\t\t\tdouble maxY = minY;\n\t\t\tfor (int i = 1; i < size(); i++) {\n\t\t\t\tGPoint p1 = points.get(i);\n\t\t\t\tminX = Math.min(minX, p1.getX());\n\t\t\t\tmaxX = Math.max(maxX, p1.getX());\n\t\t\t\tminY = Math.min(minY, p1.getY());\n\t\t\t\tmaxY = Math.max(maxY, p1.getY());\n\t\t\t}\n\t\t\treturn new GRectangle(minX, maxX, minY, maxY);\n\t\t}\n\t}", "public RectF getBounds()\n {\n return bounds;\n }", "@Override\n public Rectangle getBounds() {\n return new Rectangle(x,y,64,64);\n }", "Rectangle getBounds() {\n return new Rectangle(getLocation(), getSize());\n }", "public Rectangle getBound(){\n \tint x = (int)location.getX();\n \tint y = (int)location.getY();\n \t\n \tif(isExploded == false)\n \t\treturn new Rectangle(x, y, image.getWidth(null), image.getHeight(null));\n \telse\n \t\treturn new Rectangle(x,y, 1,1);\n }", "public RMRect getBoundsInside() { return new RMRect(0, 0, getWidth(), getHeight()); }", "public Rectangle getBounds() {\n\t\treturn new Rectangle((int) xPos, (int) yPos, (int) width, (int) height);\n\t}", "public Rectangle getBounds() {\n\t\treturn new Rectangle(getX(),getY(),width, width);\n\t}", "public Rectangle getBounds() {\n return new Rectangle(x, y, DIAMETER, DIAMETER); // returns a rectangle with its dimensions\r\n }", "public BoundsObject getBounds() {\n\t\treturn null;\n\t}", "public double[] get_bounds() {\n System.out.println ( \"section.get_bounds() called\" );\n double[] current_bounds = null;\n if (contours != null) {\n for (int i=0; i<contours.size(); i++) {\n ContourClass contour = contours.get(i);\n double[] cont_bounds = contour.get_bounds();\n if (cont_bounds != null) {\n if (current_bounds == null) {\n current_bounds = new double[4];\n current_bounds[0] = cont_bounds[0];\n current_bounds[1] = cont_bounds[1];\n current_bounds[2] = cont_bounds[2];\n current_bounds[3] = cont_bounds[3];\n } else {\n if (cont_bounds[0] < current_bounds[0]) current_bounds[0] = cont_bounds[0]; // minx\n if (cont_bounds[1] > current_bounds[1]) current_bounds[1] = cont_bounds[1]; // maxx\n if (cont_bounds[2] < current_bounds[2]) current_bounds[2] = cont_bounds[2]; // miny\n if (cont_bounds[3] > current_bounds[3]) current_bounds[3] = cont_bounds[3]; // maxy\n }\n }\n }\n }\n return ( current_bounds );\n }", "@Override\n public List<Bound> getBounds() {\n return Collections.unmodifiableList(bounds);\n }", "public RMRect getBounds() { return new RMRect(getX(), getY(), getWidth(), getHeight()); }", "@NonNull\n public Rect getBounds() {\n return new Rect(mBounds);\n }", "public Rectangle getBounds() {\n return new Rectangle((int) getX() - 20, (int) getY() - 20, 40, 40);\n }", "@Override\n\tpublic Rectangle getBound() {\n\t\trectBound.setX(posX+20);\n\t\trectBound.setY(Y_LAND - image.getHeight() +10);\n\t\trectBound.setWidth(image.getWidth()-10);\n\t\trectBound.setHeight(image.getHeight());\n\t\treturn rectBound;\n\t}", "public MWC.GenericData.WorldArea getBounds()\r\n\t{\n\t\treturn null;\r\n\t}", "public Rectangle getBounds() {\n return super.getBounds();\n }", "public Rectangle getBounds() {\n\t\tRectangle Box = new Rectangle(x, y, 48, 48);\n\t\treturn Box;\n\t}", "@Override\n public Rectangle getBounds() {\n return new Rectangle(this.bounds);\n }", "public RMRect bounds() { return new RMRect(x(), y(), width(), height()); }", "private Bounds getDrawBounds() {\n\t\tfinal float boundsWidth = 2 * OFFSET_X;\n\t\tfinal float boundsHeight = 2 * OFFSET_Y;\n\t\t\n\t\t//Get the center point of the player, then subtract by offset\n\t\tfinal float x = (activePlayer.getX() + activePlayer.getWidth() / 2f) \n\t\t\t\t/ activePlayer.getScaleX() - OFFSET_X;\n\n\t\tfinal float y = (activePlayer.getY() + activePlayer.getHeight() / 2f) \n\t\t\t\t/ activePlayer.getScaleY() - OFFSET_Y + 1;\n\t\t\n\t\treturn new Bounds(x, y, boundsWidth, boundsHeight);\n\t}", "public PBounds getBoundsReference() {\n\t\tPBounds bds = super.getBoundsReference();\n\t\tgetUnionOfChildrenBounds(bds);\n\n\t\tcachedChildBounds.setRect(bds);\n\t\tdouble scaledIndent = INDENT/renderCamera.getViewScale();\t\t\n\t\tbds.setRect(bds.getX()-scaledIndent,bds.getY()-scaledIndent,bds.getWidth()+2*scaledIndent,bds.getHeight()+2*scaledIndent);\n\t\t\n\t\treturn bds;\n\t}", "public abstract Rectangle getSnapshotBounds();", "public Rectangle getBounds() {\n return new Rectangle(getMinX(), getMinY(), getWidth(), getHeight());\n }", "public Rectangle getBoundingBox() {\n\t\treturn getBounds();\n\t}", "public java.awt.Rectangle getBounds(){\r\n return new java.awt.Rectangle((int)Math.round(x), (int)Math.round(y), (int)Math.round(getWidth()), (int)Math.round(getHeight()));\r\n }", "public Rectangle getBounds() {\n\t\tif (bounds == null) {\n\t\t\tsuper.getBounds();\n\t\t\tfor (int i = 0; i < getChildren().size(); i++) {\n\t\t\t\tIFigure child = (IFigure) getChildren().get(i);\n\t\t\t\tbounds.union(child.getBounds());\n\t\t\t}\n\t\t}\n\t\treturn bounds;\n\t}", "public Rectangle getBounds() {\n\t\t\treturn new Rectangle(x_pos, y_pos, getIconWidth(), getIconHeight());\n\t\t}", "public Rectangle getBoundsBigger() {\n return new Rectangle(x-32,y-32,128,128);\n }", "@Override\n\tpublic Rectangle getBounds() {\n\t\treturn new Rectangle(screen_x, screen_y, pinWidth, pinWidth);\n\t}", "public Rectangle getBounds() {\r\n\t\treturn new Rectangle((int) (x * scalingX), (int) (y * scalingY), (int) rocketWidth, (int) rocketHeight);\r\n\t}", "public abstract Regionlike getGridBounds();", "public Bounds getLogicalBounds() {\n return getDragContext().getLogicalBounds();\n }", "@Override\n\tpublic Rect getHitbox() \n\t{\n\t\treturn _bounds;\n\t}", "public void computeStoredBounds()\n {\n computeSRectangleBound();\n computeCircleBound();\n }", "public final native LatLngBounds getBounds() /*-{\n return this.getBounds();\n }-*/;", "public Rectangle2D getBounds() {\n\t\tif (_child == null) {\n\t\t\treturn new Rectangle2D.Double();\n\t\t} else {\n\t\t\treturn _child.getBounds();\n\t\t}\n\t}", "public CCAABoundingRectangle boundingRect(){\n\t\treturn _myBoundingRectangle;\n\t}", "public sRectangle getSRectangleBound()\n {\n return form.getSRectangleBound();\n }", "public abstract Rectangle getSnapshotSquareBounds();", "public Rectangle getBounds() {\n return null;\n }", "int getBoundsY();", "private Bounds getTextureBounds() {\n\t\tfinal float boundsWidth = 2 * OFFSET_X;\n\t\tfinal float boundsHeight = 2 * OFFSET_Y;\n\t\t\n\t\t//Get the center point of the player, then subtract by offset\n\t\tfinal float x = (activePlayer.getX() + activePlayer.getWidth() / 2f) \n\t\t\t\t/ activePlayer.getScaleX() - OFFSET_X;\n\t\tfinal float y = (activePlayer.getY() - activePlayer.getHeight() / 2f) \n\t\t\t\t/ activePlayer.getScaleY() + OFFSET_Y + 1;\n\t\t\n\t\treturn new Bounds(x, y, boundsWidth, boundsHeight);\n\t}", "public Rectangle getBoundingBox() {\n return new Rectangle(this);\r\n }", "Rectangle getBoundingBox(Rectangle rect);", "public IRectangleBound getClipBound();", "public ERectangle getPrimitiveBounds() {\n ERectangle primitiveBounds = this.primitiveBounds;\n if (primitiveBounds != null) return primitiveBounds;\n return this.primitiveBounds = computePrimitiveBounds();\n }", "public BoundsLatLon getTileBounds(int x, int y)\n {\n return boundsCalculator.getTileBounds(x, y);\n }", "private int[] getBounds(Node node) {\n String[] boundsAttr = (((Element) node).getAttribute(\"bounds\")).replace(\"[\",\"\").split(\"[^0-9]\");\n int[] bounds = new int[boundsAttr.length];\n for (int i = 0; i < boundsAttr.length; i++) {\n bounds[i] = Integer.parseInt(boundsAttr[i]);\n }\n return bounds;\n }", "int getBoundsWidth();", "public InfinitNumber getBound() {\n\t\treturn mBound;\n\t}", "public final Rectangle getBounds() {\n return label.getBounds();\n }", "public Bounds getProbabilityBounds();", "public LatLongRectangle getBoundingRectangle() {\n return boundingRectangle;\n }", "public Rectangle getBounds() {\n\t\tif (img == null)\n\t\t\treturn new Rectangle();\n\t\treturn new Rectangle(new Dimension(img.getWidth(), img.getHeight()));\n\t}", "public Rectangle getClipBounds()\r\n\t{\r\n\t\treturn _g2.getClipBounds();\r\n\t}", "@Override\r\n\tpublic Area getBoundsArea() {\n\t\treturn null;\r\n\t}", "public Rectangle getBoundingBox() {\n return location;\n }", "public Rect bounds(Window w) {\r\n\t\treturn new Rect(c.bounds(w).width,c.bounds(w).height);\r\n\t}", "public Rectangle2D getBounds() {\n\t\t// FIXME: these bounds REALLY need to be cached. But it's\n\t\t// painful because of the public members.\n\t\tif (stroke == null) {\n\t\t\treturn shape.getBounds2D();\n\t\t} else if (stroke instanceof BasicStroke) {\n\t\t\t// For some reason (antialiasing?) the bounds returned by\n\t\t\t// BasicStroke is off by one. This code works around it.\n\t\t\t// if all we want is the bounds, then we don't need to actually\n\t\t\t// stroke the shape. We've had reports that this is no longer\n\t\t\t// necessary with JDK1.3.\n\t\t\tRectangle2D rect = shape.getBounds2D();\n\t\t\tint width = (int) ((BasicStroke) stroke).getLineWidth() + 2;\n\t\t\treturn new Rectangle2D.Double(rect.getX() - width, rect.getY()\n\t\t\t\t\t- width, rect.getWidth() + width + width, rect.getHeight()\n\t\t\t\t\t+ width + width);\n\t\t} else {\n\t\t\t// For some reason (antialiasing?) the bounds returned by\n\t\t\t// BasicStroke is off by one. This code works around it.\n\t\t\t// We've had reports that this is no longer\n\t\t\t// necessary with JDK1.3.\n\t\t\tRectangle2D rect = stroke.createStrokedShape(shape).getBounds2D();\n\t\t\treturn new Rectangle2D.Double(rect.getX() - 1, rect.getY() - 1,\n\t\t\t\t\trect.getWidth() + 2, rect.getHeight() + 2);\n\t\t}\n\t}", "@Override\n\tpublic MyRectangle getMyBoundingBox() {\n\t\t\n\t\treturn this;\n\t}", "public Rectangle2D getBoundary() {\n return new Rectangle2D(x, y, width, height);\n }", "public Rectangle getPlotBounds();", "public RMRect getBoundsMarked()\n{\n // Declare bounds marked rect\n RMRect boundsMarked = null;\n \n // If stroke, get stroke marked bounds\n if(getStroke()!=null)\n boundsMarked = getStroke().getBounds(this);\n \n // If fill, get fill marked bounds\n if(getFill()!=null) {\n RMRect b = getFill().getBounds(this);\n boundsMarked = boundsMarked==null? b : boundsMarked.unionRect(b);\n }\n \n // If effect, get effect marked bounds\n if(getEffect()!=null) {\n RMRect b = getEffect().getBounds(this);\n boundsMarked = boundsMarked==null? b : boundsMarked.unionRect(b);\n }\n \n // Return marked bounds\n return boundsMarked!=null? boundsMarked : getBoundsInside();\n}", "public Vec2 \tgetPos(){ \t\t\t\t\treturn bound.getPos();\t\t}", "private float[] getBounds(TileCoolantPipe tile) {\n float[] bounds = new float[6];\n boolean[] connected = tile.getConnectedSides();\n float hDiameter = cableDiameter / 2.0F;\n for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {\n float width = 0.5F;\n if (!connected[dir.ordinal()]) {//(sides & dir.flag) != dir.flag) {\n width = hDiameter;\n }\n if (dir.ordinal() % 2 == 0) {\n width *= -1;\n }\n bounds[dir.ordinal()] = 0.5F + width;\n }\n return bounds;\n }", "public Rectangle getBounds(Image sterowiec)\n {\n if(sterowiec == balon)\n return new Rectangle(wsp[0]+19, wsp[1]+8, 43, 63);\n else\n return new Rectangle(wsp[0]+7, wsp[1]+14, 69, 42);\n }", "public S2LatLngRect getBound() {\n // To save time, we ignore numerical errors in the computed S2LatLngs while\n // accumulating the bounds and then account for them here.\n //\n // S2LatLng(S2Point) has a maximum error of 0.955 * S2.DBL_EPSILON in latitude.\n // In the worst case, we might have rounded \"inwards\" when computing the\n // bound and \"outwards\" when computing the latitude of a contained point P,\n // therefore we expand the latitude bounds by 2 * S2.DBL_EPSILON in each\n // direction. (A more complex analysis shows that 1.5 * S2.DBL_EPSILON is\n // enough, but the expansion amount should be a multiple of S2.DBL_EPSILON in\n // order to avoid rounding errors during the expansion itself.)\n //\n // S2LatLng(S2Point) has a maximum error of S2.DBL_EPSILON in longitude, which\n // is simply the maximum rounding error for results in the range [-Pi, Pi].\n // This is true because the Gnu implementation of atan2() comes from the IBM\n // Accurate Mathematical Library, which implements correct rounding for this\n // intrinsic (i.e., it returns the infinite precision result rounded to the\n // nearest representable value, with ties rounded to even values). This\n // implies that we don't need to expand the longitude bounds at all, since\n // we only guarantee that the bound contains the *rounded* latitudes of\n // contained points. The *true* latitudes of contained points may lie up to\n // S2.DBL_EPSILON outside of the returned bound.\n\n S2LatLng expansion = S2LatLng.fromRadians(2 * S2.DBL_EPSILON, 0);\n return builder.build().expanded(expansion).polarClosure();\n }", "public boolean getBoundsVolatile() {\n\t\treturn true;\n\t}", "private Bounds getBounds(final Value value, final DebugContext context)\r\n throws ViewerException {\r\n Bounds b = new Bounds();\r\n Method getBoundsMethod = value.getMethod(context,\r\n \"getBounds\", \"java.awt.Rectangle\", null);\r\n Value bounds = value.invokeMethod(context, getBoundsMethod,\r\n null);\r\n String type = value.getType(context).getName(context);\r\n int dot = type.lastIndexOf('.');\r\n if (dot >= 0) {\r\n type = type.substring(dot + 1);\r\n }\r\n b.type = type;\r\n \r\n try {\r\n Method getTextMethod = value.getMethod(context, \"getText\",\r\n \"java.lang.String\", null);\r\n Value result = value.invokeMethod(context, getTextMethod,\r\n null);\r\n if (!result.isNull()) {\r\n String str = result.toString(context);\r\n if (str.length() > 10) {\r\n str = str.substring(0, 7) + \"...\";\r\n }\r\n b.type += \" \\\"\" + str + \"\\\"\";\r\n }\r\n }\r\n catch (ViewerException e) {\r\n }\r\n \r\n b.bounds.x = bounds.getFieldValue(context, \"x\").toInt(context);\r\n b.bounds.y = bounds.getFieldValue(context, \"y\").toInt(context);\r\n b.bounds.width = bounds.getFieldValue(context, \"width\").\r\n toInt(context);\r\n b.bounds.height = bounds.getFieldValue(context, \"height\").\r\n toInt(context);\r\n if (value.isInstanceOf(context, \"java.awt.Container\")) {\r\n Method getComponentsMethod = value.getMethod(context,\r\n \"getComponents\", \"java.awt.Component[]\", null);\r\n Value children;\r\n try {\r\n children = value.invokeMethod(context,\r\n getComponentsMethod, null);\r\n }\r\n catch (ViewerException e) {\r\n b.children = new Bounds[0];\r\n return b;\r\n }\r\n b.children = new Bounds[children.getArrayLength(context)];\r\n for (int c = 0; c < b.children.length; c++) {\r\n b.children[c] = getBounds(children.getArrayElement(context,\r\n c), context);\r\n }\r\n }\r\n return b; \r\n }", "@Override\n\tpublic BoundaryRectangle getBoundingBox() {\n\t\treturn new BoundaryRectangle(0, 0, drawView.getWidth(), drawView.getHeight());\n\t}", "public int[] getSelectionBounds() {\r\n if(selectionBounds == null){\r\n return new int[]{};\r\n }\r\n return selectionBounds;\r\n }", "public List<Float> getBoundingsOfCell() {\n\n\t\tfloat minXPoint = Float.POSITIVE_INFINITY;\n\t\tfloat maxXPoint = Float.NEGATIVE_INFINITY;\n\t\tfloat minYPoint = Float.POSITIVE_INFINITY;\n\t\tfloat maxYPoint = Float.NEGATIVE_INFINITY;\n\n\t\tfor (int i = 0; i < face.edges().size(); i++) {\n\n\t\t\tDCEL_Edge e = (DCEL_Edge) face.edges().get(i);\n\n\t\t\tArc2_Sweep arc = (Arc2_Sweep) e.reference;\n\n\t\t\t// Looking for most left located point of cell\n\t\t\tif (minXPoint > arc.minX().x) {\n\t\t\t\tminXPoint = arc.minX().x;\n\t\t\t}\n\t\t\t// Looking for most right located point of cell\n\t\t\tif (maxXPoint < arc.maxX().x) {\n\t\t\t\tmaxXPoint = arc.maxX().x;\n\t\t\t}\n\t\t\t// Looking for highest located point of cell\n\t\t\tif (minYPoint > arc.minY().y) {\n\t\t\t\tminYPoint = arc.minY().y;\n\t\t\t}\n\t\t\t// Looking for lowest located point of cell\n\t\t\tif (maxYPoint < arc.maxY().y) {\n\t\t\t\tmaxYPoint = arc.maxY().y;\n\t\t\t}\n\n\t\t}\n\n\t\tList<Float> boundings = new ArrayList<Float>();\n\t\tboundings.add(minXPoint);\n\t\tboundings.add(maxXPoint);\n\t\tboundings.add(minYPoint);\n\t\tboundings.add(maxYPoint);\n\t\treturn boundings;\n\n\t}" ]
[ "0.78879124", "0.7684051", "0.76107746", "0.7550256", "0.7550256", "0.7504835", "0.7462285", "0.74454325", "0.742858", "0.7409983", "0.74079865", "0.7384373", "0.7384373", "0.7384373", "0.73785585", "0.7362133", "0.7356691", "0.7317764", "0.72989964", "0.7291646", "0.7288883", "0.72776604", "0.72607833", "0.72120047", "0.7205663", "0.7198593", "0.71916085", "0.71856225", "0.7178039", "0.7168463", "0.7158234", "0.7134432", "0.71209985", "0.71192116", "0.7118318", "0.7088848", "0.70877707", "0.708748", "0.7062151", "0.70619774", "0.7040344", "0.7034479", "0.70249957", "0.7005976", "0.6999878", "0.69943386", "0.69885665", "0.6987504", "0.6971447", "0.69669145", "0.6929628", "0.69295996", "0.6923727", "0.6914387", "0.6904345", "0.68781173", "0.68771833", "0.68702143", "0.68368053", "0.6824078", "0.6823587", "0.6812617", "0.681125", "0.68074924", "0.67651993", "0.67625844", "0.67614704", "0.6699406", "0.66883063", "0.6664922", "0.6624607", "0.65913326", "0.6563985", "0.6554737", "0.6540879", "0.6528107", "0.6515108", "0.6503728", "0.6484008", "0.6456886", "0.64457375", "0.64315575", "0.64178705", "0.63941896", "0.63928014", "0.638778", "0.63747406", "0.6368651", "0.63537675", "0.6337335", "0.63346034", "0.6323894", "0.631991", "0.6305278", "0.63047177", "0.63029873", "0.6288773", "0.6285412", "0.6282812", "0.6268602" ]
0.73451763
17
This method used to draw individual on simulation map. If current state is moving or in conversation, individual must appear on map. It uses health status to give more information about health state of individual. Black used for healthiness, red used for infected.
public void paint(Graphics2D g2d) { if(currentState == moving || currentState == inConversation) { switch (healthStatus) { case HEALTHY: g2d.setColor(Color.BLACK); break; case INFLECTED: g2d.setColor(Color.RED); break; default: break; } g2d.fillRect(x, y, individualSize, individualSize); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void draw()\n\t{\n\t\t// First update the lighting of the world\n\t\t//int x = avatar.getX();\n\t\t//int y = avatar.getY();\t\t\n\n\t\tfor (int x = 0; x < width; x++)\n\t\t{\n\t\t\tfor (int y = 0; y < height; y++)\n\t\t\t{\n\t\t\t\ttiles[x][y].draw(x, y);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor (int i = monsters.size() - 1; i >=0; i--)\n\t\t{\n\t\t\tMonster monster = monsters.get(i);\n\t\t\tint x = monster.getX();\n\t\t\tint y = monster.getY();\n\t\t\t\n\t\t\t// Check if the monster has been killed\n\t\t\tif (monster.getHitPoints() <= 0)\n\t\t\t{\n\t\t\t\tmonsters.remove(i);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (tiles[x][y].getLit())\n\t\t\t\t\tmonster.draw();\n\t\t\t}\n\t\t}\t\t\n\t\tavatar.draw();\n\t}", "@Override\n public void drawHealth() {\n System.out.println(\"I'm a hospital object \");\n }", "public void draw(Graphics g){\n if (isEmpty()) {\n g.setColor(new Color(255, 204, 204));\n g.fillRect(getXGraphic(), getYGraphic(), 120, 120);\n g.setColor(Color.BLACK);\n if (getIndication()){\n g.setColor(new Color(0, 0, 0, 100));\n g.fillRect(getXGraphic(), getYGraphic(),120,120);\n }\n if (getTargetable()){\n g.setColor(new Color(0, 0, 255));\n g.drawRect(getXGraphic(), getYGraphic(),120,120);\n }\n\n g.drawRect(getXGraphic(), getYGraphic(), 120, 120);\n } else {\n enemy.draw(getXGraphic(), getYGraphic() ,g, getIndication());\n\n //Draw blue square around if it is a targetable space\n if (getTargetable()){\n g.setColor(new Color(0, 0, 255));\n g.drawRect(getXGraphic(), getYGraphic(),120,120);\n }\n }\n }", "private void modifyMapStatus(int status) {\n\t\tint bC = centerPoint.getX() / UNIT;\n\t\tint bR = centerPoint.getY() / UNIT;\n\n\t\tfor (int i = bR; i < bR + row; i++) {\n\t\t\tfor (int j = bC; j < bC + column; j++) {\n\t\t\t\tif(stage==1){\n\t\t\t\t\tGameView.map[i][j] = status;\n\t\t\t\t}else if(stage ==2){\n\t\t\t\t\tGameViewStage2.map[i][j] = status;\n\t\t\t\t}else {\n\t\t\t\t\tGameViewStage3.map[i][j] = status;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void battleStatus(){\n Program.terminal.println(\"________________TURN \"+ turn +\"________________\");\n Program.terminal.println(\"\");\n Program.terminal.println(\" +-------------------- \");\n Program.terminal.println(\" |Name:\"+ currentMonster.name);\n Program.terminal.println(\" |HP: \" + currentMonster.currentHp+\"/\"+currentMonster.hp);\n Program.terminal.println(\" |\" + barGauge(1));\n Program.terminal.println(\" +-------------------- \");\n Program.terminal.println(\"\");\n Program.terminal.println(\"My HP:\" + MainCharacter.hpNow +\"/\"+ MainCharacter.hpMax + \" \" + barGauge(2));\n Program.terminal.println(\"My MP:\" + MainCharacter.mpNow +\"/\"+ MainCharacter.mpMax + \" \" + barGauge(3));\n Program.terminal.println(\"\");\n askAction();\n }", "@Override\n\tpublic void show () {\n overWorld = new Sprite(new TextureRegion(new Texture(Gdx.files.internal(\"Screens/overworldscreen.png\"))));\n overWorld.setPosition(0, 0);\n batch = new SpriteBatch();\n batch.getProjectionMatrix().setToOrtho2D(0, 0, 320, 340);\n\n // Creates the indicator and sets it to the position of the first grid item.\n indicator = new MapIndicator(screen.miscAtlases.get(2));\n // Creates the icon of Daur that indicates his position.\n icon = new DaurIcon(screen.miscAtlases.get(2));\n // Sets the mask position to zero, as this screen does not lie on the coordinate plane of any tiled map.\n screen.mask.setPosition(0, 0);\n screen.mask.setSize(320, 340);\n Gdx.input.setInputProcessor(inputProcessor);\n\n // Creates all relevant text.\n createText();\n // Sets numX and numY to the position of Daur on the map.\n numX = storage.cellX;\n numY = storage.cellY;\n indicator.setPosition(numX * 20, numY * 20 + 19);\n // Sets the icon to the center of this cell.\n icon.setPosition(numX * 20 + 10 - icon.getWidth() / 2, numY * 20 + 29 - icon.getHeight() / 2);\n // Creates all the gray squares necessary.\n createGraySquares();\n }", "public void draw(GraphicsHandler graphicsHandler) {\n\t\tswitch (playLevelScreenState) {\n\t\tcase RUNNING:\n\t\tcase PLAYER_DEAD:\n\t\t\tmap.draw(graphicsHandler);\n\t\t\tplayer.draw(graphicsHandler);\n\t\t\thud.draw(graphicsHandler);\n\t\t\tif (isGamePaused) {\n\t\t\t\tpauseLevelScreen.draw(graphicsHandler);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase LEVEL_WIN_MESSAGE:\n\t\t\tlevelClearedScreen.draw(graphicsHandler);\n\t\t\tbreak;\n\t\tcase LEVEL_LOSE_MESSAGE:\n\t\t\tlevelLoseScreen.draw(graphicsHandler);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "public void status(leapstream.scoreboard.core.model.Status status) {\n Stati stati = status.is();\n foreground(stati);\n background(stati);\n label.text(\"\" + stati);\n }", "void draw(Graphics g)\n {\n int aliveCount = 0, deadCount = 0;\n\n boolean[][] gridArray = grid.getGrid();\n for(int row = 0; row < gridArray.length; row++){\n for(int col = 0; col < gridArray[row].length; col++){\n if(gridArray[row][col]){\n if(grid.isInverted()) {\n g.setColor(Color.white);\n } else {\n g.setColor(Color.black);\n }\n aliveCount++;\n } else {\n if(grid.isInverted()) {\n g.setColor(Color.black);\n } else {\n g.setColor(Color.white);\n }\n deadCount++;\n }\n g.fillRect(col * (grid.getCellSize() + grid.getCellInnerGap()) + grid.getCellOuterGap() , row * (grid.getCellSize() + grid.getCellInnerGap()) + grid.getCellOuterGap(), grid.getCellSize(), grid.getCellSize());\n }\n }\n\n UserInterface.infoLabel.setText(\"<html><center>Generation: \" + grid.getGeneration() + \"</center>Alive: \" + aliveCount + \" ; Dead: \" + deadCount + \"</html>\");\n }", "public void draw(Graphics2D g) {\n \t switch(id){\n \t case NORMAL:\n \t g.drawImage(img,getX(),getY(),2*getWidth(),2*getHeight(),null);\n\t Graphics2D graphics = (Graphics2D)g.create();\n \t graphics.setColor(Color.red);\n \t graphics.fill3DRect(getX()+10,getY()-10,health,10,true);\n \t graphics.dispose();\n \t break;\n \t case BOSS:\n \t g.drawImage(img,getX(),getY(),getWidth(),getHeight(),null);\n\t Graphics2D graphics = (Graphics2D)g.create();\n \t graphics.setColor(Color.red);\n \t graphics.fill3DRect(getX()+10,getY()-10,health,10,true);\n \t graphics.dispose();\n \t\t break;\n \t }\n \t}", "public void updateCell() {\n alive = !alive;\n simulator.getSimulation().changeState(xPosition, yPosition);\n setColor();\n }", "public void paintStation(StationStatus status) {\n mapBounds = status.getBounds();\n if (mapBounds.getHeight() < MIN_HEIGHT) {\n mapBounds = new Rectangle2D.Double(mapBounds.getX(), mapBounds.getCenterY() - MIN_HEIGHT / 2, mapBounds.getWidth(), MIN_HEIGHT);\n }\n if (mapBounds.getWidth() < MIN_WIDTH) {\n mapBounds = new Rectangle2D.Double(mapBounds.getCenterX() - MIN_WIDTH / 2, mapBounds.getY(), MIN_WIDTH, mapBounds.getHeight());\n }\n Collection<? extends Edge> edges = status.getStationMap().getEdges().values();\n Consumer<Graphics2D> redPainters = edges.stream()\n .filter(e -> status.getSection(e).isEmpty())\n .map(edge -> createLinePainter(edge, TRACK_STROKE, false))\n .reduce(Consumer::andThen)\n .orElse(NONE_PAINTER);\n Consumer<Graphics2D> greenPainters = edges.stream()\n .filter(e -> status.getSection(e).isPresent())\n .map(edge -> createLinePainter(edge, TRACK_STROKE, true))\n .reduce(Consumer::andThen)\n .orElse(NONE_PAINTER);\n Consumer<Graphics2D> trainPainters = Painters.createLineTrainPainters(status);\n\n painter = redPainters\n .andThen(greenPainters)\n .andThen(trainPainters);\n repaint();\n }", "private void drawWhite() throws IOException, ReversiException {\n playSound(PLAY_SOUND);\n // get the list of stones need to be changed\n String list = fromServer.readUTF();\n // draw white the list of stones\n boardComponent.drawWhite(list);\n setScoreText();\n\n // followed by the TURN command\n responseToServer();\n }", "public void draw() {\n GraphicsContext gc = getGraphicsContext2D();\n /*gc.clearRect(0, 0, getWidth(), getHeight());\n\n if (squareMap != null) {\n squareMap.draw(gc);\n }\n if (hexMap != null) {\n hexMap.draw(gc);\n }*/\n\n // Draw animations\n for (SpriteAnimationInstance anim : animationList) {\n anim.draw(gc);\n }\n\n // Lastly draw the dialogue window, no matter which canvas\n // we are on, all the same.\n DfSim.dialogueWindow.draw(gc);\n\n /*if (landMap != null) {\n landMap.draw(gc);\n }*/\n\n // Draw a border around the canvas\n //drawBorder(gc);\n\n // And now just draw everything directly from the simulator\n /*for (Raindrop item : sim.getDrops()) {\n drawMovableCircle(gc, item);\n }\n for (Earthpatch item : sim.getPatches()) {\n drawMovableCircle(gc, item);\n }\n for (SysShape item : sim.getShapes()) {\n drawSysShape(gc, item);\n }\n for (Spike item : sim.getSpikes()) {\n drawMovablePolygon(gc, item);\n }\n for (GravityWell item : sim.getGravityWells()) {\n drawGravityWell(gc, item);\n }*/\n }", "public void drawDebugInfo() {\n\n\t\t// Draw our home position.\n\t\tbwapi.drawText(new Point(5,0), \"Our home position: \"+String.valueOf(homePositionX)+\",\"+String.valueOf(homePositionY), true);\n\t\t\n\t\t// Draw circles over workers (blue if they're gathering minerals, green if gas, white if inactive)\n\t\tfor (Unit u : bwapi.getMyUnits()) {\n\t\t\tif (u.isGatheringMinerals()) \n\t\t\t\tbwapi.drawCircle(u.getX(), u.getY(), 12, BWColor.BLUE, false, false);\n\t\t\telse if (u.isGatheringGas())\n\t\t\t\tbwapi.drawCircle(u.getX(), u.getY(), 12, BWColor.GREEN, false, false);\n\t\t\telse if (u.getTypeID() == UnitTypes.Protoss_Probe.ordinal() && u.isIdle())\n\t\t\t\tbwapi.drawCircle(u.getX(), u.getY(), 12, BWColor.WHITE, false, false);\n\t\t\t\t\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic void draw(Graphics2D g) {\n\t\tint realPosX = (int)(position.x + PlayState.camX);\n\t\tint realPosY = (int)(position.y + PlayState.camY);\n\t\tg.setColor(Color.white);\n\t\tg.fillRect(realPosX, realPosY, width, height/6);\n\t\tg.setColor(Color.red);\n\t\tg.fillRect(realPosX, realPosY, (int)(widthDouble*healthPercentage), height/6);\n\t\tg.drawImage(model, realPosX, realPosY, width, height, null);\n\t}", "private void draw() {\n this.player.getMap().DrawBackground(this.cameraSystem);\n\n //Dibujamos al jugador\n player.draw();\n\n for (Character character : this.characters) {\n if (character.getMap() == this.player.getMap()) {\n character.draw();\n }\n }\n\n //Dibujamos la parte \"superior\"\n this.player.getMap().DrawForeground();\n\n //Sistema de notificaciones\n this.notificationsSystem.draw();\n\n this.player.getInventorySystem().draw();\n\n //Hacemos que la cámara se actualice\n cameraSystem.draw();\n }", "private void updateStatusText() {\n Piece.Color playerColor = board.getTurnColor();\n\n if(board.isGameOver()) {\n if(board.isDraw()) {\n tvShowStatus.setTextColor(Color.BLUE);\n tvShowStatus.setText(\"DRAW\");\n }\n else if (board.getWinnerColor() == Piece.Color.Black) {\n tvShowStatus.setTextColor(Color.BLACK);\n tvShowStatus.setText(\"BLACK WINS\");\n }\n else {\n tvShowStatus.setTextColor(Color.WHITE);\n tvShowStatus.setText(\"WHITE WINS\");\n }\n }\n else if(playerColor == Piece.Color.Black) {\n tvShowStatus.setTextColor(Color.BLACK);\n tvShowStatus.setText(\"BLACK\");\n }\n else {\n tvShowStatus.setTextColor(Color.WHITE);\n tvShowStatus.setText(\"WHITE\");\n }\n }", "@Override\r\n\tpublic void draw(Batch batch, float alpha) {\r\n\t\tbatch.setProjectionMatrix(camera.combined);\r\n\t\theroHealth.draw(batch);\r\n\t\tcover.draw(batch);\r\n\t}", "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 }", "private void render() {\n\t\ttheMap.draw(g);\n\t\ttheTrainer.draw(g);\n\t}", "public void drawDebug(){\n debugRenderer.setProjectionMatrix(cam.combined);\n debugRenderer.begin(ShapeRenderer.ShapeType.Line);\n\n for (Object e : world.getEnemies()) {\n Enemy enemy = (Enemy)e;\n Rectangle rect = enemy.getBounds();\n float x1 = rect.x;\n float y1 = rect.y;\n debugRenderer.setColor(new Color(1, 0, 0, 1));\n debugRenderer.rect(x1, y1, rect.width, rect.height);\n }\n\n for(Bullet b : world.getPlayer().getWeapon().getBullets()) {\n Rectangle rect = b.getBounds();\n float x1 = rect.x;\n float y1 = rect.y;\n debugRenderer.setColor(new Color(1, 0, 0, 1));\n debugRenderer.rect(x1, y1, rect.width, rect.height);\n }\n\n for(Enemy e : world.getEnemies()) {\n for(Bullet b : e.getWeapon().getBullets()){\n Rectangle rect = b.getBounds();\n float x1 = rect.x;\n float y1 = rect.y;\n debugRenderer.setColor(new Color(1, 0, 0, 1));\n debugRenderer.rect(x1, y1, rect.width, rect.height);\n }\n }\n\n Player player = world.getPlayer();\n Rectangle rect = player.getBounds();\n float x1 = rect.x;\n float y1 = rect.y;\n debugRenderer.setColor(new Color(0, 1, 0, 1));\n debugRenderer.rect(x1, y1, rect.width, rect.height);\n debugRenderer.end();\n }", "public void draw(){\n if (! this.isFinished() ){\n UI.setColor(this.color);\n double left = this.xPos-this.radius;\n double top = GROUND-this.ht-this.radius;\n UI.fillOval(left, top, this.radius*2, this.radius*2);\n }\n }", "private void draw() {\n gsm.draw(g);\n }", "@Override\n\tpublic void render(Graphics g) {\n\t\tg.setColor(Color.RED);\n\t\tg.drawRect((int) xPosition, (int) yPosition, width, height);\n\n\t\tif (health == 3) {\n\n\t\t\tg.setColor(Color.RED);\n\t\t\tg.fillRect((int) xPosition + 1, (int) yPosition + 1, width / 3, height - 2);\n\n\t\t\tg.setColor(Color.RED);\n\t\t\tg.fillRect((int) xPosition + width / 3, (int) yPosition + 1, width / 3, height - 2);\n\n\t\t\tg.setColor(Color.RED);\n\t\t\tg.fillRect((int) (xPosition + width) - (width / 3) - 2, (int) yPosition + 1, (width / 3) + 1, height - 2);\n\n\t\t} else if (health == 2) {\n\n\t\t\tg.setColor(Color.RED);\n\t\t\tg.fillRect((int) xPosition + 1, (int) yPosition + 1, width / 3, height - 2);\n\n\t\t\tg.setColor(Color.RED);\n\t\t\tg.fillRect((int) xPosition + width / 3, (int) yPosition + 1, width / 3, height - 2);\n\n\t\t} else if (health == 1) {\n\n\t\t\t// Flash health bar.\n\t\t\tif (healthFlashTimer <= healthFlashLength / 2) {\n\n\t\t\t\tg.setColor(Color.RED);\n\t\t\t\tg.fillRect((int) xPosition + 1, (int) yPosition + 1, width / 3, height - 2);\n\t\t\t} else {\n\n\t\t\t\tif (healthFlashTimer >= healthFlashLength)\n\t\t\t\t\thealthFlashTimer = 0;\n\t\t\t}\n\n\t\t\thealthFlashTimer++;\n\t\t}\n\t}", "@Override\n public void drawIcons(Graphics g) {\n drawStatus(g);\n\n int tileDimension = 120;\n\n if (!isEmpty()) {\n Icon intent = enemy.getIntent();\n intent.setPosition(getXGraphic() + (tileDimension / 2), getYGraphic() - (tileDimension / 3));\n intent.draw(g);\n }\n }", "private void determineState() {\n if ( .66 <= ( ( float ) currentHealth / maxHealth ) ) {\n if ( currentState != HealthState.HIGH ) {\n currentState = HealthState.HIGH;\n for ( Image i : healthMeter ) {\n i.setDrawable( new TextureRegionDrawable( healthBars.findRegion( \"highHealth\" ) ) );\n }\n }\n } else if ( .33 <= ( ( float ) currentHealth / maxHealth ) ) {\n if ( currentState != HealthState.MEDIUM ) {\n currentState = HealthState.MEDIUM;\n for ( Image i : healthMeter ) {\n i.setDrawable( new TextureRegionDrawable( healthBars.findRegion( \"mediumHealth\" ) ) );\n }\n }\n } else if ( .0 <= ( ( float ) currentHealth / maxHealth ) ) {\n if ( currentState != HealthState.LOW ) {\n currentState = HealthState.LOW;\n for ( Image i : healthMeter ) {\n i.setDrawable( new TextureRegionDrawable( healthBars.findRegion( \"lowHealth\" ) ) );\n }\n }\n }\n }", "public void drawMap() {\n\t\tRoad[] roads = map.getRoads();\r\n\t\tfor (Road r : roads) {\r\n\t\t\tif (r.turn) {\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road = true;\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_vert = true;\r\n\t\t\t} else if (r.direction == Direction.NORTH)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_north = true;\r\n\t\t\telse if (r.direction == Direction.SOUTH)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_south = true;\r\n\t\t\telse if (r.direction == Direction.WEST)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_west = true;\r\n\t\t\telse if (r.direction == Direction.EAST)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_east = true;\r\n\t\t\ttry {\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].updateImage();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void drawHealthBar() {}", "public void updateDisplay()\n {\n\t Color metal = new Color(153, 153, 153);\n\t Color background = new Color(0, 0, 0);\n\t Color sand = new Color(251, 251, 208);\n\t Color water = new Color(102, 179, 255);\n\t int rows = grid.length;\n\t int cols = grid[0].length;\n\t for(int i = 0; i < rows; i++) {\n\t\t for(int j = 0; j < cols; j++) {\n\t\t\t if(grid[i][j] == METAL) {\n\t\t\t\t //color should be gray or whatever\n\t\t\t\t display.setColor(i, j, metal);\n\t\t\t }\n\t\t\t else if(grid[i][j] == EMPTY) {\n\t\t\t\t display.setColor(i, j, background);\n\t\t\t }\n\t\t\t else if(grid[i][j] == SAND) {\n\t\t\t\t display.setColor(i, j, sand);\n\t\t\t }\n\t\t\t else {\n\t\t\t\t display.setColor(i, j, water);\n\t\t\t }\n\t\t }\n\t }\n }", "public void render(){\n ui.stroke(255,140,0);\r\n Random rand = new Random();\r\n int value1 = rand.nextInt(255);\r\n int value2 = rand.nextInt(255);\r\n int value3 = rand.nextInt(255);\r\n int value4 = rand.nextInt(255);\r\n ui.fill(value1,value2,value3,value4);\r\n ui.rect(x + 75 ,y + 380,200,40);\r\n String Text = \"TARGET ACQUIRED\";\r\n ui.textSize(18);\r\n ui.fill(255, 0, 0);\r\n ui.text(Text, x + 95 ,y + 407);\r\n\r\n //Create Target Aimer\r\n ui.noFill();\r\n ui.stroke(255,0,0);\r\n ui.ellipse(x + width / 2, y + height / 2, radius, radius);\r\n\r\n radius = radius + 1;\r\n if(radius>=150){\r\n radius *= -1;\r\n }\r\n }", "public void drawPiece(Graphics g){\n if (current == null){\n return;\n }\n\n for (int y = 1; y < 21; y++){\n for (int x = 1; x < 13; x++){\n if (map[x][y]){\n g.setColor(colors[x][y]);\n g.fillRoundRect(26 * x - 13, 26 * (21 - y) - 13, 25, 25, 2, 2);\n }\n }\n }\n }", "Cell(int xpos, int ypos, int status)\n {\n this.X = xpos;\n this.Y = ypos;\n this.status = status;\n if (status == 0)\n {\n cell.setVisible(false);\n }\n cell.setFill(Color.WHITE);\n }", "public void render() {\n int pixel = getPixelSize();\n for (int xx = x; xx<x+w; xx += pixel) {\n for (int yy = y; yy<y+h; yy += pixel) {\n Location next = getLocation(xx, yy);\n if (next != null) { // This way if a wall is spawned at the edge it's ok\n next.setColor(color(255,255,255));\n next.setType(LocationType.WALL);\n getGridCache().add(next);\n }\n }\n }\n }", "private void drawFallingPiece() {\r\n\t\t// loops through each rectangle of the shape type (always 4), and draws it\r\n\t\t// based on it's status and position.\r\n\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\tdrawSquare(game.fallingPiece.x + game.fallingPiece.coord[game.fallingPiece.status][i][0],\r\n\t\t\t\t\t game.fallingPiece.y + game.fallingPiece.coord[game.fallingPiece.status][i][1],\r\n\t\t\t\t\t game.fallingPiece.color);\r\n\t\t}\r\n\t}", "public void turnOn() {\n this.status = true;\n update(this.redValue, this.greenValue, this.blueValue);\n }", "public void draw(Graphics g, boolean gameover) { \r\n int healthPos= Main.WIDTH / 2+4;\r\n if (!gameover){\r\n g.setColor(Color.WHITE);\r\n g.fillRect(healthPos-3,(Main.HEIGHT /8) -51,6,37);\r\n if (this.playerNum==1){\r\n g.fillRect(healthPos-this.healthplace*3-5,(Main.HEIGHT /8) -47, (this.healthplace*3)+2, 29);\r\n g.setColor(Color.RED);\r\n g.fillRect(healthPos-this.healthplace*3-3, (Main.HEIGHT / 8) - 45, (this.healthplace*3), 25);\r\n g.setColor(Color.GREEN);\r\n g.fillRect(healthPos-this.health*3-3, (Main.HEIGHT / 8) - 45, (this.health*3), 25);\r\n }\r\n else{\r\n g.fillRect(healthPos+3,(Main.HEIGHT /8) -47, (this.healthplace*3)+2, 29);\r\n g.setColor(Color.RED);\r\n g.fillRect(healthPos+3, (Main.HEIGHT / 8) - 45, (this.healthplace*3), 25);\r\n g.setColor(Color.GREEN);\r\n g.fillRect(healthPos+3, (Main.HEIGHT / 8) - 45, (this.health*3), 25);\r\n }\r\n }\r\n \r\n g.drawImage(Main.sprites[getState()], this.positionX, this.positionY, this);\r\n\r\n }", "public void render(){\r\n if(getLives() >= 10){\r\n StdDraw.picture(super.xCoord,super.yCoord,\"EnemyPurple.png\",super.radius*2,super.radius*2);\r\n }\r\n if(getLives() < 10){\r\n StdDraw.picture(super.xCoord,super.yCoord,\"EnemyPink.png\",super.radius*2,super.radius*2);\r\n }\r\n }", "void draw() {\n\t\tSystem.out.println(\"Drawing the Rectange...\");\n\t\t}", "private void draw() {\n model.tick();\n\n List<Entity> entities = model.getCurrentLevel().getEntities();\n\n for (EntityView entityView: entityViews) {\n entityView.markForDelete();\n }\n\n double heroXPos = model.getCurrentLevel().getHeroX();\n heroXPos -= xViewportOffset;\n\n if (heroXPos < VIEWPORT_MARGIN) {\n if (xViewportOffset >= 0) {\n xViewportOffset -= VIEWPORT_MARGIN - heroXPos;\n if (xViewportOffset < 0) {\n xViewportOffset = 0;\n }\n }\n } else if (heroXPos > width - VIEWPORT_MARGIN) {\n xViewportOffset += heroXPos - (width - VIEWPORT_MARGIN);\n }\n\n backgroundDrawer.update(xViewportOffset);\n\n for (Entity entity: entities) {\n boolean notFound = true;\n for (EntityView view: entityViews) {\n if (view.matchesEntity(entity)) {\n notFound = false;\n view.update(xViewportOffset);\n break;\n }\n }\n if (notFound) {\n EntityView entityView = new EntityViewImpl(entity);\n entityViews.add(entityView);\n pane.getChildren().add(entityView.getNode());\n }\n }\n\n for (EntityView entityView: entityViews) {\n if (entityView.isMarkedForDelete()) {\n pane.getChildren().remove(entityView.getNode());\n }\n }\n entityViews.removeIf(EntityView::isMarkedForDelete);\n\n if (model.heroDead()) {\n try {\n java.util.concurrent.TimeUnit.SECONDS.sleep(1);\n } catch (Exception e) {\n e.printStackTrace();\n }\n model.restartLevel();\n }\n if (model.finish()) {\n Text finished = new Text(\"F I N I S H E D !\");\n finished.setFont(new Font(50));\n finished.setX(model.getCurrentLevel().getWidth()/2-150);\n finished.setY(model.getCurrentLevel().getHeight()/2);\n pane.getChildren().add(finished);\n } else if (model.gameOver()) {\n Text finished = new Text(\"G A M E O V E R !\");\n finished.setFont(new Font(50));\n finished.setX(model.getCurrentLevel().getWidth()/2-200);\n finished.setY(model.getCurrentLevel().getHeight()/2);\n pane.getChildren().add(finished);\n\n lives.setText(\"Lives: \" + model.getLives());\n lives.setFont(new Font(20));\n lives.setX(width-100);\n lives.setY(30);\n\n } else {\n elapsedTime = (new Date()).getTime() - model.getStartTime();\n elapsedTime = elapsedTime/1000;\n time.setText(\"Time: \" + elapsedTime);\n time.setFont(new Font(20));\n time.setX(30);\n time.setY(30);\n lives.setText(\"Lives: \" + model.getLives());\n lives.setFont(new Font(20));\n lives.setX(width-100);\n lives.setY(30);\n }\n\n\n\n\n\n }", "public void draw() {\n \n // TODO\n }", "public void checkHealth(){\n if (this.getHealth() < this.initialHealth/2){\n this.setImgSrc(\"/students/footballstudent1.png\");\n this.getTile().setImage(\"/students/footballstudent1.png\");\n }\n }", "@Override\n public void render(GameContainer gc, StateBasedGame stateBasedGame, Graphics g) throws SlickException {\n //Loads this seperate, else the map is over-riding all drawn during the game\n loadMap.render(gc, stateBasedGame, g);\n //Render all objects\n for (GameObject obj : objects) {\n obj.render(gc, stateBasedGame, g);\n }\n Input input = gc.getInput();\n int mouseX = input.getMouseX();\n int mouseY = input.getMouseY();\n\n if (sellTower || upgradePressed) {\n if (input.isMousePressed(1)) {\n sellTower = false;\n upgradePressed = false;\n }\n }\n\n //Draws this tower\n for (BasicTower basicTower : basicTowers) {\n basicTower.basicClicked.draw(basicTower.towerX * w, basicTower.towerY * w, w, w);\n }\n //Draws this tower\n for (SniperTower sniperTower : sniperTowers) {\n sniperTower.sniperClicked.draw(sniperTower.towerX * w, sniperTower.towerY * w, w, w);\n }\n //Draws this tower\n for (QuickTower quickTower : quickTowers) {\n quickTower.quickClicked.draw(quickTower.towerX * w, quickTower.towerY * w, w, w);\n }\n //Draws this tower\n for (BomberTower bomberTower : bomberTowers) {\n bomberTower.bomberClicked.draw(bomberTower.bombertowerX * w, bomberTower.bombertowerY * w, w, w);\n }\n\n //This draws for each enemy its healthbar based on it current HP\n for (Enemy enemies : enemies) {\n Rectangle bar = new Rectangle(enemies.getStartPosX() * w + 8,\n enemies.getStartPosY() * w,\n 50 * enemies.getHP() / ((enemy.startHP + currentLevel)), 6);\n GradientFill fill = new GradientFill(enemies.getStartPosX() * w + 8,\n 0, new Color(255, 60, 0),\n enemies.getStartPosX() * w + 60, 0, new Color(255, 180, 0));\n // g.drawString(\"\" + enemies.getHP(), enemies.getStartPosX() * w, enemies.getStartPosY() * w);\n\n g.setColor(Color.darkGray);\n g.fillRect(enemies.getStartPosX() * w + 8, enemies.getStartPosY() * w, 50, 6);\n g.fill(bar, fill);\n\n enemies.e1.draw(enemies.getStartPosX() * w + 8,\n enemies.getStartPosY() * w + 8, w - 16, w - 16);\n }\n\n //Controls the bullets\n for (int i = 0; i < bulletList.size(); i++) {\n Bullets bullets = bulletList.get(i);\n basicbulletSheet.draw(bullets.location.getX(), bullets.location.getY(), 32, 32);\n bulletCircle = new Circle(bullets.location.getX(), bullets.location.getY(), 10);\n for (Enemy enemy : enemies) {\n enemy.Playrect = new Circle(enemy.getStartPosX() * w + r,\n enemy.getStartPosY() * w + r, 25);\n if (bulletList.size() > 0 && bulletCircle.intersects(enemy.Playrect)) {\n bulletCount++;\n collides = true;\n enemy.setHP(enemy.getHP() - 1);\n if (collides) {\n bulletList.remove(i);\n } else {\n collides = false;\n }\n }\n }\n //If the bullet runs out of the screen, remove it\n if (bulletCircle.getX() > (loadMap.HEIGHT - 6) * w || bulletCircle.getY() > loadMap.WIDTH * w) {\n bulletList.remove(i);\n }\n //g.setColor(transparent);\n //g.fill(bulletCircle);\n }\n\n g.setColor(Color.green);\n g.drawString(\"Level: \" + currentLevel, 715, 385);\n\n //SELL TOWERS\n if (loadMap.MAP[mouseY / w][mouseX / w] == 12) {\n if (input.isMousePressed(0)) {\n sellTower = true;\n upgradePressed = false;\n }\n }\n //Remove sellTower or Upgradepressed if mouse is on a tower in the menu\n if (loadMap.MAP[mouseY / w][mouseX / w] == 8 || loadMap.MAP[mouseY / w][mouseX / w] == 6 ||\n loadMap.MAP[mouseY / w][mouseX / w] == 10 || loadMap.MAP[mouseY / w][mouseX / w] == 4) {\n sellTower = false;\n upgradePressed = false;\n }\n\n //Visible if selltower is pressed\n if (sellTower) {\n loadMap.MAP[4][11] = 13;\n } else {\n loadMap.MAP[4][11] = 12;\n }\n //Sell Basic\n if (loadMap.MAP[mouseY / w][mouseX / w] == 5 && basicTowers.listIterator().hasNext()) {\n BasicTower b = getBasicTower(mouseY / w, mouseX / w);\n g.drawString(\"BasicTower\", 715, 445);\n g.drawString(\"Refund value: \" + basicTowers.listIterator().next().refundValue, 715, 475);\n g.drawString(\"Upgrade Cost: \" + basicTowers.listIterator().next().upgradeCost, 715, 505);\n if (b != null) {\n g.drawString(\"Tower Level: \" + b.towerLevel, 715, 535);\n }\n if (sellTower) {\n if (input.isMousePressed(0)) {\n BasicTower t = getBasicTower(mouseY / w, mouseX / w);\n if (t != null) {\n player.addCredits(t.refundValue);\n basicTowers.remove(t);\n }\n loadMap.MAP[mouseY / w][mouseX / w] = 1;\n sellTower = false;\n }\n }\n }\n\n //Sell Bomber\n if (loadMap.MAP[mouseY / w][mouseX / w] == 7 && bomberTowers.listIterator().hasNext()) {\n BomberTower b = getBomberTower(mouseY / w, mouseX / w);\n g.drawString(\"BomberTower\", 715, 445);\n g.drawString(\"Refund value: \" + bomberTowers.listIterator().next().refundValue, 715, 475);\n g.drawString(\"Upgrade Cost: \" + bomberTowers.listIterator().next().upgradeCost, 715, 505);\n if (b != null) {\n g.drawString(\"Tower Level: \" + b.towerLevel, 715, 535);\n }\n if (sellTower) {\n if (input.isMousePressed(0)) {\n BomberTower t = getBomberTower(mouseY / w, mouseX / w);\n if (t != null) {\n player.addCredits(t.refundValue);\n bomberTowers.remove(t);\n }\n loadMap.MAP[mouseY / w][mouseX / w] = 1;\n sellTower = false;\n }\n }\n }\n\n //Sell QuickTower\n if (loadMap.MAP[mouseY / w][mouseX / w] == 9 && quickTowers.listIterator().hasNext()) {\n QuickTower b = getQuickTower(mouseY / w, mouseX / w);\n g.drawString(\"QuickTower\", 715, 445);\n g.drawString(\"Refund value: \" + quickTowers.listIterator().next().refundValue, 715, 475);\n g.drawString(\"Upgrade Cost: \" + quickTowers.listIterator().next().upgradeCost, 715, 505);\n if (b != null) {\n g.drawString(\"Tower Level: \" + b.towerLevel, 715, 535);\n }\n if (sellTower) {\n if (input.isMousePressed(0)) {\n QuickTower t = getQuickTower(mouseY / 64, mouseX / 64);\n if (t != null) {\n player.addCredits(t.refundValue);\n quickTowers.remove(t);\n }\n loadMap.MAP[mouseY / w][mouseX / w] = 1;\n sellTower = false;\n }\n }\n }\n //Sell Sniper\n if (loadMap.MAP[mouseY / w][mouseX / w] == 11 && sniperTowers.listIterator().hasNext()) {\n SniperTower s = getSniperTower(mouseY / w, mouseX / w);\n g.drawString(\"SniperTower\", 715, 445);\n g.drawString(\"Refund Value: \" + sniperTowers.listIterator().next().refundValue, 715, 475);\n g.drawString(\"Upgrade Cost: \" + sniperTowers.listIterator().next().upgradeCost, 715, 505);\n if (s != null) {\n g.drawString(\"Tower Level: \" + s.towerLevel, 715, 535);\n }\n if (sellTower) {\n if (input.isMousePressed(0)) {\n SniperTower t = getSniperTower(mouseY / 64, mouseX / 64);\n if (t != null) {\n player.addCredits(t.refundValue);\n sniperTowers.remove(t);\n }\n loadMap.MAP[mouseY / w][mouseX / w] = 1;\n sellTower = false;\n }\n }\n }\n\n\n //UPGRADE TOWERS\n if (loadMap.MAP[mouseY / w][mouseX / w] == 14) {\n if (input.isMousePressed(0)) {\n upgradePressed = true;\n }\n }\n //Visible if upgradePressed is pressed\n if (upgradePressed) {\n loadMap.MAP[4][13] = 15;\n } else {\n loadMap.MAP[4][13] = 14;\n }\n\n //Upgrade Basic\n if (loadMap.MAP[mouseY / w][mouseX / w] == 5 && basicTowers.listIterator().hasNext()) {\n if (upgradePressed) {\n if (input.isMousePressed(0)) {\n BasicTower t = getBasicTower(mouseY / w, mouseX / w);\n if (t != null) {\n if (t.towerLevel < t.maxTowerLevel) {\n if (player.getCredits() >= t.upgradeCost) {\n t.towerLevel++;\n t.ap = t.ap + 1;\n t.coolDown = t.coolDown - 50;\n\n player.addCredits(-t.upgradeCost);\n }\n }\n upgradePressed = false;\n }\n }\n }\n }\n\n //Upgrade Bomber\n if (loadMap.MAP[mouseY / w][mouseX / w] == 7 && bomberTowers.listIterator().hasNext()) {\n if (upgradePressed) {\n if (input.isMousePressed(0)) {\n BomberTower t = getBomberTower(mouseY / w, mouseX / w);\n if (t != null) {\n if (t.towerLevel < t.maxTowerLevel) {\n if (player.getCredits() >= t.upgradeCost) {\n t.towerLevel++;\n t.attackPower++;\n //t.Radius = t.setRadius();\n t.coolDown = t.coolDown - 300;\n\n player.addCredits(-t.upgradeCost);\n }\n }\n upgradePressed = false;\n }\n }\n }\n }\n\n //Upgrade Quick\n if (loadMap.MAP[mouseY / w][mouseX / w] == 9 && quickTowers.listIterator().hasNext()) {\n if (upgradePressed) {\n if (input.isMousePressed(0)) {\n QuickTower t = getQuickTower(mouseY / w, mouseX / w);\n if (t != null) {\n if (t.towerLevel < t.maxTowerLevel) {\n if (player.getCredits() >= t.upgradeCost) {\n t.towerLevel++;\n t.attackPower++;\n //t.Radius = t.setRadius();\n t.coolDown = t.coolDown - 20;\n\n player.addCredits(-t.upgradeCost);\n }\n }\n upgradePressed = false;\n }\n }\n }\n }\n\n //Upgrade Sniper\n if (loadMap.MAP[mouseY / w][mouseX / w] == 11 && sniperTowers.listIterator().hasNext()) {\n if (upgradePressed) {\n if (input.isMousePressed(0)) {\n SniperTower t = getSniperTower(mouseY / w, mouseX / w);\n if (t != null) {\n if (t.towerLevel < t.maxTowerLevel) {\n if (player.getCredits() >= t.upgradeCost) {\n t.towerLevel++;\n t.attackPower++;\n //t.Radius = t.setRadius();\n t.coolDown = t.coolDown - 500;\n\n player.addCredits(-t.upgradeCost);\n }\n }\n upgradePressed = false;\n }\n }\n }\n }\n\n g.setFont(pauseFont);\n g.setColor(white);\n g.drawString(\"PRESS 'ESC' FOR PAUSE\", 100,8);\n\n }", "public void draw(){\r\n\r\n\t\t\t//frame of house\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.down();\r\n\t\t\tpen.move(250,0);\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen.move(0,300);\r\n\t\t\tpen.move(-250,150);\r\n\t\t\tpen.move(-250,0);\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(250,150);\r\n\t\t\tpen.down();\r\n\t\t\tpen.move(-250,150);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(0,0);\r\n\t\t\tpen.down();\r\n\r\n\t\t\t//door\r\n\t\t\tpen.setColor(Color.blue);\r\n\t\t\tpen.setWidth(10);\r\n\t\t\tpen.move(50,0);\r\n\t\t\tpen.move(50,100);\r\n\t\t\tpen.move(-50,100);\r\n\t\t\tpen.move(-50,0);\r\n\t\t\tpen.move(0,0);\r\n\r\n\t\t\t//windows\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(150,80);\r\n\t\t\tpen.down();\r\n\t\t\tpen.drawCircle(30);\r\n\t\t\tpen.up();\r\n\t\t\tpen.move(-150,80);\r\n\t\t\tpen.down();\r\n\t\t\tpen.drawCircle(30);\r\n\t\t\tpen.up();\r\n\r\n\t\t\t//extra\r\n\t\t\tpen.move(-45,120);\r\n\t\t\tpen.down();\r\n\t\t\tpen.setColor(Color.black);\r\n\t\t\tpen.drawString(\"This is a house\");\r\n\t}", "public void gossipGirl(){\n\t\tfor(Point p: currentPiece){\n\t\t\twell[p.x + pieceOrigin.x][p.y + pieceOrigin.y] = currentColor;\n\t\t}\n\t\trowChecked();\n\n\t\tsetNewPiece();\n\t\tgetNewPiece();\n\t}", "public void drawHealth(Graphics2D g2d) {\t\n\t\tg2d.setColor(new Color(0,0,0,200));\n\t\tint w = StagePanel.boardRectSize;\n\t\tint h = StagePanel.boardRectSize/6;\n\t\tint x = (int)getRectHitbox().getCenterX() - w/2;\n\t\tint y = (int)getRectHitbox().getCenterY() - parentGP.boardRect.getSize()/2;\n\t\t\n\t\tRectangle maxHealthShieldRect = new Rectangle(x, y, w, h);\n\t\tg2d.fill(maxHealthShieldRect);\n\t\tfloat unitHealthSize = (w*(1.0f/(maxHealth+maxShield)));\n\t\tRectangle maxHealthRect = new Rectangle(x,y, (int)(unitHealthSize * health), h);\n\t\tRectangle maxShieldRect = new Rectangle(x+(int)(unitHealthSize * health),y, (int)(unitHealthSize * shield), h);\n\t\tg2d.setColor(Commons.cHealth);\n\t\tg2d.fill(maxHealthRect);\n\t\tg2d.setColor(Commons.cShield);\n\t\tg2d.fill(maxShieldRect);\n\t\tg2d.setStroke(new BasicStroke(3)); \n\t\tg2d.setColor(Color.BLACK);\n\t\tg2d.draw(maxHealthShieldRect);\n\t\tif(parentGP.boardRect == StagePanel.curHoverBR || parentGP == StagePanel.curSelectedGP) {\n\t\t\tdrawHealthValues(g2d, x, y,StagePanel.boardRectSize/5);\n\t\t}\n\t}", "private void drawMap(final Graphics2D theGraphics) {\n for (int y = 0; y < myGrid.length; y++) {\n final int topy = y * SQUARE_SIZE;\n\n for (int x = 0; x < myGrid[y].length; x++) {\n final int leftx = x * SQUARE_SIZE;\n\n switch (myGrid[y][x]) {\n case STREET:\n theGraphics.setPaint(Color.LIGHT_GRAY);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n drawStreetLines(theGraphics, x, y);\n break;\n\n case WALL:\n theGraphics.setPaint(Color.BLACK);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n break;\n\n case TRAIL:\n theGraphics.setPaint(Color.YELLOW.darker().darker());\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n break;\n\n case LIGHT:\n // draw a circle of appropriate color\n theGraphics.setPaint(Color.LIGHT_GRAY);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n theGraphics.setPaint(myLightColor);\n theGraphics.fillOval(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n break;\n \n case CROSSWALK:\n theGraphics.setPaint(Color.LIGHT_GRAY);\n theGraphics.fillRect(leftx, topy, SQUARE_SIZE, SQUARE_SIZE);\n \n drawCrossWalkLines(theGraphics, x, y);\n \n // draw a small circle of appropriate color centered in the square\n theGraphics.setPaint(myLightColor);\n theGraphics.fillOval(leftx + (int) (SQUARE_SIZE * CROSSWALK_SCALE),\n topy + (int) (SQUARE_SIZE * CROSSWALK_SCALE),\n SQUARE_SIZE / 2, SQUARE_SIZE / 2);\n break;\n\n default:\n }\n\n drawDebugInfo(theGraphics, x, y);\n }\n }\n }", "public void show(Graphics g) {\n for (int row = 0; row < grid.length; row++) { //iterate through the array\r\n for (int col = 0; col < grid[0].length; col++) {\r\n if (grid[row][col]==true) //if the value is \"alive\"\r\n {\r\n g.setColor(Color.black); //display black square\r\n } else {\r\n g.setColor(Color.white); //otherwise display white square\r\n }\r\n g.fillRect(col * 5 + 2, row * 5 + 2, 5, 5); // fill the square in\r\n }\r\n }\r\n }", "public void drawRoad(int player, int location, Graphics g){\n\t}", "public void paintComponent(Graphics g)\n {\n super.paintComponent(g);\n\t\t\t//This if statement isolates all conditions in which a square would appear white\n\t\t\t//(and one condition which would make it red). \n if (revealed || (gameLost && ((mine && !flagged) || (!mine && flagged))))\n {\n setBackground(Color.WHITE);\n if (mine || flagged) //All conditions which would show a mine icon.\n {\t\t\t\t\t\t\t//Any flagged square that fit the first if statement must be a falsely flagged\n if (revealed)\t\t//non-mine after the game is lost, so it does fit this category.\n {\n setBackground(Color.RED); //Just for the specific mine that was clicked on to lose the game.\n }\n g.fillOval(SHIFT - 1, SHIFT - 1, \n SQUARE_SIZE - 2*SHIFT + 1, SQUARE_SIZE - 2*SHIFT + 1);\n g.drawLine(SQUARE_SIZE/2, 0, SQUARE_SIZE/2, SQUARE_SIZE);\n g.drawLine(0, SQUARE_SIZE/2, SQUARE_SIZE, SQUARE_SIZE/2);\n g.drawLine(SHIFT, SQUARE_SIZE - SHIFT - 1, SQUARE_SIZE - SHIFT - 1, SHIFT);\n g.drawLine(SHIFT, SHIFT, SQUARE_SIZE - SHIFT - 1, SQUARE_SIZE - SHIFT - 1);\n g.setColor(Color.WHITE);\n g.fillRect(GLARE_LOC, GLARE_LOC, GLARE_SIZE, GLARE_SIZE);\n if (flagged) //Just mistakenly flagged non-mines after the game is lost.\n {\n g.setColor(Color.RED);\n g.drawLine(0, 0, SQUARE_SIZE, SQUARE_SIZE);\n g.drawLine(1, 0, SQUARE_SIZE, SQUARE_SIZE - 1);\n g.drawLine(0, 1, SQUARE_SIZE - 1, SQUARE_SIZE);\n g.drawLine(0, SQUARE_SIZE - 1, SQUARE_SIZE - 1, 0);\n g.drawLine(1, SQUARE_SIZE - 1, SQUARE_SIZE - 1, 1);\n g.drawLine(0, SQUARE_SIZE - 2, SQUARE_SIZE - 2, 0);\n }\n }\n else //Revealed non-mines\n {\n if (adjacentMines != 0)\n {\n g.setColor(COLORS[adjacentMines - 1]);\n Font f = g.getFont();\n g.setFont(new Font(f.getName(), Font.BOLD, f.getSize()));\n g.drawString(\"\" + adjacentMines, \n \t\tSHIFT, SQUARE_SIZE - SHIFT);\n }\n }\n }\n else //Unrevealed\n {\n setBackground(Color.GREEN);\n if (flagged)\n {\n g.fillPolygon(FLAG_BASE_X, FLAG_BASE_Y, FLAG_BASE_X.length);\n g.drawLine(FLAG_BASE_X[2], FLAG_BASE_Y[2], \n \t\tFLAG_BASE_X[2], FLAG_BASE_Y[2] - POLE_LENGTH);\n g.setColor(Color.RED);\n g.fillPolygon(FLAG_X, FLAG_Y, FLAG_X.length);\n }\n }\n }", "public void drawPokemon() {\n setAttackText();\n drawImage();\n }", "private void setInformationToDraw(Player player)\n {\n playerPieceList = player.getPieces();\n\n if (player == antagonistPlayer) {\n x = antagonistLocation[0];\n y = antagonistLocation[1];\n damageToAnnounce = antagonistDamage;\n healthBenefitToAnnounce = antagonistHealthBenefit;\n } else if (player == heroPlayer) {\n x = heroLocation[0];\n y = heroLocation[1];\n damageToAnnounce = heroDamage;\n healthBenefitToAnnounce = heroHealthBenefit;\n } else {\n x = 0;\n y = 0;\n }\n }", "public void drawGrid(Graphics g)\n {\n //g.setColor(Color.GREEN);\n \n \n if(lastpowerUp.equals(\"RAINBOW\") && powerupTimer > 0)\n {\n int x = (int)(Math.random()*250);\n int y = (int)(Math.random()*250);\n int z = (int)(Math.random()*250);\n \n Color randomColor = new Color(x,y,z);\n g.setColor(randomColor); \n \n g.drawLine(150,150,1260,150);\n g.drawLine(150,150,150,630);\n g.drawLine(150,630,1260,630);\n g.drawLine(1260,150,1260,630);\n }\n else\n { \n if(lastpowerUp.equals(\"BLUE\") && powerupTimer > 0)\n {\n Color transGray = new Color(55,55,55);\n g.setColor(transGray); \n } \n else if(difficult.equals(\"GHOST\"))\n g.setColor(Color.WHITE);\n else if(color.equals(\"GREEN\"))\n g.setColor(Color.GREEN); //Green outline\n else if(color.equals(\"BLUE\"))\n g.setColor(Color.BLUE); \n else if(color.equals(\"CYAN\"))\n g.setColor(Color.CYAN); \n else if(color.equals(\"WHITE\"))\n g.setColor(Color.WHITE); \n else if(color.equals(\"GRAY\"))\n g.setColor(Color.GRAY);\n else if(color.equals(\"YELLOW\"))\n g.setColor(Color.YELLOW); \n else if(color.equals(\"MAGENTA\"))\n g.setColor(Color.MAGENTA); \n else if(color.equals(\"ORANGE\"))\n g.setColor(Color.ORANGE); \n else if(color.equals(\"PINK\"))\n g.setColor(Color.PINK); \n else if(color.equals(\"RED\"))\n g.setColor(Color.RED); \n \n \n g.drawLine(150,150,1260,150);\n g.drawLine(150,150,150,630);\n g.drawLine(150,630,1260,630);\n g.drawLine(1260,150,1260,630);\n }\n }", "public void draw()\n\t{\n\t\tdrawWalls();\n\n\t\tfor( Zombie z: zombies )\n\t\t{\n\t\t\tz.draw();\n\t\t}\n\t\tfor( Entity h: humans )\n\t\t{\n\t\t\th.draw();\n\t\t}\n\n\t\tdp.repaintAndSleep(rate);\n\t}", "public void draw()\n {\n canvas.setForegroundColor(color);\n canvas.fillCircle(xPosition, yPosition, diameter);\n }", "public void render() {\n hudCamera.update();\n hudBatch.setProjectionMatrix(hudCamera.combined);\n\n hudBatch.begin();\n if (gameWorld.getHero() != null) {\n drawHealthPoints();\n drawInventory();\n }\n Chest openChest = findOpenChest();\n if (openChest != null) {\n drawOpenChest();\n if (Gdx.input.isTouched()) {\n checkOpenChestInput(openChest);\n }\n }\n hudBatch.end();\n }", "public void drawGameCompleteScreen() {\r\n PennDraw.clear();\r\n\r\n if (didPlayerWin()) {\r\n PennDraw.text(width / 2, height / 2, \"You Win!\");\r\n } else if (didPlayerLose()) {\r\n PennDraw.text(width / 2, height / 2, \"You have lost...\");\r\n }\r\n\r\n PennDraw.advance();\r\n }", "private void drawHealthPoints() {\n int i = 0;\n for (; i < Math.floor(gameWorld.getHero().getHealthPoints()); i++) {\n hudBatch.draw(heartFull, i * HEART_SIZE, VIRTUAL_HEIGHT - HEART_SIZE, HEART_SIZE, HEART_SIZE);\n }\n if (gameWorld.getHero().getHealthPoints() % 1 != 0) {\n hudBatch.draw(heartHalf, i++ * HEART_SIZE, VIRTUAL_HEIGHT - HEART_SIZE, HEART_SIZE, HEART_SIZE);\n }\n for (; i < gameWorld.getHero().getMaxHealthPoints(); i++) {\n hudBatch.draw(heartEmpty, i * HEART_SIZE, VIRTUAL_HEIGHT - HEART_SIZE, HEART_SIZE, HEART_SIZE);\n }\n }", "private void battleTickStatuses(){\n updateStatuses(battleEnemies);\n updateStatuses(battleAllies);\n }", "@Override\n\t\tprotected void paintComponent(Graphics g) {\n\t\t\tsuper.paintComponent(g);\n\t\t\tGraphics2D ga = (Graphics2D) g; \n\t\t\tif (currentColor == color) {\n\t\t\t\tShape check = factory.getShape(ShapeFactory.CHECK);\n\t\t\t\tcheck.setPosition(new Point2D.Double(point.getX() + getPreferredSize().width/2 - 7, point.getY()+ 25));\n\t\t\t\tga.setColor(currentColor);\n\t\t\t\tcheck.draw(ga);\n\t\t\t}\n\t\t}", "public void draw(Graphics g){\n int x = (int) super.getLocation().getX();\n int y = (int) super.getLocation().getY();\n if(nunMissiles > 0) { //will draw battery as 'active'\n g.setColor(this.color);\n g.fillRect(x, y, 180, 50);\n } else { //if the battery is out of missiles, it will be a grey box\n g.setColor(new Color(131, 131, 131));\n g.drawRect(x, y, 180, 50);\n }\n //drawing the number of missiles the battery has\n String numMis =\"\"+ nunMissiles;\n g.setColor(Color.white);\n Font currentFont = g.getFont();\n Font newFont = currentFont.deriveFont(currentFont.getSize() + 5);\n g.setFont(newFont);\n g.drawString(numMis, x + 90, y + 25);\n }", "public void draw() {\n\t\tSystem.out.println(getMessageSource().getMessage(\"greeting2\", null, null));\r\n\r\n\t\tSystem.out.println(getMessageSource().getMessage(\"drawing.circle\", null, null));\r\n\t\tSystem.out.println(\"Center's Coordinates: (\" + getCenter().getX() + \", \" + getCenter().getY() + \")\");\r\n\t\tSystem.out.println(getMessageSource().getMessage(\"drawing.center\",\r\n\t\t\t\tnew Object[] { getCenter().getX(), getCenter().getY() }, \"Default point coordinates msg\", null));\r\n\t}", "public Individual(Simulation world) {\n\t\tmoving = new Moving(this);\n\t\tinConversation = new InConversation(this);\n\t\tinHospital = new InHospital(this);\n\t\tdead = new Dead(this);\n\t\tcurrentState = moving;\n\t\tspeed = random.nextInt(25)+1;\n\t\txSpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed * Math.cos(Math.PI/4));\n\t\tySpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed * Math.cos(Math.PI/4));\n\t\tsocialDistance = random.nextInt(10);\n\t\tconversationTime = random.nextInt(5) + 1;\n\t\tdouble[] maskChoice = {0.2, 1};\n\t\tmaskIndicator = maskChoice[random.nextInt(2)];\n\t\tindividualSize = 5;\n\t\thealthStatus = HealthStatus.HEALTHY;\n\t\tthis.world = world;\n\t\tx = random.nextInt(world.getSIMULATION_WIDTH() - individualSize);\n\t\ty = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize);\n\t\ttimerList = new ArrayList<>();\n\t\t\n\t\thospitalNeed = new Thread(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tworld.getHospital().acceptIndividual();\n\t\t\t\t\tsynchronized (this) {\n\t\t\t\t\t\tcurrentState.goHospital();\n\t\t\t\t\t}\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\t\n\t\t\t}\n\t\t});\n\t\tworld.healthy();\n\t}", "public void paintEntityGui(Entity entity, Graphics graphics, Camera camera, Minimap minimap)\r\n\t{\t\r\n\t\tif(entity.getFaction() == EntityConfiguration.PLAYER_FACTION)\r\n\t\t{\r\n\t\t\tgraphics.setColor(Color.green);\r\n\t\t}\r\n\t\telse if(entity.getFaction() == EntityConfiguration.BOT_FACTION)\r\n\t\t{\r\n\t\t\tgraphics.setColor(Color.red);\r\n\t\t}\r\n\t\telse if(entity.getId() == EntityConfiguration.RESSOURCE)\r\n\t\t{\r\n\t\t\tgraphics.setColor(Color.yellow);\r\n\t\t}\r\n\t\tgraphics.fillRect(entity.getPosition().getX() / GameConfiguration.TILE_SIZE * minimap.getGridMapWidth() + minimap.getFirstGridXOfMap(), \r\n\t\t\t\tentity.getPosition().getY() / GameConfiguration.TILE_SIZE * minimap.getGridMapHeight() + minimap.getFirstGridYOfMap(), \r\n\t\t\t\tminimap.getGridMapWidth(), minimap.getGridMapHeight());\r\n\t}", "public void draw() {\r\n\t\tif (active_)\r\n\t\t\tGlobals.getInstance().getCamera().drawImageOnHud(posx_, posy_, currentImage());\r\n\t}", "public void paint(Graphics g)\n\t\t{\n\t\t\t\n\t\t\tif (!gameStarted)\n\t\t\t\ttown.show (g); //when the game first starts draws the map\n//\t\t\ttown.show(g);\n//\t\t\ttestPlayer.show(g);\n//\t\t\thouse1.show (g);\n//\t\t\thome.show (g);\n//\t\t\thouse2.show (g);\n//\t\t\tpokecentre.show (g);\n//\t\t\toakLab.show(g);\n\t\t}", "public void render(Graphics g) {\n\t\tg.setColor(Color.MAGENTA);\n\t\tg.fillRect(x, y, 50, 50);\n\t\t\n\t\tg.setColor(Color.white);\n\t\tg.drawRect(x, y, 50, 50);\n\t\t\n\t\tg.setColor(Color.gray);\n\t\tg.fillRect(x, y - 10, 50, 2);\n\t\t\n\t\tg.setColor(Color.red);\n\t\tg.fillRect(x, y - 10, bossHealth, 2);\n\t}", "public void draw(float dt, Graphics g) {\n\t\t// Graphics.gl.glTranslatef(-.25f * Values.RESOLUTIONS[Values.X], -.25f\n\t\t// * Values.RESOLUTIONS[Values.Y], 1);\n\t\t// super.drawNew(g);\n\t\tg.setColor(1);\n\t\tsynchronized (this) {\n\t\t\tdrawBottom(dt, g);\n\t\t\tdrawTop(dt, g, sprites);\n\t\t}\n\t\t// if (Math.random() < .01f) {\n\t\t// color[3] = 0;\n\t\t// }\n\t\t// if (color[3] <= .5f) {\n\t\t// color[3]+=.08f;\n\t\t// g.fadeOldSchoolColorWhite(1, .9f, 0, .3f - color[3]);\n\t\t// } else {\n\t\t// g.fadeOldSchoolColor(color[0], color[1], color[2], color[3]);\n\t\t// }\n\t\tsuper.checkMenu();\n\t\tsuper.draw(dt, g);\n\t}", "public void draw() {\n mGameBoard.draw();\n }", "public void draw(ShapeRenderer renderer){\n\n\t\tfor (int x = 0; x < MAP_WIDTH; x++) {\n\t\t\tfor (int y = 0; y<MAP_HEIGTH;y++){\n\t\t\t\tif (currentLevel.getLevelMap().isFilled(x, y)) {\n\t\t\t\t\trenderer.setColor(Color.TEAL);\n\t\t\t\t\trenderer.begin(ShapeType.Line);\n\t\t\t\t\t\trenderer.rect(X_OFFSET*TILE_SIZE+x*TILE_SIZE,Y_OFFSET*TILE_SIZE+y*TILE_SIZE,TILE_SIZE,TILE_SIZE);\t\n\t\t\t\t\trenderer.end();\n\t\t\t\t}else{\n\t\t\t\t\trenderer.begin(ShapeType.Filled);\n\t\t\t\t\trenderer.rect(X_OFFSET*TILE_SIZE+x*TILE_SIZE,Y_OFFSET*TILE_SIZE+y*TILE_SIZE,TILE_SIZE,TILE_SIZE);\n\t\t\t\t\trenderer.end();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "public void notifyGameOn() {\n this.myStatusString.setText(\"Game is On\");\n final LineBorder line = new LineBorder(Color.GREEN, 2, true);\n this.myStatusString.setBorder(line);\n this.myStatusString.setForeground(Color.GREEN);\n this.myStatusString.setFont(new Font(FONT_TIMES, Font.BOLD, NUM_FONT_SIZE)); \n }", "public static void newGame(boolean humanChecker,boolean whoTurn, boolean computerColor) {\n\t\tG=new gamePlay();\n\t\tnumRed=0;\n\t\tnumBlue=0;\n\t\t\n\t\t\n\t\tdouble value = Math.random();\n\t\tFont font = new Font(\"Sans Serif\", 20, 20);\n\t\tStdDraw.setFont(font);\n\t\t\n\t\twhosFirst = true;\n\t\tif (value < 0.5) {\n\t\t\tStdDraw.text(500, 950, \"Blue Player goes first!\");\n\t\t\tif(computerColor){\n\t\t\t\twhoTurn=true;\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhoTurn=false;\n\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\tStdDraw.text(500, 950, \"Red Player goes first!\");\n\t\t\tif(computerColor){\n\t\t\t\twhoTurn=false;\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhoTurn=true;\n\t\t\t\t\n\t\t\t}\n\t\t\twhosFirst = false;\n\t\t}\n\t\t\n\t\tStdDraw.text(500, 100, \"Please click on the location that you wish to place your piece.\");\n\t\t\n\t\t//creating objects to represent each piece that you are playing with\n\t\tpieceArray = new PlayerPiece[12];\n\t\tfor (int i = 0; i < 12; i++) {\n\t\t\tif (i < 6) {\n\t\t\t\tpieceArray[i] = new PlayerPiece(\"BLUE\", i + 1);\n\t\t\t} else {\n\t\t\t\tpieceArray[i] = new PlayerPiece(\"RED\", i + 1);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//creating objects to represent each location on the game board\n\t\tspots = new moveLocations[17];\n\t\tspots[0] = new moveLocations(165, 235, 765, 835);\n\t\tspots[1] = new moveLocations(465, 535, 765, 835);\n\t\tspots[2] = new moveLocations(765, 835, 765, 835);\n\t\tspots[3] = new moveLocations(765, 835, 465, 535);\n\t\tspots[4] = new moveLocations(765, 835, 165, 235);\n\t\tspots[5] = new moveLocations(465, 535, 165, 235);\n\t\tspots[6] = new moveLocations(165, 235, 165, 235);\n\t\tspots[7] = new moveLocations(165, 235, 465, 535);\n\t\tspots[8] = new moveLocations(315, 385, 615, 685);\n\t\tspots[9] = new moveLocations(465, 535, 615, 685);\n\t\tspots[10] = new moveLocations(615, 685, 615, 685);\n\t\tspots[11] = new moveLocations(615, 685, 465, 535);\n\t\tspots[12] = new moveLocations(615, 685, 315, 385);\n\t\tspots[13] = new moveLocations(465, 535, 315, 385);\n\t\tspots[14] = new moveLocations(315, 385, 315, 385);\n\t\tspots[15] = new moveLocations(315, 385, 465, 535);\n\t\tspots[16] = new moveLocations(1000, 2000, 1000, 2000);\n\t\t\n\t\t\n\t\tif(humanChecker){\n\t\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\t\t\t\n\t\t\tif(computerColor){\n\t\t\t\t\n\t\t\t\tStdDraw.text(80, 820, \"Computer\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\n\t\t\t\tStdDraw.text(920, 820, \"Computer\");\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tint j = 0;\n\t\tint num1 = 700;\n\t\tint num2 = 700;\n\t\t\n\t\tboolean mouseClicked = false;\n\t\tboolean mouseClicked1 = false;\n\t\tboolean boolVal = true;\n\t\tboolean boolVal2 = true;\n\t\tdouble xLocation = 0;\n\t\tdouble yLocation = 0;\n\t\tdouble xLocation1 = 0;\n\t\tdouble yLocation1 = 0;\n\t\tint countBlue=0;\n\t\tint countRed=6;\n\t\tboolean turn=true;\n\t\tboolean fixingTurn=false;\n\t\t//Main while loop for 12 turns\n\t\t//setting up the game board when the user clicks new game\n\t\twhile (j < 12) {\n\t\t\t\n\t\t\t//all the if's and else if's were designed in assignment 1 to represent where a player can put there piece\n\t\t\t//we realize that this is a very inefficient way of coding although it does work\n\t\t\t//This class is designed for setting up the board with the first moves\n\t\t\t//the rest of the game is in the gamePlay class\n\t\t\t//we made the gamePlay class for assignment 2 and we made sure to modularize it\n\t\t\t//we also reduced the conditional statements to make the code easier to read and improve efficiency\n\t\t\tif (j == 1) {\n\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\tStdDraw.filledRectangle(500, 950, 400, 50);\n\t\t\t}\n\t\t\tif(whoTurn&&humanChecker){\n\t\t\t\tComputerMove moving=new ComputerMove();\n\t\t\t\tif(computerColor){\n\t\t\t\t\tmoving.placeAIPiece(countBlue);\n\t\t\t\t\t\n\t\t\t\t\tcountBlue++;\n\t\t\t\t\tnumBlue++;\n\t\t\t\t\tif(fixingTurn){\n\t\t\t\t\t\tfixingTurn=false;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfixingTurn=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tmoving.placeAIPiece(countRed);\n\t\t\t\t\t\n\t\t\t\t\tcountRed++;\n\t\t\t\t\tnumRed++;\n\t\t\t\t\tif(fixingTurn){\n\t\t\t\t\t\tfixingTurn=false;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfixingTurn=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\tif (j % 2 == 0) {// first\n\t\t\t\tif (whosFirst) {// blue goes first\n\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\tStdDraw.filledRectangle(900, 900, 100, 50);\n\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\t\t\t\t\tStdDraw.text(100, 900, \"Blue's Turn!\");\n\t\t\t\t\tfixingTurn=true;\n\t\t\t\t\twhile (boolVal) {\n\n\t\t\t\t\t\tmouseClicked = StdDraw.mousePressed();\n\t\t\t\t\t\txLocation = StdDraw.mouseX();\n\t\t\t\t\t\tyLocation = StdDraw.mouseY();\n\t\t\t\t\t\tif (!spots[0].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[0].getMinX(), spots[0].getMaxX(), spots[0].getMinY(), spots[0].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 800, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[0].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(0);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[1].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[1].getMinX(), spots[1].getMaxX(), spots[1].getMinY(), spots[1].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 800, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[1].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[2].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[2].getMinX(), spots[2].getMaxX(), spots[2].getMinY(), spots[2].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 800, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[2].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[3].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[3].getMinX(), spots[3].getMaxX(), spots[3].getMinY(), spots[3].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 500, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[3].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(3);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[4].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[4].getMinX(), spots[4].getMaxX(), spots[4].getMinY(), spots[4].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 200, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[4].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(4);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[5].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[5].getMinX(), spots[5].getMaxX(), spots[5].getMinY(), spots[5].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 200, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[5].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(5);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[6].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[6].getMinX(), spots[6].getMaxX(), spots[6].getMinY(), spots[6].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 200, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[6].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(6);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[7].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[7].getMinX(), spots[7].getMaxX(), spots[7].getMinY(), spots[7].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 500, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[7].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(7);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[8].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[8].getMinX(), spots[8].getMaxX(), spots[8].getMinY(), spots[8].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 650, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[8].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(8);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[9].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[9].getMinX(), spots[9].getMaxX(), spots[9].getMinY(), spots[9].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 650, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[9].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(9);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[10].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[10].getMinX(), spots[10].getMaxX(), spots[10].getMinY(), spots[10].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 650, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[10].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(10);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[11].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[11].getMinX(), spots[11].getMaxX(), spots[11].getMinY(), spots[11].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 500, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[11].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(11);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[12].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[12].getMinX(), spots[12].getMaxX(), spots[12].getMinY(), spots[12].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 350, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[12].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(12);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[13].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[13].getMinX(), spots[13].getMaxX(), spots[13].getMinY(), spots[13].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 350, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[13].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(13);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[14].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[14].getMinX(), spots[14].getMaxX(), spots[14].getMinY(), spots[14].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 350, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[14].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(14);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[15].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[15].getMinX(), spots[15].getMaxX(), spots[15].getMinY(), spots[15].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 500, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[15].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(15);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t}\n\t\t\t\t\tcountBlue++;\n\t\t\t\t\tnumBlue++;\n\t\t\t\t} else {\n\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\tStdDraw.filledRectangle(100, 900, 100, 50);\n\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\t\t\t\t\tStdDraw.text(900, 900, \"Red's Turn!\");//this is for red's turn assuming blue got to go first\n\t\t\t\t\tfixingTurn=false;\n\t\t\t\t\t//all the conditions below on where red can put their piece\n\t\t\t\t\twhile (boolVal2) {\n\t\t\t\t\t\tmouseClicked = StdDraw.mousePressed();\n\t\t\t\t\t\txLocation = StdDraw.mouseX();\n\n\t\t\t\t\t\tyLocation = StdDraw.mouseY();\n\t\t\t\t\t\tif (!spots[0].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[0].getMinX(), spots[0].getMaxX(), spots[0].getMinY(), spots[0].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 800, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[0].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(0);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[1].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[1].getMinX(), spots[1].getMaxX(), spots[1].getMinY(), spots[1].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 800, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[1].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[2].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[2].getMinX(), spots[2].getMaxX(), spots[2].getMinY(), spots[2].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 800, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[2].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[3].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[3].getMinX(), spots[3].getMaxX(), spots[3].getMinY(), spots[3].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 500, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[3].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(3);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if (!spots[4].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[4].getMinX(), spots[4].getMaxX(), spots[4].getMinY(), spots[4].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 200, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[4].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(4);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[5].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[5].getMinX(), spots[5].getMaxX(), spots[5].getMinY(), spots[5].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 200, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[5].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(5);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[6].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[6].getMinX(), spots[6].getMaxX(), spots[6].getMinY(), spots[6].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 200, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[6].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(6);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[7].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[7].getMinX(), spots[7].getMaxX(), spots[7].getMinY(), spots[7].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 500, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[7].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(7);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[8].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[8].getMinX(), spots[8].getMaxX(), spots[8].getMinY(), spots[8].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 650, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[8].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(8);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[9].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[9].getMinX(), spots[9].getMaxX(), spots[9].getMinY(), spots[9].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 650, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[9].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(9);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[10].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[10].getMinX(), spots[10].getMaxX(), spots[10].getMinY(), spots[10].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 650, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[10].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(10);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[11].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[11].getMinX(), spots[11].getMaxX(), spots[11].getMinY(), spots[11].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 500, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[11].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(11);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[12].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[12].getMinX(), spots[12].getMaxX(), spots[12].getMinY(), spots[12].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 350, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[12].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(12);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[13].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[13].getMinX(), spots[13].getMaxX(), spots[13].getMinY(), spots[13].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 350, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[13].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(13);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[14].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[14].getMinX(), spots[14].getMaxX(), spots[14].getMinY(), spots[14].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 350, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[14].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(14);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[15].checkOccupied() && mouseClicked && mouseInRange(xLocation, yLocation,\n\t\t\t\t\t\t\t\tspots[15].getMinX(), spots[15].getMaxX(), spots[15].getMinY(), spots[15].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 500, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation = 0;\n\t\t\t\t\t\t\tyLocation = 0;\n\t\t\t\t\t\t\tmouseClicked = false;\n\t\t\t\t\t\t\tspots[15].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(15);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcountRed++;\n\t\t\t\t\tnumRed++;\n\t\t\t\t}\n\n\t\t\t} else {// second\n\t\t\t\tif (!whosFirst) {// if blue does not get to go first, these are for blue's moves\n\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\tStdDraw.filledRectangle(900, 900, 100, 50);\n\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\t\t\t\t\tStdDraw.text(100, 900, \"Blue's Turn!\");\n\t\t\t\t\tfixingTurn=true;\n\t\t\t\t\twhile (boolVal) {\n\t\t\t\t\t\tmouseClicked1 = StdDraw.mousePressed();\n\t\t\t\t\t\txLocation1 = StdDraw.mouseX();\n\t\t\t\t\t\tyLocation1 = StdDraw.mouseY();\n\n\t\t\t\t\t\tif (!spots[0].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[0].getMinX(), spots[0].getMaxX(), spots[0].getMinY(), spots[0].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 800, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[0].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(0);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[1].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[1].getMinX(), spots[1].getMaxX(), spots[1].getMinY(), spots[1].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 800, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[1].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[2].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[2].getMinX(), spots[2].getMaxX(), spots[2].getMinY(), spots[2].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 800, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[2].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[3].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[3].getMinX(), spots[3].getMaxX(), spots[3].getMinY(), spots[3].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 500, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[3].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(3);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[4].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[4].getMinX(), spots[4].getMaxX(), spots[4].getMinY(), spots[4].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 200, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[4].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(4);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[5].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[5].getMinX(), spots[5].getMaxX(), spots[5].getMinY(), spots[5].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 200, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[5].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(5);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[6].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[6].getMinX(), spots[6].getMaxX(), spots[6].getMinY(), spots[6].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 200, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[6].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(6);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[7].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[7].getMinX(), spots[7].getMaxX(), spots[7].getMinY(), spots[7].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 500, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[7].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(7);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[8].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[8].getMinX(), spots[8].getMaxX(), spots[8].getMinY(), spots[8].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 650, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[8].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(8);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[9].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[9].getMinX(), spots[9].getMaxX(), spots[9].getMinY(), spots[9].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 650, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[9].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(9);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[10].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[10].getMinX(), spots[10].getMaxX(), spots[10].getMinY(), spots[10].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 650, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[10].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(10);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[11].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[11].getMinX(), spots[11].getMaxX(), spots[11].getMinY(), spots[11].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 500, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[11].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(11);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[12].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[12].getMinX(), spots[12].getMaxX(), spots[12].getMinY(), spots[12].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 350, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[12].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(12);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[13].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[13].getMinX(), spots[13].getMaxX(), spots[13].getMinY(), spots[13].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 350, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[13].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(13);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[14].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[14].getMinX(), spots[14].getMaxX(), spots[14].getMinY(), spots[14].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 350, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[14].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(14);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[15].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[15].getMinX(), spots[15].getMaxX(), spots[15].getMinY(), spots[15].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(80, num1, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 500, 35);\n\t\t\t\t\t\t\tnum1 -= 100;\n\t\t\t\t\t\t\tboolVal = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[15].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countBlue].changePiecePosition(15);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcountBlue++;\n\t\t\t\t\tnumBlue++;\n\t\t\t\t\t\n\t\t\t\t} else {//finally this is for if red gets to go first\n\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\tStdDraw.filledRectangle(100, 900, 100, 50);\n\t\t\t\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\t\t\t\t\tStdDraw.text(900, 900, \"Red's Turn!\");\n\t\t\t\t\tfixingTurn=false;\n\t\t\t\t\twhile (boolVal2) {\n\n\t\t\t\t\t\tmouseClicked1 = StdDraw.mousePressed();\n\n\t\t\t\t\t\txLocation1 = StdDraw.mouseX();\n\t\t\t\t\t\tyLocation1 = StdDraw.mouseY();\n\t\t\t\t\t\tif (!spots[0].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[0].getMinX(), spots[0].getMaxX(), spots[0].getMinY(), spots[0].getMaxY())) {\n\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 800, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[0].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(0);\n\t\t\t\t\t\t} else if (!spots[1].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[1].getMinX(), spots[1].getMaxX(), spots[1].getMinY(), spots[1].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 800, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[1].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[2].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[2].getMinX(), spots[2].getMaxX(), spots[2].getMinY(), spots[2].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 800, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[2].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[3].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[3].getMinX(), spots[3].getMaxX(), spots[3].getMinY(), spots[3].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 500, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[3].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(3);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if (!spots[4].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[4].getMinX(), spots[4].getMaxX(), spots[4].getMinY(), spots[4].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(800, 200, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[4].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(4);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[5].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[5].getMinX(), spots[5].getMaxX(), spots[5].getMinY(), spots[5].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 200, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[5].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(5);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[6].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[6].getMinX(), spots[6].getMaxX(), spots[6].getMinY(), spots[6].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 200, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[6].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(6);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[7].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[7].getMinX(), spots[7].getMaxX(), spots[7].getMinY(), spots[7].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(200, 500, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[7].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(7);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[8].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[8].getMinX(), spots[8].getMaxX(), spots[8].getMinY(), spots[8].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 650, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[8].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(8);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[9].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[9].getMinX(), spots[9].getMaxX(), spots[9].getMinY(), spots[9].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 650, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[9].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(9);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[10].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[10].getMinX(), spots[10].getMaxX(), spots[10].getMinY(), spots[10].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 650, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[10].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(10);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[11].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[11].getMinX(), spots[11].getMaxX(), spots[11].getMinY(), spots[11].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 500, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[11].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(11);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[12].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[12].getMinX(), spots[12].getMaxX(), spots[12].getMinY(), spots[12].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(650, 350, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[12].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(12);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[13].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[13].getMinX(), spots[13].getMaxX(), spots[13].getMinY(), spots[13].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(500, 350, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[13].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(13);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[14].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[14].getMinX(), spots[14].getMaxX(), spots[14].getMinY(), spots[14].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 350, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[14].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(14);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if (!spots[15].checkOccupied() && mouseClicked1 && mouseInRange(xLocation1, yLocation1,\n\t\t\t\t\t\t\t\tspots[15].getMinX(), spots[15].getMaxX(), spots[15].getMinY(), spots[15].getMaxY())) {\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\t\t\t\t\t\tStdDraw.filledCircle(920, num2, 35);\n\t\t\t\t\t\t\tStdDraw.setPenColor(StdDraw.RED);\n\t\t\t\t\t\t\tStdDraw.filledCircle(350, 500, 35);\n\t\t\t\t\t\t\tnum2 -= 100;\n\t\t\t\t\t\t\tboolVal2 = false;\n\t\t\t\t\t\t\txLocation1 = 0;\n\t\t\t\t\t\t\tyLocation1 = 0;\n\t\t\t\t\t\t\tmouseClicked1 = false;\n\t\t\t\t\t\t\tspots[15].changeOccupied();\n\t\t\t\t\t\t\tpieceArray[countRed].changePiecePosition(15);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcountRed++;\n\t\t\t\t\tnumRed++;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t//after each piece is placed on the game board, the piece is enabled so that it can be used later in the game\n\t\t\tif((j%2==0&&!whosFirst)||(j%2==1&&whosFirst)){\n\t\t\t\tpieceArray[countRed-1].changeEnabled();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpieceArray[countBlue-1].changeEnabled();\n\t\t\t}\n\t\t\tj++;\n\t\t\t\n\t\t\t\n\t\t\tboolVal = true;\n\t\t\tboolVal2 = true;\n\t\t\tint pieces=6;\n\t\t\tif((j%2==0&&!whosFirst)||(j%2==1&&whosFirst)){\n\t\t\t\tpieces=0;\n\t\t\t}\n\t\t\t//checking for mills in the set up of new game\n\t\t\tif(j>=0){\n\t\t\t\t\n\t\t\t\tG.millBoard(pieces,numBlue,numRed,fixingTurn,value,humanChecker,computerColor);//to deal with a mill\n\t\t\t\tG.resetMill();//to reset previous mills if they are not left in a line\n\t\t\t\t//prevents a player from getting a mill each turn for not moving their line of 3\n\t\t\t}\n\t\t\tif(humanChecker){\n\t\t\t\tif(j==1&&!whoTurn){\n\t\t\t\t\tG.turnButton();//button created in the gamePlay class to help prevent double clicking\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(humanChecker){\n\t\t\t\tif(j!=1&& !whoTurn){\n\t\t\t\t\tG.turnButton();//button created in the gamePlay class to help prevent double clicking\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!humanChecker){\t\n\t\t\t\tG.turnButton();//button created in the gamePlay class to help prevent double clicking\n\t\t\t\t\n\t\t\t}\n\t\t\tif(turn){\n\t\t\t\tturn=false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tturn=true;\n\t\t\t}\n\t\t\t\n\t\t\tif(whoTurn){\n\t\t\t\twhoTurn=false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhoTurn=true;\n\t\t\t}\n\t\t}\n\t\tStdDraw.setPenColor(StdDraw.BOOK_LIGHT_BLUE);\n\t\tStdDraw.filledRectangle(500, 100, 500, 50);\n\t\tStdDraw.setPenColor(StdDraw.BLACK);\n\t\tStdDraw.text(500, 130, \"Piece Placement Complete!\");\n\t\tmouseClicked=false;\n\t\tmouseClicked1=false;\n\t\tboolean fixer=true;\n\t\tif(humanChecker){\n\t\t\tfixer=whoTurn;\n\t\t}\n\t\tG.createGame(numRed,numBlue,humanChecker,fixer,computerColor,\"new\");//calls on the gamePlay.createGame method which allows the user to play the game until one player wins\n\t}", "public void draw()\r\n {\r\n drawn = true;\r\n }", "public void draw() {\n p.pushMatrix(); // save old visual style for other sprites\n p.translate(pos.x, pos.y); \n if (localpen) p.image(pen.get(0,0,p.width,p.height),p.width/2-pos.x, p.height/2-pos.y);\n if (visible) {\n // locked left-right rotation\n if (((direction%360<=270) & (direction%360>=90)) & rotationStyle==rotationStyle_leftRight) p.scale(-1.0f,1.0f);\n if (rotationStyle==rotationStyle_allAround) p.rotate(p.radians(-direction));\n if (ghostEffect > 0) {\n int calculatedAlpha = (int)p.map(ghostEffect,100,0,0,255);\n \n int[] alpha = new int[costumes.get(costumeNumber).width*costumes.get(costumeNumber).height];\n for (int i=0; i<alpha.length; i++) {\n // only fade non-zero pixels; 0 is full-transparency\n if (costumes.get(costumeNumber).pixels[i]!=0) alpha[i]=calculatedAlpha;\n }\n costumes.get(costumeNumber).mask(alpha);\n }\n p.image(costumes.get(costumeNumber), 0, 0, costumes.get(costumeNumber).width*(size/100),\n costumes.get(costumeNumber).height*(size/100));\n }\n p.popMatrix(); // restore default visual style\n }", "public static void drawStats(Graphics g, Entity entity, PixelPoint position, GraphicsFactory graphicsFactory){\n g.drawRect(position.x, position.y-PixelMap.MARGIN, (int)(PixelMap.TILE_WIDTH*3.5), (int)(PixelMap.AFTER_SPACE*3.5));\n\n BufferedImage icon = graphicsFactory.getGraphics(GraphicsFactory.ATTACK_ICON);\n OptionDrawer.drawOption(g, new PixelPoint(position.x+PixelMap.TILE_WIDTH/2, position.y), icon, entity.getAttack()+\"\");\n icon = graphicsFactory.getGraphics(GraphicsFactory.DEFENSE_ICON);\n OptionDrawer.drawOption(g, new PixelPoint(position.x+PixelMap.TILE_WIDTH/2, position.y+PixelMap.AFTER_SPACE), icon, entity.getDefense()+\"\");\n icon = graphicsFactory.getGraphics(GraphicsFactory.ARMOR_ICON);\n OptionDrawer.drawOption(g, new PixelPoint(position.x+PixelMap.TILE_WIDTH/2, position.y+PixelMap.AFTER_SPACE*2), icon, entity.getArmor()+\"\");\n\n icon = graphicsFactory.getGraphics(GraphicsFactory.RANGE_ICON);\n OptionDrawer.drawOption(g, new PixelPoint((int)(position.x+PixelMap.TILE_WIDTH*1.5), position.y), icon, entity.getRangeRadius()+\"\");\n icon = graphicsFactory.getGraphics(GraphicsFactory.MOVEMENT_ICON);\n OptionDrawer.drawOption(g, new PixelPoint((int)(position.x+PixelMap.TILE_WIDTH*1.5), position.y+PixelMap.AFTER_SPACE), icon, entity.getMovement()+\"\");\n icon = graphicsFactory.getGraphics(GraphicsFactory.VISION_ICON);\n OptionDrawer.drawOption(g, new PixelPoint((int)(position.x+PixelMap.TILE_WIDTH*1.5), position.y+PixelMap.AFTER_SPACE*2), icon, entity.getVisibilityRadius()+\"\");\n\n icon = graphicsFactory.getGraphics(GraphicsFactory.HEALTH_ICON);\n OptionDrawer.drawOption(g, new PixelPoint((int)(position.x+PixelMap.TILE_WIDTH*2.5), position.y), icon, entity.getMaxHealth()+\"\");\n icon = graphicsFactory.getGraphics(GraphicsFactory.UPKEEP_ICON);\n OptionDrawer.drawOption(g, new PixelPoint((int)(position.x+PixelMap.TILE_WIDTH*2.5), position.y+PixelMap.AFTER_SPACE), icon, entity.getUpkeep()+\"\");\n }", "@Override\n public void render() {\n if (!gameOver && !youWin) this.update();\n\n //Dibujamos\n this.draw();\n }", "void drawBuilding() {\r\n\t\tgc.setFill(Color.BEIGE);\r\n\t\tgc.fillRect(0, 0, theBuilding.getXSize(), theBuilding.getYSize()); // clear the canvas\r\n\t\ttheBuilding.showBuilding(this); // draw all items\r\n\r\n\t\tString s = theBuilding.toString();\r\n\t\trtPane.getChildren().clear(); // clear rtpane\r\n\t\tLabel l = new Label(s); // turn string to label\r\n\t\trtPane.getChildren().add(l); // add label\r\n\r\n\t}", "void drawCurrentToBoard () {\n board.clearTemp();\n for (int r = 0; r < currentPiece.height; ++r)\n for (int c = 0; c < currentPiece.width; ++c)\n if (currentPiece.blocks[r][c] == 1)\n board.addBlock(new Block(currentPiece.color), r + currentRow, c + currentColumn);\n }", "@Override\r\n\tpublic void update(Graphics2D g) {\n\t\tif(gameOver)\r\n\t\t{\r\n\t\t\tg.setColor(Color.black);\r\n\t\t\tg.fillRect(0, 0, 300, 50);\r\n\t\t\tg.setColor(Color.white);\r\n\t\t\tg.drawString(\"Game Over\", 10, 20);\r\n\t\t\tg.drawString(\"Round \" + roundNum, 10, 30);\r\n\t\t\tg.drawString(\"Size \" + sizeNum, 10, 40);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tg.setColor(Color.green);\r\n\t\t\tg.fillRect(0, 0, 300, 50);\r\n\t\t\tg.setColor(Color.black);\r\n\t\t\tg.drawString(\"Round \" + roundNum, 10, 30);\r\n\t\t\tg.drawString(\"Size \" + sizeNum, 10, 40);\r\n\t\t}\r\n\t\t\r\n\t}", "private void draw()\n {\n if(surfaceHolder.getSurface().isValid())\n {\n // Locks the surface. Can't be accessed or changed before it is unlocked again\n canvas = surfaceHolder.lockCanvas();\n\n // Background color\n canvas.drawColor(Color.BLACK);\n\n\n // ===================== DRAW SPRITES ======================= //\n // Draw Pacman\n canvas.drawBitmap(pacman.getBitmap(), pacman.getX(), pacman.getY(), paint);\n\n // Draw all Monsters\n for(Monster monster : monsterList)\n {\n canvas.drawBitmap(monster.getBitmap(), monster.getX(), monster.getY(), paint);\n }\n\n // Draw Cherries\n for(Cherry cherry : cherryList)\n {\n canvas.drawBitmap(cherry.getBitmap(), cherry.getX(), cherry.getY(), paint);\n }\n\n // Draw Key\n canvas.drawBitmap(key.getBitmap(), key.getX(), key.getY(), paint);\n\n // Draw Stars\n paint.setColor(Color.WHITE);\n for(Star star : starList)\n {\n paint.setStrokeWidth(star.getStarWidth());\n canvas.drawPoint(star.getX(), star.getY(), paint);\n }\n\n // ======================================================= //\n\n\n if(!gameEnded)\n {\n // Draw user HUD\n paint.setTextAlign(Paint.Align.LEFT);\n paint.setColor(Color.WHITE);\n paint.setTextSize(40);\n paint.setTypeface(Typeface.MONOSPACE);\n canvas.drawText(\"Level: \" + level, 10, 50, paint);\n canvas.drawText(\"Hi Score: \" + hiScore, (screenMax_X /4) * 3, 50 , paint);\n canvas.drawText(\"Score: \" + score, screenMax_X / 3, 50 , paint);\n canvas.drawText(\"New level in: \" + distanceRemaining + \"km\", screenMax_X / 3, screenMax_Y - 20, paint);\n canvas.drawText(\"Lives: \" + pacman.getLifes(), 10, screenMax_Y - 20, paint);\n canvas.drawText(\"Speed \" + pacman.getSpeed() * 100 + \" Km/h\", (screenMax_X /4) * 3, screenMax_Y - 20, paint);\n\n } else {\n\n // Draw 'Game Over' Screen\n paint.setTextAlign(Paint.Align.CENTER);\n paint.setTypeface(Typeface.MONOSPACE);\n paint.setFakeBoldText(true);\n paint.setTextSize(150);\n canvas.drawText(\"Game Over\", screenMax_X / 2, 350, paint);\n paint.setTextSize(50);\n paint.setTypeface(Typeface.DEFAULT);\n paint.setFakeBoldText(false);\n canvas.drawText(\"Hi Score: \" + hiScore, screenMax_X / 2, 480, paint);\n canvas.drawText(\"Your Score: \" + score, screenMax_X / 2, 550, paint);\n paint.setTextSize(80);\n canvas.drawText(\"Tap to replay!\", screenMax_X / 2, 700, paint);\n }\n\n if(levelSwitched)\n {\n // Notify the user whenever level is switched\n paint.setTextSize(100);\n paint.setTypeface(Typeface.MONOSPACE);\n paint.setFakeBoldText(true);\n paint.setTextAlign(Paint.Align.CENTER);\n canvas.drawText(\"Level \" + level + \"!\", screenMax_X / 2, 350, paint);\n }\n\n // Unlcock canvas and draw it the scene\n surfaceHolder.unlockCanvasAndPost(canvas);\n }\n }", "public void render(Graphics g){\r\n g.setColor(Color.gray);\r\n g.fillRect(15,15,200,32);\r\n g.setColor(new Color((int)redValue,(int)greenValue,0));\r\n g.fillRect(15,15,(int)health * 2,32);\r\n g.setColor(Color.white);\r\n g.drawRect(15,15,200,32);\r\n g.drawString(\"Score: \" + score, 220, 24);\r\n g.drawString(\"Level: \" + level, 220, 44);\r\n }", "public void drawMap() {\r\n\t\tfor (int x = 0; x < map.dimensionsx; x++) {\r\n\t\t\tfor (int y = 0; y < map.dimensionsy; y++) {\r\n\t\t\t\tRectangle rect = new Rectangle(x * scalingFactor, y * scalingFactor, scalingFactor, scalingFactor);\r\n\t\t\t\trect.setStroke(Color.BLACK);\r\n\t\t\t\tif (islandMap[x][y]) {\r\n\t\t\t\t\tImage isl = new Image(\"island.jpg\", 50, 50, true, true);\r\n\t\t\t\t\tislandIV = new ImageView(isl);\r\n\t\t\t\t\tislandIV.setX(x * scalingFactor);\r\n\t\t\t\t\tislandIV.setY(y * scalingFactor);\r\n\t\t\t\t\troot.getChildren().add(islandIV);\r\n\t\t\t\t} else {\r\n\t\t\t\t\trect.setFill(Color.PALETURQUOISE);\r\n\t\t\t\t\troot.getChildren().add(rect);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void printCurrentState() {\n\t\t//getX() and getY() are methods from the Point class\n\t\tSystem.out.println(\"Avatar location: \" + avatar.getLocation().getX() + \",\" + avatar.getLocation().getY());\n\t\tSystem.out.println(\"Points: \" + avatar.getScore());\n\t}", "public void drawTile() {\n\n }", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "private void setUpMap() {\n if (points.size()>2) {\n drawCircle();\n }\n\n\n }", "@Override\n public void update() {\n if (Screen.checkState(GameState.RUNNING)) {\n healthToDraw = getPlayer().getHealth();\n maxHealthToDraw = getPlayer().getMaxHealth();\n minesToDraw = getPlayer().getCurrentMines();\n maxMinesToDraw = getPlayer().getMaxMines();\n currentLevelToDraw = Screen.getRoomHandler().getCurrentLevel();\n defenseToDraw = getPlayer().getDefense();\n speedToDraw = getPlayer().getSpeed();\n rangeToDraw = getPlayer().getSmallPlayerRange();\n damageToDraw = getPlayer().getPlayerDamage();\n playerRings = getPlayer().getRings();\n skillsToDraw = new Skill[4];\n for (int i = 0; i < getPlayer().getSkills().size(); i++) {\n if ( i < 4) {\n skillsToDraw[i] = getPlayer().getSkills().get(i);\n }\n }\n }\n }", "@Override\r\n protected void paintComponent(Graphics g) {\n paintWater(g);\r\n \r\n g.setColor(new Color(255, 255, 255, 70));\r\n g.fillRect(0, 0, 500, 500);\r\n \r\n \r\n // Paint the Grid ------------------------------------------\r\n g.setColor(Color.BLACK);\r\n \r\n for (int i = -1; i < 500; i += 50) {\r\n \r\n g.fillRect(i, 0, 2, 500);\r\n g.fillRect(0, i, 500, 2);\r\n \r\n }\r\n \r\n paintShips(g);\r\n paintHits(g);\r\n \r\n \r\n if (isPainted && shortBoard == ATTACK_BOARD && newGD.isMyTurn() && !missile.isPlaced()) {\r\n g.drawImage(Assets.imgMissile, mouseX, mouseY, null);\r\n }\r\n \r\n if (shortBoard == ATTACK_BOARD && newGD.isMyTurn() && missile.isPlaced()) {\r\n g.drawImage(Assets.imgMissile, missile.getPosition().x, missile.getPosition().y, null);\r\n }\r\n \r\n // Paint square under mouse pointer (also for testing)\r\n /*if (isPainted) {\r\n \r\n g.setColor(colorSquare);\r\n g.fillRect(mouseX, mouseY, 50, 50);\r\n \r\n }*/\r\n \r\n }", "private void renderGoalCell(Graphics g, GridLocation goalCell, GridLocation gridPosition){\n g.setColor(Color.YELLOW);\n g.fillRect(gridPosition.getX() + goalCell.getX()*CELL_SIZE, gridPosition.getY() + goalCell.getY()*CELL_SIZE, CELL_SIZE, CELL_SIZE);\n }", "void draw() {\n\t\t// display debug information\n\t\t// if (debugMode)\n\t\t// displayDebugInformation();\n\n\t\tupdate();\n\t\trender(); // display freetransform points, lines and colorings\n\n\t\t// display opposite objects\n\t\t// displayOppositeObject();\n\t}", "public void drawTextualMap(){\n\t\tfor(int i=0; i<grid.length; i++){\n\t\t\tfor(int j=0; j<grid[0].length; j++){\n\t\t\t\tif(grid[i][j] instanceof Room){\n\t\t\t\t\tif(((Room)grid[i][j]).getItems().size()>0)\n\t\t\t\t\t\tSystem.out.print(\" I \");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.print(\" R \");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.print(\" = \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\tSystem.out.println(\"rows = \"+grid.length+\" cols = \"+grid[0].length);\n\t\tSystem.out.println(\"I = Room has Item, R = Room has no Item, '=' = Is a Hallway\");\n\n\t}", "public void render() {\n GameApp.getSpritebatch().draw(sprite, position.x, position.y, GridSquare.SIZE, GridSquare.SIZE);\n if (active) {\n if (currTime + attack.getAttackDelay() < System.currentTimeMillis() && attackTargets()) {\n\n currTime = System.currentTimeMillis();\n }\n attack.render();\n }\n }", "@Override\n\tpublic void render(GameContainer gc, Graphics g) {\n\t\tfloat x = getX(), y = getY(), width = getWidth(), height = getHeight();\n\t\tg.setColor(new Color(0.5f, 0.5f, 0.5f, 0.8f));\n\t\tg.fillRoundRect(x, y, width, height, 5);\n\t\t\n\t\tg.setColor(Color.black);\n\t\tg.drawString(\"Map needs to be drawn below\", x + (width - g.getFont().getWidth(\"Map needs to be drawn below\")) * 0.5f , y + 20);\n\t\tg.drawString(\"Orange - current cell\", x + 20, y + 50);\n\t\tg.drawString(\"Green - explored cell\", x + 20, y + 70);\n\t\tg.drawString(\"White - unexplored cell\", x + 20, y + 90);\n\t\tg.drawString(\"Line - connection\", x + 20, y + 110);\n\t\tg.drawString(\"Dot - contains item\", x + 20, y + 130);\n\t\t\n\t\tg.setColor(Color.orange);\n\t\tg.fillRoundRect(x + width/2 - 3, y + height/2 - 3, 46, 46, 5);\n\t\t\n\t\tg.setColor(Color.green);\n\t\tg.fillRoundRect(x + width/2 - 3 + 50, y + height/2 - 3, 46, 46, 5);\n\t\tg.fillRoundRect(x + width/2 - 3 + 100, y + height/2 - 3, 46, 46, 5);\n\t\t\n\t\tg.setColor(Color.white);\n\t\tg.fillRoundRect(x + width/2 - 3 + 100, y + height/2 - 3 + 50, 46, 46, 5);\n\t\t\n\t\tg.setColor(Color.darkGray);\n\t\tg.fillRoundRect(x + width/2, y + height/2, 40, 40, 5);\n\t\tg.fillRoundRect(x + width/2 + 50, y + height/2, 40, 40, 5);\n\t\tg.fillRoundRect(x + width/2 + 100, y + height/2, 40, 40, 5);\n\t\tg.fillRoundRect(x + width/2 + 100, y + height/2 + 50, 40, 40, 5);\n\t\t\n\t\tg.drawLine(x + width/2 + 40, y + height/2 + 20, x + width/2 + 50, y + height/2 + 20);\n\t\tg.drawLine(x + width/2 + 40 + 50, y + height/2 + 20, x + width/2 + 50 + 50, y + height/2 + 20);\n\t\tg.drawLine(x + width/2 + 120, y + height/2 + 40, x + width/2 +\t120, y + height/2 + 50);\n\t\t\n\n g.setColor(Color.cyan);\n g.fillOval(x + width/2 - 3 + 120, y + height/2 + 17, 6, 6);\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 }", "@Override\r\n public void drawOn(DrawSurface d) {\r\n d.setColor(Color.decode(\"#298A1C\"));\r\n d.fillRectangle(0, 0, d.getWidth(), d.getHeight());\r\n\r\n // draw building:\r\n d.setColor(Color.decode(\"#414142\"));\r\n d.fillRectangle(100, 200, 10, 200);\r\n d.setColor(Color.decode(\"#171017\"));\r\n d.fillRectangle(90, 400, 30, 200);\r\n d.setColor(Color.decode(\"#170F12\"));\r\n d.fillRectangle(55, 450, 100, 200);\r\n d.setColor(Color.decode(\"#FFD149\"));\r\n d.fillCircle(105, 200, 11);\r\n d.setColor(Color.decode(\"#B86731\"));\r\n d.fillCircle(105, 200, 7);\r\n d.setColor(Color.WHITE);\r\n d.fillCircle(105, 200, 3);\r\n\r\n // draw windows:\r\n int width = 10;\r\n int height = 25;\r\n int space = 8;\r\n int rowHeight = 460;\r\n drawWindows(rowHeight, d);\r\n drawWindows(rowHeight + height + space, d);\r\n drawWindows(rowHeight + height * 2 + space * 2, d);\r\n drawWindows(rowHeight + height * 3 + space * 3, d);\r\n drawWindows(rowHeight + height * 4 + space * 4, d);\r\n drawWindows(rowHeight + height * 5 + space * 5, d);\r\n }", "private void drawBubbleStatus(Graphics g, int x, int y) throws IOException{\n\t\t ImageIcon bg;\n\t\t bg = new ImageIcon(ImageIO.read(new File(relativePath + \"bubbleStatus.png\")));\n\t\t bg.paintIcon(this, g, x, y);\n\t }", "public void drawStaticHud(GL2 gl) {\n this.gl = gl;\n\n if (! player.isAlive())\n return;\n\n update();\n\n start2D();\n //drawEnergy(gl);\n\n // Set the crosshair color to green\n gl.glColor4f(0.0f, 1.0f, 0.0f, 0.0f);\n\n if(crosshair != null) {\n crosshair.bind(gl);\n }\n gl.glBegin(GL2.GL_QUADS);\n int s = HEIGHT / 2; // Cross hair 10% screen height\n\n draw(-s / 2, -s / 2, s, s);\n gl.glEnd();\n gl.glColor4f(0.0f, 0.0f, 0.0f, 1.0f);\n\n {//Health/Shield Bar\n float xStart = 0;\n float xEnd = WIDTH;\n \n float yStart = -HEIGHT;\n float yEnd = HEIGHT;\n\n if(healthbackdrop != null) { \n healthbackdrop.bind(gl);\n }\n\n gl.glBegin(GL2.GL_QUADS );\n draw(xStart, yStart, xEnd , yEnd );\n gl.glEnd();\n\n\n if(healthbar != null) {\n healthbar.bind(gl);\n }\n\n //draws the health bar\n gl.glBegin(GL2.GL_QUADS );\n drawBarGraph(xStart, yStart, xEnd , yEnd , ship.health()*0.72f);\n gl.glEnd();\n\n if(shieldbar!=null){\n shieldbar.bind(gl);\n }\n gl.glBegin(GL2.GL_QUADS );\n drawBarGraph(xStart, yStart, xEnd , yEnd , ship.shield()*0.70f);\n gl.glEnd();\n\n //health cross\n if(healthcross != null) {\n healthcross.bind(gl);\n }\n\n gl.glBegin(GL2.GL_QUADS );\n draw(xStart, yStart, xEnd , yEnd );\n gl.glEnd();\n }\n\n {//Gun bar code\n float xStart = -WIDTH;\n float xEnd = WIDTH;\n \n float yStart = -HEIGHT;\n float yEnd = HEIGHT;\n \n if(gunbackdrop != null) {\n gunbackdrop.bind(gl);\n }\n\n gl.glBegin(GL2.GL_QUADS );\n draw(xStart, yStart, xEnd , yEnd);\n gl.glEnd();\n\n if(gunbar != null) {\n gunbar.bind(gl);\n }\n\n //draw the percent bar for the gun\n gl.glBegin(GL2.GL_QUADS );\n drawBarGraph(xStart, yStart, xEnd , yEnd,ship.getWeapon().getAmmoPercent()*0.72f);\n gl.glEnd();\n\n if(gunammo != null) {\n gunammo.bind(gl);\n }\n\n gl.glBegin(GL2.GL_QUADS );\n draw(xStart, yStart, xEnd , yEnd);\n gl.glEnd();\n }\n\n gl.glFlush();\n stop2D();\n }", "@Override\r\n\tpublic void draw() {\r\n\t\t//Set the background to dark grey\r\n\t\tbackground(50, 50, 50);\t\r\n\t\t//If the current state is processing, display text explaining this\r\n\t\tif (this.currentGameState == DisplayStates.PROCESSING) {\r\n\t\t\ttext(\"Processing, please wait...\", 30, 340); \r\n\t\t} else { //Otherwise, the grid should be drawn in it's current state\r\n\t\t\tthis.zoomer.transform(); //Transform the zoom based on user input\r\n\t\t\t//Get the cells in their current state\r\n\t\t\tthis.gridCells = this.world.getCells(); \r\n\t\t\t//Work out which size images to use.\r\n\t\t\tupdateImageScale();\r\n\t\t\t//Draw the images to the sketch based on the current scale\r\n\t\t\tif (this.currentImageScale == ImageDrawScales.LARGE) {\r\n\t\t\t\tdrawImages(LARGE_IMAGE, this.gridCells);\r\n\t\t\t} else if (this.currentImageScale == ImageDrawScales.MEDIUM) {\r\n\t\t\t\tdrawImages(MEDIUM_IMAGE, this.gridCells);\r\n\t\t\t} else {\r\n\t\t\t\tdrawImages(SMALL_IMAGE, this.gridCells);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void draw() {\n\t\tbackground(51);\n\t\tfill(35);\n\t\trect(0, 0, 599, 40);\n\t\tif (this.buttonOver()) {\n\t\t\tfill(100);\n\t\t\trect(513, 7, 73, 29, 7);\n\t\t}\n\t\telse {\n\t\t\tfill(60);\n\t\t\trect(513, 7, 73, 29, 7);\n\t\t}\n\t\t\n\t\t//create the appropriate writing/texts\n\t\tfill(255);\n\t\ttextSize(20);\n\t\ttext(\"SCORE:\", 20, 30);\n\t\ttext(mySnake.score, 94, 30);\n\t\tif (mySnake.isPaused == true) {\n\t\t\ttext(\"PLAY\", 520, 30);\n\t\t}\n\t\telse {\n\t\t\ttext(\"PAUSE\", 520, 30);\n\t\t}\n\t\t\n\t\tmySnake.checkIfDead();\n\t\t\n\t\tif (mySnake.alive) { //if alive \n\t\t\t\n\t\t\tif (mySnake.isPaused == false) {\n\t\t\t\tmySnake.update();\n\t\t\t}\n\t\t\t\n\t\t\tmySnake.printSnake();\n\t\t\tmySnake.printFood();\n\t\t\t\t\n\t\t\tif (mySnake.eatFood()) {\n\t\t\t\tmySnake.createFood();\n\t\t\t}\n\t\t}\n\t\telse { //it must be dead\n\t\t\t//print the food and only the tail of the snake (as head went off board)\n\t\t\tfor (int i=0; i<mySnake.tail.length; i++) { //will only print the tail if there is any tail to begin with\n\t\t\t\trect(mySnake.tail[i][0], mySnake.tail[i][1], boxSize, boxSize);\n\t\t\t}\n\t\t\tmySnake.printFood();\n\t\n\t\t\t//write Game Over\n\t\t\tfill(40);\n\t\t\trect(50, 190, 510, 100, 7);\n\t\t\t\n\t\t\tfill(255);\n\t\t\ttextSize(80);\n\t\t\ttext(\"GAME OVER!\", 60, 270);\n\t\t}\n\t}" ]
[ "0.593635", "0.58882946", "0.5811165", "0.5692994", "0.56511974", "0.56468815", "0.5621262", "0.561455", "0.5596332", "0.5540516", "0.5539735", "0.5505524", "0.54961246", "0.5485481", "0.54799193", "0.5464711", "0.54338914", "0.5428428", "0.5427983", "0.5425516", "0.54186594", "0.5405177", "0.5391827", "0.53821474", "0.53809935", "0.5364427", "0.5364366", "0.53627455", "0.5348291", "0.5345177", "0.5345121", "0.5344303", "0.53274316", "0.5304759", "0.5291163", "0.5288238", "0.5285548", "0.5278594", "0.52699256", "0.526991", "0.52682036", "0.5266509", "0.52658117", "0.52591646", "0.52560246", "0.52549833", "0.5242396", "0.5241521", "0.52411824", "0.5226873", "0.52109593", "0.52038515", "0.5200927", "0.51972955", "0.51940286", "0.51810014", "0.5180376", "0.51736486", "0.5172041", "0.517099", "0.51672554", "0.5159213", "0.5157582", "0.51564693", "0.5154802", "0.5154503", "0.5151702", "0.51516974", "0.5148548", "0.5143623", "0.5140445", "0.5135429", "0.5124396", "0.5122133", "0.5122019", "0.510591", "0.5103857", "0.50997055", "0.50993496", "0.50984764", "0.5090408", "0.5089319", "0.5088995", "0.50873804", "0.5087365", "0.5087365", "0.5079219", "0.5078985", "0.50592804", "0.50569093", "0.505506", "0.5053231", "0.50509566", "0.5047375", "0.50470275", "0.50427985", "0.50413805", "0.50388277", "0.5037094", "0.50363743" ]
0.59121
1
After collision and investigation, if individual is get infected, its states and timers updated by that event. First health status is changed to infected to infected other individuals and indicate its color. Then individual's death timer is starts with according to current mortality rate of world. This timer has action that call justDie() function to set state to dead and parameters and removes timer from timer list of individual. It also sets up hospital need thread to prepare for starting when goHospital timer is finished. This thread function uses world's hospital reference and tries to go hospital. If hospital is available individual will accepted and tries to set up and change state to "in hospital" state by using goHospital() function. Also for start that thread there must be some time to spend. This time 25 second. After 25 second individual understand it is infected and tries to go hospital by starting hospitalNeed thread. At the end individual inform word with its infection to update statistics.
public void getCovid() { setHealthStatus(HealthStatus.INFLECTED); deathTimer = new PlayPauseTimer((int) (100*(1 - world.getMortalityRate())), new ActionListener() { @Override public void actionPerformed(ActionEvent e) { justDie(); timerList.remove(deathTimer); } }, world.getRefreshTime()); timerList.add(deathTimer); hospitalNeed = new Thread(new Runnable() { @Override public void run() { try { world.getHospital().acceptIndividual(); goHospital(); } catch (InterruptedException e) { } } }); goHospitalTimer = new PlayPauseTimer(25, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { hospitalNeed.start(); timerList.remove(goHospitalTimer); } }, world.getRefreshTime()); timerList.add(goHospitalTimer); world.infect(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void goHospital()\n\t{\n\t\tsynchronized (this) {\n\t\tworld.hospitalizedIndividual();\n\t\tcurrentState.goHospital();\n\t\t}\n\t}", "public void burry()\n\t{\n\t\tworld.death();\n\t\ttimerList.clear();\n\t\tif(hospitalNeed != null && hospitalNeed.isAlive())\n\t\t\thospitalNeed.interrupt();\n\t}", "public Individual(Simulation world) {\n\t\tmoving = new Moving(this);\n\t\tinConversation = new InConversation(this);\n\t\tinHospital = new InHospital(this);\n\t\tdead = new Dead(this);\n\t\tcurrentState = moving;\n\t\tspeed = random.nextInt(25)+1;\n\t\txSpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed * Math.cos(Math.PI/4));\n\t\tySpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed * Math.cos(Math.PI/4));\n\t\tsocialDistance = random.nextInt(10);\n\t\tconversationTime = random.nextInt(5) + 1;\n\t\tdouble[] maskChoice = {0.2, 1};\n\t\tmaskIndicator = maskChoice[random.nextInt(2)];\n\t\tindividualSize = 5;\n\t\thealthStatus = HealthStatus.HEALTHY;\n\t\tthis.world = world;\n\t\tx = random.nextInt(world.getSIMULATION_WIDTH() - individualSize);\n\t\ty = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize);\n\t\ttimerList = new ArrayList<>();\n\t\t\n\t\thospitalNeed = new Thread(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tworld.getHospital().acceptIndividual();\n\t\t\t\t\tsynchronized (this) {\n\t\t\t\t\t\tcurrentState.goHospital();\n\t\t\t\t\t}\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\t\n\t\t\t}\n\t\t});\n\t\tworld.healthy();\n\t}", "public void startHealing()\n\t{\n\t\ttimerList.clear();\n\t\tinHospitalTimer = new PlayPauseTimer(10, new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tworld.heal();\n\t\t\t\tx = random.nextInt(world.getSIMULATION_WIDTH() - individualSize);\n\t\t\t\ty = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize); \n\t\t\t\tmoveInPopulation();\n\t\t\t\texitHospital();\n\t\t\t\thealthStatus = HealthStatus.HEALTHY;\n\t\t\t\ttimerList.remove(inHospitalTimer);\n\t\t\t}\n\t\t\t\n\t\t}, world.getRefreshTime());\n\t\ttimerList.add(inHospitalTimer);\n\t}", "public void update(float dt) {\n if (codeOn == true) {\n //do nothing\n } else {\n handleinput(dt);\n }\n //movedRight(dt);\n //takes 1 step in the physics simulation 60 times per second\n world.step(1 / 60f, 6, 2);\n player.update(dt);\n\n //if character dies, freeze the camera right where he died\n if (player.currentState != Adventurer.State.DEAD) {\n gamecam.position.x = player.b2body.getPosition().x;\n }\n\n hud.update(dt);\n\n for (Enemy enemy : creator.getDungeonMonster()) {\n enemy.update(dt);\n if (enemy.getX() < player.getX() + 220 / DefaultValues.PPM) {\n enemy.b2body.setActive(true);//activate goomba\n }\n }\n if (DefaultValues.questActivated == true) {\n quest1 = true;\n quest2 = false;\n DefaultValues.questActivated = false;\n stage.addActor(dialog);\n }\n\n if (DefaultValues.quest2Activated == true) {\n quest1 = false;\n quest2 = true;\n DefaultValues.quest2Activated = false;\n stage.addActor(dialog2);\n }\n\n if (touchedFinishline == true) {\n if (progressInsideTaskTwo == 100) {\n if (saveProcessor.checkAchievement() == true) {\n DungeonCoder.manager.get(\"UIElements/Animation/achievement.mp3\", Sound.class).play();\n }\n DungeonCoder.manager.get(\"UIElements/Animation/stagecomplete.mp3\", Sound.class).play();\n hud.stopMusic();\n touchedFinishline = false;\n saveProcessor.insClear();\n System.out.println(\"Total clear:\" + saveProcessor.getTotalCleared());\n System.out.printf(\"You have cleared %d instructional stages.\\n\", saveProcessor.getInsCleared());\n dispose();\n game.setScreen(new StageThreeComplete(game));\n } else {\n touchedFinishline = false;\n new Dialog(\"Dungeon Coder\", skin, \"dialog\") {\n protected void result(Object object) {\n }\n }.text(\"You have not fulfil the requirement to complete the stage!\").button(\" Ok \", true).show(stage);\n }\n }\n\n\n //update gamecam with correct corrdinates after changes\n gamecam.update();\n\n //tell renderer to draw only what our camera can see in our game world\n renderer.setView(gamecam);\n\n }", "public void processStimulus(java.util.Enumeration en) {\n//\t\tSystem.out.println(\"physics\");\n// performPhysics();\n\n//\t\tSystem.out.println(\"behavior\");\n doEveryFrame();\n\n//\t\tobjHPindicator\n// hpAppear.setColoringAttributes(new ColoringAttributes(1.0f - (float) hitpoints / (float) maxHitpoints, (float) hitpoints / (float) maxHitpoints, 0.0f, ColoringAttributes.NICEST));\n\n// refreshPosition();\n\n if (isAlive()) {\n wakeupOn(w);\n } else {\n kill();\n }\n }", "private void processEvent(Event e) {\n\t\t// adjust timer\n\t\ttime = e.getTime();\n\t\tprintTimer();\n\n\t\t// get related patient and doctor. Start them waiting. Get preferredDoctor\n\t\tPerson p = e.getPatient();\n\t\tp.startWaiting();\n\t\tPerson d = e.getDoctor();\n\t\tif (d != null) {\n\t\t\td.startWaiting();\n\t\t}\n\t\tPerson preferredDoctor = p.getPreferredDoctor();\n\n\t\t// switch on the event type\n\t\tswitch (e.getType()) {\n\t\t\tcase Event.NEW_PATIENT :\n\t\t\t\t// new patient entered ambulance. Add him to incoming waiters\n\t\t\t\t// and check if doctors are waiting\n\t\t\t\tprint(\n\t\t\t\t\t\"New patient: \" + p + \", add to examination-waiting-list\");\n\t\t\t\t_examinationWaiters.addLast(p);\n\t\t\t\tcheckExamination();\n\t\t\t\tbreak;\n\n\t\t\tcase Event.FIRST_EXAMINATION :\n\t\t\t\t// end of 1st examination\n\t\t\t\tprint(\"1st examination end: \" + p + \", \" + d);\n\t\t\t\tif (needXray()) {\n\t\t\t\t\t// if xray needed, add patient to the xray waiters\n\t\t\t\t\t// and check if xray-doctor is waiting\n\t\t\t\t\tprint(\"Xray needed. Add \" + p + \" to xray-waiting-list\");\n\t\t\t\t\tp.setPreferredDoctor(d);\n\t\t\t\t\t_xrayWaiters.addLast(p);\n\t\t\t\t\tcheckXRay();\n\t\t\t\t} else {\n\t\t\t\t\t// if no xray needed, then patient can go home.\n\t\t\t\t\tprint(\"No xray needed. Can go home now: \" + p);\n\t\t\t\t\t_gonePatients.add(p);\n\t\t\t\t}\n\t\t\t\t// check if incoming patients are waiting\n\t\t\t\tcheckExamination();\n\t\t\t\tbreak;\n\n\t\t\tcase Event.XRAY_SHOOTING :\n\t\t\t\t// end of xray-examination. Add Patient to waiters.\n\t\t\t\t// Check if any xray waiters and if doctors are waiting\n\t\t\t\tprint(\"Xray-shooting end: \" + p);\n\t\t\t\tif (_policy == XRAY_FIRST) {\n\t\t\t\t\tprint(\"Add to back-from-xray-waiters: \" + p);\n\t\t\t\t\t_backFromXrayWaiters.addLast(p);\n\t\t\t\t} else {\n\t\t\t\t\tprint(\"Add to examination-waiting-list: \" + p);\n\t\t\t\t\t_examinationWaiters.addLast(p);\n\t\t\t\t}\n\t\t\t\tcheckExamination();\n\t\t\t\tcheckXRay();\n\t\t\t\tbreak;\n\n\t\t\tcase Event.SECOND_EXAMINATION :\n\t\t\t\t// end of second examination. Patient can go home now.\n\t\t\t\t// check if incoming patients are waiting.\n\t\t\t\tprint(\"2nd examination end: \" + p + \", \" + d);\n\t\t\t\tprint(\"Can go home: \" + p);\n\t\t\t\t_gonePatients.add(p);\n\t\t\t\tcheckExamination();\n\t\t\t\tbreak;\n\t\t}\n\t}", "int aggroHitTimer(IGeneticMob geneticMob, EntityLiving attacker);", "@Override\n\t\tpublic void run() {\n\n\n\t\t\tif (((CitizensNPC)myNPC).getHandle() == null ) sentryStatus = Status.isDEAD; // incase it dies in a way im not handling.....\n\n\t\t\tif (sentryStatus != Status.isDEAD && System.currentTimeMillis() > oktoheal && HealRate > 0) {\n\t\t\t\tif (myNPC.getBukkitEntity().getHealth() < sentryHealth) {\n\t\t\t\t\tmyNPC.getBukkitEntity().setHealth(myNPC.getBukkitEntity().getHealth() + 1);\n\t\t\t\t\tif (healanim!=null)net.citizensnpcs.util.Util.sendPacketNearby(myNPC.getBukkitEntity().getLocation(),healanim , 64);\n\n\t\t\t\t\tif (myNPC.getBukkitEntity().getHealth() >= sentryHealth) _myDamamgers.clear(); //healed to full, forget attackers\n\n\t\t\t\t}\n\t\t\t\toktoheal = (long) (System.currentTimeMillis() + HealRate * 1000);\n\t\t\t}\n\n\t\t\tif (sentryStatus == Status.isDEAD && System.currentTimeMillis() > isRespawnable && RespawnDelaySeconds != 0) {\n\t\t\t\t// Respawn\n\n\t\t\t\t// Location loc =\n\t\t\t\t// myNPC.getTrait(CurrentLocation.class).getLocation();\n\t\t\t\t// if (myNPC.hasTrait(Waypoints.class)){\n\t\t\t\t// Waypoints wp = myNPC.getTrait(Waypoints.class);\n\t\t\t\t// wp.getCurrentProvider()\n\t\t\t\t// }\n\n\t\t\t\t// plugin.getServer().broadcastMessage(\"Spawning...\");\n\t\t\t\tif (guardEntity == null) {\n\t\t\t\t\tmyNPC.spawn(Spawn);\n\t\t\t\t} else {\n\t\t\t\t\tmyNPC.spawn(guardEntity.getLocation().add(2, 0, 2));\n\t\t\t\t}\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\telse if (sentryStatus == Status.isHOSTILE && myNPC.isSpawned()) {\n\n\t\t\t\tif (projectileTarget != null && !projectileTarget.isDead()) {\n\t\t\t\t\tif (_projTargetLostLoc == null)\n\t\t\t\t\t\t_projTargetLostLoc = projectileTarget.getLocation();\n\n\t\t\t\t\tfaceEntity(myNPC.getBukkitEntity(), projectileTarget);\n\n\t\t\t\t\tif (System.currentTimeMillis() > oktoFire) {\n\t\t\t\t\t\t// Fire!\n\t\t\t\t\t\toktoFire = (long) (System.currentTimeMillis() + AttackRateSeconds * 1000.0);\n\t\t\t\t\t\tFire(projectileTarget);\n\t\t\t\t\t}\n\t\t\t\t\tif (projectileTarget != null)\n\t\t\t\t\t\t_projTargetLostLoc = projectileTarget.getLocation();\n\n\t\t\t\t\treturn; // keep at it\n\n\t\t\t\t}\n\n\t\t\t\telse if (meleeTarget != null && !meleeTarget.isDead()) {\n\t\t\t\t\t// Did it get away?\n\t\t\t\t\tif (meleeTarget.getLocation().distance(myNPC.getBukkitEntity().getLocation()) > sentryRange) {\n\t\t\t\t\t\t// it got away...\n\t\t\t\t\t\tsetTarget(null);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// target died or null\n\t\t\t\t\tsetTarget(null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse if (sentryStatus == Status.isLOOKING && myNPC.isSpawned()) {\n\n\t\t\t\tif (guardTarget != null && guardEntity == null) {\n\t\t\t\t\t// daddy? where are u?\n\t\t\t\t\tsetGuardTarget(guardTarget);\n\t\t\t\t}\n\n\t\t\t\tLivingEntity target = findTarget(sentryRange);\n\n\t\t\t\tif (target != null) {\n\t\t\t\t\t// plugin.getServer().broadcastMessage(\"Target selected: \" +\n\t\t\t\t\t// target.toString());\n\t\t\t\t\tsetTarget(target);\n\t\t\t\t} else\n\t\t\t\t\tsetTarget(null);\n\n\t\t\t}\n\n\t\t}", "@Override\n public void run() {\n cs = new CommStack(this, this.csParams);\n /** time variables to control the <Actor>s lifetime */\n long time_ini; \n /** lifecicle duration in ns */\n long deltaTime; \n /** lifecicle duration in ms */\n long deltaTime_ms;\n setInitialParameters();\n /** start the comunication Thread CommStack */\n cs.start();\n \n /** while the actor is alive, keep updating it every time_pace milliseconds */\n try {\n while (alive && !SimStatus.globalActors.get(id).actorDyingQ()) {\n /** decreases lifetime as the cycles pass */\n lifetime = lifetime - time_pace; \n if (lifetime > 0) {\n /** saves current time in nanoseconds */\n time_ini = System.nanoTime();\n label = moveActor();\n SimStatus.setActorStatus(id, x, y, vx, vy, label);\n /** saves lifecycle duration */\n deltaTime = System.nanoTime() - time_ini;\n deltaTime_ms = TimeUnit.NANOSECONDS.toMillis(deltaTime);\n /** if lifecycle duration is less than the time pace, sleeps for the time remaining */\n if (deltaTime_ms <= time_pace) {\n Thread.sleep(time_pace - deltaTime_ms);\n }\n /** if lifecycle is more than 20% bigger than time pace, launches warning */\n if(deltaTime_ms > 0.2*time_pace) { \n System.err.println(\"WARNING - actor \"+id+\" lifecicle time >20% of time_pace\");\n }\n } else {\n \n /** Starts de dying process */\n System.out.println(\"Actor \" + id + \" lifetime is over...\");\n dying = true;\n /** sets actor status to 'dying' */\n SimStatus.setActorStatus(id, x, y, vx, vy, label, dying);\n /** sleep for some time, waiting for the news to spread */\n Thread.sleep(500);\n }\n }\n /** completes the dying process */\n alive = false;\n cs.join();\n SimStatus.removeActor(id);\n } catch (InterruptedException ex) {\n Logger.getLogger(Actor.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void update()\n\t{\n\t\t//\tTHE WORLD HAS ENDED DO NOT EXECUTE FURTHER\n\t\tif( end )\n\t\t{\n\t\t\tsafeEnd = true;\n\t\t\treturn;\n\t\t}\n\n\t\t//Plot graphics\n\t\tif(plot){\n\t\t\thealthyFunction.show(infectedFunction, healthyFunction);\n\t\t\tbusFunction.show(infectedFunction, seasFunction, busFunction, colFunction, ellFunction, smpaFunction, lawFunction);\n\t\t\tplot = false;\n\t\t}\n\n\t\t//\tsafe point to manage human/zombie ratios\n\t\t//\tTODO: Modify infect to also switch zombies to humans\n\t\tinfect();\n\t\tgetWell();\n\t\taddFromQueue();\n\n\t\t//\tupdate all entities\n\t\tfor( Zombie z: zombies )\n\t\t{\n\t\t\tz.update(zombiesPaused);\n\t\t}\n\t\tfor( Entity h: humans )\n\t\t{\n\t\t\th.update(humansPaused);\n\t\t}\n\n\t\tif( zc!=zombies.size() || hc!=humans.size() )\n\t\t{\n\t\t\tzc = zombies.size();\n\t\t\thc = humans.size();\n\t\t\tSystem.out.println(zc+\"/\"+hc);\n\t\t}\n\n\t\t//Add points to our functions\n\t\thealthyFunction.add(time,humans.size());\n\t\tinfectedFunction.add(time,zombies.size());\n\t\tseascount = smpacount = ellcount = lawcount = buscount = colcount = 0;\n\t\tfor (int i = 0; i < humans.size(); i++) {\n\t\t\tEntity curr = humans.get(i);\n\t\t\tif (curr instanceof SEAS) {\n\t\t\t\tseascount++;\n\t\t\t} else if (curr instanceof SMPA) {\n\t\t\t\tsmpacount++;\n\t\t\t} else if (curr instanceof Elliot) {\n\t\t\t\tellcount++;\n\t\t\t} else if (curr instanceof Law) {\n\t\t\t\tlawcount++;\n\t\t\t} else if (curr instanceof Business) {\n\t\t\t\tbuscount++;\n\t\t\t} else if (curr instanceof Columbian) {\n\t\t\t\tcolcount++;\n\t\t\t}\n\t\t}\n\t\tbusFunction.add(time, buscount);\n\t\tcolFunction.add(time, colcount);\n\t\tellFunction.add(time, ellcount);\n\t\tlawFunction.add(time, lawcount);\n\t\tsmpaFunction.add(time, smpacount);\n\t\tseasFunction.add(time, seascount);\n\t\ttime++;\n\t}", "@Override\n public void collide(CollisionEvent e) {\n \n if (e.getOtherBody() instanceof OptimusPrime && e.getReportingBody() instanceof Health) {\n prime.incrementHealthCount();\n healthSound.play();\n e.getReportingBody().destroy();\n \n \n }\n \n else if (e.getOtherBody() instanceof OptimusPrime && e.getReportingBody() instanceof Emerald) {\n prime.incrementEmeraldCount();\n emeraldSound.play();\n e.getReportingBody().destroy();\n }\n \n else if (e.getOtherBody() instanceof OptimusPrime && e.getReportingBody() instanceof DeadZone) {\n e.getReportingBody().destroy();\n System.exit(0);\n } \n \n else if (e.getReportingBody() instanceof Boss && e.getOtherBody() instanceof FireBall){\n e.getOtherBody().destroy();\n System.out.println(\"boss hit\");\n }\n \n else if (e.getReportingBody() instanceof StaticBody && e.getOtherBody() instanceof FireBall){\n e.getOtherBody().destroy();\n System.out.println(\"boss hit\");\n } \n \n }", "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}", "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 void enterRoom(Person p) {\n if (p.poisoned) {\n System.out.println(\"The poison eats away at you. You take 5 damage.\");\n p.hp -= 5;\n System.out.println(\"You now have \" + p.hp + \"health\");\n if (p.hp <= 0) {\n\n gameOff();\n }\n }\n occupant = p;\n p.setxLoc(this.xLoc);\n p.setyLoc(this.yLoc);\n Scanner n = new Scanner(System.in);\n\n if (!m.sleep) {\n if (m.alive) {\n System.out.println(\"There's a monster in the room!\");\n } else {\n System.out.println(\"The monster's remains lies before you.\");\n }\n m.aggro = true;\n while (m.alive && m.aggro) {\n if (m.hp <= 0) {\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n }\n int damage = m.counterAttack(p);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n if (p.hp <= 0) {\n System.out.println(\"You died. No one knows you died.\");\n Runner.gameOff();\n }\n System.out.println(\"You have \" + p.hp + \" health.\");\n System.out.println(\"What do you do now? (Fight, Run)\");\n String re = n.nextLine();\n if (re.equalsIgnoreCase(\"run\")) {\n damage = (int) (m.counterAttack(p) / p.dex);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n m.aggro = false;\n }\n if (re.equalsIgnoreCase(\"Fight\")) {\n double dam = (p.str + p.str * Math.random()) / (m.resist + 1);\n\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \"damage.\");\n if (m.hp <= 0) {\n m.alive = false;\n System.out.println(\"The monster howls as you deal a finishing blow.\");\n int g = m.dropGold();\n System.out.println(\"You gain \" + p.gold + \" Gold\");\n p.gold += g;\n m.threat = false;\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n }\n }\n }\n if (m.alive) {\n if (m.sleep) {\n System.out.println(\"You find a sleeping monster. Do you attack it? (Y/N)\");\n\n String q = n.nextLine();\n if (q.equalsIgnoreCase(\"yes\") || q.equalsIgnoreCase(\"y\")) {\n\n double dam = p.str * (1.5) + p.str * Math.random();\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \" damage.\");\n m.aggro = true;\n if (m.hp <= 0) {\n System.out.println(\"The monster dies on the spot. Who's the real monster here?\");\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \" Gold\");\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n while (m.alive && m.aggro) {\n if (m.hp <= 0) {\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \"Gold\");\n }\n int damage = m.counterAttack(p);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n if (p.hp <= 0) {\n System.out.println(\"You died. Serves you right for hitting a sleeping monster.\");\n Runner.gameOff();\n }\n System.out.println(\"You have \" + p.hp + \" health.\");\n System.out.println(\"What do you do now? (Fight, Run)\");\n q = n.nextLine();\n if (q.equalsIgnoreCase(\"run\")) {\n damage = (m.counterAttack(p) / p.dex);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n m.aggro = false;\n }\n if (q.equalsIgnoreCase(\"Fight\")) {\n dam = (p.str + p.str * Math.random()) / (m.resist + 1);\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \"damage.\");\n if (m.hp <= 0) {\n m.alive = false;\n System.out.println(\"The monster howls as you deal a finishing blow.\");\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \" Gold\");\n m.threat = false;\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n }\n\n }\n } else {\n System.out.println(\"You let the sleeping monster be.\");\n m.threat = false;\n n.close();\n }\n\n }\n }\n else\n {\n System.out.println(\"The monster's remains are still here.\");\n }\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 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 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 static void worldTimeStep() {\n\t\t\n\t//Do time step for all critters\n\t\tfor (Critter c: population) {\n\t\t\tc.doTimeStep();\t\t\t\n\t\t}\n\t\n\t\t\n\t//Resolve encounters\n\t\tIterator<Critter> it1 = population.iterator();\n\t\tfightMode = true;\n\t\twhile(it1.hasNext())\n\t\t{\n\t\t\tCritter c = it1.next();\n\t\t\tIterator<Critter> it2 = population.iterator();\n\t\t\twhile(it2.hasNext()&&(c.energy > 0)) \n\t\t\t{\t\n\t\t\t\tCritter a =it2.next();\n\t\t\t\tif((c != a)&&(a.x_coord==c.x_coord)&&(a.y_coord==c.y_coord))\n\t\t\t\t{\n\t\t\t\t\tboolean cFighting = c.fight(a.toString());\n\t\t\t\t\tboolean aFighting = a.fight(c.toString());\n\t\t\t\t//If they are both still in the same location and alive, then fight\n\t\t\t\t\tif ((a.x_coord == c.x_coord) && (a.y_coord == c.y_coord) && (a.energy > 0) && (c.energy > 0)) {\t\t\n\t\t\t\t\t\tint cFight=0;\n\t\t\t\t\t\tint aFight=0;\n\t\t\t\t\t\tif(cFighting)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcFight = getRandomInt(100);\n\t\t\t\t\t\t\tcFight++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(aFighting)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taFight =getRandomInt(100);\n\t\t\t\t\t\t\taFight++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(cFight>aFight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tc.energy+=(a.energy/2);\n\t\t\t\t\t\t\t//it2.remove();\n\t\t\t\t\t\t\ta.energy=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(aFight>cFight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta.energy+=(c.energy/2);\n\t\t\t\t\t\t\t//it1.remove()\n\t\t\t\t\t\t\tc.energy=0;\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\tif(aFight>50)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ta.energy+=(c.energy/2);\n\t\t\t\t\t\t\t\t//it1.remove();\n\t\t\t\t\t\t\t\tc.energy=0;\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\tc.energy+=(a.energy);\n\t\t\t\t\t\t\t\t//it2.remove();\n\t\t\t\t\t\t\t\ta.energy=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfightMode = false;\n\t\t\n\t//Update rest energy and reset hasMoved\n\t\tfor (Critter c2: population) {\n\t\t\tc2.hasMoved = false;\n\t\t\tc2.energy -= Params.rest_energy_cost;\n\t\t}\n\t\t\n\t//Spawn offspring and add to population\n\t\tpopulation.addAll(babies);\n\t\tbabies.clear();\n\t\t\n\t\tIterator<Critter> it3 = population.iterator();\n\t\twhile(it3.hasNext())\n\t\t{\n\t\t\tif(it3.next().energy<=0)\n\t\t\t\tit3.remove();\n\t\t}\n\t//Create new algae\n\t\tfor (int i = 0; i < Params.refresh_algae_count; i++) {\n\t\t\ttry {\n\t\t\t\tmakeCritter(\"Algae\");\n\t\t\t} catch (InvalidCritterException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void familiarTick() {\n\t\tattacked = false;\n\t\tif (summonedFamiliar != null && c.getInstance().summoned != null) {\n\t\t\tif (!c.goodDistance(c.getX(), c.getY(), c.getInstance().summoned.getX(), c.getInstance().summoned.getY(),\n\t\t\t\t\t8)) {\n\t\t\t\tcallOnTeleport();\n\t\t\t}\n\t\t\tif (!c.goodDistance(c.getX(), c.getY(), c.getInstance().summoned.getX(), c.getInstance().summoned.getY(),\n\t\t\t\t\t8)) {\n\t\t\t\tc.getSummoning().callFamiliar();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (c.getInstance().playerIndex != 0\n\t\t\t\t\t&& NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackingAPerson = true;\n\t\t\t} else if (c.getInstance().playerIndex == 0\n\t\t\t\t\t&& NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackingAPerson = false;\n\t\t\t}\n\t\t\tif (c.getInstance().underAttackBy != 0\n\t\t\t\t\t&& NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackedByPerson = true;\n\t\t\t} else if (c.getInstance().underAttackBy == 0\n\t\t\t\t\t&& NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackedByPerson = false;\n\t\t\t}\n\t\t\tif (c.getInstance().npcIndex != 0\n\t\t\t\t\t&& !NPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackingAPerson\n\t\t\t\t\t&& NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].IsAttackingNPC = true;\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].facePlayer(0);\n\t\t\t} else if (NPCHandler.npcs[c.getInstance().summoningMonsterId].spawnedBy == c.getId()) {\n\t\t\t\tif (NPCHandler.npcs[c.getInstance().summoningMonsterId].IsAttackingNPC == true)\n\t\t\t\t\tcallFamiliar();\n\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].IsAttackingNPC = false;\n\t\t\t}\n\t\t\tif (c.getInstance().summoned.killerId != 0 && c.getInstance().summoned.underAttackBy == 0) {\n\t\t\t\tc.getInstance().summoned.killerId = 0;\n\t\t\t\tc.getInstance().summoned.underAttackBy = 0;\n\t\t\t\tc.getSummoning().callFamiliar();\n\t\t\t}\n\t\t\tif (attacked != true) {\n\t\t\t\tif (NPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackedByPerson == true) {\n\t\t\t\t\tattacked = true;\n\t\t\t\t\tPlayer o = PlayerHandler.players[c.getInstance().underAttackBy];\n\t\t\t\t\tif (o != null) {\n\t\t\t\t\t\tif (o.getInstance().inMulti()) {\n\t\t\t\t\t\t\tif (actionTimer == 0) {\n\t\t\t\t\t\t\t\tServer.npcHandler.followPlayer(c.getInstance().summoningMonsterId, o.playerId,\n\t\t\t\t\t\t\t\t\t\tc.playerId);\n\t\t\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].facePlayer(o.playerId);\n\t\t\t\t\t\t\t\tServer.npcHandler.attackPlayer(o, c.getInstance().summoningMonsterId);\n\t\t\t\t\t\t\t\tc.getInstance().summoned.updateRequired = true;\n\t\t\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].index = o.playerId;\n\t\t\t\t\t\t\t\tactionTimer = 7;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tactionTimer--;\n\t\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}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (attacked != true) {\n\t\t\t\tif (NPCHandler.npcs[c.getInstance().summoningMonsterId].isAttackingAPerson == true) {\n\t\t\t\t\tattacked = true;\n\t\t\t\t\tPlayer o = PlayerHandler.players[c.getInstance().playerIndex];\n\t\t\t\t\tif (o != null) {\n\t\t\t\t\t\tif (o.getInstance().inMulti()) {\n\t\t\t\t\t\t\tif (actionTimer == 0) {\n\t\t\t\t\t\t\t\tServer.npcHandler.followPlayer(c.getInstance().summoningMonsterId, o.playerId,\n\t\t\t\t\t\t\t\t\t\tc.playerId);\n\t\t\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].facePlayer(o.playerId);\n\t\t\t\t\t\t\t\tServer.npcHandler.attackPlayer(o, c.getInstance().summoningMonsterId);\n\t\t\t\t\t\t\t\tc.getInstance().summoned.updateRequired = true;\n\t\t\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].index = o.playerId;\n\t\t\t\t\t\t\t\tactionTimer = 7;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tactionTimer--;\n\t\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}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (attacked != true) {\n\t\t\t\tif (NPCHandler.npcs[c.getInstance().summoningMonsterId].IsAttackingNPC == true) {\n\t\t\t\t\tattacked = true;\n\t\t\t\t\tNPC n = NPCHandler.npcs[c.getInstance().npcIndex];\n\t\t\t\t\tif (n != null) {\n\t\t\t\t\t\t// if(n.inMulti()) {\n\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().summoningMonsterId].IsAttackingNPC = true;\n\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().npcIndex].IsUnderAttackNpc = true;\n\t\t\t\t\t\tNPCHandler.npcs[c.getInstance().npcIndex].randomWalk = false;\n\t\t\t\t\t\t// GameEngine.npcHandler.attackNPC(c.npcIndex,\n\t\t\t\t\t\t// c.getVariables().summoningMonsterId, c);\n\t\t\t\t\t\tServer.npcHandler.NpcVersusNpc(c.getInstance().summoningMonsterId,\n\t\t\t\t\t\t\t\tc.getInstance().npcIndex, c);\n\t\t\t\t\t\t// }\n\t\t\t\t\t} else {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tspeakTimer++;\n\t\t\tif (speakTimer == 100) {\n\t\t\t\tc.getInstance().summoned.forceChat(summonedFamiliar.speakText);\n\t\t\t\tspeakTimer = 0;\n\t\t\t}\n\t\t\tc.getInstance().specRestoreTimer -= 1;\n\t\t\tint hours = (c.getInstance().specRestoreTimer / 2) / 3600;\n\t\t\tint minutes = ((c.getInstance().specRestoreTimer / 2) - hours * 3600) / 60;\n\t\t\tint seconds = ((c.getInstance().specRestoreTimer / 2) - (hours * 3600 + minutes * 60));\n\n\t\t\tString timer = String.format(\"%02d:%02d\", minutes, seconds);\n\t\t\tc.getPA().sendString(timer, 17021);\n\t\t\tif (c.getInstance().specRestoreTimer == 100) {\n\t\t\t\tc.sendMessage(\"@red@Your familiar will run out in approximately 1 minute.\");\n\t\t\t\tc.sendMessage(\"@red@Warning! Item's stored in familiar will be dropped upon death!\");\n\t\t\t} else if (c.getInstance().specRestoreTimer == 50) {\n\t\t\t\tc.sendMessage(\"@red@Your familiar will run out in approximately 30 seconds.\");\n\t\t\t\tc.sendMessage(\"@red@Warning! Item's stored in familiar will be dropped upon death!\");\n\t\t\t} else if (c.getInstance().specRestoreTimer == 25) {\n\t\t\t\tc.sendMessage(\"@red@Your familiar will run out in approximately 15 seconds.\");\n\t\t\t\tc.sendMessage(\"@blu@ You can renew your familiar with a new pouch by clicking @red@ Renew pouch\");\n\t\t\t\tc.sendMessage(\"@red@Warning! Item's stored in familiar will be dropped upon death!\");\n\t\t\t} else if (c.getInstance().specRestoreTimer <= 0) {\n\t\t\t\tdismissFamiliar(false);\n\t\t\t}\n\t\t\tif (familiarSpecialEnergy != 60) {\n\t\t\t\tspecialRestoreCycle++;\n\t\t\t\tif (specialRestoreCycle == 50) {\n\t\t\t\t\tif (familiarSpecialEnergy != 60) {\n\t\t\t\t\t\tfamiliarSpecialEnergy += 15;\n\t\t\t\t\t\tif (familiarSpecialEnergy >= 60) {\n\t\t\t\t\t\t\tfamiliarSpecialEnergy = 60;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tspecialRestoreCycle = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tspecialTimer--;\n\t\t}\n\t\tif (renewTimer > 0) {\n\t\t\trenewTimer--;\n\t\t\tif (renewTimer == 0 && c.getInstance().summoned == null && summonedFamiliar != null) {\n\t\t\t\tc.getInstance().summoned = Server.npcHandler.summonNPC(c, summonedFamiliar.npcId, c.getX(),\n\t\t\t\t\t\tc.getY() + (summonedFamiliar.large ? 2 : 1), c.heightLevel, 0,\n\t\t\t\t\t\tSummoningData.getSummonHealth(summonedFamiliar.npcId), 1, 1, 1);\n\t\t\t\tcallFamiliar();\n\t\t\t}\n\t\t}\n\t\tif (loginCycle > 0) {\n\t\t\tloginCycle--;\n\t\t\tif (loginCycle == 0 && c.getInstance().summoned == null && summonedFamiliar != null) {\n\t\t\t\tc.getInstance().summoned = Server.npcHandler.summonNPC(c, summonedFamiliar.npcId, c.getX(),\n\t\t\t\t\t\tc.getY() + (summonedFamiliar.large ? 2 : 1), c.heightLevel, 0,\n\t\t\t\t\t\tSummoningData.getSummonHealth(summonedFamiliar.npcId), 1, 1, 1);\n\t\t\t\tcallFamiliar();\n\t\t\t}\n\t\t}\n\t}", "public void act()\r\n {\r\n if(worldTimer == 1)\r\n {\r\n if(wildPokemon)\r\n {\r\n textInfoBox.displayText(\"Wild \" + enemyPokemon.getName() + \" appeared!\", true, false);\r\n }\r\n else\r\n {\r\n textInfoBox.displayText(\"Enemy trainer sent out \" + enemyPokemon.getName() + \"!\", true, false);\r\n }\r\n textInfoBox.displayText(\"Go \" + playerPokemon.getName() + \"!\", true, false);\r\n textInfoBox.updateImage();\r\n\r\n worldTimer++;\r\n }\r\n else if(worldTimer == 0)\r\n {\r\n worldTimer++;\r\n }\r\n\r\n if(getObjects(Pokemon.class).size() < 2)\r\n {\r\n ArrayList<Pokemon> pokemon = (ArrayList<Pokemon>) getObjects(Pokemon.class);\r\n for(Pokemon pkmn : pokemon)\r\n {\r\n if(pkmn.getIsPlayers() == true)\r\n {\r\n textInfoBox.displayText(\"Enemy \" + enemyPokemonName.toUpperCase() + \" fainted!\", true, false);\r\n\r\n int expGain = StatCalculator.experienceGainCalc(playerPokemon.getName(), playerPokemon.getLevel());\r\n textInfoBox.displayText(playerPokemon.getName().toUpperCase() + \" gained \" + expGain + \"\\nEXP. Points!\", true, false);\r\n playerPokemon.addEXP(expGain);\r\n if(playerPokemon.getCurrentExperience() >= StatCalculator.experienceToNextLevel(playerPokemon.getLevel()))\r\n {\r\n int newEXP = playerPokemon.getCurrentExperience() - StatCalculator.experienceToNextLevel(playerPokemon.getLevel());\r\n playerPokemon.setEXP(newEXP);\r\n playerPokemon.levelUp();\r\n playerPokemon.newPokemonMoves();\r\n\r\n textInfoBox.displayText(playerPokemonName.toUpperCase() + \" grew to level \" + playerPokemon.getLevel() + \"!\", true, false);\r\n }\r\n savePokemonData(playerPokemon, currentPlayerPokemon);\r\n\r\n textInfoBox.updateImage();\r\n isPlayersTurn = true;\r\n battleOver();\r\n }\r\n else\r\n {\r\n textInfoBox.displayText(playerPokemonName.toUpperCase() + \" fainted!\", true, false);\r\n\r\n String playerName = Reader.readStringFromFile(\"gameInformation\", 0, 0);\r\n textInfoBox.displayText(playerName + \" blacked out!\", true, false);\r\n\r\n addObject(new Blackout(\"Fade\"), getWidth() / 2, getHeight() / 2);\r\n removeAllObjects();\r\n\r\n String newWorld = Reader.readStringFromFile(\"gameInformation\", 0, 4);\r\n int newX = Reader.readIntFromFile(\"gameInformation\", 0, 5);\r\n int newY = Reader.readIntFromFile(\"gameInformation\", 0, 6);\r\n\r\n GameWorld gameWorld = new GameWorld(newWorld, newX, newY, \"Down\");\r\n gameWorld.healPokemon();\r\n Greenfoot.setWorld(gameWorld);\r\n\r\n isPlayersTurn = true;\r\n battleOver();\r\n }\r\n }\r\n } \r\n\r\n if(isBattleOver)\r\n {\r\n isPlayersTurn = true;\r\n savePokemonData(playerPokemon, currentPlayerPokemon);\r\n newGameWorld();\r\n }\r\n }", "public void run(){\n\t\twhile(true){\n\n\t\t\ttry {\n\t\t\t\tsleep(200);\n\t\t\t} catch (InterruptedException e) {\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t// sleep mode\n\t\t\tif(isSuspended==true)\n\t\t\t\tsynchronized (this) {\n\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\twait();\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t//movement\n\t\t\tif(isSuspended==false)\n\t\t\t{\n\n\t\t\t\tif(state.toString() == \"Satiated\"&&counter%Frequency==0&&(!Singleton.getInstance().getFood())){\n\t\t\t\t\tnew Hungry().SetState(this);\t\n\t\t\t\t\tnotifyObservers();\n\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t\tcounter++;\n\n\t\t\t\t//checking food\n\t\t\t\tif(Singleton.getInstance().getFood() && state.toString() == \"Hungry\") //, set movement to the center\n\t\t\t\t{\n\t\t\t\t\ttry {\n\t\t\t\t\t\tbarrier.await();\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} catch (BrokenBarrierException 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\n\t\t\t\t\tv_old = Math.sqrt(x_speed*x_speed + y_speed*y_speed); \t\t\t\t\t\t\t\n\t\t\t\t\tdouble K = Math.abs( (double)(y_front - MyFrame.getHeight()/2) / (double)(x_front - MyFrame.getWidth()/2));\n\t\t\t\t\tv_hor_new = v_old / Math.sqrt(K*K+1);\t\t\t\t\t\n\t\t\t\t\tv_ver_new = v_hor_new * K;\t\t\t\t\t\t\t\t\t\t\t\n\n\n\t\t\t\t\twhile(Singleton.getInstance().getFood()==true)\n\t\t\t\t\t{\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tsleep(200);\n\t\t\t\t\t\t} catch (InterruptedException e) {\t\t\t\t\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(x_front>MyFrame.getWidth()/2)\n\t\t\t\t\t\t\tx_dir = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tx_dir=1;\n\t\t\t\t\t\tif(y_front>MyFrame.getHeight()/2)\n\t\t\t\t\t\t\ty_dir=-1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty_dir=1;\n\n\t\t\t\t\t\tx_front+=(int)v_hor_new*x_dir;\n\t\t\t\t\t\ty_front+=(int)v_ver_new*y_dir;\n\n\t\t\t\t\t\tif((Math.abs(x_front-MyFrame.getWidth()/2) <= 5) && (Math.abs(y_front-MyFrame.getHeight()/2) <= 5))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.eatInc();\n\t\t\t\t\t\t\tSingleton.getInstance().eatFood();\n\t\t\t\t\t\t\tnew Satiated().SetState(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tMyFrame.repaint();\n\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\t\t\t\telse //no food\n\t\t\t\t{\n\t\t\t\t\tx_front+=x_speed*x_dir;\n\t\t\t\t\ty_front+=y_speed*y_dir;\n\t\t\t\t\tMyFrame.repaint();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//check if direction changed\n\n\t\t\tif(x_front>=MyFrame.getWidth())\n\t\t\t{\n\t\t\t\tx_dir=-1;\n\n\t\t\t}\n\t\t\tif(y_front>=MyFrame.getHeight())\n\t\t\t{\n\t\t\t\ty_dir=-1;\n\n\t\t\t}\n\t\t\tif(x_front<=0)\n\t\t\t{\n\t\t\t\tx_dir=1;\n\n\t\t\t}\n\n\t\t\tif(y_front<=0)\n\t\t\t{\n\t\t\t\ty_dir=1;\n\n\t\t\t}\n\n\t\t\tMyFrame.repaint();\n\n\n\n\t\t}\n\n\t}", "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 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 startTimer() {\n // TODO = handle more aspects of the behaviour required by the specification\n System.out.println(\"starting timer\");\n initialHeroCastle();\n isPaused = false;\n // trigger adding code to process main game logic to queue. JavaFX will target\n // framerate of 0.3 seconds\n timeline = new Timeline(new KeyFrame(Duration.seconds(0.1), event -> {\n if (world.getMode() == -1){\n modeSelectionSwitchToMainMenu();\n }\n world.runTickMoves();\n world.runBattles();\n world.updateGoal();\n if (world.goalAchieved()) {\n world.gameOver();\n deadSwitchToMainMenu(true);\n return;\n }\n List<Soldier> soldiers = world.possiblySpawnSoldiers();\n for (Soldier s : soldiers) {\n loadSoldier(s);\n }\n List<BasicEnemy> deadEnemies = world.cleanEnemies();\n for (BasicEnemy e : deadEnemies) {\n reactToEnemyDefeat(e);\n }\n List<BasicEnemy> newEnemies = world.possiblySpawnEnemies();\n for (BasicEnemy newEnemy : newEnemies) {\n loadEnemies(newEnemy);\n }\n printThreadingNotes(\"HANDLED TIMER\");\n loopNumber.setText(\"Loop: \" + (int) world.getCurrentLoop().get());\n if (world.isCharacterDead()) {\n if (!world.useOneRing())\n deadSwitchToMainMenu(false);\n return;\n }\n if (world.isAtHeroCastle() && world.shouldShopAppear()) {\n System.out.println(\"At Hero Castle. Shopping!\");\n shopSwitchToMainMenu();\n }\n }));\n timeline.setCycleCount(Animation.INDEFINITE);\n timeline.play();\n }", "private void checkVictory()\n {\n if(throne.getEnemyHealth() <= 0)\n {\n System.out.println(\"Congrats! The land is now free from all chaos and destruction. You are now very rich and wealthy. Yay\");\n alive = false;\n }\n }", "public void act() \n {\n updateTimerDisplay();\n if(timeCounter < 3600){\n timeCounter++;\n \n }else{\n timeElapsed++;\n timeCounter = 0;\n }\n checkHighScore();\n checkRegScore();\n\n }", "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 startFCombat() {\n\t\ttry { \n\t\t\tenemyName = Monster.getFBossName();\n\t\t\tSystem.out.println(\"\\t!#> \" + enemyName + \" has appeared! <#! \");\n\t\t\tenemyNewHealth = Monster.getFBossHealth();\n\n\t\t\t// While enemy is alive\n\t\t\tCOMBAT_START: while (enemyNewHealth > 0) {\n\t\t\t\tSystem.out.println(Player.getPlayerName() + \"\\n HP: \" + playerNewHealth + \" Stamina: \"\n\t\t\t\t\t\t+ Player.getPlayerStamina());\n\t\t\t\tSystem.out.println(\"----------------------------\");\n\t\t\t\tSystem.out.println(enemyName + \" HP: \" + enemyNewHealth);\n\n\t\t\t\tScanner in = new Scanner(System.in);\n\t\t\t\tSystem.out.println(\"\\n\\t # ACTIONS # \");\n\t\t\t\tSystem.out.println(\"\\t1.) Attack!\");\n\t\t\t\tSystem.out.println(\"\\t2.) Block!\");\n\t\t\t\tSystem.out.println(\"\\t3.) Run!\\n\");\n\t\t\t\tSystem.out.println(\"What are you going to do?\");\n\t\t\t\tint input = in.nextInt();\n\t\t\t\t// conditonal preventing other input\n\t\t\t\tif (input == 1 || input == 2 || input == 3) {\n\t\t\t\t\t// Attack\n\t\t\t\t\tif (input == 1) {\n\t\t\t\t\t\tenemySwing = rand.nextInt(Monster.getFBossAttack()+1);\n\t\t\t\t\t\thit = rand.nextInt(Player.Attack()+1);\n\t\t\t\t\t\tSystem.out.println(\"You lunge forward and strike the \" + enemyName + \"!!\");\n\t\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\t\t\t\t\t\tSystem.out.println(\"You dealt \" + hit + \" damage!\");\t\t\n\t\t\t\t\t\tSystem.out.println(enemyName + \" dealt \" + enemySwing + \" Damage!\");\n\t\t\t\t\t\tenemyNewHealth = enemyNewHealth - hit;\n\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\tif (playerNewHealth <= 0) {\n\t\t\t\t\t\t\tSystem.out.println(\"\\t!@#$%^ GAME OVER ^%$#@!\");\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (enemyNewHealth <= 0) {\n\t\t\t\t\t\t\tenemyNewHealth = 0;\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\"The \" + enemyName + \" has \" + enemyNewHealth + \" health left!\");\n\t\t\t\t\t\t\tcontinue COMBAT_START;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Block\n\t\t\t\t\tif (input == 2) {\n\t\t\t\t\t\tenemySwing = rand.nextInt(Monster.Attack());\n\t\t\t\t\t\tSystem.out.println(\"You attempt to cower behind your shield!\");\n\t\t\t\t\t\t// Block\n\t\t\t\t\t\tif (Player.Block() == true) {\n\t\t\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\n\t\t\t\t\t\t\tSystem.out.println(\"\\tBlock Successful!\");\n\t\t\t\t\t\t\tSystem.out.println(enemyName + \" trys to deal \" + enemySwing + \" damage!\");\n\t\t\t\t\t\t\t// how much is blocked\n\t\t\t\t\t\t\tenemySwing = enemySwing - rand.nextInt(Player.getPlayerMaxBlock());\n\t\t\t\t\t\t\t// if how much is blocked results neg make it 0\n\t\t\t\t\t\t\tif (enemySwing <= 0) {\n\t\t\t\t\t\t\t\tenemySwing = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// output results\n\t\t\t\t\t\t\tSystem.out.println(\"You took \" + enemySwing + \" damage\");\n\t\t\t\t\t\t\t// adjust health value\n\t\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(enemyName + \" dealt \" + enemySwing + \" damage!\");\n\t\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (playerNewHealth <= 0) {\n\t\t\t\t\t\t\tSystem.out.println(\"\\t!@#$%^ GAME OVER ^%$#@!\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue COMBAT_START;\n\n\t\t\t\t\t}\n\t\t\t\t\t// Run chance\n\t\t\t\t\tif (input == 3) {\n\t\t\t\t\t\tSystem.out.println(\"You attempt to flee!\");\n\t\t\t\t\t\t// roll to see if flee\n\t\t\t\t\t\tif (Player.Run() == true) {\n\t\t\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\t\t\t\t\t\t\tSystem.out.println(\"you've run away from the \" + enemyName + \"!\");\n\t\t\t\t\t\t\tbreak COMBAT_START;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tenemySwing = rand.nextInt(Monster.Attack());\n\t\t\t\t\t\t\tSystem.out.println(enemyName + \" dealt \" + enemySwing + \" Damage!\");\n\t\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\t\tcontinue COMBAT_START;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\\t!!!Invalid Input!!!\");\n\t\t\t\t\tSystem.out.println(\"\\tPlease try Again.\");\n\t\t\t\t}\n\n\t\t\t\t// When Enemy Dies.\n\t\t\t\t//TODO: add timeunit here\n\t\t\t\tif (enemyNewHealth <= 0) {\n\t\t\t\t\tSystem.out.println(\"You have defeated \" + enemyName + \"!!\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tYou have beaten my FIRST game ever.\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tThank you so fuckin' much for playing.\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tit means the W O R L D to me :)\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tIf you want to see more of my work,\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tfollow me on Twitter @Simons_saysNull\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\t\t\t\t\tSystem.out.println(\"\\tThanks again for playing my game. - Robb Simons\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue COMBAT_START;\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void combatPhase() {\n \t\n \tpause();\n \tDice.setFinalValMinusOne();\n\n \t// Go through each battle ground a resolve each conflict\n \tfor (Coord c : battleGrounds) {\n \t\t\n \tClickObserver.getInstance().setTerrainFlag(\"\");\n \t\n \tSystem.out.println(\"Entering battleGround\");\n \t\tfinal Terrain battleGround = Board.getTerrainWithCoord(c);\n \t\t\n \t\t// find the owner of terrain for post combat\n \tPlayer owner = battleGround.getOwner();\n \t\n \t\t// simulate a click on the first battleGround, cover all other terrains\n \t\tClickObserver.getInstance().setClickedTerrain(battleGround);\n \t\tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\tClickObserver.getInstance().whenTerrainClicked();\n \t\tBoard.applyCovers();\n \t\tClickObserver.getInstance().getClickedTerrain().uncover();\n \tClickObserver.getInstance().setTerrainFlag(\"Disabled\");\n }\n });\n \t\t\n \t\t// Get the fort\n \t Fort battleFort = battleGround.getFort(); \n \t\t\n \t\t// List of players to battle in the terrain\n \t\tArrayList<Player> combatants = new ArrayList<Player>();\n \t\t\n \t\t// List of pieces that can attack (including forts, city/village)\n \t\tHashMap<String, ArrayList<Piece>> attackingPieces = new HashMap<String, ArrayList<Piece>>();\n \t\t\n \t\tSystem.out.println(battleGround.getContents().keySet());\n \t\t\n \t\tIterator<String> keySetIterator = battleGround.getContents().keySet().iterator();\n\t \twhile(keySetIterator.hasNext()) {\n\t \t\tString key = keySetIterator.next();\n\t \t\t\n \t\t\tcombatants.add(battleGround.getContents().get(key).getOwner());\n \t\t\tattackingPieces.put(battleGround.getContents().get(key).getOwner().getName(), (ArrayList<Piece>) battleGround.getContents().get(key).getStack().clone()); \n \t\t\t\n\t \t}\n\t \t\n\t \t\n\t \t\n\t \t// if the owner of the terrain has no pieces, just a fort or city/village\n\t\t\tif (!combatants.contains(battleGround.getOwner()) && battleFort != null) {\n\t\t\t\tcombatants.add(battleGround.getOwner());\n\t\t\t\tattackingPieces.put(battleGround.getOwner().getName(), new ArrayList<Piece>());\n\t\t\t}\n\n \t\t// add forts and city/village to attackingPieces\n \t\tif (battleFort != null) {\n \t\t\tattackingPieces.get(battleGround.getOwner().getName()).add(battleFort);\n \t\t}\n \t\t\n \t\tkeySetIterator = attackingPieces.keySet().iterator();\n\t \twhile (keySetIterator.hasNext()) {\n\t \t\tString key = keySetIterator.next();\n\t \t\t\n\t \t\tfor (Piece p : attackingPieces.get(key)) {\n\t \t\t\tif (p.getName().equals(\"Baron Munchhausen\") || p.getName().equals(\"Grand Duke\")) {\n\t \t\t\t\tif (p.getOwner() != battleGround.getOwner())\n\t \t\t\t\t\t((Performable)p).specialAbility();\n\t \t\t\t}\n\t \t\t\t\t\n\t \t\t}\n\t \t}\n \t\t// TODO implement city/village\n// \t\tif (City and village stuff here)\n \t\tSystem.out.println(combatants);\n \t\t\n \t\tboolean exploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t// Fight until all attackers are dead, or until the attacker becomes the owner of the hex\n \t\twhile (combatants.size() > 1 || exploring) {\n \t\t\t\n /////////////Exploration\n \t// Check if this is an exploration battle:\n \t\t// Must fight other players first\n \t\t\tboolean fightingWildThings = false;\n \tif (exploring) {\n\n \t\t\t\t// Set the battleGround explored\n \t\t\t\tbattleGround.setExplored(true);\n \t\n \t\tString exploringPlayer = null;\n \t\tIterator<String> keySetIter = battleGround.getContents().keySet().iterator();\n \t \twhile(keySetIter.hasNext()) {\n \t \t\tString key = keySetIter.next();\n \t \t\texploringPlayer = key;\n \t \t}\n \t\tplayer = battleGround.getContents(exploringPlayer).getOwner();\n \t\tplayer.flipAllUp();\n \t \t\n \t\t// Get user to roll die to see if explored right away\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \tDiceGUI.getInstance().uncover();\n \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n \t \t\t\t+ \", roll the die. You need a 1 or a 6 to explore this terrain without a fight!\");\n \t }\n \t\t\t\t});\n \t\t\t\t\n \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\tint luckyExplore = -1;\n \t\t\t\twhile (luckyExplore == -1) {\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\tluckyExplore = Dice.getFinalVal();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// If success TODO FIX this \n \t\t\t\tif (luckyExplore == 1 || luckyExplore == 6) {\n \t\t\t\t\t\n \t\t\t\t\t// Cover die. Display msg\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \tDiceGUI.getInstance().cover();\n \t\t \tGUI.getHelpText().setText(\"Attack phase: Congrats!\" + player.getName() \n \t\t \t\t\t+ \"!, You get the terrain!\");\n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\texploring = false;\n \t\t\t\t\tbreak;\n \t\t\t\t\t\n \t\t\t\t} else { // Else failure. Must fight or bribe\n \t\t\t\t\t\n \t\t\t\t\tfightingWildThings = true;\n \t\t\t\t\t\n \t\t\t\t\t// Cover die. Display msg\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \tDiceGUI.getInstance().cover();\n \t\t \tbattleGround.coverPieces();\n \t\t \tGUI.getHelpText().setText(\"Attack phase: Boooo!\" + player.getName() \n \t\t \t\t\t+ \"!, You have to bribe, or fight for your right to explore!\");\n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t// add luckyExplore amount of pieces to terrain under wildThing player\n \t\t\t\t\tfinal ArrayList<Piece> wildPieces = TheCup.getInstance().draw(luckyExplore);\n \t\t\t\t\t\t\n \t\t\t\t\t// Update the infopanel with played pieces. Active done button\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \twildThings.playWildPieces(wildPieces, battleGround);\n \t\t GUI.getDoneButton().setDisable(false);\n \t\t battleGround.coverPieces();\n \t\t \tInfoPanel.showTileInfo(battleGround);\n \t\t \n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t//////Bribing here\n \t\t\t\t\tpause();\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectCreatureToBribe\");\n \t\t\t\t\t\n \t\t\t\t\t// Uncover the pieces that the player can afford to bribe\n \t\t\t\t\t// canPay is false if there are no Pieces that the user can afford to bribe\n \t\t\t\t\tboolean canPay = false;\n \t\t\t\t\tfor (final Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n \t\t\t\t\t\tif (((Combatable)p).getCombatValue() <= player.getGold()) {\n \t\t\t\t\t\t\tcanPay = true;\n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t\t\t @Override\n \t\t\t\t public void run() {\n \t\t\t\t \tp.uncover();\n \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\ttry { Thread.sleep(50); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t// Continue looping until there are no more pieces user can afford to bribe, or user hits done button\n \t\t\t\t\twhile (canPay && isPaused) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t\t @Override\n\t \t\t public void run() {\n\t \t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t \t\t \t\t\t+ \", Click on creatures you would like to bribe\");\n\t \t\t }\n \t\t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t\t// wait for user to hit done, or select a piece\n \t\t\t\t\t\tpieceClicked = null;\n \t\t\t\t\t\twhile(pieceClicked == null && isPaused) {\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (pieceClicked != null) {\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// spend gold for bribing. Remove clicked creature\n \t\t\t\t\t\t\tplayer.spendGold(((Combatable)pieceClicked).getCombatValue());\n \t\t\t\t\t\t\t((Combatable)pieceClicked).inflict();\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// cover pieces that are too expensive\n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t\t\t @Override\n \t\t\t\t public void run() {\n \t\t\t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n \t\t\t \t\t\t+ \" bribed \" + pieceClicked.getName());\n \t\t\t\t \tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t \tif (battleGround.getContents(wildThings.getName()) != null) {\n\t \t\t\t\t for (Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n\t \t\t\t\t \tif (((Combatable)p).getCombatValue() > player.getGold())\n\t \t\t\t\t \t\tp.cover();\n\t \t\t\t\t }\n \t\t\t\t \t}\n \t\t\t\t }\n \t\t\t\t\t\t\t});\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// Check if there are any pieces user can afford to bribe and set canPay to true if so\n \t\t\t\t\t\t\tcanPay = false;\n \t\t\t\t\t\t\tif (battleGround.getContents(wildThings.getName()) == null || battleGround.getContents(wildThings.getName()).getStack().size() == 1)\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\telse {\n\t \t\t\t\t\t\t\tfor (final Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n\t \t\t\t\t\t\t\t\tif (((Combatable)p).getCombatValue() <= player.getGold()) {\n\t \t\t\t\t\t\t\t\t\tcanPay = true;\n\t \t\t\t\t\t\t\t\t\tbreak;\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t @Override\n\t\t\t public void run() {\n\t\t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t\t \t\t\t+ \" done bribing\");\n\t\t\t }\n \t\t\t\t\t});\n \t\t\t\t\tSystem.out.println(\"Made it past bribing\");\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\t\n \t\t\t\t\t// Done bribing, on to fighting\n \t\t\t\t\t\n \t\t\t\t\t// find another player to control wildThings and move on to regular combat\n \t\t\t\t\t// to be used later \n \t\t\t\t\tPlayer explorer = player;\n \t\t\t\t\tPlayer wildThingsController = null;\n \t\t\t\t\tfor (Player p : playerList) {\n \t\t\t\t\t\tif (!p.getName().equals(player.getName()))\n \t\t\t\t\t\t\twildThingsController = p;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// If wild things still has pieces left:\n \t\t\t\t\tif (battleGround.getContents().containsKey(wildThings.getName())) {\n\t \t\t\t\t\tcombatants.add(battleGround.getContents().get(wildThings.getName()).getOwner());\n\t \t \t\t\tattackingPieces.put(wildThings.getName(), (ArrayList<Piece>) battleGround.getContents().get(wildThings.getName()).getStack().clone()); \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// cover pieces again\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \tbattleGround.coverPieces();\n \t }\n \t\t\t\t});\n \t\t\t\t\n \t\t\t\tplayer.flipAllDown();\n \t} // end if (exploring)\n \t\t\t\n \t\t\tSystem.out.println(\"combatants.size() > 1 : \" + combatants.size());\n \t\t\tSystem.out.println(combatants);\n \t\t\t\n \t\t\t// This hashMap keeps track of the player to attack for each player\n \t\t\tHashMap<String, Player> toAttacks = new HashMap<String, Player>();\n\n\t\t\t\t// each player selects which other player to attack in case of more than two combatants\n \t\t\tif (combatants.size() > 2) {\n \t\t\t\t\n \t\t\t\tfor (final Player p : combatants) {\n \t\t\t\t\tif (!p.isWildThing()) {\n\t \t \t\tpause();\n\t \t \t\tClickObserver.getInstance().setPlayerFlag(\"Attacking: SelectPlayerToAttack\");\n\t \t \t\tplayer = p;\n\t\t \tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t \tPlayerBoard.getInstance().applyCovers();\n\t\t \t \tbattleGround.coverPieces();\n\t\t \t \t GUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t\t \t + \", select which player to attack\");\n\t\t\t \t \t}\n\t\t \t });\n\t\t \tfor (final Player pl : combatants) {\n\t\t \t\tif (!pl.getName().equals(player.getName())) {\n\t\t \t\t\tPlatform.runLater(new Runnable() {\n\t\t \t \t @Override\n\t\t \t \t public void run() {\n\t\t \t \t \tPlayerBoard.getInstance().uncover(pl);\n\t\t \t \t }\n\t\t \t\t\t});\n\t\t \t\t}\n\t\t \t}\n\t\t \twhile (isPaused) {\n\t\t \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t\t \t }\n\t\t \t\n\t\t \t// ClickObserver sets playerClicked, then unpauses. This stores what player is attacking what player\n\t\t \ttoAttacks.put(p.getName(), playerClicked);\n\t \t \t\tClickObserver.getInstance().setPlayerFlag(\"\");\n\t\t \t\n\t \t \t} \n \t\t\t\t}\n \t\t\t\tcombatants.remove(wildThings);\n \t\t\t\tPlayerBoard.getInstance().removeCovers();\n \t\t\t\t\n \t } else { // Only two players fighting\n \t \t\n \t \tfor (Player p1 : combatants) {\n \t \t\tfor (Player p2 : combatants) {\n \t \t\t\tif (!p1.getName().equals(p2.getName())) {\n \t \t \ttoAttacks.put(p1.getName(), p2);\n \t \t\t\t}\n \t \t\t}\n \t \t}\n \t }\n \t\t\t\n ///////////////////Call out bluffs here:\n \t\t\tbattleGround.flipPiecesUp();\n \t\t\tfor (final Player p : combatants) {\n \t\t\t\t\n \t\t\t\t// Make sure not wildThings\n \t\t\t\tif (!p.isWildThing()) {\n \t\t\t\t\t\n \t\t\t\t\tArrayList <Piece> callOuts = new ArrayList<Piece>();\n \t\t\t\t\t\n \t\t\t\t\tfor (final Piece ap : attackingPieces.get(p.getName())) {\n \t\t\t\t\t\t\n \t\t\t\t\t\t// If not supported the gtfo\n \t\t\t\t\t\tif (!ap.isSupported()) {\n\n \t\t\t\t\t\t\tcallOuts.add(ap);\n \t\t\t\t\t\t\t((Combatable)ap).inflict();\n \t\t\t\t\t\t\ttry { Thread.sleep(250); } catch( Exception e ){ return; } \n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t \t @Override\n\t \t \t public void run() {\n\t \t \t \tInfoPanel.showTileInfo(battleGround);\n\t \t \t \tGUI.getHelpText().setText(\"Attack phase: \" + p.getName()\n\t\t\t \t + \" lost their \" + ap.getName() + \" in a called bluff!\");\n\t \t \t }\n\t \t\t\t});\n \t\t\t\t\t\t\ttry { Thread.sleep(250); } catch( Exception e ){ return; } \n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tfor (Piece co : callOuts) {\n \t\t\t\t\t\tattackingPieces.get(p.getName()).remove(co);\n \t\t\t\t\t}\n\t\t\t\t\t\tif (attackingPieces.get(p.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(p.getName());\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tPlayer baby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\t// Set up this HashMap that will store successful attacking pieces\n \t\t\tHashMap<String, ArrayList<Piece>> successAttacks = new HashMap<String, ArrayList<Piece>>();\n \t\t\t// Set up this HashMap that will store piece marked to get damage inflicted\n\t\t\t\tHashMap<String, ArrayList<Piece>> toInflict = new HashMap<String, ArrayList<Piece>>();\n \t\t\tfor (Player p : combatants) {\n \t\t\t\t\n \t\t\t\tsuccessAttacks.put(p.getName(), new ArrayList<Piece>());\n \t\t\t\ttoInflict.put(p.getName(), new ArrayList<Piece>());\n \t\t\t}\n \t\t\t\n \t\t\t// Array List of pieces that need to be used during a particular phase\n\t\t\t\tfinal ArrayList<Piece> phaseThings = new ArrayList<Piece>();\n\t\t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Magic!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n/////////////////////// Magic phase\n \t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its magic. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && ((Combatable)p).isMagic() && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover magic pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece mag : phaseThings) \n\t \t\t\t\t\tmag.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n\n\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"----------------------------------------------------------------\");\n\t\t\t\t\tSystem.out.println(\"attackingPieces.size(): \" + attackingPieces.size());\n\t\t\t\t\tSystem.out.println(\"attackingPieces.keySet(): \" + attackingPieces.keySet());\n\t\t\t\t\tIterator<String> keySetIte = battleGround.getContents().keySet().iterator();\n \t \twhile(keySetIte.hasNext()) {\n \t \t\tString key = keySetIte.next();\n\n \t\t\t\t\tSystem.out.println(\"key: \" + key);\n \t\t\t\t\tSystem.out.println(\"attackingPieces.get(key).size():\\n\" + attackingPieces.get(key).size());\n \t\t\t\t\tSystem.out.println(\"attackingPieces.get(key):\\n\" + attackingPieces.get(key));\n \t \t}\n\t\t\t\t\tSystem.out.println(\"----------------------------------------------------------------\");\n\t\t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more magic pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a magic piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a magic piece to attack with\");\n\t \t }\n\t \t });\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tpieceClicked.highLight();\n\t \t \tDiceGUI.getInstance().uncover();\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t \t \t\t\t+ \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\n\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\t\tint attackStrength = -1;\n \t\t\t\t\twhile (attackStrength == -1) {\n \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n \t\t\t\t\t}\n\t\t\t\t\t\t\n \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t \t @Override\n \t \t public void run() {\n \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n \t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n \t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\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\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName()); // 'defender'\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\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// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ti++;\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\t\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Ranged!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n//////////////////// Ranged phase\n\t\t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its ranged. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && ((Combatable)p).isRanged() && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover ranged pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece ran : phaseThings) \n\t \t\t\t\t\tran.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more ranged pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a ranged piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a ranged piece to attack with\");\n\t \t }\n\t \t });\n\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tpieceClicked.highLight();\n\t \t \tDiceGUI.getInstance().uncover();\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t \t + \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\n\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\t\tint attackStrength = -1;\n \t\t\t\t\twhile (attackStrength == -1) {\n \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n \t\t\t\t\t}\n\t\t\t\t\t\t\n \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t \t @Override\n \t \t public void run() {\n \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n \t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n \t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\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\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName());\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\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// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\ti++;\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n\t\t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Melee!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n\n///////////////////////////// Melee phase\n\t\t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its melee. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && !(((Combatable)p).isRanged() || ((Combatable)p).isMagic()) && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover melee pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece mel : phaseThings) \n\t \t\t\t\t\tmel.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n \t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more melee pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a melee piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a melee piece to attack with\");\n\t \t }\n\t \t });\n\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// Is it a charging piece?\n\t \t\t\t\tint charger;\n\t \t\t\t\tif (((Combatable)pieceClicked).isCharging()) {\n\t \t\t\t\t\tcharger = 2;\n\t \t\t\t\t} else\n\t \t\t\t\t\tcharger = 1;\n\t \t\t\t\t\n\t \t\t\t\t// do twice if piece is a charger\n\t \t\t\t\tfor (int i = 0; i < charger; i++) {\n\t \t\t\t\t\t\n\t\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t \tpieceClicked.highLight();\n\t\t \t \tDiceGUI.getInstance().uncover();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t\t \t + \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t\t \t }\n\t \t\t\t\t\t});\n\t \t\t\t\t\t\n\t\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n\t \t\t\t\t\tint attackStrength = -1;\n\t \t\t\t\t\twhile (attackStrength == -1) {\n\t \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n\t \t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n\t \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t \t @Override\n\t \t \t public void run() {\n\t \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n\t \t \t\t\t\t\t\tpieceClicked.cover();\n\t \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n\t \t \t }\n\t \t\t\t\t\t});\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t\t \t\t\t\t\t\tpieceClicked.cover();\n\t \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\t\t\t \t }\n\t\t \t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \t\t\t\t\t// If piece is charging, and it is its first attack, remove the cover again\n\t \t\t\t\t\tif (((Combatable)pieceClicked).isCharging() && i == 0) {\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t \t \tpieceClicked.uncover();\n\t\t\t \t }\n\t \t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \t\t\t\t\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n\t \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n\t \t\t\t\t}\n\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName());\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n \t\t\t\t\t\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\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// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n \t\t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\ti++;\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n\t\t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Retreat!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n \t\t\t\n \t\t\t\n//////////////////////// Retreat phase\n\t\t\t\t// Can only retreat to a Terrain that has been explored and has no ememies on it\n\t\t\t\t\n\t\t\t\t// Display message, activate done button\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tGUI.getHelpText().setText(\"Attack phase: Retreat some of your armies?\");\n\t\t GUI.getDoneButton().setDisable(false);\n\t }\n\t }); \t\t\t\t\n\t\t\t\t\n\t\t\t\t// For each combatant, ask if they would like to retreat\n\t\t for (Player pl : combatants) {\n\t\t \t\n\t\t \t// Make sure wildThings aren't trying to get away\n\t\t \tif (!pl.isWildThing()) {\n\t\t\t \tplayer = pl;\n\t \t InfoPanel.uncover(player.getName());\n\t\t\t\t ClickObserver.getInstance().setActivePlayer(player);\n\t\t\t\t ClickObserver.getInstance().setCreatureFlag(\"Combat: SelectRetreaters\");\n\t\t\t\t \n\t\t\t\t // Pause and wait for player to hit done button\n\t\t\t\t pause();\n\t\t\t Platform.runLater(new Runnable() {\n\t\t\t @Override\n\t\t\t public void run() {\n\t\t\t \tbattleGround.coverPieces();\n\t\t\t \tbattleGround.uncoverPieces(player.getName());\n\t\t\t \tbattleGround.coverFort();\n\t\t\t \t GUI.getHelpText().setText(\"Attack Phase: \" + player.getName() + \", You can retreat your armies\");\n\t\t\t }\n\t\t\t });\n\t\t\t\t while (isPaused && battleGround.getContents(player.getName()) != null) {\n\t\t\t \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t\t\t\t }\t \n\t\t\t\t ClickObserver.getInstance().setTerrainFlag(\"Disabled\");\n\t\t\t\t \n\t\t\t\t // TODO, maybe an if block here asking user if they would like to attack \n\t\t\t\t System.out.println(attackingPieces + \"---BEFORE CLEARING\");\n\t\t\t\t // Re-populate attackingPieces to check for changes\n\t\t\t\t attackingPieces.clear();\n\t\t\t\t Iterator<String> keySetIterator2 = battleGround.getContents().keySet().iterator();\n\t\t\t\t \twhile(keySetIterator2.hasNext()) {\n\t\t\t\t \t\tString key = keySetIterator2.next();\n System.out.println(key + \"=====key\");\n\t\t\t \t\t\tattackingPieces.put(battleGround.getContents().get(key).getOwner().getName(), (ArrayList<Piece>) battleGround.getContents().get(key).getStack().clone()); \n\t\t\t\t \t}\n // System.out.println(attackingPieces);\n\t\t\t\t \t// if the owner of the terrain has no pieces, just a fort or city/village\n System.out.println(\"===battleground\"+battleGround);\n System.out.println(\"===attackingPieces\"+attackingPieces);\n System.out.println(combatants.contains(battleGround.getOwner()) ? \"TRUE\" : \"FALSE\");\n\t\t\t\t\t\tif (combatants.contains(battleGround.getOwner()) && battleFort != null) {\n System.out.println(battleGround + \"===battleground\");\n\t\t\t\t\t\t\tattackingPieces.put(battleGround.getOwner().getName(), new ArrayList<Piece>());\n System.out.println(attackingPieces + \"===attacking pieces\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (battleFort != null) {\n System.out.println(battleFort.getName() + \"===battlefort\");\n System.out.println(battleFort.getOwner().getName() + \"===battlefort's owner\");\n \n\t\t\t\t\t\t\tattackingPieces.get(battleFort.getOwner().getName()).add(battleFort);\n System.out.println(attackingPieces.get(battleFort.getOwner().getName()));\n\t\t\t\t\t\t}\n\t//\t\t\t\t\tif (battleGround city/village)\n\t\t\t\t\t\t// TODO city/village\n\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t // Check if all the players pieces are now gone\n\t\t\t\t if (!attackingPieces.containsKey(player.getName())) {\n\t\t\t\t \t\n\t\t\t\t \t// Display message, and remove player from combatants\n\t\t\t\t \tPlatform.runLater(new Runnable() {\n\t\t\t\t @Override\n\t\t\t\t public void run() {\n\t\t\t\t \t GUI.getHelpText().setText(\"Attack Phase: \" + player.getName() + \" has retreated all of their pieces!\");\n\t\t\t\t }\n\t\t\t\t });\n\t\t\t\t \t\n\t\t\t\t \t// If there is only 1 player fighting for the hex, \n\t\t\t\t \tif (attackingPieces.size() == 1) \n\t\t\t\t \t\tbreak;\n\t\t\t\t \t\n\t\t\t\t \t// Pause because somebody just retreated\n\t\t\t\t \ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t }\n\t\t\t\t \n\n\t \t InfoPanel.cover(player.getName());\n\t\t\t\t \n\t\t\t }\n\t\t }\n\t\t \n\t\t // Done button no longer needed\n\t\t Platform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t GUI.getDoneButton().setDisable(true);\n\t\t }\n\t\t });\n\t\t ClickObserver.getInstance().setCreatureFlag(\"\");\n\t\t ClickObserver.getInstance().setFortFlag(\"\");\n\t\t \n\t\t // Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\n\t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n\t\t\t\t\n\t\t\t\t// Add wildthings back to combatants if they were removed\n\t\t\t\tif (battleGround.getContents().containsKey(wildThings.getName()) && !combatants.contains(wildThings))\n\t\t\t\t\tcombatants.add(wildThings);\n\t\t\t\t\n \t\t} // end while (combatants.size() > 1 || exploring)\n \t\tbattleGround.coverFort();\n \t\t\n////////////////// Post Combat\n \t\t\n \t\t// sets player as the winner of the combat\n \t\t// Can be null if battle takes place on a hex owned by nobody, and each player lost all pieces\n \t\tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n \tbattleGround.removeBattleHex();\n }\n \t\t});\n \t\t\n \t\tif (combatants.size() == 0)\n \t\t\tplayer = battleGround.getOwner();\n \t\telse if (combatants.size() == 1 && combatants.get(0).getName().equals(wildThings.getName()))\n \t\t\tplayer = null;\n \t\telse\n \t\t\tplayer = combatants.get(0);\n \t\t\n \t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n \t\tSystem.out.println(\"combatants: \" + combatants);\n \t\tfor (Player p : combatants) {\n \t\tSystem.out.println(\"p.getName(): \"+ p.getName());\n \t\t\t\n \t\t}\n \t\tSystem.out.println(\"owner: \" + owner);\n \t\tSystem.out.println(\"combatants.get(0): \" + combatants.get(0));\n \t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n \t\t\n \t\t\n \t\t// Change ownership of hex to winner\n \t\tboolean ownerChanged = false;\n \t\tif (owner != null && combatants.size() > 0 && !battleGround.getOwner().equals(combatants.get(0))) {\n \t\t\tbattleGround.getOwner().removeHex(battleGround);\n \t\t\tcombatants.get(0).addHexOwned(battleGround);\n \t\t\townerChanged = true;\n \t\t}\n\t\t\t\n \t\t// See if fort is kept or downgraded.\n \t\tif (battleFort != null) {\n if (battleFort.getName().equals(\"Citadel\")) {\n owner.setCitadel(false);\n player.setCitadel(true);\n battleFort.healFort();\n player.addHexOwned(battleGround);\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", you get to keep the fort!\");\n }\n });\n checkWinners();\n return;\n }\n \t\t\n\t\t\t\t// Get player to click dice to see if fort is kept\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", roll the die to see if the fort is kept or downgraded\");\n\t \tDiceGUI.getInstance().uncover();\n\t \tInfoPanel.showTileInfo(battleGround);\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n\t\t\t\tint oneOrSixGood = -1;\n\t\t\t\twhile (oneOrSixGood == -1) {\n\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t\t\t\t\toneOrSixGood = Dice.getFinalVal();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if a 1 or 6, keep fort (Keep it.... not turn it into a keep)\n\t\t\t\tif (oneOrSixGood == 1 || oneOrSixGood == 6) {\n\t\t\t\t\tbattleFort.healFort();\n\t\t\t\t\tplayer.addHexOwned(battleGround);\n\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", you get to keep the fort!\");\n\t\t }\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tbattleFort.downgrade();Platform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", the fort was destroyed!\");\n\t\t }\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tInfoPanel.showTileInfo(battleGround);\n\t }\n\t });\n\t\t\t\t\n\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n\t\t\t\t\n\t\t\t\t\n \t\t}\n\n \t\tbattleGround.flipPiecesDown();\n\t\t\t// TODO city/village and special incomes if they are kept or lost/damaged \n \t\t\n \t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t}/// end Post combat\n\n \tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n//\t\t\t\tInfoPanel.showBattleStats();\n \tBoard.removeCovers();\n }\n\t\t});\n \t\n\t\tClickObserver.getInstance().setTerrainFlag(\"\");\n\t\tClickObserver.getInstance().setPlayerFlag(\"\");\n\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\tbattleGrounds.clear();\n }", "public static void doEncounters() {\r\n \t\r\n \tIterator<String> populationIter = population.keySet().iterator();\r\n\t\twhile (populationIter.hasNext()) { \r\n\t String pos = populationIter.next();\r\n\t ArrayList<Critter> critterList = population.get(pos);\r\n\t if(critterList.size() > 1) {\r\n\t \tint[] coords = stringToPos(pos);\r\n\t \t//get the integer value of the coordinates from the String key\r\n\t \tint x_copy = coords[0];\r\n\t \tint y_copy = coords[1];\r\n\t \t\r\n\t \tfor(int i = 0; i < critterList.size(); i++) {\r\n\t \t\tfor (int j = i+1; j < critterList.size(); j++) {\r\n\t \t\t\tCritter A = critterList.get(i);\r\n\t \t\t\tCritter B = critterList.get(j);\r\n\t \t\t\tif(A.getEnergy() > 0 && B.getEnergy() > 0 && A.x_coord == x_copy && A.y_coord == y_copy && B.x_coord == x_copy && B.y_coord == y_copy) {\r\n\t \t\t\t\t\r\n\t \t\t\t\t//Critters A and B are fighting\r\n\t \t\t\t\tA.isFight = true;\r\n\t \t\t\t\tB.isFight = true;\r\n\t \t\t\t\t\r\n\t \t\t\t\t//boolean AWantsToFight = A.fight(B.toString());\r\n\t \t\t\t\t//boolean BWantsToFight = B.fight(A.toString());\r\n\t \t\t\t\tint skillA = 0;\r\n\t \t\t\t\tint skillB = 0;\r\n\t \t\t\t\t\r\n\t \t\t\t\t//determine how A wants to respond\r\n\t \t\t\t\tif(A.fight(B.toString()) == true) {\r\n\t \t\t\t\t\tskillA = getRandomInt(A.energy);\r\n\t \t\t\t\t}\r\n\t \t\t\t\t\r\n\t \t\t\t\t//determine how B wants to respond\r\n\t \t\t\t\tif(B.fight(A.toString()) == true) {\r\n\t \t\t\t\t\tskillB = getRandomInt(B.energy);\r\n\t \t\t\t\t}\r\n\t \t\t\t\tif(A.x_coord == x_copy && B.x_coord == x_copy && A.y_coord == y_copy && B.y_coord == y_copy) {\r\n\t \t\t\t\t\tif(skillA > skillB) { // A wins\r\n\t \t\t\t\t\t\tA.energy += (int) Math.floor(B.energy*1.0*0.5);\r\n\t \t\t\t\t\t\tB.energy = 0;\r\n\t \t\t\t\t\t} else if (skillB > skillA) {\r\n\t \t\t\t\t\t\tB.energy += (int) Math.floor(A.energy*1.0*0.5); //B wins\r\n\t \t\t\t\t\t\tA.energy = 0;\r\n\t \t\t\t\t\t} else {\r\n\t \t\t\t\t\t\tif(getRandomInt(1) == 0) { // A wins\r\n\t\t \t\t\t\t\t\tA.energy += (int) Math.floor(B.energy*1.0*0.5);\r\n\t\t \t\t\t\t\t\tB.energy = 0;\r\n\t \t\t\t\t\t\t} else {\r\n\t\t \t\t\t\t\t\tB.energy += (int) Math.floor(A.energy*1.0*0.5); //B wins\r\n\t\t \t\t\t\t\t\tA.energy = 0;\r\n\t \t\t\t\t\t\t}\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t}\r\n\t \t\t\t\t\r\n\t \t\t\t\t//Critters A and B have completed their fight\r\n\t \t\t\t\tA.isFight = false;\r\n\t \t\t\t\tB.isFight = false;\r\n\t \t\t\t\t\r\n\t \t\t\t\tcritterList.set(i, A);\r\n\t \t\t\t\tcritterList.set(j, B);\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t}\r\n\t \t\r\n\t \t//Iterate through the critters in that position\r\n\t \tIterator<Critter> crittIter = critterList.iterator();\r\n\t \twhile(crittIter.hasNext()) {\r\n\t \t\tCritter c = crittIter.next();\r\n\t \t\t//remove critters who have moved out of that grid position or who have died\r\n\t \t\tif(c.x_coord != x_copy || c.y_coord != y_copy || (c.energy <= 0)) {\r\n\t \t\t\tcrittIter.remove();\r\n\t \t\t}\r\n\t \t}\r\n\t \tpopulation.replace(pos, critterList);\r\n\t }\r\n\t\t}\r\n }", "private synchronized void teamVictory() {\n \t\tif (state == MatchState.ONVICTORY || state == MatchState.ONCOMPLETE || state == MatchState.ONCANCEL) \n \t\t\treturn;\n \t\tstate = MatchState.ONVICTORY;\n \t\t/// Call the rest after a 2 tick wait to ensure the calling transitionMethods complete before the\n \t\t/// victory conditions start rolling in\n \t\tBukkit.getScheduler().scheduleSyncDelayedTask(plugin, new MatchVictory(this),2L);\n \t}", "private void pollOneCreatureOnThisTile(boolean lava, Creature aCreature, boolean areaEffect) {\n/* */ try {\n/* 1373 */ boolean dead = false;\n/* 1374 */ if (aCreature.poll()) {\n/* 1375 */ deleteCreature(aCreature);\n/* 1376 */ } else if (lava) {\n/* */ \n/* 1378 */ if (!aCreature.isInvulnerable() && !aCreature.isGhost() && !aCreature.isUnique())\n/* */ {\n/* 1380 */ if (aCreature.getDeity() == null || !aCreature.getDeity().isMountainGod() || aCreature.getFaith() < 35.0F)\n/* */ {\n/* 1382 */ if (aCreature.getFarwalkerSeconds() <= 0) {\n/* */ \n/* 1384 */ Wound wound = null;\n/* */ \n/* */ \n/* */ try {\n/* 1388 */ byte pos = aCreature.getBody().getRandomWoundPos((byte)10);\n/* 1389 */ if (Server.rand.nextInt(10) <= 6)\n/* */ {\n/* 1391 */ if (aCreature.getBody().getWounds() != null) {\n/* */ \n/* 1393 */ wound = aCreature.getBody().getWounds().getWoundAtLocation(pos);\n/* 1394 */ if (wound != null) {\n/* */ \n/* 1396 */ dead = wound.modifySeverity(\n/* 1397 */ (int)(5000.0F + Server.rand.nextInt(5000) * (100.0F - aCreature.getSpellDamageProtectBonus()) / 100.0F));\n/* 1398 */ wound.setBandaged(false);\n/* 1399 */ aCreature.setWounded();\n/* */ } \n/* */ } \n/* */ }\n/* 1403 */ if (wound == null)\n/* */ {\n/* 1405 */ if (!aCreature.isGhost() && !aCreature.isUnique() && \n/* 1406 */ !aCreature.isKingdomGuard())\n/* */ {\n/* 1408 */ dead = aCreature.addWoundOfType(null, (byte)4, pos, false, 1.0F, true, (5000.0F + Server.rand\n/* 1409 */ .nextInt(5000) * (100.0F - aCreature.getSpellDamageProtectBonus()) / 100.0F), 0.0F, 0.0F, false, false);\n/* */ }\n/* */ }\n/* 1412 */ aCreature.getCommunicator().sendAlertServerMessage(\"You are burnt by lava!\");\n/* 1413 */ if (dead)\n/* */ {\n/* 1415 */ aCreature.achievement(142);\n/* 1416 */ deleteCreature(aCreature);\n/* */ }\n/* */ \n/* 1419 */ } catch (Exception ex) {\n/* */ \n/* 1421 */ logger.log(Level.WARNING, aCreature.getName() + \" \" + ex.getMessage(), ex);\n/* */ }\n/* */ \n/* */ } \n/* */ }\n/* */ }\n/* 1427 */ } else if (!dead && areaEffect) {\n/* */ \n/* 1429 */ if (!aCreature.isInvulnerable() && !aCreature.isGhost() && !aCreature.isUnique()) {\n/* */ \n/* 1431 */ AreaSpellEffect aes = getAreaEffect();\n/* 1432 */ if (aes != null && aes.getFloorLevel() == aCreature.getFloorLevel()) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 1437 */ byte type = aes.getType();\n/* 1438 */ Creature caster = null;\n/* */ \n/* */ try {\n/* 1441 */ caster = Server.getInstance().getCreature(aes.getCreator());\n/* */ }\n/* 1443 */ catch (NoSuchCreatureException noSuchCreatureException) {\n/* */ \n/* */ \n/* */ }\n/* 1447 */ catch (NoSuchPlayerException noSuchPlayerException) {}\n/* */ \n/* */ \n/* */ \n/* 1451 */ if (caster != null) {\n/* */ \n/* */ try {\n/* */ \n/* 1455 */ if (aCreature.getAttitude(caster) == 2 || (caster\n/* 1456 */ .getCitizenVillage() != null && caster.getCitizenVillage().isEnemy(aCreature)))\n/* */ {\n/* 1458 */ boolean ok = true;\n/* 1459 */ if (!caster.isOnPvPServer() || !aCreature.isOnPvPServer()) {\n/* */ \n/* 1461 */ Village v = aCreature.getCurrentVillage();\n/* 1462 */ if (v != null && !v.mayAttack(caster, aCreature))\n/* */ {\n/* 1464 */ ok = false;\n/* */ }\n/* */ } \n/* 1467 */ if (ok)\n/* */ {\n/* 1469 */ aCreature.addAttacker(caster);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* 1532 */ catch (Exception exe) {\n/* */ \n/* 1534 */ logger.log(Level.WARNING, exe.getMessage(), exe);\n/* */ } \n/* */ }\n/* */ } \n/* */ } \n/* */ } \n/* 1540 */ } catch (Exception ex) {\n/* */ \n/* 1542 */ logger.log(Level.WARNING, \"Failed to poll creature \" + aCreature.getWurmId() + \" \" + ex.getMessage(), ex);\n/* */ \n/* */ try {\n/* 1545 */ Server.getInstance().getCreature(aCreature.getWurmId());\n/* */ }\n/* 1547 */ catch (Exception nsc) {\n/* */ \n/* 1549 */ logger.log(Level.INFO, \"Failed to locate creature. Removing from tile. Creature: \" + aCreature);\n/* 1550 */ if (this.creatures != null) {\n/* 1551 */ this.creatures.remove(aCreature);\n/* */ }\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 resolve(){\n logger.log(Level.FINE,attacker.getName()+\" withering attacked \"+defender.getName());\n AttackState state=new AttackState();\n state.weaponDamage=weapon.getDamage();\n state.initialAttackpool=baseAttackdice+baseAccuracy-woundpenalty;\n attacker.declareWitheringAttack(state); // If the attacker wants to change the pool, he modifies the state accordingly.\n defender.declareWitheringDV(state); // Defender declares their dv against this specific attack. This sets both initialdv and changedDv\n state.initialAttackRoll= new DiceThrow(state.changedAttackpool);\n attacker.modifyWitheringAttackRollAttacker(state); //This sets stuff like modifiedAttackRollAttacker and AttackerRollValuation\n defender.modifyWitheringAttackRollDefender(state); //This sets defender modifiedAttackRollDefender\n state.attackRollSuccesses=state.modifiedAttackRollDefender.evaluateResults(state.AttackRollValuationAttacker);\n state.threshholdSuccesses=state.attackRollSuccesses-state.changedDv;\n logger.log(Level.FINE,attacker.getName()+\" rolled \"+state.changedAttackpool+\" dice against \"+defender.getName()+\"'s dv of \"+state.changedDv+\" and gained \"+state.attackRollSuccesses+\" successes.\");\n attacker.changeWitheringThreshholdAttacker(state); //This sets thresholdModifiedAttacker\n defender.changeWitheringThreshholdDefender(state); //This sets thresholdModifiedDefender\n if(state.thresholdModifiedDefender>=0) {\n logger.log(Level.FINE,attacker.getName()+\" hit \"+defender.getName()+\" with \"+state.thresholdModifiedDefender+\" threshhold successes.\");\n attacker.modifyWitheringRawDamageAttacker(state); //Sets normal raw damageType, based on strength and weapon damageType, and then sets rawDamagemModifiedAttacker\n defender.modifyWitheringRawDamageDefender(state); //this sets rawDamageModifiedDefender, and sets up the various soak values, so natural soak and armor soak.\n logger.log(Level.FINE, \"The raw damage of the attack is: \"+state.rawDamageModifiedDefender);\n state.totalSoak = Math.max(state.defenderArmorSoak - ignoredArmorSoak, 0) + state.defenderNaturalSoak; //\n attacker.modifyTotalSoakAttacker(state); //This sets totalSoakmodifiedAttacker. Don't think this actually has support in the solar charmset, but giving opportunities to work with.\n defender.modifyTotalSoakDefender(state); // This sets totalSoakmodifiedDefender.\n state.postSoakSuccesses=Math.max(state.rawDamageModifiedDefender-state.totalSoakModifiedDefender,weapon.getOverwhelming());\n logger.log(Level.FINE,state.totalSoakModifiedDefender+\" damage is soaked, leading to post soak dice of \"+state.postSoakSuccesses);\n attacker.declarePostSoakAttacker(state); //sets postSoakSuccessesModifiedAttacker\n defender.declarePostSoakDefender(state); //sets postSoakSuccessesModifiedDefender\n DiceThrow droll=new DiceThrow(state.postSoakSuccessesModifiedDefender);\n state.damageRoll=droll;\n attacker.modifyWitheringDamageRollAttacker(state); //sets damageRollmodifiedAttacker and damageRollvValuation\n defender.modifyWitheringDamageRollDefender(state); //sets damageRollmodifiedDefender\n state.initiativeDamageDone=state.damageRollModifiedDefender.evaluateResults(state.damageRollValuation);\n logger.log(Level.FINE,attacker.getName()+\" rolls \"+state.postSoakSuccessesModifiedDefender+\" dice and achieves \"+state.initiativeDamageDone+\" successes.\");\n attacker.modifyInitiativeDamageAttacker(state);\n defender.modifyInitiativeDamageDefender(state); //Since this is the last change of initiative, we can check whether the defender was crashed here.\n attacker.updateInitiativeAttacker(state);\n defender.updateInitiativeDefender(state);//Here we should handle all the initiative changes respectively, with checking if people are crashed etc.\n }\n else{\n attacker.failedWitheringAttackAttacker(state);\n defender.failedWitheringAttackDefender(state);\n }\n\n }", "private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}", "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 timer()\n {\n if(exists == true)\n { \n if(counter < 500) \n { \n counter++; \n } \n else \n { \n Greenfoot.setWorld(new Test()); \n exists = false; \n } \n } \n }", "public void init() {\n\t\t// init lists\n\t\t_examinationWaiters = new LinkedList();\n\t\t_xrayWaiters = new LinkedList();\n\t\t_backFromXrayWaiters = new LinkedList();\n\t\t_gonePatients = new Vector();\n\n\t\t// init doctors\n\t\t_doctors = new Person[NUMBER_OF_DOCTORS];\n\t\tfor (int i = 0; i < _doctors.length; ++i) {\n\t\t\t_doctors[i] = new Person(\"d\" + (i + 1));\n\t\t}\n\t\t_xrayDoctor = new Person(\"x\");\n\n\t\t// init examination time computing helper arrays\n\t\t_examinationMins =\n\t\t\tnew int[] {\n\t\t\t\t0,\n\t\t\t\tFIRST_EXAMINATION_MIN,\n\t\t\t\tXRAY_EXAMINATION_MIN,\n\t\t\t\tSECOND_EXAMINATION_MIN };\n\t\t_examinationMaxs =\n\t\t\tnew int[] {\n\t\t\t\t0,\n\t\t\t\tFIRST_EXAMINATION_MAX,\n\t\t\t\tXRAY_EXAMINATION_MAX,\n\t\t\t\tSECOND_EXAMINATION_MAX };\n\n\t\t// create enterAmbulanceEvents\n\t\tVector v = new Vector();\n\t\tint i = 0;\n\t\tfor (int t = OPEN_TIME + getPoisson();\n\t\t\tt < CLOSE_TIME;\n\t\t\tt += getPoisson()) {\n\t\t\tv.add(\n\t\t\t\tnew Event(Event.NEW_PATIENT, t, new Person(\"p\" + (++i)), null));\n\t\t}\n\n\t\t// init eventQueue\n\t\t_eventQueue = new EventQueue(v);\n\n\t\t// init timer\n\t\ttime = OPEN_TIME;\n\t}", "public void secondaryThreadCalls(){\n secondThread = new secondaryThread(getHolder(), this);\n effect = new ArrayList<>();\n enemy = new ArrayList<>();\n newEnemy = new ArrayList<>();\n thirdEnemy = new ArrayList<>();\n enemyStart = System.nanoTime();\n topborder = new ArrayList<>();\n botborder = new ArrayList<>();\n secondThread = new secondaryThread(getHolder(), this);\n secondThread.setRunning(true);\n secondThread.start();\n }", "public static void main(String[] args) {\n int progressId = 1;\n Map<Integer, Set<Entity>> progressEntities = new HashMap<>();\n Set<Entity> map000entity = new HashSet<>();\n map000entity.add(new Entity(new LocationPair<>(9.5F, 12.5F), Entity.TOWARD_RIGHT, \"Cirno\") {\n int useRefresh = 10;\n int activeTime = 80;\n boolean acting = true;\n\n @Override\n public void onRegisiter() {\n this.setMovingWay(MOVING_FASTER);\n }\n\n @Override\n public void onUnRegisiter() {\n System.out.println(\"Entity was unregisitered.\");\n }\n\n @Override\n public void action() {\n if (acting) {\n if (activeTime >= 0) {\n this.setToward(Entity.TOWARD_RIGHT);\n this.setWonderMoving(Entity.GOTOWARD_RIGHT);\n } else {\n this.setToward(Entity.TOWARD_LEFT);\n this.setWonderMoving(Entity.GOTOWARD_LEFT);\n }\n }\n if (isLastMovingSucceed()) {\n if (++activeTime >= 160) {\n activeTime = -160;\n }\n }\n if (useRefresh > 0) {\n useRefresh--;\n }\n }\n\n @Override\n public void onUse() {\n if (useRefresh == 0) {\n Keyboard.setState(Keyboard.STATE_DIALOG);\n acting = false;\n int moving = this.getMoving();\n int wonderMoving = this.getWonderMoving();\n int toward = this.getToward();\n this.setMoving(Entity.NOTGO);\n this.setWonderMoving(Entity.NOTGO);\n this.facePlayer();\n System.out.println(\"Changed the state of Keyboard.\");\n Case progress = new Case(\"test.entity.prs\", 2, () -> {\n Keyboard.setState(Keyboard.STATE_MOVING);\n acting = true;\n this.setMoving(moving);\n this.setWonderMoving(wonderMoving);\n this.setToward(toward);\n EventManager.getInstance().performedNp(this, 0);\n Resource.regisiterMisc(new Misc() {\n @Override\n public void invoke() {\n if (Resource.getMapId() == 1) {\n this.completed();\n Keyboard.setState(Keyboard.STATE_DIALOG);\n ArrayList<String> str = new ArrayList<>();\n str.add(Localization.query(\"test.misc\"));\n SimpleTalkingDialog std = new SimpleTalkingDialog(str, () -> {\n Keyboard.setState(Keyboard.STATE_MOVING);\n });\n std.init();\n GameFrame.getInstance().regisiterDialog(std);\n System.out.println(\"Invoked misc.\");\n }\n }\n });\n System.out.println(\"Progress ID is now 0.\");\n System.out.println(\"Changed the state of Keyboard.\");\n useRefresh = 40;\n });\n Case hello = new Case(\"test.entity.faq\", 3, () -> {\n ArrayList<String> str = new ArrayList<>();\n str.add(Localization.query(\"test.entity.hello1\"));\n str.add(Localization.query(\"test.entity.hello2\"));\n SimpleTalkingDialog std = new SimpleTalkingDialog(str, () -> {\n Keyboard.setState(Keyboard.STATE_MOVING);\n acting = true;\n this.setMoving(moving);\n this.setWonderMoving(wonderMoving);\n this.setToward(toward);\n useRefresh = 40;\n });\n std.init();\n GameFrame.getInstance().regisiterDialog(std);\n System.out.println(\"Changed the state of Keyboard.\");\n });\n Case back = new Case(\"test.entity.buff\", 4, () -> {\n Keyboard.setState(Keyboard.STATE_MOVING);\n acting = true;\n this.setMoving(moving);\n this.setWonderMoving(wonderMoving);\n this.setToward(toward);\n Resource.getPlayer().addBuff(new SpeedBuff(600, 1.5F));\n System.out.println(\"Changed the state of Keyboard.\");\n useRefresh = 40;\n });\n progress.setRelation(hello, null, hello);\n hello.setRelation(back, progress, back);\n back.setRelation(null, hello, null);\n progress.init();\n hello.init();\n back.init();\n List<Case> cases = new ArrayList<>();\n cases.add(progress);\n cases.add(hello);\n cases.add(back);\n ArrayList<String> strs = new ArrayList<>();\n strs.add(Localization.query(\"test.entity.title\"));\n\t\t\t\t\tTalkingDialog dialog = new TalkingDialog(strs, cases);\n\t\t\t\t\tdialog.init();\n GameFrame.getInstance().regisiterDialog(dialog);\n }\n useRefresh = 10;\n }\n });\n Set<Entity> map002entity = new HashSet<>();\n List<String> greet = new ArrayList<>();\n greet.add(\"test.entity.npc\");\n map002entity.add(new FriendlyNPC(new LocationPair<>(9.5F, 7.5F), Entity.TOWARD_DOWN, \"Sanae\", 3, greet));\n progressEntities.put(0, map000entity);\n progressEntities.put(2, map002entity);\n Map<Integer, Set<Item>> progressItems = new HashMap<>();\n boolean withDefaultProgress = true;\n //*/\n\n\n /*\n int progressId = 0;\n Map<Integer, Set<Entity>> progressEntities = new HashMap<>();\n Map<Integer, Set<Item>> progressItems = new HashMap<>();\n boolean withDefaultProgress = true;\n */\n\n\n try {\n ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(new File(\"resources/object/progress\", \"progress\" + String.format(\"%03d\", progressId) + \".prs\")));\n oos.writeObject(new Progress(progressId, progressEntities, progressItems, withDefaultProgress));\n oos.close();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "@Override\n\t\t\tpublic void handle(long now) {\n\t\t\t\tif (850 < distanceX && distanceX < 950 && 400 < distanceY && distanceY < 500) {\n\t\t\t\t\tif (AllCharacter.getCharacters().get(5).isAlive()) {\n\t\t\t\t\t\tgc.drawImage(exclamation, x + 22, y - 60, 62, 62);\n\t\t\t\t\t\tisEnemyFound = true;\n\t\t\t\t\t\tGameScene.enermyID = 5;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisEnemyFound = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (200 < distanceX && distanceX < 280 && 600 < distanceY && distanceY < 680) {\n\t\t\t\t\tif (AllCharacter.getCharacters().get(6).isAlive()) {\n\t\t\t\t\t\tgc.drawImage(exclamation, x + 22, y - 60, 62, 62);\n\t\t\t\t\t\tisEnemyFound = true;\n\t\t\t\t\t\tGameScene.enermyID = 6;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisEnemyFound = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (310 < distanceX && distanceX < 450 && 200 < distanceY && distanceY < 340) {\n\t\t\t\t\tif (AllCharacter.getCharacters().get(7).isAlive()) {\n\t\t\t\t\t\tgc.drawImage(exclamation, x + 22, y - 60, 62, 62);\n\t\t\t\t\t\tisEnemyFound = true;\n\t\t\t\t\t\tGameScene.enermyID = 7;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisEnemyFound = false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tisEnemyFound = false;\n\t\t\t\t\tGameScene.enermyID = 0;\n\t\t\t\t\tanimate.stop();\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tif(role.getRoleCurHealth()==0||getRoleCurHealth()==0)\n\t\t\t\t{\n//\t\t\t\t\tUtils.SystemPrintln(\"fight!222\");\n\t\t\t\t\ttimer.cancel();\n\t\t\t\t\tifMoveEnd=false;\n\t\t\t\t}\n\t\t\t\tif(ifMoveEnd){\n//\t\t\t\t\tUtils.SystemPrintln(\"fight!333\");\n\t\t\t\t\trole.getHurt(getBaseDamage());\n\t\t\t\t\tSystem.out.println(\"getHurt!:\"+role.getRoleName()+\" 当前生命值:\"+role.getRoleCurHealth());\n\t\t\t\t}\n\t\t\t}", "@Override\n public void update() {\n if (!myNPC.isAlive()) {\n myNPC.setState(MovingState.DEATH);\n }\n\n if (isAttacking()) {\n if (attackCounter > 300) {\n myNPC.setState(MovingState.IDLE);\n attackCounter = 0;\n } else {\n attackCounter++;\n }\n return;\n }\n\n// randomMove();\n }", "@Override\n\tpublic void run() {\n\n\t\tprogressivNumber++;\n\t\tStoRMStatus status = detective.haveaLook();\n\t\tstatus.setPulseNumber(progressivNumber);\n\t\tHEALTH_LOG.debug(\"*** HEARTHBEAT ***\");\n\t\tHEALTH_LOG.info(status.toString());\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\ttry{\n\t\t\t\twhile(!Thread.interrupted()){\n\t\t\t\t\t//thread safe\n\t\t\t\t\tList<Body> bodys = new ArrayList<Body>(bodyList);\n\t\t\t\t\tfor(Body body:bodys){\n\t\t\t\t\t\tif(body.isMovable()){\n\t\t\t\t\t\t\taddWorldFTo(body);\n\t\t\t\t\t\t\tbody.update();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdetection.test(getBorderShape(),bodys,new ArrayList<Area>(areaList),contact);\n\t\t\t\t\t//调用监视器 并用contact作为联系人\n\t\t\t\t\t\n\t\t\t\t\tList<Timer> timers = new ArrayList<Timer>(timerList);\n\t\t\t\t\tfor(Timer timer:timers){\n\t\t\t\t\t\tif(timer.sendMessage()){\n\t\t\t\t\t\t\t//send time over event\n\t\t\t\t\t\t\tPhysicsTimeoverEvent event = new PhysicsTimeoverEvent(timer);\n\t\t\t\t\t\t\tcontact.sendPhysicsEvent(event);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimer.run(roundDelayTime_MS);\n\t\t\t\t\t}\n\t\t\t\t\t//更新维护定时器\n\t\t\t\t\tTimeUnit.MILLISECONDS.sleep(roundDelayTime_MS);\n\t\t\t\t}\n\t\t\t}catch(InterruptedException e){\n\t\t\t\t//e.printStackTrace();\n\t\t\t\t//it's not a exception that exit when thread sleep\n\t\t\t}\n\t\t}", "public void act() \n {\n\n World wrld = getWorld();\n if(frameCounter >= frameWait)\n {\n super.act();\n frameCounter = 0;\n }\n else\n {\n frameCounter++;\n }\n if (dying)\n deathcounter++;\n GreenfootImage trans = getImage();\n trans.scale(500,500);\n setImage(trans);\n setLocation(getX(), (getY()));\n\n if (deathcounter > 10)\n {\n wrld.removeObject(this);\n ((Universe)wrld).score += 50;\n }\n else if (getX() < 10)\n wrld.removeObject(this);\n }", "public void compute_TimerEvents()\r\n {\r\n int num;\r\n\r\n // Avant le fade-in : que les evenements START OF GAME\r\n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n if ((rhPtr.rhGameFlags & CRun.GAMEFLAGS_FIRSTLOOPFADEIN) != 0)\r\n {\r\n num = listPointers[rhEvents[-COI.OBJ_GAME] + 1]; // -NUM_START\r\n if (num != 0)\r\n {\r\n listPointers[rhEvents[-COI.OBJ_GAME] + 1] = -1;\r\n computeEventList(num, null);\r\n rh4CheckDoneInstart = true;\r\n }\r\n return;\r\n }\r\n\r\n // Les evenements timer\r\n // ~~~~~~~~~~~~~~~~~~~~\r\n num = listPointers[rhEvents[-COI.OBJ_TIMER] + 3]; // -NUM_TIMER\r\n if (num != 0)\r\n {\r\n computeEventList(num, null);\r\n }\r\n\r\n // Les evenements start of game\r\n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n num = listPointers[rhEvents[-COI.OBJ_GAME] + 1]; // -NUM_START\r\n int num2, count;\r\n CEventGroup evgPtr, evgGroup;\r\n CEvent evtPtr;\r\n if (num != 0)\r\n {\r\n if (rh4CheckDoneInstart)\r\n {\r\n // Marque DONEBEFOREFADEIN les actions d���ja effectuees : elle ne seront pas r���effectu���es...\r\n evgGroup = null;\r\n num2 = num;\r\n do\r\n {\r\n evgPtr = eventPointersGroup[num2];\r\n if (evgPtr != evgGroup)\r\n {\r\n evgGroup = evgPtr;\r\n\r\n // Stoppe les actions deja effectuees\r\n for (count = evgPtr.evgNCond; count < evgPtr.evgNCond + evgPtr.evgNAct; count++)\r\n {\r\n evtPtr = evgPtr.evgEvents[count];\r\n if ((evtPtr.evtFlags & CEvent.EVFLAGS_NOTDONEINSTART) == 0)\t\t// Une action BAD?\r\n {\r\n evtPtr.evtFlags |= CEvent.EVFLAGS_DONEBEFOREFADEIN;\r\n }\r\n }\r\n }\r\n num2++;\r\n } while (eventPointersGroup[num2] != null);\r\n }\r\n computeEventList(num, null);\r\n listPointers[rhEvents[-COI.OBJ_GAME] + 1] = 0;\t\t// Une seule fois\r\n if (rh4CheckDoneInstart)\r\n {\r\n // Enleve les flags\t\r\n evgGroup = null;\r\n num2 = num;\r\n do\r\n {\r\n evgPtr = eventPointersGroup[num2];\r\n if (evgPtr != evgGroup)\r\n {\r\n evgGroup = evgPtr;\r\n // Enleve le flag\r\n for (count = evgPtr.evgNCond; count < evgPtr.evgNCond + evgPtr.evgNAct; count++)\r\n {\r\n evtPtr = evgPtr.evgEvents[count];\r\n evtPtr.evtFlags &= ~CEvent.EVFLAGS_DONEBEFOREFADEIN;\r\n }\r\n }\r\n num2++;\r\n } while (eventPointersGroup[num2] != null);\r\n rh4CheckDoneInstart = false;\r\n }\r\n }\r\n\r\n // Les evenements timer inferieur\r\n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n num = listPointers[rhEvents[-COI.OBJ_TIMER] + 2]; // -NUM_TIMERINF\r\n if (num != 0)\r\n {\r\n computeEventList(num, null);\r\n }\r\n\r\n // Les evenements timer superieur\r\n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n num = listPointers[rhEvents[-COI.OBJ_TIMER] + 1]; // -NUM_TIMERSUP\r\n if (num != 0)\r\n {\r\n computeEventList(num, null);\r\n }\r\n }", "public void startAi(int num){\n int times = num;\n int test = 0;\n while(test < times){\n\n if (currentRoom.containsEnemy())\n {\n int eHealth = currentRoom.getEnemyHealth();\n int pHealth = player.getHealth();\n int pAD = player.getAttackDamage();\n int eAD = currentRoom.getEnemyDamage();\n ai.fightMath(eHealth, pHealth, pAD, eAD);\n player.setHealthExact(ai.getHealth());\n if (player.getHealth() > 0)\n {\n currentRoom.removeEnemy();\n System.out.println(\"\\n\" + \"AI defeated an enemy. Current health: \" + player.getHealth() + \"\\n\");\n }\n else{\n times = 0;\n }\n\n }\n \n else if(currentRoom.equals(prison))\n {\n ai.scheduleCommand(\"go\", \"up\", null);\n processCommand(command); \n test++;\n }\n\n else if(currentRoom.equals(promenade)){\n currentRoom = promenade;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"take\", \"wood\", \"sword\");\n processCommand(command);\n ai.scheduleCommand(\"take\", \"rope\", null);\n processCommand(command);\n ai.scheduleCommand(\"go\", \"up\", \"sword\"); \n processCommand(command);\n test++; \n } \n \n else if(currentRoom.equals(ossuary)){\n currentRoom = ossuary;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"open\", \"chest\", null);\n processCommand(command);\n ai.scheduleCommand(\"drop\", \"wood\", \"sword\");\n player.dropWeapon(command);\n ai.scheduleCommand(\"take\", \"silver\", \"sword\");\n processCommand(command);\n ai.scheduleCommand(\"take\", \"potion\", null);\n processCommand(command); \n ai.scheduleCommand(\"go\", \"straight\", null);\n processCommand(command);\n test++;\n\n }\n else if(currentRoom.equals(crypt))\n {\n currentRoom = crypt;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"take\", \"shovel\", null);\n processCommand(command); \n ai.scheduleCommand(\"go\", \"up\", null);\n processCommand(command);\n test++;\n }\n else if(currentRoom.equals(graveyard))\n {\n currentRoom = graveyard;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"go\", \"right\", null);\n processCommand(command);\n test++;\n }\n else if(currentRoom.equals(forest))\n {\n currentRoom = forest;\n player.setRoom(currentRoom);\n ai.runRope(player.getInventory());\n processCommand(command);\n ai.setCommand(\"go\", \"up\", null);\n processCommand(command);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n test++;\n\n\n }\n \n else if(currentRoom.equals(tower))\n {\n currentRoom = tower;\n player.setRoom(currentRoom);\n ai.setCommand(\"take\", \"potion\", null);\n processCommand(command);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"go\", \"straight\", null);\n processCommand(command);\n }\n else if(currentRoom.equals(ramparts))\n {\n currentRoom = ramparts;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"go\", \"straight\", null);\n processCommand(command);\n\n\n }\n else if(currentRoom.equals(castle))\n {\n currentRoom = castle;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"open\", \"chest\", null);\n processCommand(command);\n ai.setCommand(\"take\", \"potion\", null);\n processCommand(command);\n \n\n\n }\n\n else if(currentRoom.equals(throne))\n {\n currentRoom = throne;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n }\n\n else if(currentRoom.equals(sewers))\n {\n currentRoom = sewers;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"go\", \"down\", null);\n processCommand(command);\n\n }\n else if(currentRoom.equals(depths))\n {\n currentRoom = depths;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"right\", null);\n processCommand(command);\n }\n else if(currentRoom.equals(crypt))\n {\n currentRoom = crypt;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"up\", null);\n processCommand(command);\n\n }\n else if(currentRoom.equals(graveyard))\n {\n currentRoom = graveyard;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"straight\", null);\n processCommand(command);\n }\n else if(currentRoom.equals(bridge))\n {\n currentRoom = bridge;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"up\", null);\n processCommand(command);\n }\n\n \n } \n }", "public void run()\n {\n List<Entity> ms = new LinkedList<Entity>(monsters);\n for (Entity e : ms)\n if (e.isDead())\n monsters.remove(e);\n \n // Compare the current size with the previous size.\n if (monsters.size() < spawnThread.getPreviousSize() || spawnThread.getPreviousSize() == 0 || bossWave != null)\n {\n resetIdleTimer();\n return;\n }\n \n // Clear all player inventories, and \"kill\" all players.\n List<Player> ps = new LinkedList<Player>(arenaPlayers);\n for (Player p : ps)\n {\n MAUtils.clearInventory(p);\n MAUtils.tellPlayer(p, Msg.FORCE_END_IDLE);\n playerDeath(p);\n }\n }", "private void checkFirstStep(Horse horse) {\n\n\t\tif(horse.isOnHouse()) {\n\t\t\tif(d1.getValue()==6||d2.getValue()==6) {\n\t\t\t\tsound.playOutNestSound();\n\t\t\t\tstatus.setText(\"Player \" + lb_currentplayername.getText() + \" horse is out\");\n\t\t\t\thorse.setOnHouse(false);\n\t\t\t\thorse.setPosition(horse.getPosition()+12*currentPlayer);\n\t\t\t\tthread=new MyThread(1, horse);\n\t\t\t\tthread.start();\n\t\t\t\tresetDisableButton(true);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthread=new MyThread(0, horse);\n\t\t\t\tthread.start();\n\t\t\t\tresetDisableButton(true);\n\t\t\t}\n\t\t}\n\n\t}", "private void init() {\n healthCheckTimer.newTimeout(\n new TimerTask() {\n @Override\n public void run(Timeout timeout) throws Exception {\n if (!isStop) {\n List<BrpcChannel> newHealthyInstances = new ArrayList<BrpcChannel>();\n Iterator<BrpcChannel> iter = unhealthyInstances.iterator();\n while (iter.hasNext()) {\n BrpcChannel instance = iter.next();\n boolean isHealthy = isInstanceHealthy(instance.getIp(), instance.getPort());\n if (isHealthy) {\n newHealthyInstances.add(instance);\n }\n }\n\n List<BrpcChannel> newUnhealthyInstances = new ArrayList<BrpcChannel>();\n iter = healthyInstances.iterator();\n while (iter.hasNext()) {\n BrpcChannel instance = iter.next();\n boolean isHealthy = isInstanceHealthy(instance.getIp(), instance.getPort());\n if (!isHealthy) {\n newUnhealthyInstances.add(instance);\n }\n }\n\n healthyInstances.addAll(newHealthyInstances);\n unhealthyInstances.removeAll(newHealthyInstances);\n\n healthyInstances.removeAll(newUnhealthyInstances);\n unhealthyInstances.addAll(newUnhealthyInstances);\n notifyInvalidInstance(newUnhealthyInstances);\n\n healthCheckTimer.newTimeout(this,\n rpcClient.getRpcClientOptions().getHealthyCheckIntervalMillis(),\n TimeUnit.MILLISECONDS);\n }\n\n }\n },\n rpcClient.getRpcClientOptions().getHealthyCheckIntervalMillis(),\n TimeUnit.MILLISECONDS);\n }", "public static void tick() {\r\n\r\n\t\t// Switches on the different states of the game that it could be in\r\n\t\tswitch (gameState) {\r\n\t\tcase MAINMENU:\r\n\t\t\t// If there is not already a Main menu instance that exists\r\n\t\t\tif (mainMenu == null) {\r\n\t\t\t\t// Create a new Menu Instance\r\n\t\t\t\tmainMenu = new MainMenu();\r\n\t\t\t}\r\n\t\t\tmainMenu.tick();\r\n\t\t\tbreak;\r\n\t\tcase GAME:\r\n\t\t\t// If there is not already a game instance that exists\r\n\t\t\tif (game == null) {\r\n\t\t\t\t// Create a new game Instance\r\n\t\t\t\tgame = new Game(map, gm);\r\n\t\t\t}\r\n\t\t\t// Every time the state manager ticks it also ticks the current game state\r\n\t\t\tgame.tick();\r\n\t\t\tbreak;\r\n\t\tcase GAME_ONLINE:\r\n\t\t\tif (gameOnline == null) {\r\n\t\t\t\t// Create a new game Instance\r\n\r\n//\t\t\t\tip = JOptionPane.showInputDialog(\"Enter Server Ip\");\r\n//\t\t\t\tportTCP = Integer.parseInt(JOptionPane.showInputDialog(\"Enter TCP PORT\"));\r\n//\t\t\t\tportUDP = Integer.parseInt(JOptionPane.showInputDialog(\"Enter UDP PORT\"));\r\n//\t\t\t\tusername = JOptionPane.showInputDialog(\"Enter Your username\");\r\n\t\t\t\tgameOnline = new GameOnline(username, ip, portUDP, portTCP);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase LEVEL_EDITOR:\r\n\t\t\t// If there is not already a Editor instance that exists\r\n\t\t\tif (levelEditor == null) {\r\n\t\t\t\t// Create a new Editor Instance\r\n\t\t\t\tlevelEditor = new LevelEditor();\r\n\t\t\t}\r\n\t\t\tlevelEditor.tick();\r\n\t\t\tbreak;\r\n\t\tcase LEADERBOARD:\r\n\t\t\tif (leaderBoard == null) {\r\n\t\t\t\tleaderBoard = new Leaderboard();\r\n\t\t\t}\r\n\t\t\tleaderBoard.tick();\r\n\t\t\tbreak;\r\n\t\tcase SPLASHSCREEN_LOADING:\r\n\t\t\tif (splashScreenLoading == null) {\r\n\t\t\t\tsplashScreenLoading = new SplashScreenLoading();\r\n\t\t\t}\r\n\t\t\tsplashScreenLoading.tick();\r\n\t\t\tbreak;\r\n\t\tcase OPTIONS:\r\n\t\t\tbreak;\r\n\t\tcase TESTSCREEN:\r\n\t\t\tif (testScreen == null) {\r\n\t\t\t\ttestScreen = new TestScreen();\r\n\t\t\t}\r\n\t\t\ttestScreen.tick();\r\n\t\t\tbreak;\r\n\t\tcase MAP_SELECT_SCREEN:\r\n\t\t\tif (mapSelectScreen == null) {\r\n\t\t\t\tmapSelectScreen = new MapSelectScreen();\r\n\t\t\t}\r\n\t\t\tmapSelectScreen.tick();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tlong currentTime = System.currentTimeMillis();\r\n\t\tif (currentTime > nextSecond) {\r\n\t\t\tnextSecond += 1000;\r\n\t\t\tframesInLastSecond = framesInCurrentSecond;\r\n\t\t\tframesInCurrentSecond = 0;\r\n\r\n\t\t\t// System.out.println(framesInLastSecond + \"fps\");\r\n\t\t}\r\n\r\n\t\tframesInCurrentSecond++;\r\n\r\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}", "@Override\r\n\tpublic void run() {\r\n\r\n\t\ttry {\r\n\t\t\tThread.sleep(INITIAL_DELAY);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace(System.err);\r\n\t\t}\r\n\r\n\t\tShapedEnemy aimedEnemy = null;\r\n\r\n\t\twhile (attacking) {\r\n\t\t\tif(!aiming){\r\n\t\t\t\taimedEnemy = new AimingAI(enemies, tower, GameConsts.PREFERRED_AIMING_STRATEGY).getBestOption();\r\n\t\t\t\tif(aimedEnemy != null){\r\n\t\t\t\t\taiming = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(15);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\te.printStackTrace(System.err);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif(aimedEnemy != null){\r\n\t\t\t\tthis.tower.setAngle(270D - MathUtil.calculateAngle(\r\n\t\t\t\t\t\t(int) tower.getCenter().getX(), (int) tower.getCenter().getY(),\r\n\t\t\t\t\t\t(int) aimedEnemy.getCenter().getX(), (int) aimedEnemy.getCenter().getY()));\r\n\r\n\t\t\t\tfor (int i = 0; i < tower.getRotatedFrames().length; i++) {\r\n\t\t\t\t\tthis.tower.setNextFrame();// animacion de disparo\r\n\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(30);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\te.printStackTrace(System.err);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tgridPanel.shootEnemy(new Point2D.Double(tower\r\n\t\t\t\t\t\t.getShape().getBounds2D().getCenterX(), tower\r\n\t\t\t\t\t\t.getShape().getBounds2D().getCenterY()),\r\n\t\t\t\t\t\tnew Point2D.Double(ConversorUtil\r\n\t\t\t\t\t\t\t\t.logicToPixels(aimedEnemy.getX()) + ConversorUtil.logicToPixels(1) / 2,\r\n\t\t\t\t\t\t\t\tConversorUtil.logicToPixels(aimedEnemy.getY()) + ConversorUtil.logicToPixels(1) / 2), tower\r\n\t\t\t\t\t\t\t\t.getTowerClr(), tower.getShootStyle());\r\n\r\n\t\t\t\tplayAttackSound();\r\n\r\n\t\t\t\taimedEnemy.reduceLife(tower.getShootDamage());\r\n\r\n\t\t\t\tif(!ModelUtil.isValidTarget(aimedEnemy, tower)){\r\n\t\t\t\t\taiming = false;\r\n\r\n\t\t\t\t\tif(aimedEnemy.getRemainingLife() <= 0){\r\n\t\t\t\t\t\tif(ModelUtil.countDeadEnemies(enemies) == enemies.size()){\r\n\t\t\t\t\t\t\tattacking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(tower.getShootDelay().longValue());\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\te.printStackTrace(System.err);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\ttower.setAngle(0.0D);\r\n\t\tSystem.out.println(\"[ INFO] TowerAttack Finished - \"\r\n\t\t\t\t+ Thread.currentThread().toString());\r\n\t}", "public void act() { \n check = borde(flag);\n if(check == true )\n restaura();\n moveRandom(move);\n if(animationE % 3 == 0){\n checkanimation();\n } \n animationE++; \n alive=checkfire();\n if(alive == true){\n enemyoff();\n } \n \n }", "private void checkForAccident(double time) {\n\n\t\tdouble chance = .005D;\n\n\t\t// Materials science skill modification.\n\t\tint skill = getEffectiveSkillLevel();\n\t\tif (skill <= 3) {\n\t\t\tchance *= (4 - skill);\n\t\t} else {\n\t\t\tchance /= (skill - 2);\n\t\t}\n\n\t\t// Modify based on the workshop building's wear condition.\n\t\tchance *= workshop.getBuilding().getMalfunctionManager().getWearConditionAccidentModifier();\n\n\t\tif (RandomUtil.lessThanRandPercent(chance * time)) {\n\n\t\t\tif (person != null) {\n//\t\t\t\tlogger.info(\"[\" + person.getLocationTag().getShortLocationName() + \"] \" + person.getName() + \" has accident while manufacturing good.\");\n\t\t\t\tworkshop.getBuilding().getMalfunctionManager().createASeriesOfMalfunctions(person);\n\t\t\t} else if (robot != null) {\n//\t\t\t\tlogger.info(\"[\" + robot.getLocationTag().getShortLocationName() + \"] \" + robot.getName() + \" has accident while manufacturing godd.\");\n\t\t\t\tworkshop.getBuilding().getMalfunctionManager().createASeriesOfMalfunctions(robot);\n\t\t\t}\n\t\t}\n\t}", "public void tick() {\n\t\tif (timer!=Game.timeCount)\n\t\t\thandler.addObject(new EnemyPlane(Game.WIDTH-38,r.nextInt(Game.HEIGHT-50), ID.Enemy, handler));\n\t\t\ttimer = Game.timeCount;\n\t}", "public void setup() {\n\t\taddBehaviour(new TickerBehaviour(this, 1000L) {\n\n\t\t\t@Override\n\t\t\tprotected void onTick() {\n\t\t\t\tint extinguishedFires = 0;\n\t\t\t\t\n\t\t\t\tfor(int i = 0; i < worldAgent.getAircraftAgents().length; i++) {\n\t\t\t\t\textinguishedFires+=worldAgent.getAircraftAgents()[i].getAircraftMetricsStats().getNumTotalFiresExtinguishedByThisAircraft();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tworldAgent.getWorldMetricsStats().setNumTotalFiresExtinguishedByAllAircrafts(extinguishedFires);\n\t\t\t\t\n\t\t\t\tif(extinguishedFires >= 3) {\t\t\t\t\t\n\t\t\t\t\tlong end_time = System.currentTimeMillis();\n\t\t\t\t\tlong execution_time = end_time - init_time;\n\t\t\t\t\t\n\t\t\t\t\tAircraftAgent[] aircrafts = worldAgent.getAircraftAgents();\n\t\t\t\t\t\n\t\t\t\t\tfor(int i = 0; i < aircrafts.length; i++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(Thread sleepingThread : aircrafts[i].getSleepingThreads().values()) {\n\t\t\t\t\t\t\tSystem.err.println(\"Interrupting thread = \\\"\" + sleepingThread.getName() + \"!\");\n\t\t\t\t\t\t\tsleepingThread.interrupt();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tkillContainer();\n\t\t\t\t\t\n\t\t\t\t\tLogger.appendConfigValues(execution_time);\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Run no. \" + JADELauncher.NUMBER_OF_RUNS + \" finished.\");\n\n\t\t\t\t\tif(JADELauncher.NUMBER_OF_RUNS == 0) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tLogger.closeStream();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tJADELauncher.NUMBER_OF_RUNS--;\n\t\t\t\t\t\tinstanceRun();\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t});\n\t\t\n\t\tinstanceRun();\n\t}", "public static void worldTimeStep() {\r\n \t\r\n \t//remake the hash map based on the x and y coordinates of the critters\r\n \tremakeMap(population);\r\n \t\r\n \t//Iterate through the grid positions in the population HashMap\r\n \tIterator<String> populationIter = population.keySet().iterator();\r\n \twhile (populationIter.hasNext()) { \r\n String pos = populationIter.next();\r\n ArrayList<Critter> critterList = population.get(pos);\r\n \r\n //Iterate through the critters ArrayList \r\n ListIterator<Critter> currCritter = critterList.listIterator();\r\n while(currCritter.hasNext()) {\r\n \tCritter thisCritter = currCritter.next();\r\n \tthisCritter.hasMoved = false;\r\n \tthisCritter.doTimeStep();\r\n \tif(thisCritter.hasMoved || thisCritter.getEnergy() <= 0) {\r\n \t\tcurrCritter.remove();\r\n \t} else {\r\n \t\tcurrCritter.set(thisCritter);\r\n \t}\r\n }\r\n population.replace(pos, critterList);\r\n }\r\n \t\r\n \tfixPopulation();\r\n \tmergePopulationMoved(populationMoved);\r\n \t\r\n \tdoEncounters();\r\n \t\r\n \tfixPopulation();\r\n \tmergePopulationMoved(populationMoved); //Stage 1 Complete\r\n \r\n \t//deduct resting energy cost from all critters in the hash map\r\n \t//could do a FOR EACH loop instead of iterator -- fixed\r\n \tpopulationIter = population.keySet().iterator();\r\n \twhile(populationIter.hasNext()) {\r\n \t\tString pos = populationIter.next();\r\n ArrayList<Critter> critterList = population.get(pos);\r\n \r\n //Iterate through the Critters attached to the keys in the Hash Map\r\n ListIterator<Critter> currCritter = critterList.listIterator();\r\n while(currCritter.hasNext()) {\r\n \tCritter thisCritter = currCritter.next();\r\n \t//deduct the rest energy cost from each critter\r\n \tthisCritter.energy = thisCritter.energy - Params.REST_ENERGY_COST;\r\n \t//remove all critters that have died after reducing the rest energy cost\r\n \tif(thisCritter.getEnergy() <= 0) {\r\n \t\tcurrCritter.remove();\r\n \t} else {\r\n \t\tcurrCritter.set(thisCritter);\r\n \t}\r\n }\r\n population.replace(pos, critterList);\r\n \t}\r\n \t\r\n \tmergePopulationMoved(babies);\r\n \t\r\n \t\r\n \t//add the clovers in each refresh of the world \r\n \ttry {\r\n \t\tfor(int j = 0; j < Params.REFRESH_CLOVER_COUNT; j++) {\r\n \t\t\tcreateCritter(\"Clover\");\r\n \t\t}\r\n \t} catch(InvalidCritterException p) {\r\n \t\tp.printStackTrace();\r\n \t}\r\n }", "private void tickPeople() {\n\t\tplayer.tick();\n\t\tfor (Councilman councilman: councilmen) {\n\t\t\tcouncilman.tick();\n\t\t}\n\t}", "public void gameAttack(){\n int counter = 0;\n while (currentPlayer.wantToAttack(this)){\n counter++;\n if (counter > 100) break;\n /*In rare cases, AI players will repeatedly select the same attackers and defenders\n while also not wanting to dice fight. That will infinitely loop here and this counter will prevent it\n Under normal circumstances, no reasonable player will ever try to do more than 100 separate attacks in the same turn\n */\n\n String[] attackerDefender = {\"\",\"\"};\n //AttackStarterSelection\n attackerDefender[0] = currentPlayer.chooseAttackStarter(this);\n\n //AttackDefenderSelection\n attackerDefender[1] = currentPlayer.chooseAttackDefender(this, attackerDefender[0]);\n\n //DiceFightOrQuit\n int attackerDice, defenderDice;\n while (currentPlayer.wantToDiceFight(this, attackerDefender[0]+ \",\" + attackerDefender[1])){\n //DiceFightAttackerChoice\n attackerDice = currentPlayer.getAttackerDice(this, getTerritory(attackerDefender[0]));\n\n //DiceFightDefenderChoice\n Player defender = this.getPlayerFromList(this.getTerritory(attackerDefender[1]).getOwner());\n defenderDice = defender.getDefenderDice(this, this.getTerritory(attackerDefender[1]));\n\n\n //DiceFight results\n displayMessage(this.diceFight(attackerDefender, attackerDice,defenderDice));\n\n //Possible elimination and announcement of winner\n //Current diceFight ends if attacker has 1 troop left, or territory is conquered\n if (endDiceFight(attackerDefender, attackerDice)) break;\n\n }//End diceFightOrQuit\n\n\n }//End wantToAttack\n //Proceed to fortify stage of turn\n }", "static void AdultItinerary(int location)\n {\n\t\tboatLock.acquire(); \n\n\t\twhile (true){ //continuous loop\n\t\t\t//check location\n if (location == 0){ //Oahu\n //may need while loop instead of if loop here...\n while ( childrenOnOahu > 1 || countOnBoat > 0 || boatLocation != 0){\n onOahu.sleep();\n }\n\t\t\t /*if( childrenOnOahu > 1) {\n\t\t\t\t\tonOahu.sleep();\n\t\t\t\t}\n\t\t\t\t//check number of children on boat | adults on boat\n\t\t\t\tif( countOnBoat > 0){\n\t\t\t\t\tonOahu.sleep();\n\t\t\t\t}\n\t\t\t\t//make sure boat is on Oahu\n\t\t\t\tif(boatLocation != 0){\n\t\t\t\t\tonOahu.sleep();\n\t\t\t\t} */\n\t\t\t//-------------------------------------------------------\n bg.AdultRowToMolokai();\n \n //update count and location\n adultsOnOahu--;\n adultsOnMolokai++;\n boatLocation = 1;\n location = 1;\n \n //communicating number of people on Molokai\n coms.speak(childrenOnMolokai + adultsOnMolokai);\n \n //wake everyone up and sleep on Molokai\n onMolokai.wakeAll();\n onMolokai.sleep();\n\t\t\t \n\t\t//Make sure there is at least ONE child on Molokai\n\t\tLib.assertTrue(childrenOnMolokai > 0);\n }\n else if (location == 1){ //Molokai\n onMolokai.sleep();\n }\n else{\n System.out.println(\"ERROR: Location other than 0 or 1\");\n Lib.assertTrue(false);\n break; \n }\n }\n\n boatLock.release(); \n }", "public static void gameOfLife() throws Exception {\n for(int i = 0; i < N; i++) {\n for(int j = 0; j < N; j++) {\n state [i] [j] = Math.random() > 0.5 ? 1 : 0;\n }\n }\n\n display.repaint();\n pause();\n\n ParallelConwaysGameOfLife [] threads = new ParallelConwaysGameOfLife[P];\n\n for (int me = 0; me < P; me++) {\n threads[me] = new ParallelConwaysGameOfLife(me);\n threads[me].start();\n }\n\n for (int me = 0; me < P; me++) {\n threads[me].join();\n }\n\n }", "public void printSimulationState(){\n\n boolean flagActive = false;\n\n //boolean unloadPassengersNow = false;\n \n boolean timeHasArrived = false;\n \n //sleeps for 20 to allow threads to run\n try{\n Thread.sleep(20);\n }catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n \n //configures flags\n for(int i = 0; i< a; i++){ \n if(flagActive != true)\n flagActive = (elevatorArray[i].getScanCompleteFlag() || elevatorArray[i].getScannedBuildingFloorFlag());\n\n \n //System.out.println(\"====\" + SimClock.getTime());\n //System.out.println(\"====\" + elevatorArray[i].getMoveQueue().get(0).getExpectedArrival());\n \n if(timeHasArrived != true){\n if ((SimClock.getTime() >= nextArrivalTime) && (nextArrivalTime != -2)){\n timeHasArrived = true;\n }\n \n if (elevatorArray[i].getMoveQueue().size() > 0){\n nextArrivalTime = elevatorArray[i].getMoveQueue().get(0).getExpectedArrival();\n }else{\n nextArrivalTime = -2;\n }\n }\n \n if (flagActive && timeHasArrived){\n break;\n }\n }\n\n \n if(flagActive || timeHasArrived){\n System.out.println(\"********************** @\" + (SimClock.getTime()) + \" Simulated Seconds **********************\"); \n \n System.out.println(\"Building Floors:\");\n for(int i = 0; i < aBuildingManager.getFloors().length; i++){\n int[] passengerRequestArray = aBuildingManager.getFloors()[i].getPassengerRequests();\n System.out.println(\" \" + \"Floor \" + (i+1) + \": \" + Arrays.toString(passengerRequestArray));\n }\n System.out.println();\n \n for (int i = 0; i< a; i++){\n System.out.println();\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \"\\n\" + \"# of Passengers: \" + Arrays.toString(elevatorArray[i].getPassengerDestinations()) + \"\\n\" + \"Current Floor: \" + (elevatorArray[i].getCurrentFloor()+1) + \n \"\\nTotal Unloaded Passengers: \" + elevatorArray[i].getTotalUnloadedPassengers() + \"\\n\" + \"Total Loaded Passengers: \" + elevatorArray[i].getTotalLoadedPassengers() );\n System.out.println(\"=============================================================\");\n } \n \n\n \n for (int i = 0; i < a; i++){\n //checking to see if there exists passengersToUnload and prints corresponding output\n\n if(elevatorArray[i].getPassengersToUnload() != 0){ \n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" has arrived at Floor \" + (elevatorArray[i].getCurrentFloor()+1) + \" to unload passengers.\\n - \" + \n elevatorArray[i].getPassengersToUnload() + \" passengers are exiting the elevator.\");\n System.out.println(\"=============================================================\");\n elevatorArray[i].resetPassengersToUnload();\n }\n \n if(elevatorArray[i].getScanCompleteFlag()){\n \n //prevFloorArray[i] = -1;\n //floorChanged = false;\n \n System.out.println();\n System.out.println(\"=============================================================\");\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" has arrived at Floor \" + (elevatorArray[i].getCurrentFloor()+1) + \" and picked up \" + elevatorArray[i].getNumPassengers() + \" passenger(s).\");\n \n // iterating through each PassengerDestination in the Elevator to specify each floor's destination and amount\n // of passengers wanting to go to said floor\n for (int k = 0; k < elevatorArray[i].getPassengerDestinations().length; k++){\n if (elevatorArray[i].getPassengerDestinations()[k] != 0)\n System.out.println(\" - \" + elevatorArray[i].getPassengerDestinations()[k] + \" passenger(s) will go to Floor \" + (k+1));\n \n }\n System.out.println(\"=============================================================\");\n elevatorArray[i].resetScanCompleteFlag();\n continue;\n \n // checking if ScanBuildingFloorFlag() triggered\n }else if(elevatorArray[i].getScannedBuildingFloorFlag()){\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" will go to Floor \" + (elevatorArray[i].getMoveQueue().get(0).getDestination()+1) + \" to load passengers.\");\n \n //prevFloorArray[i] = -2;\n elevatorArray[i].resetScannedBuildingFloorFlag();\n continue;\n }\n }\n \n flagActive = false;\n timeHasArrived = false; \n System.out.println();\n }\n \n\n}", "public void tick(){\n oilLevel --;\n maintenance --;\n happiness --;\n health --;\n boredom ++;\n }", "static void boss_fight() {\n miss_choice = miss.nextInt(2);//random used to determie a miss or a hit\n playerhealth = 3500;\n nagahealth = 3500;\n bosshealth = 10000;//#enemyobject-the actual boss that has created the game play(antagonsit)\n System.out.println(\"You have recently leveled up and have increased your HP to 3500. Be careful...\");\n System.out.println(\"You can now cast 8 different types of spells...\");\n enter = next.nextLine();\n System.out.println(\"These spells include fire, ice, wind, lightening, throw rocks, sacred sword, \");\n System.out.println(\"cosmic rays, and teleport\");\n enter = next.nextLine();\n System.out.println(\"Naga has his own spells don't worry about him...\");\n enter = next.nextLine();\n System.out.println(\"'I can use 3 different types of dark magic and 2 different types of normal attacks'\");\n System.out.println(\"Don't worry, we got this \"+ username + \".\");\n enter = next.nextLine();\n System.out.println(\"ALL OR NOTHING!!! GHAAAA!!!\");\n enter = next.nextLine();\n monsterisalive = true;\n //#while \n /* while loop that will let players fight the boss */\n while(monsterisalive){\n System.out.println(\"It is your turn...which move will you use:\");\n System.out.println(\"fire, ice, wind, lightening, throw rocks, sacred sword, cosmic rays, teleport, or heal.\");\n attack = next.nextLine();\n if(attack.contains(\"fire\")) {\n System.out.println(\"Alright, I'm fired up...FOOOSH!!!\");\n bosshealth = bosshealth-30; //player deals damage\n System.out.println(\"WHOA! The witch lost 30 HP. The boss now has \" + bosshealth + \" HP.\" );\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"ice\")) {\n System.out.println(\"Alright, it's gonna be a little chilly...GHAAAA!!!\");\n bosshealth = bosshealth-20;\n System.out.println(\"BRRR... The evil witch lost 20 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"lightening\")) {\n System.out.println(\"Someone's gonna get fried today! ZAAAAP!!!\");\n bosshealth = bosshealth-40;\n System.out.println(\"OUCH!!! The evil witch lost 40 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP\");\n }else if (answer.contains(\"throw rocks\")) {\n System.out.println(\"Incoming Boulder...BOOOOOMM!!!\");\n bosshealth = bosshealth-30;\n System.out.println(\"The witch lost 30 HP. It now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"sacred swords\")) {\n System.out.println(username + \" summons the guardians of the 9 sacred swords, and \");\n System.out.println(\"the guardians released their swords to punish the wicked witch...\");\n enter = next.nextLine();\n System.out.println(\"The 9 swords punctures the wicked releasing powerful, positive energy.\");\n bosshealth = bosshealth-150;\n System.out.println(\"ZHHHHNGG!!! BOOOM!!! Ouch...the boss lost 150 HP. The boss now has \" + bosshealth);\n System.out.println(\"HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"cosmic rays\")) {\n System.out.println(username + \" casts a spell that absorbs all of the radiation from space...\");\n System.out.println(\"Then a large light bombards the witch and inflicts 130 HP.\");\n bosshealth = bosshealth-130;\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"teleport\")) {\n System.out.println(username + \" creates a blue portal and jumps inside the portal...\");\n enter = next.nextLine();\n System.out.println(username + \" then teleports behind the witch and strikes...Then jumps back in...\");\n enter = next.nextLine();\n System.out.println(\"Then appears in the rear side and strikes the boss again and quickly disappears...\");\n enter = next.nextLine();\n System.out.println(\"Finally...\" + username + \" strikes again on top of the witch.\");\n enter = next.nextLine();\n bosshealth = bosshealth-210;\n System.out.println(\"WOW!!!\" + username + \" inflicted 210 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"wind\")) {\n System.out.println(\"Alright, let's finish this up...WHIRL!!!\");\n bosshealth = bosshealth-10;\n System.out.println(\"The evil witch lost 10 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"heal\")){\n healing_challenge3();\n System.out.println(\"\\n\");\n System.out.println(username + \"'s HP increased 300 health points and now have \" + playerhealth + \".\");\n System.out.println(\"The boss still has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n }else{\n System.out.println(\"Please make sure you type everything correctly next time. You lost a turn...\");\n }\n \n if(bosshealth <= zero) { //check to see if boss is still alive\n System.out.println(\"You defeated the boss...Congratulations, you have won the war.\");\n enter = next.nextLine();\n System.out.println(\"The witch has disappeared, vanished forever in a black hole that consumed the boss.\");\n enter = next.nextLine();\n System.out.println(\"That is the last time you'll ever see that hideous thing ever again.\");\n monsterisalive = false;\n endgame();\n // It's Naga's turn\n }else if (bosshealth > zero) {\n System.out.println(\"It's Naga's turn...You can do this Naga!\");\n naga_attacks = naga.nextInt(6);\n if(naga_attacks == 0){\n System.out.println(\"Naga used shadow force...\");\n System.out.println(\"Naga disappears in a pitch black vortex...\");\n enter = next.nextLine();\n System.out.println(\"GHAAAAR!!!\");\n enter = next.nextLine();\n System.out.println(\"Naga flies out of his vortex and rams into the witch. YOUCH!\");\n System.out.println(\"The boss lost 180 HP.\");\n bosshealth = bosshealth-180;//Naga deals damage\n enter = next.nextLine();\n System.out.println(\"The evil witch now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 1) {\n System.out.println(\"Naga used firebreath...A large dark ember sparks from naga's mouth and \");\n System.out.println(\"begins to build up. The large black fire surrounds the witch and burns the witch\");\n enter = next.nextLine();\n System.out.println(\"'ARGHH! You will pay for that', the witch screamed.\");\n enter = next.nextLine();\n bosshealth = bosshealth-200;\n System.out.println(\"WHOA!!! The fiery breath inflicted 200 HP. The boss now has\" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 2) {\n System.out.println(\"Naga used his blades of terror to torture the witch...\");\n System.out.println(\"Naga creates a strong whirlwind with his wings and released thousands of sharp\");\n System.out.println(\"scales that severely wounded the witch. SHINGG!!!\");\n enter = next.nextLine();\n bosshealth = bosshealth-150;\n System.out.println(\"OWWW!!! The boss lost 150 HP and now has \" + bosshealth + \"HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\"); \n }else if (naga_attacks == 3) {\n System.out.println(\"Naga used wings of Justice. \");\n enter = next.nextLine();\n System.out.println(\"Naga flies up high and plunges down toward the witch...\");\n System.out.println(\"Naga uppercuts the witch with his large wings and knocks the witch off her feet.\");\n enter = next.nextLine();\n bosshealth = bosshealth-210;\n System.out.println(\"YIKES!!! Naga inflicted 210 HP. The boss has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 4) {\n System.out.println(\"Naga used tail whip...\");\n System.out.println(\"SWWWSSS!!! BRMMM!!!\");\n System.out.println(\"Naga sets himself apart and lunges forward with his tail and thrusts the witch\");\n System.out.println(\"off the arena...\");\n enter = next.nextLine();\n System.out.println(\"The witch teleports herself back into the arena, but loses 60 HP because of this.\");\n bosshealth = bosshealth-60;\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Now Naga has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 5) {\n healing_naga_challenge3();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n System.out.println(\"\\n\");\n System.out.println(\"The boss still has \" + bosshealth + \" HP.\");\n }\n }\n \n if(bosshealth <= zero) { //check to see if boss is still alive\n //#win\n /* This is the conditions to win. The boss's health must equal to or less than zero. If you win the \n boolean monsterisalive is equal to false and the player will come to the endgame method to \n displayt he credits...\n */\n System.out.println(\"You defeated the boss...Congratulations, you have won the war.\");\n enter = next.nextLine();\n System.out.println(\"The witch has disappeared, vanished forever in a black hole that consumed the boss.\");\n enter = next.nextLine();\n System.out.println(\"That is the last time you'll ever see that hideous thing ever again.\");\n monsterisalive = false;\n endgame();\n //it's the boss's turn\n }else if (bosshealth > zero) { //if it is still greater than zero...\n System.out.println(\"It's the monster's turn...brace yourselves\");\n System.out.println(\"'The witch has 8 different spells that she can use...she's very strong...\");\n System.out.println(\"BE CAREFUL,' stated Naga.\");\n enter = next.nextLine();\n System.out.println(\"Are you ready to feel what pain really is? Prepare yourself...\");\n System.out.println(\"ARGGHHH!!! BRRRM!!!\");\n enter = next.nextLine();\n System.out.println(\"Naga and \"+ username + \" are on their guard ready to defend against the witches attacks\");\n enter = next.nextLine();\n System.out.println(\"Here I go...\");\n enter = next.nextLine();\n which = pick.nextInt(2);//decide which one will get hit: player or Naga\n boss_attacks = boss.nextInt(9);//decides which\n if (boss_attacks == 0) {\n System.out.println(\"'Night Shadow!'\");\n //this will determine which player gets hit; you or Naga\n if(which == 0) { //player gets hit\n enter = next.nextLine();\n System.out.println(\"The witch summons a dark cloud from above with her staff...\");\n enter = next.nextLine();\n /* #enemyobject\n The witch affects the protagonist/player by harming the player's health through savage attacks that \n inflicts large amounts of damage to the player. \n */\n System.out.println(\"The dark cloud duplicates and strikes \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"Ouch \" + username + \" loses 200 HP.\");\n playerhealth = playerhealth-200;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n enter = next.nextLine();\n System.out.println(\"The witch summons a dark cloud from above with her staff...\");\n enter = next.nextLine();\n System.out.println(\"The dark cloud duplicates and strikes Naga. Naga collapses\");\n enter = next.nextLine();\n System.out.println(\"Ouch Naga loses 200 HP.\");\n nagahealth = nagahealth-200;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 1) {\n System.out.println(\"'Shadow Blade!'\");\n //this will determine who will get hit\n if (which == 0) { // player gets hit\n System.out.println(\"The witch's staff transforms into a deadly blade.\");\n System.out.println(\"The blade has \" + username + \"'s face on the back...\");\n enter = next.nextLine();\n System.out.println(\"Watch out \" + username + \". She's on to you...\");\n enter = next.nextLine();\n System.out.println(\"The witch charges up and strikes \" + username + \".\");\n System.out.println(\"SLASH...SHING!!!\");\n enter = next.nextLine();\n System.out.println(\"OUCH!!! \" + username + \" loses 150 HP.\");\n playerhealth = playerhealth-150;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n System.out.println(\"The witch's staff transforms into a deadly blade.\");\n System.out.println(\"The blade has a black dragon symbol on the edge...\");\n enter = next.nextLine();\n System.out.println(\"'Naga she's on to you. WATCH OUT!' \" + username + \" screams.\");\n System.out.println(\"SLASH...SHING!!!\");\n enter = next.nextLine();\n System.out.println(\"OUCH!!! naga loses 150 HP.\");\n nagahealth = nagahealth-150;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 2) {\n System.out.println(\"Dragon spiral!\");\n if(which == 0) { //player gets hit\n System.out.println(\"The witch summons a red and purple dragon underground...\");\n System.out.println(\"The red and purple dragon shoots out red and purple flames that fuse\");\n System.out.println(\"together to form a gigantic half red and purple flame.\");\n enter = next.nextLine();\n System.out.println(\"Look out \" + username + \".\");\n System.out.println(\"FOOOSH!!! The burning lava like embers engulf \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"ARRHHH!!! \" + username + \" loses 300 HP.\");\n playerhealth = playerhealth-300;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n System.out.println(\"The witch summons a red and purple dragon underground...\");\n System.out.println(\"The red and purple dragon shoots out red and purple flames that fuse\");\n System.out.println(\"together to form a gigantic half red and purple flame.\");\n enter = next.nextLine();\n System.out.println(\"'Look out Naga,' \" + username + \" stated.\");\n System.out.println(\"FOOOSH!!! The burning lava like embers engulf Naga.\");\n enter = next.nextLine();\n System.out.println(\"ARRHHH!!! Naga loses 300 HP.\");\n nagahealth = nagahealth-300;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 3) {\n System.out.println(\"Take over\");\n enter = next.nextLine();\n System.out.println(\"The witch summons the demons and releases them from a black portal she created\");\n System.out.println(\"Gouls, bats, and other hideous creatures emerged from the darkness\");\n if(which == 0) {// player gets hit\n System.out.println(\"The creatures targets \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"Watch out \" + username + \".\");\n System.out.println(\"GARRRL!!! SCRAA!!! FOOSHING!!!\");\n enter = next.nextLine();\n System.out.println(\"AHHH!!! \" + username + \" gets bitten, beaten, and scratched ...\");\n playerhealth = playerhealth-50;\n System.out.println(username + \" loses 50 HP. You now have \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) {\n System.out.println(\"The creatures targets Naga.\");\n enter = next.nextLine();\n System.out.println(\"'Watch out Naga,' \" + username + \" stated.\");\n System.out.println(\"GARRRRL!!! SCRAAA!!! FOOOSHHING!!!\");\n enter = next.nextLine();\n nagahealth = nagahealth-50;\n System.out.println(\"ARRGGG!!! Naga loses 50 HP. Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 4) {\n System.out.println(\"dark cosmic swords!!!\");\n System.out.println(\"GHAAA!!!\");\n enter = next.nextLine();\n System.out.println(\"There are 5 darks lands in her reign, which means 5 different swords in her possession.\");\n System.out.println(\"Sword 1 released fire...\");\n System.out.println(\"FOOSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 2 released water...\");\n System.out.println(\"GURLG!!! FSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 3 released ice...\");\n System.out.println(\"SHING!!! BRRRRR!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 4 released wind...\");\n System.out.println(\"WHIRL!!! WHIRL!!! GUSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 5 released lightening...\");\n System.out.println(\"ZHNGGG!!! BAM!!!! BRVRMM!!!\");\n System.out.println(\"The ground ruptures and collides on \" + username + \" and Naga.\");\n enter = next.nextLine();\n System.out.println(\"These swords have just released the dark elements of the earth!\");\n System.out.println(\"YOUCH!!! Both Naga and \" + username + \" lost 220 HP.\");\n enter = next.nextLine();\n playerhealth = playerhealth-220;\n nagahealth = nagahealth-220;\n System.out.println(username + \" now has \" + playerhealth + \" HP and Naga has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (boss_attacks == 5) {\n System.out.println(\"Knock down!\");\n if(miss_choice == 0) {//boss miss\n System.out.println(\"The witch summons a dark spell from her staff.\");\n enter = next.nextLine();\n System.out.println(\"An evil figure lurks in the shadows...'Can you see it Naga?' \");\n System.out.println(username + \" said.\");\n enter = next.nextLine();\n System.out.println(\"'No...I can't see a thing.\");\n enter = next.nextLine();\n System.out.println(\"Suddenly, you see a big shadow coming at Naga.\");\n enter = next.nextLine();\n System.out.println(username + \" sends a fireball flying at the shadowy figure and it disappears.\");\n System.out.println(\"Naga then sees the figure coming towards \" + username + \" and sends a flame\");\n System.out.println(\"at the shadow...The figure plunges back into the witches staff. \");\n enter = next.nextLine();\n System.out.println(\"'I guess you saw that coming, won't happen ever again!' the witch exclaimed.\");\n enter = next.nextLine();\n System.out.println(\"You dodged the witches attack!\");\n enter = next.nextLine();\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" still has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga still has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (miss_choice == 1) { //boss hits\n System.out.println(\"The witch summons a dark spell from her staff.\");\n enter = next.nextLine();\n System.out.println(\"An evil figure lurks in the shadows...'Can you see it Naga?' \");\n System.out.println(username + \" said.\");\n enter = next.nextLine();\n System.out.println(\"'No...I can't see a thing.\");\n enter = next.nextLine();\n System.out.println(\"Suddenly, you see a big shadow coming at Naga.\");\n enter = next.nextLine();\n System.out.println(username + \" sends a fireball flying at the shadowy figure, but you missed!\");\n System.out.println(\"The shadowy figure steals 50 HP of Naga's health.\");\n nagahealth = nagahealth-50;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The shadowy figure then turns towards \" + username + \".\");\n System.out.println(\"Naga spits out a large fire, but misses the figure...\");\n System.out.println(\"The shadowy figure steals 50 HP of \" + username + \".\");\n playerhealth = playerhealth-50;\n System.out.println(username + \" still has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 6) {\n System.out.println(\"Volcanic Eruption!\");\n if(miss_choice == 0) {//the boss misses\n System.out.println(\"The witch casts a spell that creates a series of volcanoes around you.\");\n System.out.println(\"The witch then forces the volcanoes to spit lava out...\");\n System.out.println(\"However, you saw that coming already. You and Naga jumped out of the way\");\n enter = next.nextLine();\n System.out.println(\"You dodged the attack!\");\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" has \" + playerhealth + \" HP, and Naga has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (miss_choice == 1) {//the boss is able to hit you\n System.out.println(\"The witch summons the evil lava guardian...\");\n System.out.println(\"She then points her staff directly at...\");\n if(which == 0){//player gets hit\n System.out.println(username);\n enter = next.nextLine();\n System.out.println(\"Watch out!!!\");\n System.out.println(\"GURGLLE!!! FSH!!!\");\n System.out.println(\"The lava erupts like a fountain lake and basks \" + username + \".\");\n System.out.println(username + \" loses 100 HP.\");\n enter = next.nextLine();\n playerhealth = playerhealth-100;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (which == 1){ //naga gets hit\n System.out.println(\"Naga\");\n enter = next.nextLine();\n System.out.println(\"Watch out!\");\n System.out.println(\"GURGLRE!!! FSH!!!\");\n System.out.println(\"The lava shoots out at Naga's face, feet, and back...\");\n System.out.println(\"Removing all of his scales in the process\");\n System.out.println(\"Naga loses 100 HP.\");\n enter = next.nextLine();\n nagahealth = nagahealth-100;\n System.out.println(username + \" has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }\n }else if (boss_attacks == 7) {\n System.out.println(\"Satin's Spear\");\n System.out.println(\"The witch uses her staff to summon her friend Satin...\");\n enter = next.nextLine();\n System.out.println(\"EXTERMINATE THEM!!!\");\n if(miss_choice == 0){ //boss missed\n System.out.println(\"Yes ma'm...\");\n System.out.println(\"Statin launches his spear...\");\n enter = next.nextLine();\n System.out.println(\"BUT, Naga and \" + username + \" were able to dodge the attack!\");\n System.out.println(\"MISS!\");\n enter = next.nextLine();\n System.out.println(\"OOPS!\");\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" has \" + playerhealth + \" and Naga has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \"+ bosshealth + \" HP.\");\n }else if(miss_choice == 1){//boss gets a hit\n System.out.println(\"Yes ma'm...\");\n System.out.println(\"URGGGHAAA!!!\");\n enter = next.nextLine();\n System.out.println(\"Satin launches his spear, which duplicated...\");\n System.out.println(\"The spear is still launching up on the air...\");\n enter = next.nextLine();\n if(which == 0) { //player gets hit\n System.out.println(username + \" wants to protect his friend so he jumps forward to block\");\n System.out.println(\"the threatening spear from piercing his friend...\");\n enter = next.nextLine();\n System.out.println(\"However, in doing so the spear lands on \" + username + \".\");\n System.out.println(\"The spear erupts into pieces, shattering \" + username + \"'s legs.\");\n enter = next.nextLine();\n System.out.println(\"The wound heals but inflicts 300 damage to \" + username + \".\");\n playerhealth = playerhealth-300;\n System.out.println(username + \" has \" + playerhealth + \" HP.\");\n }else if(which == 1) { //Naga gets hit\n System.out.println(\"Naga tries to shield \" + username + \" and successfully does.\");\n System.out.println(\"BUT, in doing so the spear pierces Naga's well-armored belly.\");\n enter = next.nextLine();\n System.out.println(\"The spear automatically drills deeper until Naga can't fight anymore...\");\n System.out.println(\"The wound heals, but dealt 300 damage to Naga.\");\n nagahealth = nagahealth-300;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }\n }\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (boss_attacks == 8) {\n System.out.println(\"Health Spell...\");\n System.out.println(\"The evil witch raised her staff and a blue vortex emerged.\");\n System.out.println(\"\\n\");\n System.out.println(\"However, the witch suddenly jumps into the vortex and after a while jumps out.\");\n System.out.println(\"OH NO!!! She tried to heal herself...\");\n bosshealth = bosshealth + 350;\n if(bosshealth == 10000) {\n System.out.println(\"She already had a maximum health of \" + bosshealth + \" HP. So it didn't work.\");\n System.out.println(\"\\n\");\n }else if(bosshealth > 10000) {\n bosshealth = 10000;\n System.out.println(\"The boss currently now \" + bosshealth + \" HP.\");\n }else{\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }\n }\n //#lose-player loses all of HP \n if(playerhealth <= zero) { //in case player loses all of his/her health\n System.out.println(\"OH NO!!!\" + username + \" lost was defeated!\");\n System.out.println(\"Naga currently has \" + nagahealth + \" HP.\");\n System.out.println(\"Better luck next time...\");\n monsterisalive = false;\n replaybossfight();\n }\n //#lose-naga's HP is equal to or less than zero\n if(nagahealth <= zero) { // in case Naga loses all of his/her health\n System.out.println(\"OH NO!!! Naga lost all of his health and was defeated!\");\n System.out.println(username + \" currently has \" + playerhealth + \" HP.\");\n System.out.println(\"Better luck next time...\");\n monsterisalive = false;\n replaybossfight();\n }\n \n }\n \n }", "public void act() \r\n {\r\n addDrone();\r\n if(droneTimer>0)\r\n {\r\n droneTimer--;\r\n }\r\n }", "private void attack() {\n final Random rnd = new Random();\n // Создаем WorkerThread\n attackerExecutor = Executors.newScheduledThreadPool(1);\n mAttackExecuter = attackerExecutor.scheduleWithFixedDelay(new Runnable() {\n @Override\n public void run() {\n for (int i =0; i<enemyPerWave;i++){\n int x = (int) (rnd.nextInt((int) (rightBorder-leftBorder))+leftBorder);\n\n createBossBall(x,0);\n }\n attackRatee-=attackLiveRate;\n if (attackRatee < 100){\n mAttackExecuter.cancel(true);\n attackerExecutor.shutdownNow();\n\n }\n }\n }, 0,attackLiveRate , TimeUnit.MILLISECONDS);\n\n }", "@Override\n @SuppressWarnings(\"empty-statement\")\n public void attack(){\n\n if (myTerritory.getAlpha() <= 0.5){\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getSoldiers()/4;\n defendingSoldiers = myTerritory.getSoldiers()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }\n else\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getFoodGrowth()/4;\n defendingSoldiers = myTerritory.getFoodGrowth()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }", "private void startEmergency()\n {\n sendUserPresentLocationDetailsToEmergencyConatct();\n\n /*final ClientConfiguration clientConfiguration = getClientConfiguration();\n completedTime = completedTime + clientConfiguration.getTimeDelayEmergency();\n Timer timer = new Timer();\n timer.schedule(new TimerTask()\n {\n @Override\n public void run()\n {\n completedTime = completedTime + clientConfiguration.getTimeDelayEmergency();\n if (clientConfiguration.getMaxTimeEmergency() < completedTime)\n {\n completedTime = 0;\n cancel();\n notifyEmergencyCompleted();\n }\n else\n {\n sendUserPresentLocationDetailsToEmergencyConatct();\n }\n }\n }, clientConfiguration.getTimeDelayEmergency(), clientConfiguration.getTimeDelayEmergency());*/\n }", "public void checkCollision(){\n\r\n for(int i = 0; i < enemies.size(); i++){\r\n \r\n // Player and Enemy collision\r\n \r\n if(collide(this.player, enemies.get(i)) && this.player.isVisible() && enemies.get(i).isVisible()){\r\n System.out.println(\"Collide\");\r\n this.player.setHealth(this.player.getHealth() - 100);\r\n }\r\n\r\n // Player and Enemy bullet collision\r\n \r\n for(int j =0; j < enemies.get(i).getBullets().size(); j++){\r\n\r\n if(collide(this.player, enemies.get(i).getBullets().get(j)) && this.player.isVisible() && enemies.get(i).getBullets().get(j).isVisible()){\r\n\r\n enemies.get(i).getBullets().get(j).setVisible(false);\r\n this.player.setHealth(this.player.getHealth() - enemies.get(i).getBullets().get(j).getDamage());\r\n\r\n }\r\n }\r\n\r\n }\r\n //time = DEFAULT_TIME_DELAY;\r\n// }\r\n\r\n\r\n\r\n for(int i = 0; i < player.getBullets().size(); i++){\r\n\r\n\r\n // Player bullet and enemy collision\r\n\r\n for(int j = 0; j < enemies.size(); j++) {\r\n if (collide(enemies.get(j), player.getBullets().get(i)) && enemies.get(j).isVisible() && player.getBullets().get(i).isVisible()) {\r\n\r\n if (enemies.get(j).getHealth() < 0) {\r\n enemies.get(j).setVisible(false);\r\n score.addScore(100);\r\n }\r\n\r\n enemies.get(j).setHealth(enemies.get(j).getHealth() - player.getBullets().get(i).getDamage());\r\n // enemies.get(j).setColor(Color.RED);\r\n player.getBullets().get(i).setVisible(false);\r\n\r\n\r\n }\r\n }\r\n\r\n\r\n // Boss collision & player bullet collision\r\n\r\n if(collide(player.getBullets().get(i), this.boss1) && player.getBullets().get(i).isVisible() && boss1.isVisible()){\r\n\r\n if(boss1.getHealth() < 0){\r\n boss1.setVisible(false);\r\n score.addScore(1000);\r\n state = STATE.WIN;\r\n }\r\n this.boss1.setHealth(this.boss1.getHealth() - player.getBullets().get(i).getDamage());\r\n // this.boss1.setHealth(0);\r\n player.getBullets().get(i).setVisible(false);\r\n\r\n }\r\n\r\n }\r\n\r\n // Bullet vs Bullet Collision\r\n\r\n for(int k = 0 ; k < player.getBullets().size(); k++){\r\n\r\n if(player.getBullets().get(k).isVisible()) {\r\n for (int i = 0; i < enemies.size(); i++) {\r\n\r\n if(enemies.get(i).isVisible()) {\r\n for (int j = 0; j < enemies.get(i).getBullets().size(); j++) {\r\n\r\n if (collide(player.getBullets().get(k), enemies.get(i).getBullets().get(j)) && enemies.get(i).getBullets().get(j ).isVisible()) {\r\n\r\n\r\n System.out.println(\"bullets colliding\");\r\n\r\n player.getBullets().get(k).setVisible(false);\r\n enemies.get(i).getBullets().get(j).setColor(Color.yellow);\r\n enemies.get(i).getBullets().get(j).deflect(this.player.getX() + this.player.getW()/2, this.player.getY() + this.player.getH()/2);\r\n\r\n player.getBullets().add(enemies.get(i).getBullets().get(j));\r\n\r\n enemies.get(i).getBullets().remove(enemies.get(i).getBullets().get(j)); //removes bullet\r\n\r\n\r\n k++;\r\n j--;\r\n //enemies.get(i).getBullets().get(j).setVisible(false);\r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n for(int i = 0; i < boss1.getBullets().size(); i++) {\r\n\r\n\r\n if (collide(player.getBullets().get(k), boss1.getBullets().get(i)) && boss1.getBullets().get(i).isVisible()) {\r\n\r\n System.out.println(\"boss bullets colliding\");\r\n player.getBullets().get(k).setVisible(false);\r\n boss1.getBullets().get(i).setColor(Color.yellow);\r\n boss1.getBullets().get(i).deflect(this.player.getX() + this.player.getW()/2, this.player.getY() + this.player.getH()/2);\r\n player.getBullets().add(boss1.getBullets().get(i));\r\n boss1.getBullets().remove(boss1.getBullets().get(i));\r\n k++;\r\n i--;\r\n\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Boss bullet and player collision\r\n\r\n for(Bullet b : boss1.getBullets() ){\r\n\r\n\r\n if(collide(player, b) && player.isVisible() && b.isVisible()){\r\n b.setVisible(false);\r\n player.setHealth(player.getHealth() - b.getDamage());\r\n }\r\n }\r\n\r\n\r\n // Power up collision\r\n\r\n for(PowerUp p : powerUps){\r\n\r\n if(collide(player, p) && p.isVisible()){\r\n\r\n p.executeEffect(this.player);\r\n p.setVisible(false);\r\n }\r\n }\r\n\r\n\r\n\r\n // Deleting out of bound bullets\r\n for(int i = 0; i < player.getBullets().size(); i++){\r\n if(player.getBullets().get(i).getY() < 0 || player.getBullets().get(i).getY() > GameWorld.SCREEN_H ||\r\n player.getBullets().get(i).getX()< 0 || player.getBullets().get(i).getX() > GameWorld.SCREEN_W) {\r\n\r\n player.getBullets().remove(player.getBullets().get(i));\r\n }\r\n }\r\n\r\n }", "@Override\n public void summonHorsesToPaddock(){\n rl.lock();\n try{\n System.out.println(\"B : Trying to summon horse...\");\n //change broker state\n// MyThreadBroker broker = (MyThreadBroker) Thread.currentThread();\n// broker.broker_states = MyThreadBroker.Broker_States.ANNOUNCING_NEXT_RACE;\n //change log\n log.setBrokerState(MyThreadBroker.Broker_States.ANNOUNCING_NEXT_RACE);\n log.changeLog();\n keep_waiting = false;\n stable_horses.signal(); \n }finally{\n rl.unlock();\n }\n \n }", "@Override\n\tpublic void run() {\n\t\tDrawable ens[], wes[], tow;\n\t\tEnemy e;\n\t\twhile(true) {\n\t\t\tUtils.acquireLock(GameScreen.game.pause);\n\t\t\tGameScreen.game.pause.release();\n\t\t\tif(GameScreen.game.state != 0) {\n\t\t\t\tUtils.acquireLock(mutex);\n\t\t\t\tens = (Enemy[]) enemies.toArray(new Enemy[0]);\n\t\t\t\twes = (Weapon[]) weapons.toArray(new Weapon[0]);\n\t\t\t\ttow = (Tower) tower;\n\t\t\t\tmutex.release();\n\t\t\t\tfor(Drawable dw : ens) {\n\t\t\t\t\tUtils.joinThread(dw.runningThread);\n\t\t\t\t}\n\t\t\t\tfor(Drawable dw : wes) {\n\t\t\t\t\tUtils.joinThread(dw.runningThread);\n\t\t\t\t}\n\t\t\t\tUtils.joinThread(tow.runningThread);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(semester >= 5) {\n\t\t\t\tgameWon();\n\t\t\t} else if(test >= 5) {\n\t\t\t\tsemester++;\n\t\t\t\ttest = 0;\n\t\t\t} else if(killedEnemies >= totalEnemies) {\n\t\t\t\ttest++;\n\t\t\t\tkilledEnemies = 0;\n\t\t\t\ttotalEnemies = (test + 1) * (semester + 1) * 2;\n\t\t\t} else {\n\t\t\t\t//if (Utils.getRandom().nextInt(100) < 25) {\n\t\t\t\t\te = new Enemy(semester, test);\n\t\t\t\t\tUtils.acquireLock(mutex);\n\t\t\t\t\tenemies.add(e);\n\t\t\t\t\te.init();\n\t\t\t\t\tmutex.release();\n\t\t\t\t//}\n\t\t\t\tUtils.sleep(2500 - ((semester + 1) * (test + 1) * 100));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tThread.yield();\n\t\t}\n\t}", "public void startClock(){\n\n final Timer gTimer = new Timer();\n gTimer.schedule(new TimerTask() {\n @Override\n public void run() {\n //Log.e(\"GLOBAL TIMER\",\"RUNNING...\");\n if(!((MainActivity)context).isPaused) {\n //if they are dead, remove them from list\n Iterator<EnemyCharacter> iter0 = enemyFactory.enemies.iterator();\n while (iter0.hasNext()) {\n EnemyCharacter enemyCharacter = iter0.next();\n\n if (enemyCharacter.isDead) {\n iter0.remove();\n }\n }\n\n gTime++;\n //Reset the power ups on set intervals.\n if (gTime % 2000 == 0) {\n canGrowl = true;\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n bottomFragment.growl.setBackgroundResource(R.drawable.growl_btn);\n }\n });\n\n }\n if (gTime % 7000 == 0) {\n canTebow = true;\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n bottomFragment.tebow.setBackgroundResource(R.drawable.tebow_btn);\n }\n });\n }\n if (gTime % 5000 == 0) {\n canAlberta = true;\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n bottomFragment.alberta.setBackgroundResource(R.drawable.alberta_btn);\n }\n });\n }\n\n //INCREASE DIFFICULTY OVER TIME\n if (gTime < 1000) {\n difficulty = 1;\n } else if (gTime < 3000) {\n difficulty = 2;\n } else if (gTime < 7000) {\n difficulty = 3;\n } else if (gTime < 12000) {\n difficulty = 4;\n } else {\n difficulty = 5;\n }\n\n //USE DIFFICULTY TO CREATE ENEMIES\n if (difficulty == 1) {\n if (gTime % 400 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else if (difficulty == 2) {\n if (gTime % 300 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else if (difficulty == 3) {\n if (gTime % 300 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else if (difficulty == 4) {\n if (gTime % 200 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else {\n //Log.e(\"MAX\", \"Difficulty\");\n if (gTime % 100 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n }\n\n //DO THE ANIMATIONS\n Iterator<EnemyCharacter> iter3 = enemyFactory.enemies.iterator();\n while (iter3.hasNext()) {\n EnemyCharacter enemyCharacter = iter3.next();\n\n //Do the animation and moving every ten times this timer runs\n if (gTime % 10 == 0) {\n enemyCharacter.animate();\n enemyCharacter.move();\n }\n }\n\n //TEBOW TO THE RESCUE WITH THE POWER OF JEEESUUUSS!\n if (drawTebow) {\n Iterator<EnemyCharacter> iter = enemyFactory.enemies.iterator();\n while (iter.hasNext()) {\n EnemyCharacter enemyCharacter = iter.next();\n if (enemyCharacter.x < maxWidth / 2) {\n tebow.setX(enemyCharacter.x - 100);\n tebow.setY(enemyCharacter.y);\n iter.remove();\n drawTebowCounter++;\n }\n if (drawTebowCounter >= 10) {\n drawTebow = false;\n drawTebowCounter = 0;\n }\n }\n }\n\n //REDRAW EVERYTHING CONSTANTLY\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n canvasView.invalidate();\n }\n });\n\n //CHECK TO SEE IF THE PLAYER LOST THE GAME OR IF ENEMY GETS AUTO-MAGICALLY CHOMPED\n Iterator<EnemyCharacter> iter1 = enemyFactory.enemies.iterator();\n while (iter1.hasNext()) {\n EnemyCharacter enemyCharacter = iter1.next();\n\n //Check if the player lost\n if (enemyCharacter.x < -50) {\n gameOver = true;\n }\n if (enemyCharacter.x < 50) {\n if ((enemyCharacter.y + enemyCharacter.bitmap.getHeight() / 2) > canvasView.albert.y) {\n if ((enemyCharacter.y + enemyCharacter.bitmap.getHeight() / 2) < canvasView.albert.y + canvasView.albert.bitmap.getHeight()) {\n //Enemy in range. Chomp him.\n enemyCharacter.isDead = true;\n score++;\n canvasView.albert.chomp(canvasView);\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n bottomFragment.updateScores();\n }\n }\n }\n }\n\n if (gameOver) {\n gTimer.purge();\n gTimer.cancel();\n restart();\n\n //launch play fragment dialog\n DialogFragment gameOverDialog = new PlayFragment.GameOverDialog();\n gameOverDialog.show(((MainActivity) context).getFragmentManager(), \"Game Over\");\n }\n }\n }//END OF GLOBAL TIMER RUN METHOD\n },0,10);\n }", "public void run() {\n\t\t\n\t\twhile(true) {\n\t\t \ttry {\n\t\t \t\t\n\t\t \t\tSystem.out.println(\"SeatCountWriteAccess TRYING to enter Critical Section in Patient\" + id);\n\t\t \t\t // Try to get access to the waiting room chairs\n\t\t\t\tLazyDentist.seatCountWriteAccess.acquire();\n\t\t\t\tSystem.out.println(\"SeatCountWriteAccess ENTERED Critical Section in Patient \" + id);\n\t\t\t\t\n\t\t\t\tif (LazyDentist.numberOfFreeWRSeats > 0) {\n\t\t\t\t\t\n\t\t\t\t\t// Customer sits on a chair, decreasing the number of free seats\n\t\t\t \t\tLazyDentist.numberOfFreeWRSeats--; \n\t\t\t \t\t\n\t\t\t \t\tSystem.out.println(\"PatientReady signalled by the Patient \" + id);\n\t\t\t \t\t// Notifies the dentist, who is waiting until there is a patient\n\t\t\t \t\tLazyDentist.patientReady.release(); \n\t\t\t \t\t\n\t\t\t \t\tSystem.out.println(\"SeatCountWriteAccess signalled by the Patient \" + id);\n\t\t\t \t\t// No need to lock the chairs anymore\n\t\t\t \t\tLazyDentist.seatCountWriteAccess.release(); \n\t\t\t \t\t\n\t\t\t \t\ttry {\n\t\t\t \t\t\tSystem.out.println(\"DentistReady TRYING to enter Critical Section in Patient \" + id);\n\t\t\t \t\t\t// Wait until the dentist is ready\n\t\t\t \t\t\tLazyDentist.dentistReady.acquire();\n\t\t\t \t\t\tSystem.out.println(\"DentistReady ENTERED Critical Section in Patient \" + id);\n\t\t\t \t\t\t\n\t\t\t \t\t\t// Consult the dentist\n\t\t\t \t\t\tconsultDentist();\n\t\t\t \t\t\t\n\t\t\t \t\t} catch (InterruptedException e) {\n\t\t\t \t\t\te.printStackTrace();\n\t\t\t \t\t}\n\t\t\t\t} else { // If there are no free seats\n\t\t\t\t\tSystem.out.println(\"No free seats available. Patient \" + id + \" is leaving the dentist\");\n\t\t\t\t\t\n\t\t\t\t\t// Release lock on seats\n\t\t\t\t\tSystem.out.println(\"SeatCountWriteAccess signalled by the Patient \" + id);\n\t\t\t\t\tLazyDentist.seatCountWriteAccess.release();\n\t\t\t\t}\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n MadScientist madScientist = new MadScientist(new TimeMachine());\r\n LinearlyTimeTraveler linearlyTimeTraveler = new LinearlyTimeTraveler(\"LinearMan\", 100d);\r\n DoublyTimeTraveler doublyTimeTraveler = new DoublyTimeTraveler(\"DoubleMan\", 100d);\r\n ExpolyTimeTraveler expolyTimeTraveler = new ExpolyTimeTraveler(\"ExpoMan\", 100d, DECAY_CONSTANT);\r\n // experiment on each TimeTraveler\r\n // a TimeTraveler should always start with 100 years of time travel strength\r\n // one TimeTraveler implementation should linearly decay (i.e., one year of actual time travel reduces the\r\n // time traveler's ability by one year)\r\n //250 multi-thread to speed up the process\r\n for (int i=0; i<250; i++) {\r\n madScientist.experiment(linearlyTimeTraveler);\r\n }\r\n // one TimeTraveler implementation should decay double the travel value (i.e., one year of actual time travel reduces\r\n // the time traveler's ability by two years)\r\n //150 multi-thread\r\n for (int i=0; i<150; i++) {\r\n madScientist.experiment(doublyTimeTraveler);\r\n }\r\n // one TimeTraveler implementation should have exponential decay with a decay constant inputted by the scientist (see http://en.wikipedia.org/wiki/Exponential_decay)\r\n //50 multi-thread\r\n for (int i=0; i<50; i++) {\r\n madScientist.experiment(expolyTimeTraveler);\r\n }\r\n // continue to experiment until all the TimeTraveler's have exhausted their ability to travel\r\n }", "public void infect() {\n\t\tPlagueAgent current = this;\n\t\tif (!current.infected) {\n\t\t\tfor (PlagueAgent a : plagueWorld.getNeighbors(current, 5)) {\n\t\t\t\tif (a.infected) {\n\t\t\t\t\tint luck = Utilities.rng.nextInt(100);\n\t\t\t\t\tif (luck < plagueWorld.VIRULENCE) {\n\t\t\t\t\t\tthis.infected = true;\n\t\t\t\t\t\tplagueWorld.newInfection();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tplagueWorld.changed();\n\t}", "public void run() {\n \t\t\t\t\tPerformTransition.transition(am, MatchState.LOSERS, am.getResult().getLosers(), false);\n \t\t\t\t\tif (victor != null) /// everyone died at once??\n \t\t\t\t\t\tPerformTransition.transition(am, MatchState.WINNER, victor, false);\n \t\t\t\t\tarenaInterface.onComplete();\n \t\t\t\t\tnotifyListeners(new MatchCompletedEvent(am));\n \t\t\t\t\tupdateBukkitEvents(MatchState.ONCOMPLETE);\n \t\t\t\t\tdeconstruct();\t\n \t\t\t\t}", "public void approach(contestant c) throws InterruptedException {\n\n int rand1 = ThreadLocalRandom.current().nextInt(1500, 5000);\n int rand2 = ThreadLocalRandom.current().nextInt(1, 3);\n\n setPriority(10); //raise thread priority to make decision\n\n //System.out.println(this.getName() + \" is now talking to \" + c.getName());\n sleep(rand1); // simulate 'talking phase'\n\n visit[c.getID()] = true; // record contestant attempt\n\n if (rand2 == 2) { // if roll is successful (contestant gets number) (33.3% chance of success)\n\n msg(\"has given their number to \" + c.getName());\n //System.out.println(this.getName() + \" has given their number to \" + c.getName());\n c.datenums.add(this); // record successful match inside contestant\n\n } else\n\n msg(\"has rejected \" + c.getName());\n //System.out.println(this.getName() + \" has rejected \" + c.getName());\n\n sem.release();\n\n setPriority(5); //reset thread priority to default\n\n increaseRound(c); // increase round total\n\n }", "public void handle(GameState state, Duration dt) {\r\n Player p = state.getPlayer();\r\n if (e.getDistance(p) < 1.1) p.damage(1);\r\n }", "public void tick()\r\n\t{\r\n\t\tsuper.tick();\r\n\t\t\r\n\t\tswitch(state) {\r\n\t\tcase ENTERING:\r\n\t\t\tif (speed() == 0) {\r\n\t\t\t\tsetSpeed(speed);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase STOPPED:\r\n\t\t\tif (speed() > 0) {\r\n\t\t\t\tsetSpeed(0);\r\n\t\t\t}\r\n\t\t\t//Remain in same state\r\n\t\t\tbreak;\r\n\t\tcase EXITING:\r\n\t\t\tif (speed() == 0) {\r\n\t\t\t\tsetSpeed(speed);\r\n\t\t\t}\r\n\t\t\t//turn();\r\n\t\t\t//Remain in same state\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t// Check to see if enity has entered a box\r\n\t\tBox box = getBox();\r\n\t\tif( box != null){\r\n\t\t//check to see if the box contains the vehicle, and check ot see if the pedsetrian is already in the box\r\n\t\t//if so add it to the box\r\n\t\t\tif( box.insideBox(this) && !inBox && state == State.EXITING){ \r\n\t\t\t\tbox.addEntity(this);\r\n\t\t\t\tinBox = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t\r\n\t\t//Check for boundary crossing\r\n\t\tif ((x() < lane.road().getIntersection().getMinX() || x() > lane.road().getIntersection().getMaxX()) || (y() < lane.road().getIntersection().getMinY() || y() > lane.road().getIntersection().getMaxY())) {\r\n\t\t\tlane.removePedestrian(this);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public void updateInfectiousSchedule(DengueSpreadModelRebuildDailyRountine peopleM) {\n\t\t\t\tif(infectiousTimeline > 0) infectiousTimeline ++;\n\t\t\t\t\n\t\t\t\t// whether the building is infected\n\t\t\t\t\t\tBag PlaceVisited = peopleM.socialNetwork.getEdgesOut(this);\n\t\t\t\t\t\tboolean infected = false;\n\t\t\t\t\t\tfor (int i = 0; i < PlaceVisited.size(); i++) {\n\t\t\t\t\t\t\tif(((Building)((Edge)PlaceVisited.get(i)).getTo()).isInfectious()) {\n\t\t\t\t\t\t\t\tinfected = true;\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\n\t\t\t\t// if infected\n\t\t\t\tif(infected && infectiousTimeline == 0) infectiousTimeline ++;\n\t}", "private void handleStandardGameplay(float deltaTime) {\n\t\t// Decrease time to next revived enemy\n\t\tmSpawnTime--;\n\n\t\t// Accumulate time elapsed while playing\n\t\tmRoundTimeElapsed += deltaTime;\n\n\t\t/**\n\t\t * Input Handling\n\t\t * When the screen is touched, kill touched attackers\n\t\t */\n\t\tif(Gdx.input.justTouched()) {\n\t\t\t// Grab the touch position, saved as a Vector3\n\t\t\tmLastTouch.set(Gdx.input.getX(), Gdx.input.getY(), 0);\n\t\t\tmCamera.unproject(mLastTouch); // Translates to game world coordinates\n\n\t\t\t// Find the first attacker located at the touch position, if any\n\t\t\tint indexOfAttacker = getFirstAttackerAt(mLastTouch.x, mLastTouch.y);\n\t\t\t// If the index is greater than negative one, kill the attacker and add points\n\t\t\tif(indexOfAttacker > -1){\n\t\t\t\tmAttackers[indexOfAttacker].kill();\n\t\t\t\tmLivingAttackerCount--;\n\t\t\t\tmMonsterHouseSpawn--;\n\t\t\t\tmRoundScore += 100f;\n\t\t\t\tif(indexOfAttacker > ATTACKER_HALF_SIZE - 1)\n\t\t\t\t\tmRoundScore += 150f; // 150 Bonus points for killing a knight\n\t\t\t}\n\t\t}\n\n\t\t// Spawns a new enemy once the respawn timer hits less than 0\n\t\tif(mSpawnTime <0) {\n\t\t\t// Revive an attacker\n\t\t\treviveAttacker();\n\n\t\t\t// Randomly select a new respawn timer within min and max bounds\n\t\t\tmSpawnTime = mRandom.nextInt(mSpawnTimeMax - mSpawnTimeMin + 1) + mSpawnTimeMin;\n\t\t}\n\n\t\t//spawns a row of enemy units if player is doing well\n\t\tif(mMonsterHouseSpawn <0) {\n\t\t\tint monsterHouseRush = 3;\n\t\t\twhile(monsterHouseRush > 0) {\n\t\t\t\tfor (float i = 0; i < 5f; i++) {\n\t\t\t\t\treviveAttacker();\n\t\t\t\t}\n\t\t\t\tmonsterHouseRush--;\n\t\t\t}\n\t\t\tmMonsterHouseSpawn = 10;\n\t\t}\n\n\t\t// Loop through the array of attackers and update each (dead attackers' update does nothing)\n\t\tfor (int i = 0; i < ATTACKER_ARRAY_SIZE; i++) {\n\t\t\tAttacker a = mAttackers[i];\n\t\t\ta.update(deltaTime);\n\n\t\t\tif(a.getX() > MIN_STOP_X) {\n\t\t\t\t// Play the attacker's \"attack\" animation\n\t\t\t\ta.play(\"attack\", true);\n\t\t\t\t// The attacker stops at the castle and the castle begins losing health\n\t\t\t\ta.setPosition(MIN_STOP_X, a.getY());\n\t\t\t\tmCastleHealth -= a.getHitDamage();\n\t\t\t\t// Only bother checking castle damage stage here - only when damage is being dealt\n\t\t\t\tfloat percentDamage = (mCastleMaxHealth - mCastleHealth) / mCastleMaxHealth;\n\t\t\t\tif(percentDamage < 0.5f) {\n\t\t\t\t\tmCastleDamageStage = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmCastleDamageStage = 1;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.15f) {\n\t\t\t\t\tmCastleDamageStage = 2;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.35f) {\n\t\t\t\t\tmCastleDamageStage = 3;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.65f) {\n\t\t\t\t\tmCastleDamageStage = 4;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.85f) {\n\t\t\t\t\tmCastleDamageStage = 5;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check if the game is over, where mCastleHealth <= 0\n\t\tif(mCastleHealth <= 0) {\n\t\t\t// The castle has fallen to the attackers\n\t\t\t// Currently, the game will pause and add text that states the game is over\n\t\t\tmCastleHealth = 0f;\n\t\t\tmHealthText = \"Castle Strength: \" + mCastleHealth;\n\t\t\tmGameState = STATE_GAME_OVER;\n\t\t\thideAllButtons();\n\t\t}\n\n\t\t// If the round time is up, end the round and go to a new state\n\t\tif(mRoundTimeElapsed > mRoundMaxTime) {\n\t\t\tmGameState = STATE_ROUND_OVER;\n\t\t\tmTotalScore += mRoundScore;\n\t\t\tmRoundNumber++;\n\t\t\thideAllButtons();\n\t\t}\n\t}", "@Override\n\tpublic void run()\n\t{\n\t\tlong startTime = System.currentTimeMillis();\n\t\tlong startTimeGun = startTime;\n\t\tlong startTimeEnemyGun = startTime;\n\t\tlong startTimeClouds = startTime;\n\t\tlong startTimeBoss = startTime;\n\t\tlong startTimeBossBullet = startTime;\n\t\t\n\t\t//start player gun sound, this will run till player dies\n\t\tif (GameState._weapons.get(0).getWeaponName()==(Constants.PLAYER) && GameState._weapons.get(0).getDestroyedFlag() == false)\n\t\t{\n\t\t\tAudioPlayer.resumePlayerGun();\n\t\t}\n\t\t\n\t\t//main game loop\n\t\twhile(GameState.mIsRunning == true)\n\t\t{\t\n\t\t\tlong currentTime = System.currentTimeMillis();\n\t\t\ttry\n\t\t\t{\t\n\t\t\t\t//create clouds \n\t\t\t\tint cloudCount = GameUtils.getTypeCount(Constants.CLOUD); \n\t\t\t\tlong currentTimeClouds = currentTime;\n\t\t\t\tif (currentTimeClouds - startTimeClouds > 1000 && cloudCount < 6)\n\t\t\t\t{\n\t\t\t\t\tstartTimeClouds = currentTimeClouds;\n\t\t\t\t\tEnvBuilder.generateCloud(GameState._weapons.get(0).getX(), GameState._weapons.get(0).getY(), GameState._weapons.get(0).getCurrentDirection());\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t \t//generate a new ship. \t\n\t\t \tint enemyCount = GameUtils.getTypeCount(Constants.ENEMY_FIGHTER); \n\t\t \t// System.out.println(\"enemyCount: \" + enemyCount);\n\t\t\t\tif (GameState.mWaitTimeBetweenLevels == false && (currentTime - startTime) > 300 && enemyCount < 4)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t \tEnvBuilder.generateEnemy(GameState._weapons.get(0).getX()\n\t\t\t \t\t\t, GameState._weapons.get(0).getY());\t\t\n\t\t\t \tstartTime = currentTime;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//generate a boss ship\t\t\t\t\n\t\t\t\tif (GameState.mWaitTimeBetweenLevels == false && (currentTime - startTimeBoss) > 6000)\n\t\t\t\t{\n\t\t\t\t\tEnvBuilder.generateEnemyBoss(GameState._weapons.get(0).getX()\n\t\t\t\t\t \t\t, GameState._weapons.get(0).getY());\n\t\t\t\t\tstartTimeBoss = currentTime;\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t// fire enemy guns constantly\t\n\t\t\t\tlong currentTimeEnemyGun = System.currentTimeMillis();\n\t\t\t\tif (currentTimeEnemyGun - startTimeEnemyGun > 850 && GameState._weapons.get(0).getWeaponName()==(Constants.PLAYER) == true && GameState.sFireEnemyGuns == true)\n\t\t\t\t{\n\t\t\t\t\tfor(int i = 0; i < GameState._weapons.size(); i ++)\n\t\t\t\t\t{\t\n\t\t\t\t\t\tif (currentTime - startTimeBossBullet > 500)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (GameState._weapons.get(i).getWeaponName() == (Constants.ENEMY_BOSS))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tint targetTrack = (int)GameUtils.getTargetTrack(GameState._weapons.get(i), GameState._weapons.get(0));\t\n\t\t\t\t\t\t\t\tMovementEngine bossBullet = new BossBullet(targetTrack, targetTrack\n\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getX() \n\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getY()\n\t\t\t\t\t\t\t\t\t\t, 3, 3, 1, 1\n\t\t\t\t\t\t\t\t\t\t, Constants.GUN_ENEMY, GameState._weapons.get(i), 50, 1); \n\t\t\t\t\t\t\t\tGameState._weapons.add(bossBullet);\n\t\t\t\t\t\t\t\tstartTimeBossBullet = currentTime;\n\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}\n\t\t\t\t\t\tif ((int)(Math.random() * 100) > 98)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (Math.random() * 100 > 20)\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (GameState._weapons.get(i).getWeaponName()==(Constants.ENEMY_FIGHTER) && GameUtils.getRange(GameState._weapons.get(i), GameState._weapons.get(0)) > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstartTimeEnemyGun = currentTimeEnemyGun;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// get player track\n\t\t\t\t\t\t\t\t\tint targetTrack = (int)GameUtils.getTargetTrack(GameState._weapons.get(i), GameState._weapons.get(0));\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\tMovementEngine bullet = new Bullet(targetTrack, targetTrack\n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getX() \n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getY()\n\t\t\t\t\t\t\t\t\t\t\t, 3, 3, 1, 1\n\t\t\t\t\t\t\t\t\t\t\t, Constants.GUN_ENEMY, GameState._weapons.get(i), 100, 1); \n\t\t\t\t\t\t\t\t\tGameState._weapons.add(bullet);\n\t\t\t\t\t\t\t\t\tif (GameState._muted == false)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tAudioPlayer.playEnemyGun();\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\telse\n\t\t\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (GameState._weapons.get(i).getWeaponName()==(Constants.ENEMY_FIGHTER) && GameUtils.getRange(GameState._weapons.get(i), GameState._weapons.get(0)) > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstartTimeEnemyGun = currentTimeEnemyGun;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// get player track\n\t\t\t\t\t\t\t\t\tint targetTrack = (int)GameUtils.getTargetTrack(GameState._weapons.get(i), GameState._weapons.get(0));\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\tMovementEngine missile = new Missile(targetTrack, targetTrack\n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getX()\n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getY()\n\t\t\t\t\t\t\t\t\t\t\t, GameState._weapons.get(i).getCurrentSpeed(), 3, 1, 1\n\t\t\t\t\t\t\t\t\t\t\t, Constants.MISSILE_ENEMY, GameState._weapons.get(0), GameState._weapons.get(i), 200); \n\t\t\t\t\t\t\t\t\tGameState._weapons.add(missile);\n\t\t\t\t\t\t\t\t\tif (GameState._muted == false)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tAudioPlayer.playMissileSound();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t// fire gun constantly\n\t\t\t\t// System.out.println(\"gunModifier:\" + _gunModifier);\n\t\t\t\tif (GameState._weapons.get(0).getDestroyedFlag() == false && (GameState._weapons.get(0).getWeaponName()==(Constants.PLAYER)))\n\t\t\t\t{\n\t\t\t\t\tlong currentTimeGun = currentTime;\n\t\t\t\t\tif (currentTimeGun - startTimeGun > 40)\n\t\t\t\t\t{\n\t\t\t\t\t\tstartTimeGun = currentTimeGun;\n\t\t\t\t\t\tMovementEngine bullet = new Bullet(GameState._weapons.get(0).getCurrentDirection() + _gunModifier, GameState._weapons.get(0).getCurrentDirection() + _gunModifier\n\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(0).getX()\n\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(0).getY(),10, 10, 1, 1, Constants.GUN_PLAYER, GameState._weapons.get(0), 200, 1); \n\t\t\t\t\t\tGameState._weapons.add(bullet);\n\t\t\t\t\t\tgunModifier();\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t// move the ships around, check for collisions.\n\t\t\t\tfor(int i = 0; i < GameState._weapons.size(); i ++)\n\t\t \t{\t\t \t\t\n\t\t \t\tMovementEngine ship = GameState._weapons.get(i);\n\t\t \t\tif(ship.getWeaponName()==(Constants.MISSILE_PLAYER) || ship.getWeaponName()==(Constants.MISSILE_ENEMY))\n\t\t\t\t\t{\n\t\t \t\t\t// make smoke trail\n\t\t \t\t\tMovementEngine missileSmokeTrail = new ExplosionParticle(ship.getCurrentDirection(), ship.getCurrentDirection()\n\t\t\t\t\t\t\t\t, (int)ship.getX()\n\t\t\t\t\t\t\t\t, (int)ship.getY(),0, 0, 0, 0, Constants.MISSILE_SMOKE, null, 5, 1); \t\t \t\t\t\n\t\t \t\t\tGameState._weapons.add(missileSmokeTrail);\n\t\t\t\t\t}\n\n\t\t \t\t// make boss damage smoke trail\n\t\t \t\tif (ship.getWeaponName()==(Constants.ENEMY_BOSS))\n\t\t \t\t{\n\t\t\t \t\tif (ship.getHitpoints() < 10 )\n\t\t\t \t\t{\t\t\t \t\t\n\t\t\t\t\t\t\tint particleDirection = (int)(Math.random() * 360);\n\t\t\t\t\t\t\tint particleSpeed = (int)(Math.random() * 10);\n\t\t\t\t\t\t\tint particleEndurance = (int)(Math.random() * 50);\n\t\t\t\t\t\t\tMovementEngine explosionParticle = new ExplosionParticle(particleDirection, particleDirection\n\t\t\t\t\t\t\t\t\t, ship.getX(), ship.getY(), particleSpeed, 1, 1, 1, Constants.BOSS_SMOKE\n\t\t\t\t\t\t\t\t\t, null, particleEndurance, 1); \n\t\t\t\t\t\t\tGameState._weapons.add(explosionParticle);\n\t\t\t \t\t}\n\t\t \t\t}\n\t\t \t\tship.run();\t\n\t\t \t\t\n\t\t \t\t//TODO O(n^2) function unfortunately, any other way to make this faster? \n\t\t \t\tcheckCollisions(ship);\n\t\t \t}\n\t\t\t\t\n\t\t\t\t//check destroyed and remove from list if so, remove all objects that are over 450 units away from the player\n\t\t\t\tfor(int i = 1; i < GameState._weapons.size(); i ++)\n\t\t \t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((i > 0 && GameUtils.getRange(GameState._weapons.get(0), GameState._weapons.get(i)) > 450) \n\t\t\t\t\t\t\t\t|| (GameState._weapons.get(i).getDestroyedFlag() == true))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGameState._weapons.remove(i);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\tcatch(ArrayIndexOutOfBoundsException e)\n\t\t\t\t\t{\n\t\t\t\t\t\t// ignore and continue\n\t\t\t\t\t}\n\t\t \t}\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tlong singleLoopTime = System.currentTimeMillis() - currentTime;\n\t\t\t\tif (singleLoopTime < 16)\n\t\t\t\t{\n\t\t\t\t\tsleep(16 - singleLoopTime);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(InterruptedException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public static void periodic() {\n a2 = limelightTable.getEntry(\"ty\").getDouble(0); //Sets a2, the y position of the target\n d = Math.round((h2-h1) / Math.tan(Math.toRadians(a1+a2))); //Calculates distance using a tangent\n\n if(m_gamepad.getStartButtonReleased()) { //Reset errorSum to 0 when start is released\n errorSum = 0;\n }\n\n shooting(); //Determine when we should be shooting\n reportStatistics(); //Report telemetry to the Driver Station\n }", "@Override\n public void update() {\n if(alive==false){\n afterBeKilled();\n return;\n }\n animate();\n chooseState();\n checkBeKilled();\n if(attack){\n if(timeBetweenShot<0){\n chooseDirection();\n attack();\n timeBetweenShot=15;\n }\n else{\n timeBetweenShot--;\n }\n\n }\n else{\n calculateMove();\n setRectangle();\n }\n }", "static void player_fights() {\n monsterisalive = true;\n \n //#enemyobject\n /*The small creatures are one of the many enemies in this game. These small creatures tries to hinder \n the player's growth by killing the player. There are also many traps that make the player go in a maze again.*/\n \n monsterhealth = 100; //this is a level one monster\n playerhealth = 200; //this is the player's maximum health\n\n do {//do while loops are similar to a while loop in that they continuously perform an action. Howver, do whiles\n //run at least once before checking the conditions\n \n if(monsterisalive = true){//oragnized to help create better view\n System.out.println(\"Use you spells to defeat your enemies...\");\n System.out.println(\"Which attack do you want to use? Fire Spell, Ice Spell, or run\");\n attack = next.nextLine();\n if(attack.contains(\"f\")) {\n System.out.println(username + \" uses his fire spell...FOOOSH!!!\");\n enter = next.nextLine();\n System.out.println(\"The monster lost 30 HP\");\n enter = next.nextLine();\n monsterhealth = monsterhealth-30; \n }else if(attack.contains(\"i\")) {\n System.out.println(username + \" uses his ice spell...GHAAAA!!!\");\n enter = next.nextLine();\n System.out.println(\"The monster loses 20 HP\");\n enter = next.nextLine();\n monsterhealth = monsterhealth-20; \n }else{\n System.out.println(username + \" there's no turning back\");\n \n }\n }\n /*make sure that this if statement is outside the main if statement that introduces the do while loop\n location matters, not following this formula will keep cycling through this method without ever continuing the main story */\n \n if(monsterhealth <= zero) { \n monsterisalive = false;\n //condition that will exit the while loop and return back to the main game\n System.out.println(\"You won\");\n }else if(monsterisalive = true){ \n \n /* I placed the if statement for the monster here so it won't interfere with the player's fighting\n //if you were to place this statement somewhere inside if(monsterisalive = true), you would keep going\n until it is done going over the entire battle play. */\n \n System.out.println(\"It's the monster's turn...Be prepared!\");\n enter = next.nextLine();\n System.out.println(\"The monster engulfs you in a dark portal and throws you back out!\");\n enter = next.nextLine();\n System.out.println(\"OUCH!!! You lose 20 HP!\");\n enter = next.nextLine();\n playerhealth = playerhealth-20;\n }\n \n //this is the if statement that will determine whether or not the player continues to fight\n //if the player's HP reaches zero...the player will be forced to withdraw and return to the current checkpoint\n // * check statement *\n \n if(playerhealth == zero){\n System.out.println(\"Oh no...you lost all your HP!\");\n monsterisalive = false;//ends the while loop \n backtocheckpoint1();\n }\n \n }while(monsterisalive); \n }", "@Override\n\tpublic void \t\t\t\t\t\tuserDefinedInternalTransition (\n\t\t\t\t\t\t\t\tDuration elapsedTime)\n\t{\n\t\tDuration d1 = new Duration (\n\t\t\t\tthis.interDayDelay , \n\t\t\t\tthis.getSimulatedTimeUnit()\n\t\t\t) ; \n\t\t\n\t\tassert d1 != null ;\n\t\t\n\t\tTime t = this.getCurrentStateTime().add(d1) ; \n\t\tdouble dur = 2.0 * this.meanRunDuration * this.rg.nextBeta(1.75, 1.75) ; \n\t\tdouble temp = 2.0 * this.meanTemperature * this.rg.nextBeta(1.75, 1.75) ; \n\t\t// impossible to set temperature more than MAX_TEMPERATURE\n\t\ttemp = (temp > OvenModel.MAX_TEMPERATURE)?OvenModel.MAX_TEMPERATURE:temp ;\n\t\tthis.scheduleEvent(new RunOven(t, dur , temp));\n\t}", "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 Alarm(){\n waitingQueue = new PriorityQueue<ThreadWait>(10, new TimeCompare());\n Machine.timer().setInterruptHandler(new Runnable() {\n\t\tpublic void run() { timerInterrupt(); }\n\t });\n }", "@Override\n\tpublic void tick() {\n\t\tif(fighting) {\n\t\t\t//Mostrar numero de ronda\n\t\t\tif(msjRonda) {\n\t\t\t\ttiempoRondaMsj--;\n\t\t\t\tif(tiempoRondaMsj==0) {\n\t\t\t\t\tmsjRonda=false;\n\t\t\t\t\ttiempoRondaMsj=100;\n\t\t\t\t\tmsjFight=true;\n\t\t\t\t\thandler.getGame().setSoundEffect(6,true);\n\t\t\t\t}\n\t\t\t\thandler.getGame().setTiempoQuieto(true);\n\t\t\t}\n\t\t\t//Mostrar mensaje FIGHT!\n\t\t\telse if(msjFight) {\n\t\t\t\ttiempoFightMsj--;\n\t\t\t\tif(tiempoFightMsj==0) {\n\t\t\t\t\tmsjFight=false;\n\t\t\t\t\ttiempoFightMsj=100;\n\t\t\t\t}\n\t\t\t\thandler.getGame().setTiempoQuieto(true);\n\t\t\t}\n\t\t\t//Mostrar el ganador de la ronda\n\t\t\telse if(msjGanador) {\n\t\t\t\thandler.getGame().setTiempoQuieto(true);\n\t\t\t\ttiempoGanador--;\n\t\t\t\tif(tiempoGanador==0) {\n\t\t\t\t\tmsjGanador=false;\n\t\t\t\t\ttiempoGanador=100;\n\t\t\t\t\t//Si gana la CPU no mostramos los puntos que ha hecho (nos saltamos el estado msjGanador)\n\t\t\t\t\tif((mode==1 && resultado==2) || mode==3) {\n\t\t\t\t\t\ttiempoTime=50;\n\t\t\t\t\t\ttiempoVital=100;\n\t\t\t\t\t\tmsjPuntos=false;\n\t\t\t\t\t\tbonus=0;\n\t\t\t\t\t\thandler.getGame().setFade(true);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Actualizar variables para gestionar el final de ronda\n\t\t\t\t\t\taccionFinRonda();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tmsjPuntos=true;\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}\n\t\t\t//Mostrar puntos ganados\n\t\t\telse if(msjPuntos) {\n\t\t\t\ttiempoTime--;\n\t\t\t\ttiempoVital--;\n\t\t\t\t//bonus se usa para controlar el tiempo a mostrar despues de llegar hasta el maximo valor del bonus\n\t\t\t\tif(bonus>=(puntosTime+puntosVital+10000)) {\n\t\t\t\t\ttiempoTime=50;\n\t\t\t\t\ttiempoVital=100;\n\t\t\t\t\tmsjPuntos=false;\n\t\t\t\t\thandler.getGame().setFade(true);\t\n\t\t\t\t\tbonus=0;\n\t\t\t\t\t\n\t\t\t\t\t//Actualizar variables para gestionar el final de ronda\n\t\t\t\t\taccionFinRonda();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Comenzamos a hacer tick de la pelea cuando se han mostrado los mensajes iniciales\n\t\t\telse {\n\t\t\t\tif(handler.getGame().getKeyManager().primeraVez && primeraVez2) {\n\t\t\t\t\tprimeraVez2=false;\n\t\t\t\t\t\n\t\t\t\t\tif(handler.getKeyManager().ESC){ // Salir juego\n\t\t\t\t\t\tpause=!pause;\n\t\t\t\t\t\thandler.getGame().setSoundEffect(25,false);\n\t\t\t\t\t\thandler.getGame().quererSalir=true;\n\t\t\t\t\t\thandler.getGame().posAvion=1;\n\t\t\t\t\t\thandler.getGame().xEsc=590;\n\t\t\t\t\t\thandler.getGame().yEsc=335;\n\t\t\t\t\t\thandler.getGame().widthEsc=100;\n\t\t\t\t\t\thandler.getGame().heightEsc=50;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(handler.getGame().quererSalir) {\n\t\t\t\t\t\tif(handler.getKeyManager().enter && handler.getGame().posAvion==2){ // yes\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(handler.getKeyManager().enter && handler.getGame().posAvion==1){ // no\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(25,false);\n\t\t\t\t\t\t\thandler.getGame().quererSalir=false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(handler.getKeyManager().D){ // dcha\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(26,false);\n\t\t\t\t\t\t\tif(handler.getGame().posAvion==2) {\n\t\t\t\t\t\t\t\thandler.getGame().posAvion=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\thandler.getGame().posAvion=2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(handler.getKeyManager().A){ // izq\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(26,false);\n\t\t\t\t\t\t\tif(handler.getGame().posAvion==1) {\n\t\t\t\t\t\t\t\thandler.getGame().posAvion=2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\thandler.getGame().posAvion=1;\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\telse {\n\t\t\t\t\t\tif(handler.getKeyManager().P && mode!=3){ // Pause !!!!\n\t\t\t\t\t\t\t//System.out.println(\"Hola\");\n\t\t\t\t\t\t\tpause=!pause;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(!handler.getGame().getKeyManager().primeraVez) {\n\t\t\t\t\tprimeraVez2=true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(pause) {\n\t\t\t\t\t//que se detenga el tiempo de la pelea\n\t\t\t\t\thandler.getGame().setTiempoQuieto(true);\n\t\t\t\t\thandler.getGame().pauseState=new PauseState(handler);\n\t\t\t\t\tpause=false;\n\t\t\t\t\tState.setState(handler.getGame().pauseState);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//que avance el tiempo de la pelea\n\t\t\t\t\thandler.getGame().setTiempoQuieto(false);\n\t\t\t\t\t\n\t\t\t\t\tworld.tick();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Si se ha acabado el tiempo\n\t\t\t\tif(handler.getGame().tiempoRestante==0) {\n\t\t\t\t\t//Y el player 2 tiene mas vida, gana player 2\n\t\t\t\t\tif(handler.getWorld().getEntityManager().getPlayer_1().getVida()<\n\t\t\t\t\t handler.getWorld().getEntityManager().getPlayer_2().getVida()) {\n\t\t\t\t\t\tmarcador2++;\n\t\t\t\t\t\tresultado=2;\n\t\t\t\t\t}\n\t\t\t\t\t//Y el player 1 tiene mas vida, gana el player 1\n\t\t\t\t\telse {\n\t\t\t\t\t\tresultado=1;\n\t\t\t\t\t\tmarcador1++;\n\t\t\t\t\t}\n\t\t\t\t\tfinRonda=true;\n\t\t\t\t}\n\t\t\t\t//Player 2 ha ganado\n\t\t\t\telse if(handler.getWorld().getEntityManager().getPlayer_1().getVida()<=0) {\n\t\t\t\t\t//Comienza la animacion de KO\n\t\t\t\t\tif (handler.getWorld().getEntityManager().getPlayer_1().getAnimacionActual() != 13) {\n\t\t\t\t\t\t//Sonido de grito\n\t\t\t\t\t\tif (handler.getWorld().getEntityManager().getPlayer_1().getFighter() == 1) {\n\t\t\t\t\t\t\t//Chun\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(30);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//Ryu y Blanka\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(29);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ko) {\n\t\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().KO = true;\n\t\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().KO = true;\n\t\t\t\t\t\t\tresultado=2;\n\t\t\t\t\t\t\tmarcador2++;\n\t\t\t\t\t\t\tko = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().setAnimacionActual(13);\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().getAnimaciones().get(13).setAnimacionEnCurso(true);\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().getAnimaciones().get(13).resetAnimtaion();\n\t\t\t\t\t}\n\t\t\t\t\t//Finaliza la animacion de KO\n\t\t\t\t\telse if(handler.getWorld().getEntityManager().getPlayer_1().getAnimacionActual() == 13\n\t\t\t\t\t\t\t&& handler.getWorld().getEntityManager().getPlayer_1().getAnimaciones().get(13).getIndex() == 4) {\n\t\t\t\t\t\tfinRonda=true;\n\t\t\t\t\t\tko = true;\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().KO = false;\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().KO = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Player 1 ha ganado\n\t\t\t\telse if(handler.getWorld().getEntityManager().getPlayer_2().getVida()<=0) {\n\t\t\t\t\t//Comienza la animacion de KO\n\t\t\t\t\tif (handler.getWorld().getEntityManager().getPlayer_2().getAnimacionActual() != 13) {\n\t\t\t\t\t\t//Sonido de grito\n\t\t\t\t\t\tif (handler.getWorld().getEntityManager().getPlayer_2().getFighter() == 1) {\n\t\t\t\t\t\t\t//Chun\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(30);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//Ryu y Blanka\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(29);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ko) {\n\t\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().KO = true;\n\t\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().KO = true;\n\t\t\t\t\t\t\tresultado=1;\n\t\t\t\t\t\t\tmarcador1++;\n\t\t\t\t\t\t\tko = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().setAnimacionActual(13);\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().getAnimaciones().get(13).setAnimacionEnCurso(true);\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().getAnimaciones().get(13).resetAnimtaion();\n\t\t\t\t\t}\n\t\t\t\t\t//Finaliza la animacion de KO\n\t\t\t\t\telse if(handler.getWorld().getEntityManager().getPlayer_2().getAnimacionActual() == 13\n\t\t\t\t\t\t\t&& handler.getWorld().getEntityManager().getPlayer_2().getAnimaciones().get(13).getIndex() == 4) {\n\t\t\t\t\t\tfinRonda=true;\n\t\t\t\t\t\tko = true;\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().KO = false;\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().KO = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//SUMAR LOS PUNTOS AL JUGADOR QUE CORRESPONDA SI HA TERMINADO LA RONDA\n\t\t\t\tif(finRonda) {\n\t\t\t\t\t//Si ha ganado la ronda el jugador 1, se le suman los puntos por tiempo y vida\n\t\t\t\t\tif(resultado==1) {\n\t\t\t\t\t\t//TIEMPO\n\t\t\t\t\t\tpuntosTime=handler.getGame().tiempoRestante*100;\n\t\t\t\t\t\t//VIDA\n\t\t\t\t\t\tpuntosVital=(int)handler.getWorld().getEntityManager().getPlayer_1().getVida()*10;\n\t\t\t\t\t\t//Bonus de dificutad:\n\t\t\t\t\t\tif (handler.getGame().mode == 1) {\n\t\t\t\t\t\t\tif (handler.getGame().getDificultad() == 1 || handler.getGame().getDificultad() == 3) {\n\t\t\t\t\t\t\t\t//Medio o incremental\n\t\t\t\t\t\t\t\tpuntosTime *= 1.2;\n\t\t\t\t\t\t\t\tpuntosVital*=1.2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (handler.getGame().getDificultad() == 2) {\n\t\t\t\t\t\t\t\t//Medio o incremental\n\t\t\t\t\t\t\t\tpuntosTime *= 1.4;\n\t\t\t\t\t\t\t\tpuntosVital*=1.4;\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\telse if(resultado==2) {\n\t\t\t\t\t\t//TIEMPO\n\t\t\t\t\t\tpuntosTime=handler.getGame().tiempoRestante*100;\n\t\t\t\t\t\t//VIDA\n\t\t\t\t\t\tpuntosVital=(int)handler.getWorld().getEntityManager().getPlayer_2().getVida()*10;\n\t\t\t\t\t}\n\t\t\t\t\tmsjGanador=true;\n\t\t\t\t\tif(mode==1) {\n\t\t\t\t\t\tif(resultado==1) {\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(19);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(20);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//Si ha terminado la pelea y se muestran las caras reventadas\n\t\telse {\n\t\t\ttiempoVS--;\n\t\t\tif(tiempoVS<=0) {\n\t\t\t\ttiempoVS=250;\n\t\t\t\tif(mode==2) {\n\t\t\t\t\thandler.getGame().setPuntos1(0);\n\t\t\t\t\thandler.getGame().setPuntos2(0);\n\t\t\t\t\thandler.getGame().setCurrentSong(3);\n\t\t\t\t\tState.setState(handler.getGame().selectFighterState2);\n\t\t\t\t}\n\t\t\t\telse if(mode==1) {\n\t\t\t\t\t//Si ha ganado la CPU se guarda el score\n\t\t\t\t\tif(mostrarScoreLose) {\n\t\t\t\t\t\tState ScoreState = new ScoreState(handler,fighter1,false);\n\t\t\t\t\t\thandler.getGame().setCurrentSong(0);\n\t\t\t\t\t\tState.setState(ScoreState);\n\t\t\t\t\t}\n\t\t\t\t\t//Si se termina el modo historia se guarda el score\n\t\t\t\t\telse if(mostrarScoreWin) {\n\t\t\t\t\t\tState EndGameState = new EndGameState(handler,fighter1,false);\n\t\t\t\t\t\tif(fighter1==0) {\n\t\t\t\t\t\t\thandler.getGame().setCurrentSong(7);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(fighter1==1) {\n\t\t\t\t\t\t\thandler.getGame().setCurrentSong(8);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\thandler.getGame().setCurrentSong(9);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tAssets.initAssets_EndGameState();\n\t\t\t\t\t\tState.setState(EndGameState);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tState selectFighterState1=new SelectFighterState1(handler,fighterToSelectFighter);\n\t\t\t\t\t\thandler.getGame().setCurrentSong(3);\n\t\t\t\t\t\tState.setState(selectFighterState1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(mode==3) {\n\t\t\t\t\thandler.getGame().finPeleaDemo=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void run()\n\t{\n\t\tthis.isDead = true;\n\t\tthis.currHP = hp;\n\t}", "public void act()\n {\n if (Greenfoot.getRandomNumber(200) < 3)\n {\n addObject(new Cabbage(), Greenfoot.getRandomNumber(600), 0);\n }\n \n if (Greenfoot.getRandomNumber(200) < 3)\n {\n addObject(new Eggplant(), Greenfoot.getRandomNumber(600), 0);\n }\n \n if (Greenfoot.getRandomNumber(200) < 3)\n {\n addObject(new Onion(), Greenfoot.getRandomNumber(600), 0);\n }\n \n if (Greenfoot.getRandomNumber(300) < 3)\n {\n addObject(new Pizza(), Greenfoot.getRandomNumber(600), 0);\n }\n \n if (Greenfoot.getRandomNumber(400) < 3)\n {\n addObject(new Cake(), Greenfoot.getRandomNumber(600), 0);\n }\n \n if (Greenfoot.getRandomNumber(400) < 3)\n {\n addObject(new Icecream(), Greenfoot.getRandomNumber(600), 0);\n }\n countTime();\n }", "public void setupSimulation() {\n final Timer timerStatus = new Timer();\n\n TimerTask taskUpdateFood = new TimerTask() {\n @Override\n public void run() {\n terrain.toggleFood();\n }\n };\n timerStatus.schedule(taskUpdateFood, 0, 1000);\n\n startTime = System.currentTimeMillis();\n }", "BossEnemy(){\n super();\n totallyDied = true;\n }", "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 void pickUpTimer()\r\n\t{\t\t\r\n\t\tSystem.out.println(timer.get());\r\n\t\tif(timer.get() < Config.Auto.timeIntakeOpen)\r\n\t\t{\r\n\t\t\t//claw.openClaw();\r\n\t\t\tSystem.out.println(\"in second if\");\r\n\t\t}\r\n\t\t\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeElevatorStack)\r\n\t\t{\r\n\t\t\t//elevator.setLevel(elevatorLevel);\r\n\t\t\t//elevatorLevel++;\r\n\t\t}\r\n\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeIntakeClose)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"in first if\");\r\n\t\t\t//claw.closeClaw();\r\n\t\t}\r\n\t\t\r\n\t\telse\r\n\t\t\tendRoutine();\r\n\t}", "protected void onTick() {\n\t\t\t\tDFAgentDescription template = new DFAgentDescription();\r\n\t\t\t\tServiceDescription sd = new ServiceDescription();\r\n\t\t\t\tsd.setType(\"TractorDT\");\r\n\t\t\t\ttemplate.addServices(sd);\r\n\t\t\t\ttry {\r\n\t\t\t\t\tDFAgentDescription[] result = DFService.search(myAgent, template);\r\n\t\t\t\t\tDTAgents = new AID[result.length];\r\n\t\t\t\t\tfor (int i = 0; i < result.length; ++i) {\r\n\t\t\t\t\t\tDTAgents[i] = result[i].getName();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (FIPAException fe) {\r\n\t\t\t\t\tfe.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//System.out.println(\"DigitalTwin request being performed\");\r\n\t\t\t\t// Perform a Fuel Usage request\r\n\t\t\t\tmyAgent.addBehaviour(new DataRequestPerformer());// add behaviour here)\r\n\t\t\t}", "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 }" ]
[ "0.60824025", "0.605935", "0.5989367", "0.5901637", "0.57742983", "0.5771291", "0.5696809", "0.56708777", "0.56501305", "0.56389624", "0.5621051", "0.5620243", "0.56025845", "0.548589", "0.5473542", "0.54027814", "0.5365722", "0.5312319", "0.5306677", "0.52866054", "0.52464134", "0.5241765", "0.5240547", "0.5239811", "0.5233447", "0.5231934", "0.5220766", "0.5214914", "0.5208569", "0.51968306", "0.5184797", "0.5183451", "0.51770604", "0.51696867", "0.51693505", "0.5169023", "0.5160085", "0.51559097", "0.5155575", "0.5152782", "0.5144361", "0.51389164", "0.5131014", "0.5126565", "0.51154774", "0.5107185", "0.50970495", "0.50947857", "0.50947726", "0.50947565", "0.50750285", "0.50733674", "0.5073246", "0.5073214", "0.5071194", "0.5056077", "0.50560606", "0.50486743", "0.5040226", "0.50395274", "0.50341064", "0.5033783", "0.50293905", "0.5025705", "0.5018375", "0.50147253", "0.5007297", "0.50051403", "0.50030863", "0.5000764", "0.4991502", "0.49873218", "0.49832857", "0.4980085", "0.49781376", "0.4972278", "0.4959654", "0.495587", "0.4951713", "0.49506602", "0.4949382", "0.49486676", "0.49413297", "0.49404296", "0.49381623", "0.49379146", "0.49331114", "0.4932363", "0.49288613", "0.49284664", "0.4914964", "0.49091533", "0.49073875", "0.49073175", "0.48962012", "0.48958722", "0.48957103", "0.4891874", "0.48861566", "0.4885904" ]
0.61129713
0
Go hospital called when individual is accepted by hospital. It also inform world to its hospitalization. Since state can change, it happens in synchronized block. Current state define action. If user is already dead, hospitalization doesn't effect anything and individual exits hospital immediately. Otherwise in case moving or conversation, individual is get into hospital immediately to start healing process.
public void goHospital() { synchronized (this) { world.hospitalizedIndividual(); currentState.goHospital(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\tpublic void action() {\n\t\t\tswitch (state) {\r\n\t\t\tcase REGISTER:\r\n\t\t\t\tSystem.out.println(\"Philosopher Agent \"\r\n\t\t\t\t\t\t+ myAgent.getAID().getName()\r\n\t\t\t\t\t\t+ \" trying to register\");\r\n\t\t\t\t\r\n\t\t\t\t// searching for waiter agent\r\n\t\t\t\twhile(waiter == null) {\r\n\t\t\t\t\twaiter = searchWaiterAgent(\"waiter-service\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tACLMessage cfp = new ACLMessage(ACLMessage.CFP);\r\n\t\t\t\tcfp.addReceiver(waiter);\r\n\t\t\t\tcfp.setContent(\"philosopher-agent\");\r\n\t\t\t\tcfp.setConversationId(\"philosopher-waiter-fork\");\r\n\t\t\t\tcfp.setReplyWith(\"cfp\"+System.currentTimeMillis());\r\n\t\t\t\tSystem.out.println(\"Philosopher Agent \"\r\n\t\t\t\t\t\t+ myAgent.getAID().getName()\r\n\t\t\t\t\t\t+ \" send registration request \" + cfp);\r\n\t\t\t\tmyAgent.send(cfp);\r\n\t\t\t\t\r\n\t\t\t\t// Prepare template to get response\r\n\t\t\t\t//mt = MessageTemplate.and(MessageTemplate.MatchConversationId(\"philosopher-waiter-fork\"),\r\n\t\t\t\t//\t\tMessageTemplate.MatchInReplyTo(request.getReplyWith()));\r\n\t\t\t\tmt = MessageTemplate.MatchConversationId(\"philosopher-waiter-fork\");\r\n\t\t\t\tstate = State.REGISTERED;\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase REGISTERED:\r\n\t\t\t\tACLMessage response = myAgent.receive();\r\n\t\t\t\tif (response != null && response.getConversationId().equals(\"philosopher-waiter-fork\")) {\r\n\t\t\t\t\tif (response.getPerformative() == ACLMessage.SUBSCRIBE) {\r\n\t\t\t\t\t\t// behaviour can be finished\r\n\t\t\t\t\t\tregistered = true;\r\n\t\t\t\t\t\tSystem.out.println(\"Philosopher Agent \"\r\n\t\t\t\t\t\t\t\t+ myAgent.getAID().getName()\r\n\t\t\t\t\t\t\t\t+ \" registered Successfully\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tregistered = false;\r\n\t\t\t\t\t\tSystem.out.println(\"Philosopher Agent \"\r\n\t\t\t\t\t\t\t\t+ myAgent.getAID().getName()\r\n\t\t\t\t\t\t\t\t+ \" registration in progress\");\r\n\t\t\t\t\t\tstate = State.REGISTER;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.out.println(myAgent.getAID().getName() + \" blocked\");\r\n\t\t\t\t\tblock();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}", "public void burry()\n\t{\n\t\tworld.death();\n\t\ttimerList.clear();\n\t\tif(hospitalNeed != null && hospitalNeed.isAlive())\n\t\t\thospitalNeed.interrupt();\n\t}", "public void attackOrQuit(){\n gameState = GameState.ATTACKORQUIT;\n notifyObservers();\n }", "@Override\n public void summonHorsesToPaddock(){\n rl.lock();\n try{\n System.out.println(\"B : Trying to summon horse...\");\n //change broker state\n// MyThreadBroker broker = (MyThreadBroker) Thread.currentThread();\n// broker.broker_states = MyThreadBroker.Broker_States.ANNOUNCING_NEXT_RACE;\n //change log\n log.setBrokerState(MyThreadBroker.Broker_States.ANNOUNCING_NEXT_RACE);\n log.changeLog();\n keep_waiting = false;\n stable_horses.signal(); \n }finally{\n rl.unlock();\n }\n \n }", "public void exitHospital()\n\t{\n\t\tworld.getHospital().dischargeIndividual();\n\t\tworld.dischargedIndividual();\n\t}", "@Override\r\n\tpublic void onMachine() {\n System.out.println(\"Please On the machine to cook \");\r\n grillmachine.setState(grillmachine.getOnState());\r\n\t}", "HospitalSystem(Patient patient, Action action){\r\n\t\tthis.patient=patient;\r\n\t\treferredTo=action;\r\n\t\t\r\n\t\t//call the selection action method which will process the patient\r\n\t\tselectAction();\r\n\t\t\r\n\t}", "protected void actionConfirmed()\r\n\t\t{\n\r\n\t\t\tif ( actionSelect.getSelectedItem() == null )\r\n\t\t\t\tDEFAULT_SHELL.executeLine( \"set battleAction=attack\" );\r\n\r\n\t\t\tRunnable request = (Runnable) locationSelect.getSelectedItem();\r\n\t\t\tif ( request == null )\r\n\t\t\t\treturn;\r\n\r\n\t\t\tsetProperty( \"lastAdventure\", request.toString() );\r\n\r\n\t\t\t// If there are conditions in the condition field, be\r\n\t\t\t// sure to process them.\r\n\r\n\t\t\tString conditionList = conditionField.getText().trim();\r\n\t\t\tif ( conditionList.equalsIgnoreCase( \"none\" ) )\r\n\t\t\t\tconditionList = \"\";\r\n\r\n\t\t\tif ( conditionList.length() > 0 )\r\n\t\t\t{\r\n\t\t\t\tDEFAULT_SHELL.executeLine( \"conditions clear\" );\r\n\r\n\t\t\t\tboolean verifyConditions = false;\r\n\t\t\t\tboolean useDisjunction = false;\r\n\t\t\t\tString [] conditions = conditionList.split( \"\\\\s*,\\\\s*\" );\r\n\r\n\t\t\t\tfor ( int i = 0; i < conditions.length; ++i )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( conditions[i].equals( \"check\" ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Postpone verification of conditions\r\n\t\t\t\t\t\t// until all other conditions added.\r\n\r\n\t\t\t\t\t\tverifyConditions = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( conditions[i].equals( \"outfit\" ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Determine where you're adventuring and use\r\n\t\t\t\t\t\t// that to determine which components make up\r\n\t\t\t\t\t\t// the outfit pulled from that area.\r\n\r\n\t\t\t\t\t\tif ( !(request instanceof KoLAdventure) || !EquipmentDatabase.addOutfitConditions( (KoLAdventure) request ) )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tsetStatusMessage( \"No outfit corresponds to this zone.\" );\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tverifyConditions = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( conditions[i].equals( \"or\" ) || conditions[i].equals( \"and\" ) || conditions[i].startsWith( \"conjunction\" ) || conditions[i].startsWith( \"disjunction\" ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tuseDisjunction = conditions[i].equals( \"or\" ) || conditions[i].startsWith( \"disjunction\" );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( !DEFAULT_SHELL.executeConditionsCommand( \"add \" + conditions[i] ) )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tKoLmafia.enableDisplay();\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( verifyConditions )\r\n\t\t\t\t{\r\n\t\t\t\t\tDEFAULT_SHELL.executeConditionsCommand( \"check\" );\r\n\t\t\t\t\tif ( StaticEntity.getClient().conditions.isEmpty() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tKoLmafia.updateDisplay( \"All conditions already satisfied.\" );\r\n\t\t\t\t\t\tKoLmafia.enableDisplay();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( StaticEntity.getClient().conditions.size() > 1 )\r\n\t\t\t\t\tDEFAULT_SHELL.executeConditionsCommand( useDisjunction ? \"mode disjunction\" : \"mode conjunction\" );\r\n\r\n\t\t\t\tconditionField.setText( \"\" );\r\n\t\t\t\tif ( countField.getText().equals( \"\" ) )\r\n\t\t\t\t\tcountField.setText( String.valueOf( KoLCharacter.getAdventuresLeft() ) );\r\n\t\t\t}\r\n\r\n\t\t\t(new RequestThread( request, getValue( countField ) )).start();\r\n\t\t\tcountField.setText( \"\" );\r\n\t\t}", "public void enterHatchingState() {\n\n\t}", "public void action(){\n turn.sendMsg(turn.getController().getTurnOwner().getName()+\"'s turn!\");\n if(turn.getPlayer().isDown()){\n turn.setPhase(new RecoveryPhase());\n }else {\n turn.setPhase(new StarsPhase());\n }\n }", "public void alertTheWaiter(){\n Chef c = (Chef) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = c.getChefID();\n \tstate_fields[1] = c.getChefState();\n\n Message m_toServer = new Message(1, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n \t}\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n c.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "public void resolve(){\n logger.log(Level.FINE,attacker.getName()+\" withering attacked \"+defender.getName());\n AttackState state=new AttackState();\n state.weaponDamage=weapon.getDamage();\n state.initialAttackpool=baseAttackdice+baseAccuracy-woundpenalty;\n attacker.declareWitheringAttack(state); // If the attacker wants to change the pool, he modifies the state accordingly.\n defender.declareWitheringDV(state); // Defender declares their dv against this specific attack. This sets both initialdv and changedDv\n state.initialAttackRoll= new DiceThrow(state.changedAttackpool);\n attacker.modifyWitheringAttackRollAttacker(state); //This sets stuff like modifiedAttackRollAttacker and AttackerRollValuation\n defender.modifyWitheringAttackRollDefender(state); //This sets defender modifiedAttackRollDefender\n state.attackRollSuccesses=state.modifiedAttackRollDefender.evaluateResults(state.AttackRollValuationAttacker);\n state.threshholdSuccesses=state.attackRollSuccesses-state.changedDv;\n logger.log(Level.FINE,attacker.getName()+\" rolled \"+state.changedAttackpool+\" dice against \"+defender.getName()+\"'s dv of \"+state.changedDv+\" and gained \"+state.attackRollSuccesses+\" successes.\");\n attacker.changeWitheringThreshholdAttacker(state); //This sets thresholdModifiedAttacker\n defender.changeWitheringThreshholdDefender(state); //This sets thresholdModifiedDefender\n if(state.thresholdModifiedDefender>=0) {\n logger.log(Level.FINE,attacker.getName()+\" hit \"+defender.getName()+\" with \"+state.thresholdModifiedDefender+\" threshhold successes.\");\n attacker.modifyWitheringRawDamageAttacker(state); //Sets normal raw damageType, based on strength and weapon damageType, and then sets rawDamagemModifiedAttacker\n defender.modifyWitheringRawDamageDefender(state); //this sets rawDamageModifiedDefender, and sets up the various soak values, so natural soak and armor soak.\n logger.log(Level.FINE, \"The raw damage of the attack is: \"+state.rawDamageModifiedDefender);\n state.totalSoak = Math.max(state.defenderArmorSoak - ignoredArmorSoak, 0) + state.defenderNaturalSoak; //\n attacker.modifyTotalSoakAttacker(state); //This sets totalSoakmodifiedAttacker. Don't think this actually has support in the solar charmset, but giving opportunities to work with.\n defender.modifyTotalSoakDefender(state); // This sets totalSoakmodifiedDefender.\n state.postSoakSuccesses=Math.max(state.rawDamageModifiedDefender-state.totalSoakModifiedDefender,weapon.getOverwhelming());\n logger.log(Level.FINE,state.totalSoakModifiedDefender+\" damage is soaked, leading to post soak dice of \"+state.postSoakSuccesses);\n attacker.declarePostSoakAttacker(state); //sets postSoakSuccessesModifiedAttacker\n defender.declarePostSoakDefender(state); //sets postSoakSuccessesModifiedDefender\n DiceThrow droll=new DiceThrow(state.postSoakSuccessesModifiedDefender);\n state.damageRoll=droll;\n attacker.modifyWitheringDamageRollAttacker(state); //sets damageRollmodifiedAttacker and damageRollvValuation\n defender.modifyWitheringDamageRollDefender(state); //sets damageRollmodifiedDefender\n state.initiativeDamageDone=state.damageRollModifiedDefender.evaluateResults(state.damageRollValuation);\n logger.log(Level.FINE,attacker.getName()+\" rolls \"+state.postSoakSuccessesModifiedDefender+\" dice and achieves \"+state.initiativeDamageDone+\" successes.\");\n attacker.modifyInitiativeDamageAttacker(state);\n defender.modifyInitiativeDamageDefender(state); //Since this is the last change of initiative, we can check whether the defender was crashed here.\n attacker.updateInitiativeAttacker(state);\n defender.updateInitiativeDefender(state);//Here we should handle all the initiative changes respectively, with checking if people are crashed etc.\n }\n else{\n attacker.failedWitheringAttackAttacker(state);\n defender.failedWitheringAttackDefender(state);\n }\n\n }", "@Override\n public void action() {\n DFAgentDescription appointmentAgentDescription = dfSubscription.getAgentDescription();\n List<AllocationState> preferredAllocations = patientAgent.getAllocationStates();\n\n if (patientAgent.getCurrentAllocation() == GlobalAgentConstants.APPOINTMENT_UNINITIALIZED) {\n /* Patient agent has not got any appointment from the hospital agent yet */\n return;\n\n } else if (preferredAllocations.isEmpty()) {\n /* Patient Agent has its most preferred appointment */\n isHappyWithAppointment = true;\n\n } else if (appointmentAgentDescription != null) {\n\n /* Loop executed when action is executed for the first time */\n if (preferredAllocationsIterator == null) {\n /* Querying patient preferences */\n preferredAllocationsIterator = patientAgent.getAllocationStates().iterator();\n currentSize = patientAgent.getAllocationStates().size();\n }\n\n\n if (!preferredAllocationsIterator.hasNext()) {\n /* Condition executed when no more swaps available */\n updatePreferences();\n\n } else if (expectedMessageTemplate == null) {\n\n /* We are not expecting any response, we can make another swap proposal */\n proposeSwap(preferredAllocationsIterator.next(), appointmentAgentDescription);\n\n } else {\n /* Some message has been sent, awaiting a response */\n ACLMessage expectedMessage = patientAgent.receive(expectedMessageTemplate);\n if (expectedMessage != null) {\n boolean wasSwapSuccessful = receiveResponse(expectedMessage, appointmentAgentDescription);\n expectedMessageTemplate = null;\n currentlyProposedAllocationSwap = null;\n\n /* If swap has been successful, we need to update our preference list\n as the patient agent has got new appointment */\n if (wasSwapSuccessful) {\n updatePreferences();\n }\n }\n }\n }\n }", "public void executeAction()\n\t{\t\t\n\t\tthis.getUser().setHealth(this.getUser().getHealth()+HEALTH);\n\t}", "public void getCovid()\n\t{\n\t\tsetHealthStatus(HealthStatus.INFLECTED);\n\t\tdeathTimer = new PlayPauseTimer((int) (100*(1 - world.getMortalityRate())), new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjustDie();\n\t\t\t\ttimerList.remove(deathTimer);\n\t\t\t}\n\t\t\t\n\t\t}, world.getRefreshTime());\n\t\ttimerList.add(deathTimer);\n\t\t\n\t\thospitalNeed = new Thread(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tworld.getHospital().acceptIndividual();\n\t\t\t\t\tgoHospital();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\tgoHospitalTimer = new PlayPauseTimer(25, new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\thospitalNeed.start();\n\t\t\t\ttimerList.remove(goHospitalTimer);\n\t\t\t}\n\t\t\t\n\t\t}, world.getRefreshTime());\n\t\ttimerList.add(goHospitalTimer);\n\t\tworld.infect();\n\t}", "public void playerHasInvincibility() {\n\t\tthis.state = canBeKilled;\n\t}", "@Override\n\tpublic void action() \n\t{\n\t\tif(this.user.arrivedToFinalStation())\n\t\t{\n\t\t\tthis.user.stablishDesiredVehicle();\n\t\t\tthis.user.stablishDesiredStation();\n\t\t}\n\t\t\n\t\t//printing info\n\t\tSystem.out.println(\"\\nI'm \" + this.user.getLocalName() + \": I'm on \" + this.user.getCurrentStation() + \" and I want to go to \" + this.user.desiredStation + \" by \" + this.user.desiredVehicle +\".\\n\");\n\t\t//this.mensaje=scanner.nextLine(); //debug\n\t\t\n\t\t//PetitionRequest\n\t\tSystem.out.println(\"I make a vehicle request to \" + this.user.getCurrentStation() + \": I'm on \" + this.user.getCurrentStation() + \" and I want to go to \" + this.user.desiredStation + \" by \" + this.user.desiredVehicle + \".\");\n\t\tthis.msgObject = new Capsule(null,this.user.getDesiredVehicle(),this.user.getDesiredStation(),null);\n\t\tUtils.enviarMensaje(myAgent, this.user.getCurrentStation(), this.msgObject, \"VEHICLE_REQUEST\");\n\t\t\n\t\t//Waiting for answer\n\t\tACLMessage msg=this.myAgent.blockingReceive(\n\t\t\t\tMessageTemplate.and(\n\t\t\t\t\t\tMessageTemplate.MatchPerformative(ACLMessage.REQUEST), \n\t\t\t\t\t\tMessageTemplate.MatchOntology(\"ontologia\"))\n\t\t\t\t);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tthis.comment = msg.getEnvelope().getComments();\n\t\t\tthis.msgObject = (Capsule) msg.getContentObject();\n\t\t\tSystem.out.println(\"\\t\" + this.user.getCurrentStation() + \" told me \" + this.comment + \". \");\n\t\t\t\n\t\t\tswitch(this.comment)\n\t\t\t{\n\t\t\tcase \"VEHICLE_DELIVERY\":\n\t\t\t\t//1. The station give to the user the vehicle normaly\n\t\t\t\tif(msgObject.getVehicle() != null) {\n\t\t\t\t\tthis.user.takeVehicle(msgObject.getVehicle());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//2. The user goes to the final station\n\t\t\t\tthis.notifyMonitor(\"moving\");\n\t\t\t\tthis.user.goToStation();\n\t\t\t\tthis.notifyMonitor(\"waiting\");\n\n\t\t\t\t//3. Leaves the vehicle on the final station\n\t\t\t\tif(this.user.hasVehicle())\n\t\t\t\t{\n\t\t\t\t\tthis.vehicleTemp = this.user.leaveVehicle();\n\t\t\t\t\tmsgObject = new Capsule(this.vehicleTemp,null, null, null);\n\t\t\t\t\tUtils.enviarMensaje(myAgent, this.user.getCurrentStation(), this.msgObject, \"VEHICLE_RETURN\");\n\t\t\t\t}\n\n\t\t\t\t//4. The user waits a bit\n\t\t\t\tthis.user.waitSomeTime(8000);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"UNSATISFACTORY_REQUEST\":\n\t\t\t\t// The station reports that the request couldn't be completed properly\n\t\t\t\t//1. The capsule can cointain: alternativeStation and alternativeVehicle\n\t\t\t\tif(msgObject.getStation() != null) {\t//checks if there's an alternative reserved station\n\t\t\t\t\tSystem.out.println(\"\\t\"+this.user.getCurrentStation() + \" told me that there's an alternative route -> \" + msgObject.getStation() + \". \");\n\t\t\t\t\tthis.user.stablishDestinationStation(msgObject.getStation());\n\t\t\t\t}\n\t\t\t\tif(msgObject.getVehicle() != null) { //checks if the station gave an alternative vehicle\n\t\t\t\t\tSystem.out.println(\"\\t\"+this.user.getCurrentStation() + \" gived to me an alternative vehicle -> \" + msgObject.getVehicle().getType() + \". \");\n\t\t\t\t\tthis.user.takeVehicle(msgObject.getVehicle());\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\\tI have to go walking. \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//2. Moving to the destination station\n\t\t\t\tthis.notifyMonitor(\"moving\");\n\t\t\t\tthis.user.goToStation();\n\t\t\t\tthis.notifyMonitor(\"waiting\");\n\n\t\t\t\t//3. If has a vehicle, the user leaves it\n\t\t\t\tif(this.user.hasVehicle()) \n\t\t\t\t{\n\t\t\t\t\t//send the vehicle to the station\n\t\t\t\t\tthis.vehicleTemp = this.user.leaveVehicle();\n\t\t\t\t\tmsgObject = new Capsule(this.vehicleTemp,null, null, null);\n\t\t\t\t\tUtils.enviarMensaje(myAgent, this.user.getCurrentStation(), this.msgObject, \"VEHICLE_RETURN\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//4. the user waits before restarting the behavior\n\t\t\t\tthis.user.waitSomeTime(4000);\n\t\t\t}\n\t\t}\n\t\tcatch (UnreadableException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic void tick(){\n\t\tif(!alert){\r\n\t\t\tif(hostileToPlayer&&closeEnoughToAlert(World.player))\r\n\t\t\t\t{alert=true;target=World.player;}\r\n\t\t}\r\n\t\t\r\n\t\tif(alert&&null!=target){\r\n\t\t\t//For now, advance towards the player\r\n\t\t\tPathfinder.moveTowards(this, target);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//If within attacking range but not yet attacking, and not stunned, do so.\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}", "@Override\n public void proceedToPaddock(int id){\n rl.lock();\n //horse_count++;\n //stable_broker.signal();\n try{\n System.out.println(\"H : Sending horse \" + id + \" to paddock...\");\n numHorses_stable--;\n if(numHorses_stable == 0){\n keep_waiting = true;\n System.out.println(\"H : All horses have reached the Paddock(HorseCount = \" + numHorses_stable + \")\");\n }\n else{\n System.out.println(\"H : Horse \" + id + \" is reaching paddock(HorseCount = \" + numHorses_stable + \")\");\n }\n //change horse_states\n// MyThreadHorses horse = (MyThreadHorses) Thread.currentThread();\n// horse.horse_states = MyThreadHorses.Horse_States.AT_THE_PADDOCK;\n //change log\n log.setHorseState(id, MyThreadHorses.Horse_States.AT_THE_PADDOCK);\n log.changeLog();\n //signal next horse\n stable_horses.signal();\n \n }finally{\n rl.unlock();\n }\n }", "private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}", "public int onEnter( int dir )\n {\n return OK;\n }", "private synchronized void teamVictory() {\n \t\tif (state == MatchState.ONVICTORY || state == MatchState.ONCOMPLETE || state == MatchState.ONCANCEL) \n \t\t\treturn;\n \t\tstate = MatchState.ONVICTORY;\n \t\t/// Call the rest after a 2 tick wait to ensure the calling transitionMethods complete before the\n \t\t/// victory conditions start rolling in\n \t\tBukkit.getScheduler().scheduleSyncDelayedTask(plugin, new MatchVictory(this),2L);\n \t}", "public void startHealing()\n\t{\n\t\ttimerList.clear();\n\t\tinHospitalTimer = new PlayPauseTimer(10, new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tworld.heal();\n\t\t\t\tx = random.nextInt(world.getSIMULATION_WIDTH() - individualSize);\n\t\t\t\ty = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize); \n\t\t\t\tmoveInPopulation();\n\t\t\t\texitHospital();\n\t\t\t\thealthStatus = HealthStatus.HEALTHY;\n\t\t\t\ttimerList.remove(inHospitalTimer);\n\t\t\t}\n\t\t\t\n\t\t}, world.getRefreshTime());\n\t\ttimerList.add(inHospitalTimer);\n\t}", "@Override\n public void stateAction(SmartBartender smartBartenderContext) {\n LOGGER.info(\"Ready for use! Waiting for user input\");\n if (this.nextState == null) {\n this.nextState = new CleaningState();\n } else {\n this.nextState = new ShutdownState();\n }\n this.nextState(smartBartenderContext);\n\n }", "public void saluteTheClient(){\n Waiter w = (Waiter) Thread.currentThread();\n CommunicationChannel com = new CommunicationChannel(serverHostName, serverPortNumb);\n Object[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n state_fields[0] = w.getWaiterID();\n \tstate_fields[1] = w.getWaiterState();\n\n Message m_toServer = new Message(0, params, 0, state_fields, 2, null); \n Message m_fromServer;\n\n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n\t\t\t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n \t}\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n\n w.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "public void dispatchHandler(int hash) {\n\n // TODO: This does NOT execute in a state, but executes immediately.\n // fact is that once u switch state, the condition AICondition_STate does not work then.\n // so maybe you need to pass \"previous state\" integer and use this afterwards.\n //setState(hash, 0.1f);\n }", "@Suspendable\n @Override\n public Void call() throws FlowException {\n // We retrieve the notary identity from the network map.\n final Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n QueryCriteria queryCriteria = new QueryCriteria.LinearStateQueryCriteria(null, ImmutableList.of(this.linearId),\n Vault.StateStatus.UNCONSUMED, null);\n List<StateAndRef<NDAState>> ndaStates = getServiceHub().getVaultService().queryBy(NDAState.class, queryCriteria).getStates();\n\n // We create the transaction components.\n NDAState outputState = new NDAState(getOurIdentity(), crmParty, \"APPROVED\");\n StateAndContract outputStateAndContract = new StateAndContract(outputState, LEGAL_CONRACT_ID);\n List<PublicKey> requiredSigners = ImmutableList.of(getOurIdentity().getOwningKey(), crmParty.getOwningKey());\n Command cmd = new Command<>(new LegalContract.Approve(), requiredSigners);\n\n // We create a transaction builder and add the components.\n final TransactionBuilder txBuilder = new TransactionBuilder();\n txBuilder.addInputState(ndaStates.get(0));\n txBuilder.setNotary(notary);\n txBuilder.withItems(outputStateAndContract, cmd);\n\n // Signing the transaction.\n final SignedTransaction signedTx = getServiceHub().signInitialTransaction(txBuilder);\n // Creating a session with the other party.\n FlowSession otherpartySession = initiateFlow(crmParty);\n // Obtaining the counterparty's signature.\n SignedTransaction fullySignedTx = subFlow(new CollectSignaturesFlow(\n signedTx, ImmutableList.of(otherpartySession), CollectSignaturesFlow.tracker()));\n // Finalising the transaction.\n subFlow(new FinalityFlow(fullySignedTx));\n return null;\n }", "void notify(HorseFeverEvent e);", "public void educationLoan(){\r\n\t\tSystem.out.println(\"HSBC ----educationLoan method called from HSBCBank class\");\r\n\t}", "@Override\n\tpublic void landedOn() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(300);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 300 dollars by landing on Bonus Square\");\n\t\tMonopolyGameController.allowCurrentPlayerToEndTurn();\n\n\t}", "public State getInHospital() {\n\t\treturn inHospital;\n\t}", "public void act() \n {\n moveEnemy();\n checkHealth();\n attacked();\n }", "public void accomplishGoal() {\r\n isAccomplished = true;\r\n }", "public void handle(GameState state, Duration dt) {\r\n Player p = state.getPlayer();\r\n if (e.getDistance(p) < 1.1) p.damage(1);\r\n }", "public void edicationLoan() {\n\t\tSystem.out.println(\"hsbc -- education loan\");\n\t\t\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 }", "private void haveFun() {\n\t\tint action = inputPrompt.funActivities(money);\r\n\t\tthis.money -= action;\r\n\t\t//has better effect depending on how much money you have spent\r\n\t\tthis.mentalHealth += FUNHEALTH + action;\r\n\t\tdailyTime--;\r\n\t\tinputPrompt.mainInfo(energy, physHealth, mentalHealth, money);\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void doAction(MedcivGame game) {\n\t\ttry {\r\n\t\t\t((Livestock)game.matchingVillager(ownerId).getItemById(targetId)).setTendedToThisTurn(true);\r\n\t\t}catch(NullPointerException e) {\r\n\t\t\t//do nothing; the cow is dead, or you are\r\n\t\t}\r\n\t}", "@Override\n public void logic() throws PogamutException {\n /*\n * Step:\n * 1. find the bot and approach him (get near him ... distance < 200)\n * 2. greet him by saying \"Hello!\"\n * 3. upon receiving reply \"Hello, my friend!\"\n * 4. answer \"I'm not your friend.\"\n * 5. and fire a bit at CheckerBot (do not kill him, just a few bullets)\n * 6. then CheckerBot should tell you \"COOL!\"\n * 7. then CheckerBot respawns itself\n * 8. repeat 1-6 until CheckerBot replies with \"EXERCISE FINISHED\"\n */\n Location loc = new Location(0, 0, 0);\n weaponry.changeWeapon(UT2004ItemType.ASSAULT_RIFLE);\n switch (state) {\n case 0: // navigate to random point\n if (!navigation.isNavigating())\n navigation.navigate(this.navPoints.getRandomNavPoint());\n if (players.canSeePlayers()) {\n loc = players.getNearestVisiblePlayer().getLocation();\n navigation.navigate(loc);\n log.info(\"Bot see player on \" + loc.toString());\n }\n if (loc.getDistance(bot.getLocation()) < 190) {\n navigation.stopNavigation();\n log.info(\"Bot is close enough\");\n state = 1;\n }\n if (congrats_receive) {\n log.info(\"Received info about success\");\n state = 7;\n }\n break;\n case 1: // nearby player\n this.sayGlobal(\"Hello!\");\n resetTimeout();\n state = 2;\n break;\n case 2: //waiting for answer\n tickTimeout();\n if (received.equals(\"Hello, my friend!\")) {\n log.info(\"Answer received\");\n state = 3;\n }\n else if (receiveTimeout) {\n log.warning(\"Answer didn't received, repeating.\");\n navigation.navigate(navPoints.getRandomNavPoint());\n state = 0;\n }\n break;\n case 3: // say back\n this.sayGlobal(\"I'm not your friend.\");\n state = 4;\n break;\n case 4:\n if (players.getNearestVisiblePlayer() == null) {\n log.warning(\"Resetting because no player in view\");\n state = 0;\n } else {\n shoot.shoot(players.getNearestVisiblePlayer());\n log.info(\"Start shooting at the enemy\");\n resetTimeout();\n state = 5;\n }\n break;\n case 5:\n tickTimeout();\n if (damaged) {\n shoot.stopShooting();\n damaged = false;\n resetTimeout();\n log.info(\"Enemy damaged\");\n state = 6;\n } else if (receiveTimeout) {\n log.warning(\"Resetting because not damage to the enemy\");\n state = 0;\n }\n break;\n case 6:\n tickTimeout();\n if (cool_received){\n log.info(\"Success in the turn, repeating\");\n cool_received = false;\n resetTimeout();\n state = 0;\n }\n else if(receiveTimeout) {\n log.warning(\"No final answer, repeating\");\n state = 0;\n }\n break;\n case 7:\n sayGlobal(\"I solved the exercise.\");\n }\n }", "public void stolenMonster(GameState state) {\n }", "public abstract void performAction(Individual victim) {\n\tvictim.health -= this.performance;\n}", "public void enterRoom(Person p) {\n if (p.poisoned) {\n System.out.println(\"The poison eats away at you. You take 5 damage.\");\n p.hp -= 5;\n System.out.println(\"You now have \" + p.hp + \"health\");\n if (p.hp <= 0) {\n\n gameOff();\n }\n }\n occupant = p;\n p.setxLoc(this.xLoc);\n p.setyLoc(this.yLoc);\n Scanner n = new Scanner(System.in);\n\n if (!m.sleep) {\n if (m.alive) {\n System.out.println(\"There's a monster in the room!\");\n } else {\n System.out.println(\"The monster's remains lies before you.\");\n }\n m.aggro = true;\n while (m.alive && m.aggro) {\n if (m.hp <= 0) {\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n }\n int damage = m.counterAttack(p);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n if (p.hp <= 0) {\n System.out.println(\"You died. No one knows you died.\");\n Runner.gameOff();\n }\n System.out.println(\"You have \" + p.hp + \" health.\");\n System.out.println(\"What do you do now? (Fight, Run)\");\n String re = n.nextLine();\n if (re.equalsIgnoreCase(\"run\")) {\n damage = (int) (m.counterAttack(p) / p.dex);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n m.aggro = false;\n }\n if (re.equalsIgnoreCase(\"Fight\")) {\n double dam = (p.str + p.str * Math.random()) / (m.resist + 1);\n\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \"damage.\");\n if (m.hp <= 0) {\n m.alive = false;\n System.out.println(\"The monster howls as you deal a finishing blow.\");\n int g = m.dropGold();\n System.out.println(\"You gain \" + p.gold + \" Gold\");\n p.gold += g;\n m.threat = false;\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n }\n }\n }\n if (m.alive) {\n if (m.sleep) {\n System.out.println(\"You find a sleeping monster. Do you attack it? (Y/N)\");\n\n String q = n.nextLine();\n if (q.equalsIgnoreCase(\"yes\") || q.equalsIgnoreCase(\"y\")) {\n\n double dam = p.str * (1.5) + p.str * Math.random();\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \" damage.\");\n m.aggro = true;\n if (m.hp <= 0) {\n System.out.println(\"The monster dies on the spot. Who's the real monster here?\");\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \" Gold\");\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n while (m.alive && m.aggro) {\n if (m.hp <= 0) {\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \"Gold\");\n }\n int damage = m.counterAttack(p);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n if (p.hp <= 0) {\n System.out.println(\"You died. Serves you right for hitting a sleeping monster.\");\n Runner.gameOff();\n }\n System.out.println(\"You have \" + p.hp + \" health.\");\n System.out.println(\"What do you do now? (Fight, Run)\");\n q = n.nextLine();\n if (q.equalsIgnoreCase(\"run\")) {\n damage = (m.counterAttack(p) / p.dex);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n m.aggro = false;\n }\n if (q.equalsIgnoreCase(\"Fight\")) {\n dam = (p.str + p.str * Math.random()) / (m.resist + 1);\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \"damage.\");\n if (m.hp <= 0) {\n m.alive = false;\n System.out.println(\"The monster howls as you deal a finishing blow.\");\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \" Gold\");\n m.threat = false;\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n }\n\n }\n } else {\n System.out.println(\"You let the sleeping monster be.\");\n m.threat = false;\n n.close();\n }\n\n }\n }\n else\n {\n System.out.println(\"The monster's remains are still here.\");\n }\n }", "public void act(Person hero)\r\n { \r\n // dead people can't act\r\n if (room != null)\r\n {\r\n if(Game.random(5)==0)\r\n {\r\n if (type == MONSTER) \r\n eat(hero);\r\n else \r\n attack(hero);\r\n }\r\n }\r\n }", "@Override\n\tpublic void enterMain() {\n\t\tIsland island = game.getCurrentLocation();\n\t\tif (game.checkAccessibleIsland(island)) \n\t\t{\n\t\t\tboolean state = false;\n\t\t\twhile (state == false) {\n\t\t\t\tArrayList<Island> islands = game.getAvailableIslands();\n\t\t\t\tSystem.out.println(\"Your current money: \" + game.getMoney()+ \" coins.\");\n\t\t\t\tSystem.out.println(\"You have : \" + game.getRemainingDays() + \" days left.\");\n\t\t\t\tIsland currentLoc = game.getCurrentLocation();\n\t\t\t\tString islandName = currentLoc.getIslandName();\n\t\t\t\tSystem.out.println(\"Your current location is: \" + islandName + \" Island.\" + \"\\n\");\n\t\t\t\tSystem.out.println(\"What do you want to do? \");\n\t\t\t\tSystem.out.println(\"(1) See ship's specification\");\n\t\t\t\tSystem.out.println(\"(2) Go to other Island\");\n\t\t\t\tSystem.out.println(\"(3) Go to store in your current location\");\n\t\t\t\tSystem.out.println(\"(4) End game\");\n\t\t\t\ttry {\n\t\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\t\tif (selectedAction <= 4 && selectedAction > 0) {\n\t\t\t\t\t\tstate = true;\n\t\t\t\t\t\tif (selectedAction == 1) {\n\t\t\t\t\t\t\tgame.seeShipSpec();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (selectedAction == 2) {\n\t\t\t\t\t\t\tprintAvailableIslands(islands);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (selectedAction == 3) {\n\t\t\t\t\t\t\tgame.goToStore();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tgame.gameOver(\"You ended the game\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\t\tscanner.nextLine();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tboolean state = false;\n\t\t\twhile (state == false)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Your current money: \" + game.getMoney()+ \" coins.\");\n\t\t\t\tSystem.out.println(\"You have : \" + game.getRemainingDays() + \" days left.\");\n\t\t\t\tIsland currentLoc = game.getCurrentLocation();\n\t\t\t\tString islandName = currentLoc.getIslandName();\n\t\t\t\tSystem.out.println(\"Your current location is: \" + islandName + \" Island.\" + \"\\n\");\n\t\t\t\tSystem.out.println(\"What do you want to do? \");\n\t\t\t\tSystem.out.println(\"(1) See ship's specification\");\n\t\t\t\tSystem.out.println(\"(2) Go to store in your current location\");\n\t\t\t\tSystem.out.println(\"(3) End Game\");\n\t\t\t\ttry {\n\t\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\t\tif (selectedAction <= 3 && selectedAction > 0) {\n\t\t\t\t\t\tstate = true;\n\t\t\t\t\t\tif (selectedAction == 1) {\n\t\t\t\t\t\t\tgame.seeShipSpec();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (selectedAction == 2) {\n\t\t\t\t\t\t\tgame.goToStore();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tgame.gameOver(\"You ended the game\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\t\tscanner.nextLine();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void handleEntrance(){\r\n\t\t\tcarsArriving();\r\n\t\t\tcarsEntering(entrancePassQueue);\r\n\t\t\tcarsEntering(entranceCarQueue); \t\r\n\t\t}", "private void meetWithHrForBenefitAndSalryInfo() {\n metWithHr = true;\n }", "public void interact() {\r\n\t\tif(alive) {\r\n\t\t\tCaveExplorer.print(attackDescription);\r\n\t\t\tbattle();\r\n\t\t}else {\r\n\t\t\tCaveExplorer.print(deadDescription);\r\n\t\t}\r\n\t}", "public void act() \n {\n verificaClique();\n }", "@Override\n\tpublic void passedBy() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(250);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 250 dollars by landing on Bonus Square\");\n\n\t}", "public void act() \n {\n CreatureWorld playerWorld = (CreatureWorld)getWorld();\n\n if( getHealthBar().getCurrent() <= 0 )\n {\n getWorld().showText(\"Charmander has fainted...\", getWorld().getWidth()/2, getWorld().getHeight()/2 + 26);\n Greenfoot.delay(30);\n }\n }", "void defendAttack(IUnit attacker, int incomingDamage);", "public void hungry()\r\n {\r\n \tSystem.out.println(\"I'm hungry!! Feed me!!\");\r\n \tbarking();\r\n }", "public void interactWhenApproaching() {\r\n\t\t\r\n\t}", "@Override\n protected void onDeath(final Creature killer) {\n getDeathPenalty().checkCharmOfLuck();\n\n if (isInStoreMode()) {\n setPrivateStoreType(Player.STORE_PRIVATE_NONE);\n }\n if (isProcessingRequest()) {\n final Request request = getRequest();\n if (isInTrade()) {\n final Player partner = request.getOtherPlayer(this);\n sendPacket(SendTradeDone.FAIL);\n partner.sendPacket(SendTradeDone.FAIL);\n }\n request.cancel();\n }\n //cubicdata\n deleteCubics();\n deleteAgathion();\n\n boolean checkPvp = true;\n if (ServerConfig.ALLOW_CURSED_WEAPONS) {\n if (isCursedWeaponEquipped()) {\n CursedWeaponsManager.getInstance().dropPlayer(this);\n checkPvp = false;\n } else if (killer != null && killer.isPlayer() && killer.isCursedWeaponEquipped()) {\n CursedWeaponsManager.getInstance().increaseKills(((Player) killer).getCursedWeaponEquippedId());\n checkPvp = false;\n }\n }\n\n if (checkPvp) {\n doPKPVPManage(killer);\n\n altDeathPenalty(killer);\n }\n\n //And in the end of process notify death penalty that owner died :)\n getDeathPenalty().notifyDead(killer);\n\n setIncreasedForce(0);\n\n if (isInParty() && getParty().isInReflection() && getParty().getReflection() instanceof DimensionalRift) {\n ((DimensionalRift) getParty().getReflection()).memberDead(this);\n }\n\n stopWaterTask();\n stopMountFeedTask();\n\n if (!isSalvation() && isOnSiegeField() && isCharmOfCourage()) {\n ask(new ConfirmDlg(SystemMsg.YOUR_CHARM_OF_COURAGE_IS_TRYING_TO_RESURRECT_YOU, 60000), new ReviveAnswerListener(this, 100, false, 60000));\n setCharmOfCourage(false);\n }\n\n if (AllSettingsConfig.AltKillAnnounce && killer != null && killer.isPlayer())\n AnnouncementUtils.announceToAll(killer.getName() + \" убил игрока \" + getName() + \"!\");\n\n super.onDeath(killer);\n }", "public void action() {\n store.readNextArrival();\n Employee employee = (Employee)this.getActor();\n checkout = store.firstUnmannedCheckout();\n checkout.setCashier(employee);\n checkout.setOpen(true);\n int quittingTime = employee.getQuittingTime();\n Event event = new ShiftCompletedEvent(quittingTime, employee, checkout);\n store.getEventList().addEvent(event);\n \n System.out.printf(\"Time %d: Cashier %d arrives (Speed %d, quitting time %d, checkout %d)\\n\",\n time,\n employee.getId(),\n employee.getSpeed(),\n employee.getQuittingTime(),\n checkout.getIndex());\n }", "@Override\n public void trigger() {\n output.addNewEvent(\"Suspender Assinante \" + subscriber.getId() + \" da Central \" + central.getId());\n this.sucess = this.network.suspendSubscriberFromCentral(this.subscriber.getId(), this.central.getId());\n if (sucess) {\n output.addNewSignal(\"Assinante \" + this.subscriber.getId() + \" suspendida da Central \" + central.getId());\n } else {\n output.addNewSignal(\"Assinante \" + this.subscriber.getId() + \" não está conectado ou ativo à Central \" + central.getId());\n }\n }", "private void stateReturnToHomeBase() {\n\t\tif (isCloserToBall()) {\n\t\t\tstate = State.ATTACKING;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isCloseTo(playerDeafaultPosition)) {\n\t\t\tif (isAlignedTo(playerDeafaultPosition)) {\n\t\t\t\tcommander.doDashBlocking(50.0d);\n\t\t\t} else {\n\t\t\t\tturnTo(playerDeafaultPosition);\n\t\t\t}\n\t\t}\n\t}", "private static void checkActions()\n\t{\n\t\tSystem.out.println();\n\t\t\n\t\tif (fighterAction.equals(\"Kick\") && opponentAction.equals(\"Kick\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" smashes shins with \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tplayerOneHurt = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Kick\") && opponentAction.equals(\"Punch\"))\n\t\t{\n\t\t\tannounce(opponentName,\" gives a big uppercut to \", playerOneName);\n\t\t\tplayerOneHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Kick\") && opponentAction.equals(\"Block\"))\n\t\t{\n\t\t\tannounce(opponentName,\" takes a big kick to the ribs from \", playerOneName);\n\t\t\topponentHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Punch\") && opponentAction.equals(\"Kick\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" gives a big uppercut to \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Punch\") && opponentAction.equals(\"Punch\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" exchanges quick jabs with \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tplayerOneHurt = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Punch\") && opponentAction.equals(\"Block\"))\n\t\t{\n\t\t\tannounce(opponentName,\" parries the punch and deals big damage to \", playerOneName);\n\t\t\tplayerOneHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Block\") && opponentAction.equals(\"Kick\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" takes a big kick to the ribs from \", opponentName);\n\t\t\tplayerOneHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\telse if (fighterAction.equals(\"Block\") && opponentAction.equals(\"Punch\"))\n\t\t{\n\t\t\tannounce(playerOneName,\" parries the punch and deals big damage to \", opponentName);\n\t\t\topponentHurt = true;\n\t\t\tcounterAttack = true;\n\t\t}\n\t\n\t\t// Both block\n\t\telse\n\t\t{\n\t\t\tannounce(\"\",\"Both fighters stand still, waiting for the other to make a move!\",\"\");\n\t\t}\n\n\t\tSystem.out.println();\n\t}", "protected void onEnter(){}", "public void treatment()\n {\n\t\tCommunicationManagerServer cms = CommunicationManagerServer.getInstance();\n\t\tDataServerToComm dataInterface = cms.getDataInterface();\n\t\t/** On récupère et stocke l'adresse IP du serveur\n\t\t */\n\t\tdataInterface.updateUserChanges(user);\n\n\t /** Création du message pour le broadcast des informations**/\n\t updatedAccountMsg message = new updatedAccountMsg(this.user);\n\t\tmessage.setPort(this.getPort());\n\t cms.broadcast(message);\n\t}", "public void accept()\n { ua.accept();\n changeStatus(UA_ONCALL);\n if (ua_profile.hangup_time>0) automaticHangup(ua_profile.hangup_time); \n printOut(\"press 'enter' to hangup\"); \n }", "public int performAction()\n {\n if(stunCountdown > 0) \n {\n ERROR_LOG.writeToLog(\"The saboteur is not supposed to call performAction() while stuunned. Remaining time stunned: \" + stunCountdown + '.');\n \n chasingPlayer = false;\n return stunCountdown;\n }\n \n if(chasingPlayer)\n {\n setRoom(Game.getInstance().getPlayer().getCurrentRoom());\n }\n else\n {\n if(((getCurrentRoom().isOperating() && getCurrentRoom() instanceof ItemRoom) || Game.getInstance().getGameInfo().getHackedExit() == null) && Math.random() < chanceOfSabotage)\n {\n if(!getCurrentRoom().isOperating() || !(getCurrentRoom() instanceof ItemRoom))\n {\n int sabotageExit = (int) Math.floor(Math.random() * getCurrentRoom().getCollectionOfExits().size());\n getCurrentRoom().getCollectionOfExits().get(sabotageExit).setOperating(false);\n Game.getInstance().getGameInfo().setHackedExit(getCurrentRoom().getCollectionOfExits().get(sabotageExit));\n ACTION_LOG.writeToLog(\"Sabotaged the exit between \\\"the \" + getCurrentRoom().getName() + \"\\\" and \\\"the \" + getCurrentRoom().getExit(getCurrentRoom().getCollectionOfExits().get(sabotageExit)).getName() + \"\\\".\");\n }\n else if(Game.getInstance().getGameInfo().getHackedExit() != null)\n {\n getCurrentRoom().setOperating(false);\n ACTION_LOG.writeToLog(\"Sabotaged the room: \\\"\" + getCurrentRoom().getName() + \"\\\".\");\n }\n else if(Math.random() < CHANCE_OF_DOOR_SABOTAGE)\n {\n int sabotageExit = (int) Math.floor(Math.random() * getCurrentRoom().getCollectionOfExits().size());\n getCurrentRoom().getCollectionOfExits().get(sabotageExit).setOperating(false);\n Game.getInstance().getGameInfo().setHackedExit(getCurrentRoom().getCollectionOfExits().get(sabotageExit));\n ACTION_LOG.writeToLog(\"Sabotaged the exit between \\\"the \" + getCurrentRoom().getName() + \"\\\" and \\\"the \" + getCurrentRoom().getExit(getCurrentRoom().getCollectionOfExits().get(sabotageExit)).getName() + \"\\\".\");\n }\n else\n {\n getCurrentRoom().setOperating(false);\n ACTION_LOG.writeToLog(\"Sabotaged the room: \\\"\" + getCurrentRoom().getName() + \"\\\".\");\n }\n \n chanceOfSabotage = DEFAULT_CHANCE_OF_SABOTAGE;\n }\n else\n {\n List<Exit> neighbors = getCurrentRoom().getCollectionOfExits();\n \n for(int i = neighbors.size() - 1; i >= 0; i--)\n if(getCurrentRoom().getExit(neighbors.get(i)).isControlRoom() || !neighbors.get(i).isOperating())\n neighbors.remove(i);\n \n if (neighbors.isEmpty())\n {\n ACTION_LOG.writeToLog(\"Saboteur tried to move, but all exits where removed. Current room: \\\"\" + getCurrentRoom().getName() + \"\\\".\");\n return -1;\n }\n \n int exitIndex = (int) (Math.floor(Math.random() * neighbors.size()));\n \n setRoom(getCurrentRoom().getExit(neighbors.get(exitIndex)));\n \n chanceOfSabotage += CHANCE_OF_SABOTAGE_GROWTH;\n \n //ACTION_LOG.writeToLog(\"Moved to \\\"the \" + getCurrentRoom().getName() + \"\\\".\");\n \n checkChasingPlayer();\n }\n }\n \n return(5 + (int) Math.floor(Math.random() * 6));\n }", "@Override\n\tpublic void execute() {\n\t\t// TODO Auto-generated method stub\n\t\tstate.setTimeForLastEvent(state.getCurrentTime());\n\t\tstate.setCurrentEvent(this);\n\t\tstate.setCurrentTime(startTime);\n\t\tstate.updateIdleTime();\n\t\tstate.updateQueueTime();\n\t\t\n\t\tstate.setCurrentCustomer(cust);\n\t\tstate.callChanged();\n\t\t\n\t\t\n\t\t\n\t\tif (state.isQueueEmpty()) {\n\t\t\tstate.increaseIdleChairs();\n\t\t}else {\n\t\t\tdouble timeForNext = state.getHairdresserFinishTime();\n\t\t\tHairSalonEvent finished = new HaircutFinishedEvent(timeForNext,state,store, state.getFirst());\n\t\t\tstore.add(finished);\n\t\t\tstate.removeFirst();\n\t\t\tstate.increaseCuttinTime(timeForNext);\n\t\t\tstate.setLatestCustomerFinishTime(timeForNext);\n\t\t\t\n\n\t\t}\n\t\tif (state.checkHaircut(cust)){\n\t\t\t\n\t\t\tdouble timeForNext = state.getUnsatisfiedCustomerArrivalTime();\n\t\t\tHairSalonEvent returning = new PriorityCustomerEntersEvent(timeForNext,state,store,cust);\n\t\t\tstore.add(returning);\n\t\t\t\n\t\t\t\n\t\t}else {\n\t\t\tstate.increaseNumberOfCust();\n\t\t}\n\t\t\n\t}", "public void caughtCheating(){\n\t\tinGoodStanding = false;\n\t}", "public void action()\n {\n if(timeout > 0 && timeout < 2)\n {\n timeout = 0;\n agent.removeBehaviour(introNegotiation);\n introNegotiation = null;\n counter = 0;\n\n\n }\n //If this is the very first time getting to this state or if the timeout reset the counter to 0\n if(counter < 1)\n {\n //Clean the list of receivers in case there is something\n if(!receivers.isEmpty())\n receivers.removeAllElements();\n //Calculate the duration of the intro\n calculateDurationIntro();\n //Find a receiver\n findAllReceivers();\n constructACLMessage();\n introNegotiation = new IntroNegotiation(agent,msg);\n introNegotiation.setDataStore(getDataStore());\n agent.addBehaviour(introNegotiation);\n }\n\n\n //Handle where I'm heading to from here.\n switch (steps)\n {\n case 0:\n transition = 29;\n break;\n case 1:\n agent.removeBehaviour(introNegotiation);\n introNegotiation = null;\n transition = 17;\n\n }\n\n\n\n }", "@Override\n protected void sendUpdatedStateTo(GamePlayer p) {\n //makes sure player exists\n if(p == null){\n return;\n }\n // if there is no state to send, ignore\n if(state == null){\n return;\n }\n //creates a copy of the official state and sends it to the desired player\n StrategoGameState stateForPlayer = new StrategoGameState(state);\n p.sendInfo((stateForPlayer));\n }", "public void attack(User p)\n\t{\n\t\tint damage = getAttack() - p.getDefense();\n\t\tint evade = 0;\n\t\tif(damage <= 0)\n\t\t{\n\t\t\tevade = p.getDefense() - getAttack();\n\t\t\tdamage = 1;\n\t\t}\n\t\t\n\t\tif(Math.random() * 100 < evade * 5)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, \"Miss\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tp.reduce(damage);\n JOptionPane.showMessageDialog(null,\"Enemy attacked you! User's health = \" + p.getHealth() + \"\\n\" + \"Damage dealt = \" + damage); \n\t}", "@Override\r\n\tpublic void act() {\n\t\tausgeben();\r\n\t}", "public void act()\n {\n // if (claimer ==null){\n // this.setClaim(false);\n //}\n if(claimer == null){\n setClaim(false);\n }\n if (energy>0){\n \n removeEnergy(decayRate);\n\n }\n else {\n // getWorld().removeObject(this);\n\n }\n \n //check the energy decay\n //change size and weight\n //\n }", "public void act()\n {\n // Make sure fish is alive and well in the environment -- fish\n // that have been removed from the environment shouldn't act.\n if ( isInEnv() ) \n move();\n }", "public void interact(final GlobalObject object) {\r\n\t\tswitch(object.defs().getOptions()[0]) {\r\n\t\t\tcase \"Challenge\": // TODO\r\n\t\t\t\tplayer.sm(\"<col=ff0000>WARNING: \"+object.getName()+\" is much stronger than the last time you fought it.\");\r\n\t\t\t\tplayer.sm(\"<col=ff0000>It will take all of your skills to defeat it. Are you ready?\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"Pass\": // Barriers\r\n\t\t\t\tString bossName = object.getName().replace(\"Barrier (\", \"\").replace(\")\", \"\");\r\n\t\t\t\tif(!hasKills(bossName))\r\n\t\t\t\t\tplayer.sm(\"You need to kill \"+getFormattedName(bossName)+\" \"\r\n\t\t\t\t\t\t+ \"\"+C_O_R_Data.getKillsNeeded(bossName)+\" times in order to pass this barrier.\");\r\n\t\t\t\telse\r\n\t\t\t\t\tpassBarrier(object, isWalkingBack(object));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public void hunterStartCarrying(DPlayer hunter){\n hunter.getPlayerState().setCarrying(true);\n }", "@Override\n\tpublic State who() {\n\t\treturn State.CASUAL;\n\t}", "public synchronized void enterHall(){\n\t\twhile(nbPlaces==0 || sessionStarted==false){ //This is a while because the customer thread must check every time after waking up\n\t\t\t \t\t\t\t\t\t\t\t\t\t //whether the session has started or not.\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"The customer \"+Thread.currentThread().getId()+\" is waiting to enter the projection hall.\");\n\t\t\t\twait();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tnbPlaces--;\n\t\tSystem.out.println(\"The customer \"+Thread.currentThread().getId()+\" is going to enter the projection hall.\");\n\t}", "public abstract boolean attack(PermanentCharm i);", "@Override\n public void chooseAction(){\n healthDecay = getHealth() - 5;\n //now scan for Nazguls\n\n if(healthDecay == 0){\n death(this);\n }\n int scan_result = scan();\n\n if(scan_result == 1){\n move();\n }\n\n if(scan_result == 0 && healthDecay < 75){\n stay();\n }\n\n if(scan_result == 0 && hobbitCounter == 15){\n replicate();\n hobbitCounter = 0;\n }\n\n else{\n move();\n \n }\n hobbitCounter = hobbitCounter + 1;\n }", "@Override\n\tpublic void declarehealthy(Patient patient) {\n\t\tsf.getCurrentSession().evict(patient);\n\n\t\tpatient.setHealthy(true);\n\n\t\tsf.getCurrentSession().update(patient);\n\n\t}", "public void approach(contestant c) throws InterruptedException {\n\n int rand1 = ThreadLocalRandom.current().nextInt(1500, 5000);\n int rand2 = ThreadLocalRandom.current().nextInt(1, 3);\n\n setPriority(10); //raise thread priority to make decision\n\n //System.out.println(this.getName() + \" is now talking to \" + c.getName());\n sleep(rand1); // simulate 'talking phase'\n\n visit[c.getID()] = true; // record contestant attempt\n\n if (rand2 == 2) { // if roll is successful (contestant gets number) (33.3% chance of success)\n\n msg(\"has given their number to \" + c.getName());\n //System.out.println(this.getName() + \" has given their number to \" + c.getName());\n c.datenums.add(this); // record successful match inside contestant\n\n } else\n\n msg(\"has rejected \" + c.getName());\n //System.out.println(this.getName() + \" has rejected \" + c.getName());\n\n sem.release();\n\n setPriority(5); //reset thread priority to default\n\n increaseRound(c); // increase round total\n\n }", "@Override\n\tpublic void onTalkToNpc(Player p, final Npc n) {\n\t\tp.setBusy(true);\n\t\tn.blockedBy(p);\n\n\t\tplayMessages(p, n, true, \"Can I come through this gate?\");\n\t\tplayMessages(p, n, false, \"You must pay a toll of 10 gold coins to pass\");\n\n\t\tString[] options = new String[] { \"No thankyou, I'll walk round\", \"Who does my money go to?\", \"yes ok\" };\n\n\t\tp.setMenuHandler(new MenuHandler(options) {\n\t\t\t@Override\n\t\t\tpublic void handleReply(int option, String reply) {\n\t\t\t\towner.setBusy(true);\n\t\t\t\tplayMessages(owner, n, true, reply);\n\n\t\t\t\tswitch(option) {\n\t\t\t\tcase 0: // no thanks\n\t\t\t\t\tplayMessages(owner, n, false, \"Ok suit yourself\");\n\n\t\t\t\t\tn.unblock();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: // who does money go to\n\t\t\t\t\tplayMessages(owner, n, false, \"The money goes to the city of Al Kharid\");\n\n\t\t\t\t\tn.unblock();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: // yes\n\t\t\t\t\tif(owner.getInventory().remove(10, 10) > -1) { // enough money\n\t\t\t\t\t\towner.getActionSender().sendInventory();\n\t\t\t\t\t\towner.getActionSender().sendMessage(\"You pay the guard\");\n\t\t\t\t\t\tplayMessages(owner, n, false, \"You may pass\");\n\t\t\t\t\t\towner.getActionSender().sendMessage(\"The gate swings open\"); // lold\n\t\t\t\t\t\t//x > 91 (left side of fence\n\t\t\t\t\t\tif(owner.getX() > 91)\n\t\t\t\t\t\t\towner.teleport(90, 649, false);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\towner.teleport(93, 649, false);\n\t\t\t\t\t\n\n\t\t\t\t\t\tn.unblock();\n\t\t\t\t\t} else { // not enough money\n\t\t\t\t\t\tplayMessages(owner, n, true, \"Oh dear I don't actually seem to have enough money\");\n\n\t\t\t\t\t\tn.unblock();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\towner.setBusy(false);\n\t\t\t}\n\t\t});\n\t\tp.getActionSender().sendMenu(options);\n\t\tp.setBusy(false);\n\t}", "public boolean execute(Living who);", "public abstract void enter();", "@Override\n public void enter() {\n ballPursuit = new Pursuit(player, 1, 1.0, fsmAI.ball);\n player.steeringBehaviorsManager.addBehavior(ballPursuit);\n }", "public void breath() {\n\t\tif (alive) {\n\t\t\t_age++;\n\t\t\t// Respiration process\n\t\t\tboolean canBreath = useEnergy(Math.min((_mass - _lowmaintenance) / Utils.SEGMENT_COST_DIVISOR, _energy));\n\t\t\tif ((_age >> 8) > _geneticCode.getMaxAge() || !canBreath) {\n\t\t\t\t// It's dead, but still may have energy\n\t\t\t\tdie(null);\n\t\t\t} else {\n\t\t\t\tif (_energy <= Utils.tol) {\n\t\t\t\t\talive = false;\n\t\t\t\t\t_world.decreasePopulation();\n\t\t\t\t\t_world.organismHasDied(this, null);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// The corpse slowly decays\n\t\t\tuseEnergy(Math.min(_energy, Utils.DECAY_ENERGY));\n\t\t}\n\t}", "private void harvest() {\n\t\t// if VERY far from flower, it must have died. start scouting\n\t\tif(grid.getDistance(grid.getLocation(targetFlower),grid.getLocation(this)) > 200) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// if crop storage is full, return to hive with information\n\t\telse if(food >= maxCrop) {\n\t\t\tif(targetFlower != null) {\n\t\t\t\tlastFlowerNectar = targetFlower.food;\n\t\t\t}\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if daylight is diminishing, return to hive\n\t\telse if(clock.time > (endForagingTime + 1.0)){\n\t\t\tlastFlowerNectar = 0;\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if flower loses all nectar, start scouting for new flower\n\t\telse if(targetFlower.food <= 0){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// semi-random decision to scout for new flower if current flower has low food\n\t\telse if(RandomHelper.nextIntFromTo(0,(int)(maxFlowerNectar/4)) > targetFlower.food &&\n\t\t\t\tRandomHelper.nextDoubleFromTo(0,1) < forageNoise){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// otherwise continue harvesting current flower\n\t\telse{\n\t\t\thover(grid.getLocation(targetFlower));\n\t\t\ttargetFlower.food -= foragingRate;\n\t\t\tfood += foragingRate;\n\t\t\tfood -= lowMetabolicRate;\n\t\t}\n\t}", "@Override\n public void userRequestedAction()\n {\n inComm = true;\n view.disableAction();\n\n // switch to loading ui\n view.setActionText(\"Loading...\");\n view.setStatusText(loadingMessages[rand.nextInt(loadingMessages.length)]);\n view.setStatusColor(COLOR_WAITING);\n view.loadingAnimation();\n\n // switch the status of the system\n if (isArmed) disarmSystem();\n else armSystem();\n isArmed = !isArmed;\n\n // notify PubNub\n }", "public void callTheWaiter(){\n Student s = (Student) Thread.currentThread();\n\n \tCommunicationChannel com = new CommunicationChannel (serverHostName, serverPortNumb);\n \tObject[] params = new Object[0];\n \tObject[] state_fields = new Object[2];\n \tstate_fields[0] = s.getID();\n \tstate_fields[1] = s.getStudentState();\n \t\n Message m_toServer = new Message(7, params, 0, state_fields, 2, null); \n Message m_fromServer; \n \n while (!com.open ()){ \n \ttry{ \n \t\tThread.currentThread ();\n \t\tThread.sleep ((long) (10));\n \t}\n \tcatch (InterruptedException e) {}\n }\n \n com.writeObject (m_toServer);\n \n m_fromServer = (Message) com.readObject(); \n \n s.setState((int) m_fromServer.getStateFields()[1]);\n \n com.close ();\n }", "private void attackPhase(Player p) \n\t{\n\t\tp.attack();\n\t}", "private void SecondStateFiringChecks()\n {\n List<Player> AffectedPlayers = game.GetAffectedPlayers(geoTarget, game.GetConfig().GetBlastRadius(missileType));\n\n if(AffectedPlayers.size() == 1)\n {\n final Player affectedPlayer = AffectedPlayers.get(0);\n\n if(lLastWarnedID != affectedPlayer.GetID() && affectedPlayer.GetRespawnProtected())\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_respawn_protected, affectedPlayer.GetName(), TextUtilities.GetTimeAmount(affectedPlayer.GetStateTimeRemaining())));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else if(lLastWarnedID != affectedPlayer.GetID() && game.GetNetWorthMultiplier(game.GetOurPlayer(), affectedPlayer) < Defs.NOOB_WARNING)\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_noob, affectedPlayer.GetName()));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else if(lLastWarnedID != affectedPlayer.GetID() && game.GetNetWorthMultiplier(game.GetOurPlayer(), affectedPlayer) > Defs.ELITE_WARNING)\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_elite, affectedPlayer.GetName()));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else\n {\n Launch();\n }\n }\n else\n {\n Launch();\n }\n }", "abstract public void enter();", "public abstract boolean isGoal(CCState state);", "@Override\n\tpublic void decide() {\n\t\tif (this.isDead) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(this.age >= this.lifeSpan) {\n\t\t\t// DIE\n\t\t\tthis.environment.removeAgent(this.getPosX(), this.getPosY());\n\t\t\tthis.isDead = true;\n\n\t\t\t// Print if required\n\t\t\tif (this.appConfig.hasTrace()) {\n\t\t\t\tSystem.out.println(\"Agent;Death;Fish;\" + this.getPosX() + \";\" + this.getPosY());\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\tthis.age++;\n\t\tthis.color = Color.GREEN;\n\t\tboolean canFuck = this.breedTime == 0;\n\n\t\tint[] coordinates = this.chooseCoordinates();\n\n\t\t// fish cannot move or fuck because there is no place to do so\n\t\tif (coordinates == null) {\n\t\t\tthis.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.environment.moveAgent(this, coordinates[0], coordinates[1]);\n\n\t\t// Time to fuck-zer\n\t\tif (canFuck) {\n\t\t\tthis.fuck(this.getPosX(), this.getPosY());\n\t\t}\n\t\t// Update breedtime in order to wait the holy fuck time\n\t\telse {\n\t\t\tthis.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime;\n\t\t}\n\t\tthis.posX = coordinates[0];\n\t\tthis.posY = coordinates[1];\n\t}", "void state_REQState(){\r\n eccState = INDEX_REQState;\r\n alg_REQAlg();\r\n CNF.serviceEvent(this);\r\n state_START();\r\n}", "void evadeAttack(IUnit attacker, int incomingDamage);", "@Override\n\t\t\tpublic void action() {\n\t\t\t\tMessageTemplate cfpTemplate = MessageTemplate.MatchPerformative(ACLMessage.CFP);\n\t\t\t\tMessageTemplate informTemplate = MessageTemplate.MatchPerformative(ACLMessage.INFORM);\n\t\t\t\tMessageTemplate messageTemplate = MessageTemplate.or(cfpTemplate, informTemplate);\n\t\t\t\tACLMessage receivedMessage = myAgent.receive(messageTemplate);\n\t\t\t\t\n\t\t\t\tif (receivedMessage != null) {\n\t\t\t\t\thasReceivedMessage = true;\n\t\t\t\t\t\n\t\t\t\t\tif (receivedMessage.getPerformative() == ACLMessage.CFP) {\n\t\t\t\t\t\tdouble price = Double.parseDouble(receivedMessage.getContent());\n\t\t\t\t\t\tSystem.out.println(\"Buyer [\" + getAID().getLocalName() + \"] received \"\n\t\t\t\t\t\t\t\t+ \"CFP with price \" + Double.toString(price));\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Value in range; send proposal\n\t\t\t\t\t\tif (price <= priceToBuy) {\n\t\t\t\t\t\t\tACLMessage proposal = new ACLMessage(ACLMessage.PROPOSE);\n\t\t\t\t\t\t\tproposal.addReceiver(receivedMessage.getSender());\n\t\t\t\t\t\t\tproposal.setProtocol(receivedMessage.getProtocol());\n\t\t\t\t\t\t\tmyAgent.send(proposal);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttransitionStatus = sendProposal;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Price too high; refuse and wait for new CFP\n\t\t\t\t\t\t\tACLMessage refusal = new ACLMessage(ACLMessage.REFUSE);\n\t\t\t\t\t\t\trefusal.addReceiver(receivedMessage.getSender());\n\t\t\t\t\t\t\trefusal.setProtocol(receivedMessage.getProtocol());\n\t\t\t\t\t\t\tmyAgent.send(refusal);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttransitionStatus = highPrice;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (receivedMessage.getPerformative() == ACLMessage.INFORM) {\n\t\t\t\t\t\ttransitionStatus = noBuyers;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tblock();\n\t\t\t\t}\n\t\t\t}", "protected void acceptCandidateState() {\n\tpartialEnergy = candidatePartialEnergy;\n\n\t// sanity check\n\tif (candidateStateEnergy == 0.0) {\n\t throw new LoggedException(\"Attempting to set an invalid state.\");\n\t}\n\n\tcurrentStateEnergy = candidateStateEnergy;\n\t\n\t// stops any attempt to reuse this\n\tcandidatePartialEnergy = null;\n\t\n\tcandidateStateEnergy = 0.0;\n\t\n\tswapPoints(i,j);\n\t\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 }", "public static boolean caregiverThink(Domain d, State s) {\n\t\tObjectInstance caregiver = s.getObject(Names.OBJ_CAREGIVER);\n\t\tObjectClass goalClass = d.getObjectClass(Names.CLASS_GOAL);\n\t\tboolean arranged = false;\n\n\t\tObjectInstance myGoal = null;\n\n\t\t//If the old clothing is still at the changing table, it needs to be at the hamper\n\t\tif(!d.getPropFunction(Names.PROP_FIND).isTrue(s, new String[]{Names.OBJ_HAMPER, Names.OBJ_OLD_CLOTHES})) {\n\t\t\tmyGoal = new ObjectInstance(goalClass, Names.OBJ_OLD_CLOTHES + \":\" + Names.OBJ_HAMPER);\n\t\t\n\t\t//If the baby has a rash and the lotion is not at the changing table, the lotion needs to be at the changing table\n\t\t} else if(d.getPropFunction(Names.PROP_RASH).isTrue(s, new String[]{}) && !d.getPropFunction(Names.PROP_FIND).isTrue(s, new String[]{Names.OBJ_CHANGING_TABLE, Names.OBJ_OINTMENT})) {\n\t\t\tmyGoal = new ObjectInstance(goalClass, Names.OBJ_OINTMENT + \":\" + Names.OBJ_CHANGING_TABLE);\n\n\t\t//If the new clothes aren't at the changing table, they need to be at the changing table\n\t\t} else if(!d.getPropFunction(Names.PROP_FIND).isTrue(s, new String[]{Names.OBJ_CHANGING_TABLE, Names.OBJ_NEW_CLOTHES})) {\n\t\t\tmyGoal = new ObjectInstance(goalClass, Names.OBJ_NEW_CLOTHES + \":\" + Names.OBJ_CHANGING_TABLE);\n\n\t\t//Otherwise, the problem is solved\n\t\t} else {\n\t\t\tmyGoal = new ObjectInstance(goalClass, \"null\");\n\t\t\tarranged = true;\n\t\t}\n\n\t\tcaregiver.addRelationalTarget(Names.ATTR_MENTAL_STATE, myGoal.getName());\n\t\treturn arranged;\n\t}", "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 }", "static void healing_challenge3() { //this is where the player will be able to heal himself/herself in boss challenge\n System.out.println(\" You open up the bag to check your inventory...\");\n enter = next.nextLine();\n if(potions <= zero) {\n System.out.println(username + \" feels something in the bag...\");\n System.out.println(\"\\n\");\n System.out.println(\"There is a large object inside, but turns out to be your spell book\");\n enter = next.nextLine();\n System.out.println(\"UH! OH! You ran out of potions. GUESS YOUR ON YOUR OWN!!!\");\n System.out.println(\"\\n\");\n }else if(potions > zero && playerhealth != 3500) { //this makes sure their aren't any loop holes in the game for cheats\n System.out.println(username + \" found a potion in the bag.\");\n System.out.println(username + \" takes the new blue potion and consumes it entirely...\");\n System.out.println(username + \" gained 300 HP points.\");\n playerhealth = playerhealth + 300; //player's health is healed\n potions--;//put it like this, not potions = potions--; This would break the game...\n if(playerhealth > 3500){ //in case that player heals and adds 300 and health goes higher than maixmum\n playerhealth = 3500;\n }\n //in case if player tries to cheat with the maximum health\n }else if (playerhealth == 3500) {\n System.out.println(\"You are at your maximum health...You can't raise it any higher than that...\");\n System.out.println(\"NICE TRY!\");\n } \n }", "public void startFCombat() {\n\t\ttry { \n\t\t\tenemyName = Monster.getFBossName();\n\t\t\tSystem.out.println(\"\\t!#> \" + enemyName + \" has appeared! <#! \");\n\t\t\tenemyNewHealth = Monster.getFBossHealth();\n\n\t\t\t// While enemy is alive\n\t\t\tCOMBAT_START: while (enemyNewHealth > 0) {\n\t\t\t\tSystem.out.println(Player.getPlayerName() + \"\\n HP: \" + playerNewHealth + \" Stamina: \"\n\t\t\t\t\t\t+ Player.getPlayerStamina());\n\t\t\t\tSystem.out.println(\"----------------------------\");\n\t\t\t\tSystem.out.println(enemyName + \" HP: \" + enemyNewHealth);\n\n\t\t\t\tScanner in = new Scanner(System.in);\n\t\t\t\tSystem.out.println(\"\\n\\t # ACTIONS # \");\n\t\t\t\tSystem.out.println(\"\\t1.) Attack!\");\n\t\t\t\tSystem.out.println(\"\\t2.) Block!\");\n\t\t\t\tSystem.out.println(\"\\t3.) Run!\\n\");\n\t\t\t\tSystem.out.println(\"What are you going to do?\");\n\t\t\t\tint input = in.nextInt();\n\t\t\t\t// conditonal preventing other input\n\t\t\t\tif (input == 1 || input == 2 || input == 3) {\n\t\t\t\t\t// Attack\n\t\t\t\t\tif (input == 1) {\n\t\t\t\t\t\tenemySwing = rand.nextInt(Monster.getFBossAttack()+1);\n\t\t\t\t\t\thit = rand.nextInt(Player.Attack()+1);\n\t\t\t\t\t\tSystem.out.println(\"You lunge forward and strike the \" + enemyName + \"!!\");\n\t\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\t\t\t\t\t\tSystem.out.println(\"You dealt \" + hit + \" damage!\");\t\t\n\t\t\t\t\t\tSystem.out.println(enemyName + \" dealt \" + enemySwing + \" Damage!\");\n\t\t\t\t\t\tenemyNewHealth = enemyNewHealth - hit;\n\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\tif (playerNewHealth <= 0) {\n\t\t\t\t\t\t\tSystem.out.println(\"\\t!@#$%^ GAME OVER ^%$#@!\");\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (enemyNewHealth <= 0) {\n\t\t\t\t\t\t\tenemyNewHealth = 0;\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\"The \" + enemyName + \" has \" + enemyNewHealth + \" health left!\");\n\t\t\t\t\t\t\tcontinue COMBAT_START;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Block\n\t\t\t\t\tif (input == 2) {\n\t\t\t\t\t\tenemySwing = rand.nextInt(Monster.Attack());\n\t\t\t\t\t\tSystem.out.println(\"You attempt to cower behind your shield!\");\n\t\t\t\t\t\t// Block\n\t\t\t\t\t\tif (Player.Block() == true) {\n\t\t\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\n\t\t\t\t\t\t\tSystem.out.println(\"\\tBlock Successful!\");\n\t\t\t\t\t\t\tSystem.out.println(enemyName + \" trys to deal \" + enemySwing + \" damage!\");\n\t\t\t\t\t\t\t// how much is blocked\n\t\t\t\t\t\t\tenemySwing = enemySwing - rand.nextInt(Player.getPlayerMaxBlock());\n\t\t\t\t\t\t\t// if how much is blocked results neg make it 0\n\t\t\t\t\t\t\tif (enemySwing <= 0) {\n\t\t\t\t\t\t\t\tenemySwing = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// output results\n\t\t\t\t\t\t\tSystem.out.println(\"You took \" + enemySwing + \" damage\");\n\t\t\t\t\t\t\t// adjust health value\n\t\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(enemyName + \" dealt \" + enemySwing + \" damage!\");\n\t\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (playerNewHealth <= 0) {\n\t\t\t\t\t\t\tSystem.out.println(\"\\t!@#$%^ GAME OVER ^%$#@!\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue COMBAT_START;\n\n\t\t\t\t\t}\n\t\t\t\t\t// Run chance\n\t\t\t\t\tif (input == 3) {\n\t\t\t\t\t\tSystem.out.println(\"You attempt to flee!\");\n\t\t\t\t\t\t// roll to see if flee\n\t\t\t\t\t\tif (Player.Run() == true) {\n\t\t\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\t\t\t\t\t\t\tSystem.out.println(\"you've run away from the \" + enemyName + \"!\");\n\t\t\t\t\t\t\tbreak COMBAT_START;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tenemySwing = rand.nextInt(Monster.Attack());\n\t\t\t\t\t\t\tSystem.out.println(enemyName + \" dealt \" + enemySwing + \" Damage!\");\n\t\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\t\tcontinue COMBAT_START;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\\t!!!Invalid Input!!!\");\n\t\t\t\t\tSystem.out.println(\"\\tPlease try Again.\");\n\t\t\t\t}\n\n\t\t\t\t// When Enemy Dies.\n\t\t\t\t//TODO: add timeunit here\n\t\t\t\tif (enemyNewHealth <= 0) {\n\t\t\t\t\tSystem.out.println(\"You have defeated \" + enemyName + \"!!\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tYou have beaten my FIRST game ever.\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tThank you so fuckin' much for playing.\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tit means the W O R L D to me :)\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tIf you want to see more of my work,\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tfollow me on Twitter @Simons_saysNull\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\t\t\t\t\tSystem.out.println(\"\\tThanks again for playing my game. - Robb Simons\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue COMBAT_START;\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}" ]
[ "0.6256287", "0.592419", "0.58466864", "0.5737568", "0.5725186", "0.5717976", "0.5712651", "0.5649383", "0.5582351", "0.5555276", "0.5525043", "0.5523344", "0.5502297", "0.54701966", "0.54434407", "0.5439606", "0.54269016", "0.5397927", "0.53825295", "0.53672457", "0.535018", "0.5339157", "0.532755", "0.53232324", "0.53195626", "0.53004605", "0.5290233", "0.5283977", "0.5271737", "0.5258515", "0.52534133", "0.5250074", "0.5247763", "0.5245902", "0.5233927", "0.521547", "0.52090967", "0.5198401", "0.5196945", "0.51948524", "0.5187433", "0.5187113", "0.51735693", "0.51478696", "0.51436937", "0.5140542", "0.513885", "0.5134126", "0.51339567", "0.51313287", "0.5129374", "0.5127983", "0.5124363", "0.51230055", "0.511869", "0.5115897", "0.5112018", "0.51119894", "0.5106845", "0.5106384", "0.5104061", "0.5102502", "0.50999033", "0.50952643", "0.5091523", "0.508795", "0.5085357", "0.50829744", "0.5075366", "0.5074605", "0.50692856", "0.50651896", "0.5064388", "0.506114", "0.50598675", "0.50587136", "0.5058424", "0.5056325", "0.5053755", "0.50522757", "0.5049616", "0.50469905", "0.5044777", "0.5040991", "0.50402343", "0.50358844", "0.5035237", "0.5033456", "0.5028347", "0.5027628", "0.5022797", "0.50104004", "0.49966317", "0.49952063", "0.49951178", "0.4990291", "0.49888578", "0.49863508", "0.49793315", "0.49769494" ]
0.7431002
0
Removes death timer from timer list to prevent individual to death. Called in case of succesfully get into hospital.
public void dontDie() { timerList.remove(deathTimer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@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\r\n\tpublic void onDeath() {\n\t\ta.remove();\r\n\t}", "public void burry()\n\t{\n\t\tworld.death();\n\t\ttimerList.clear();\n\t\tif(hospitalNeed != null && hospitalNeed.isAlive())\n\t\t\thospitalNeed.interrupt();\n\t}", "private void eliminateDay() {\r\n\tdayElimTimer.cancel();\r\n\tdayElimTimer.purge();\r\n\r\n\t// playerIDs.remove(playerOnTrialID);\r\n\tplayers.remove(playerOnTrialID);\r\n\r\n\tif (mafia.contains(playerOnTrialID)) {\r\n\t int index = mafia.indexOf(playerOnTrialID);\r\n\t mafia.remove(index);\r\n\r\n\t} else {\r\n\t int index = innocentIDs.indexOf(playerOnTrialID);\r\n\t innocentIDs.remove(index);\r\n\t}\r\n\r\n\tserver.setPlayerMuted(playerOnTrialID, true);\r\n\r\n\tserver.publicMessage(server.getUsername(playerOnTrialID) + \" has been eliminated\");\r\n\r\n\tplayerOnTrialID = null;\r\n\telimDay.clear();\r\n\tsave.clear();\r\n\telimDayVoteInProgress = false;\r\n\r\n\tcheckWin();\r\n }", "public synchronized void postDeregister() {\n if (timer != null) {\n try {\n timer.cancel();\n } catch (Exception x) {\n if (LOG.isLoggable(Level.FINEST))\n LOG.log(Level.FINEST,\"Failed to cancel timer\",x);\n else if (LOG.isLoggable(Level.FINE))\n LOG.fine(\"Failed to cancel timer: \"+x);\n } finally {\n timer = null;\n }\n }\n }", "public void resetDeaths()\n {\n \tstats.put(deathsKey, 0);\n }", "protected void kill() {\n\t\tsetDeathTime(0.6);\n\t}", "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 }", "@Override\n protected void afterKill() {\n if (timeAfterDeath > 0) {\n --timeAfterDeath;\n } else {\n if (finalAnimation > 0) {\n --finalAnimation;\n } else {\n remove();\n }\n }\n }", "public void death(){\n World w = getWorld();\n Level l = (Level)w;\n if(l.getPlayersLives().getValue() > 0){\n l.removeLife();\n l.respawn();\n }\n else{\n if(l.getPlayersLives().getValue() == 0){\n Label text = new Label(\"You lose\",50);\n getWorld().addObject(text,(getWorld().getWidth()/2),(getWorld().getHeight()/2));\n l.addScore();\n Scoring st = new Scoring(l.getScore());\n Greenfoot.delay(50);\n Greenfoot.setWorld(st);\n }\n }\n getWorld().removeObject(this);\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 }", "@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)\n\tprivate void onDeath(PlayerDeathEvent event) {\n\t\t//don't remove from the map: allow callbacks to unregister each other\n\t\tList<RegisteredCallback> list = entries.get(event.getEntity());\n\t\tif(list == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//copy list: can get modified while iterating\n\t\tfor(RegisteredCallback callback : new ArrayList<>(list)) {\n\t\t\tif(!callback.active) {\n\t\t\t\tcontinue; //callbacks can unregister each other\n\t\t\t}\n\t\t\t\n\t\t\tcallback.timing.startTiming();\n\t\t\ttry {\n\t\t\t\tcallback.getCallback().onDeath(event.getEntity());\n\t\t\t} catch (Throwable t) {\n\t\t\t\tplugin.getLogger().log(Level.SEVERE, \"Error handling callback in \" + getClass().getSimpleName(), t);\n\t\t\t}\n\t\t\tcallback.timing.stopTiming();\n\t\t\ttryUnregister(event.getEntity(), callback);\n\t\t}\n\t\t\n\t\tlist = entries.remove(event.getEntity());\n\t\tif(list != null && !list.isEmpty()) {\n\t\t\tfor(RegisteredCallback callback : list) {\n\t\t\t\tplugin.getLogger().severe(getClass().getSimpleName()\n\t\t\t\t\t\t+ \" callback registered during player death: \" + callback.getCallback().getClass().getName());\n\t\t\t\tcallback.active = false;\n\t\t\t}\n\t\t}\n\t}", "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}", "public void stopAndRemove() {\n\t\tstartMoveDownTimer.stop();\n\t\tmoveDownTimer.stop();\n\t}", "private void deathRoom()\n {\n if(currentRoom.equals(deathRoom4))\n {\n alive = false;\n }\n }", "public void unsetTime()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(TIME$2, 0);\n }\n }", "public void death() {\n\t\t\tif (died==false) {\n\t\t\t\tlives-=1;\n\t\t\t\tdeathSound.play();//play the death sound\n\t\t\t\t\n\t\t\t}\n\t\t\tpauseGame(deathSound.getLength());//pause the game until the death sound is over\n\t\t\tif (lives==0) {//if you have no lives left, you died forever and the flag changes.\n\t\t\t\tdeath=true;\n\t\t\t}\n\t\t\tdied=true;\n\t\t}", "public void removeTimeObserver(TimeObserver observer);", "private void stop_announce_timer() {\n if (rprocesses == null) {\n return;\n }\n for (RoutingProcess rp : rprocesses.values()) {\n rp.stop_announce_timer();\n }\n }", "public void removeTime(int index) {\r\n\t\tthis.timeAvailable.remove(index);\r\n\t}", "public synchronized void removeLife()\n\t{\n\t\t--lives;\n\n\t\tif (lifeLostListener != null)\n\t\t\tlifeLostListener.onLifeLost();\n\t}", "private void removeTimeListeners()\n {\n myProcessorBuilder.getTimeManager().removeActiveTimeSpanChangeListener(myActiveTimeSpanChangeListener);\n myProcessorBuilder.getAnimationManager().removeAnimationChangeListener(myAnimationListener);\n myTimeAgnostic = true;\n }", "public void purgeTimeouts() {\n\t\ttimeoutSet = new LinkedList<Event>();\n\t}", "public void checkForRemoval()\n {\n if (life <= 0)\n {\n SideScrollingWorld world = (SideScrollingWorld) getWorld(); \n \n world.isPacmanDead = true;\n getWorld().removeObject(this);\n }\n }", "public void death(){\n\t}", "public void notAlive() {\n\n for (var i = ownedAnimals.size() - 1; i >= 0; i--) {\n if (ownedAnimals.get(i).healthPoints <= 0) {\n System.out.println(\"The \"\n + ownedAnimals.get(i).type\n + \" \" + ownedAnimals.get(i).animalName\n + \" died\");\n ownedAnimals.remove(i);\n\n\n }\n\n\n }\n }", "public final static void removeTimers (Timers timers ) { \n\t\tString key = getKey( timers.getId() ) ;\n\t\tcache.remove(key);\n\t}", "public static void updateTimers() {\n\t\tfor (NameAndCaller nac : clocks.keySet().toArray(EMPTY_NAMEANDCALLER_ARRAY)) {\n\t\t\tif (hasExpired(nac.getName(), nac.getCaller())) {\n\t\t\t\tTimeable t = nac.getCaller();\n\t\t\t\tt.handleTimer(nac.getName());\n\t\t\t\tcancel(nac.getName(), nac.getCaller());\n\t\t\t}\n\t\t}\n\t}", "private void cancelSchedule() {\n\n if (timer == null)\n return;\n // timer.cancel();\n }", "public void cancelTimers() {\n this.impressionTimer.cancel();\n this.autoDismissTimer.cancel();\n }", "public void stopTime() {\n if (isRunning) {\n timer.cancel();\n timer.purge();\n }\n isRunning = false;\n }", "public void stopTimer() {\n if (mHandler != null) {\n mHandler.removeCallbacks(mStatusChecker);\n }\n }", "private static void stopCleanUp() {\n\n if (isEventTrackerRunning && timer != null) {\n timer.cancel();\n timer.purge();\n debugLogger.info(\"Timer stopped: {}\", new Date());\n } else {\n debugLogger.info(\"Timer was already stopped : {}\", new Date());\n\n }\n isEventTrackerRunning = false;\n\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 }", "@Override\n\tpublic void onDestroy() {\n\t\ttimer.cancel();\n\t\tsuper.onDestroy();\n\t}", "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}", "private void dance() {\n\t\t// if they are done dancing, start sleeping\n\t\tif(danceDuration <= 0){\n\t\t\thive.dancingBees.remove(this);\n\t\t\tstate = \"SLEEPING\";\n\t\t}\n\t\telse{ // otherwise keep dancing and decrease duration of dance\n\t\t\tdanceDuration--;\n\t\t}\n\t}", "private void shutdownWatchListTimers()\r\n {\r\n debug(\"shutdownWatchListTimers() all timers\");\r\n // Null our our parser, It is not needed now.\r\n if (populateListVector == null)\r\n {\r\n return;\r\n }\r\n // Stop All of our timers.\r\n for (int i = 0; i < populateListVector.size(); i++)\r\n {\r\n PopulateWatchListTask task = (PopulateWatchListTask) populateListVector.elementAt(i);\r\n task.cancel();\r\n this.setStatusBar(\"WatchList [\" + tabPane.getTitleAt(i) + \"] - Stopped.\");\r\n debug(\"WatchList [\" + tabPane.getTitleAt(i) + \"] - Stopped.\");\r\n }\r\n // Clear all objects from the Timer List\r\n populateListVector.removeAllElements();\r\n populateListVector = null;\r\n // Signal the Garbage Collector to reclaim anything it may see neccessary\r\n System.gc();\r\n debug(\"shutdownWatchListTimers() all timers - complete\");\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}", "private void killBullet() {\r\n this.dead = true;\r\n }", "protected void setDeathTime(double deathtime){\n\t\tthis.death_time = deathtime;\n\t}", "public void addKill() {\n nDeaths++;\n }", "private void death(Player p) {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Player \"+p.getNumber()+\" died\");\r\n\t\tp.setDead(true);\r\n\t\tp.discardAllCardsNotPlayed();\r\n\t\t\r\n\t\t// Calculates death message\r\n\t\tString deathMessage = \"\";\r\n\t\tif (p.has(\"Artifact\")) {\r\n\t\t\tif (!p.isUnderground()) {\r\n\t\t\t\tdeathMessage = \"Fortunately, they had an artifact above ground so the villagers were able to recover the treasure\";\r\n\t\t\t} else {\r\n\t\t\t\tdeathMessage = \"They perished underground so all treasure was lost\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tdeathMessage = \"They perished without an artifact so all treasure was lost\";\r\n\t\t}\r\n\t\tgameChannel.sendMessage(\":skull: **\"+getName(p)+\"** died in the dungeon.\\n\"+deathMessage).queueAfter(dragonAttackingDelay+2000, TimeUnit.MILLISECONDS);\r\n\t\t\r\n\t\t// Commented out because should be handled by App's detection\r\n\t\t// If this player was currentPlayer, endTurn if not already\r\n//\t\tif (!checkIfGameIsOver() && currentPlayer.isDead() && !turnIsEnding) {\r\n//\t\t\tendTurn();\r\n//\t\t}\r\n\t}", "@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tstopTimer();\r\n\t}", "public void destroy() {\n\t\tif(timer!=null) {\n\t\t\ttimer.purge();\n\t\t\ttimer.cancel();\n\t\t}\n\t}", "void unsetSchedule();", "public void unsetBirthTime()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(BIRTHTIME$12, 0);\n }\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 }", "@Override\r\n\tpublic void onDeath() {\n\t\t\r\n\t}", "public final static void removeTimers ( Integer id ) {\n\t\tString key = getKey( id ) ;\n\t\tcache.remove(key);\n\t}", "public boolean checkDeath() {\r\n\t\tif (death) {\r\n\t\t\tdeath = false;\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 removeDead() {\n for (BaseObject object : new ArrayList<BaseObject>(bombs)) {\n if (!object.isAlive())\n bombs.remove(object);\n }\n\n for (BaseObject object : new ArrayList<BaseObject>(rockets)) {\n if (!object.isAlive())\n rockets.remove(object);\n }\n\n for (BaseObject object : new ArrayList<BaseObject>(ufos)) {\n if (!object.isAlive())\n ufos.remove(object);\n }\n }", "public void removeOrganDeceased(LocalDate dateOfDeath) {\n DonorReceiver account = accountManager.getAccountsByNHI(selectedRecord.getNhi()).get(0);\n TransplantWaitingList.removeOrganDeceased(selectedRecord, accountManager, dateOfDeath);\n PageNav.loadNewPage(PageNav.TRANSPLANTLIST);\n }", "public void deactivate () {\n\t\tif (_timer!=null) {\n\t\t\t_timer.cancel ();\n\t\t\t_timer.purge ();\n\t\t\t_timer = null;\n\t\t}\n\t}", "private void stopTime()\n {\n timer.stop();\n }", "@Override\n protected void onDeath(final Creature killer) {\n getDeathPenalty().checkCharmOfLuck();\n\n if (isInStoreMode()) {\n setPrivateStoreType(Player.STORE_PRIVATE_NONE);\n }\n if (isProcessingRequest()) {\n final Request request = getRequest();\n if (isInTrade()) {\n final Player partner = request.getOtherPlayer(this);\n sendPacket(SendTradeDone.FAIL);\n partner.sendPacket(SendTradeDone.FAIL);\n }\n request.cancel();\n }\n //cubicdata\n deleteCubics();\n deleteAgathion();\n\n boolean checkPvp = true;\n if (ServerConfig.ALLOW_CURSED_WEAPONS) {\n if (isCursedWeaponEquipped()) {\n CursedWeaponsManager.getInstance().dropPlayer(this);\n checkPvp = false;\n } else if (killer != null && killer.isPlayer() && killer.isCursedWeaponEquipped()) {\n CursedWeaponsManager.getInstance().increaseKills(((Player) killer).getCursedWeaponEquippedId());\n checkPvp = false;\n }\n }\n\n if (checkPvp) {\n doPKPVPManage(killer);\n\n altDeathPenalty(killer);\n }\n\n //And in the end of process notify death penalty that owner died :)\n getDeathPenalty().notifyDead(killer);\n\n setIncreasedForce(0);\n\n if (isInParty() && getParty().isInReflection() && getParty().getReflection() instanceof DimensionalRift) {\n ((DimensionalRift) getParty().getReflection()).memberDead(this);\n }\n\n stopWaterTask();\n stopMountFeedTask();\n\n if (!isSalvation() && isOnSiegeField() && isCharmOfCourage()) {\n ask(new ConfirmDlg(SystemMsg.YOUR_CHARM_OF_COURAGE_IS_TRYING_TO_RESURRECT_YOU, 60000), new ReviveAnswerListener(this, 100, false, 60000));\n setCharmOfCourage(false);\n }\n\n if (AllSettingsConfig.AltKillAnnounce && killer != null && killer.isPlayer())\n AnnouncementUtils.announceToAll(killer.getName() + \" убил игрока \" + getName() + \"!\");\n\n super.onDeath(killer);\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 die() {\n if (dayCountDown == 0) {\n new Holdable(getLocation()).init();\n }\n }", "@Override\n\tprotected void onDeathUpdate() {\n\t\thelpers.values().forEach(DragonHelper::onDeathUpdate);\n\n\t\t// unmount any riding entities\n\t\tremovePassengers();\n\n\t\t// freeze at place\n\t\tmotionX = motionY = motionZ = 0;\n\t\trotationYaw = prevRotationYaw;\n\t\trotationYawHead = prevRotationYawHead;\n\n\t\tif (isEgg()) {\n\t\t\tsetDead();\n\t\t} else {\n\t\t\t// actually delete entity after the time is up\n\t\t\tif (deathTime >= getMaxDeathTime()) {\n\t\t\t\tsetDead();\n\t\t\t}\n\t\t}\n\n\t\tdeathTime++;\n\t}", "private void Dead() {\n\t\thunger -= 5;\n\t\tthirst -= 5;\n\t\tif ((thirst < 25) && (hunger < 25)){\t\t\t// Player is very weak\n\t\t\thealth -= 15;\n\t\t}else if ((thirst < 25) || (hunger < 25)){\t\t// Player is kinda weak\n\t\t\thealth -= 5;\n\t\t}\n\t\tif (health <= 0){\t\t\t\t\t\t\t\t// Player is dead\n\t\t\taddMessage(\"Overcome by your weakness you succumb.\", \"AI\");\n\t \t\taddMessage(\"You have died\", \"AI\");\n\t \t\tmenu = MENU.GAME_OVER;\n\t\t}\n\t}", "public boolean shouldRemove() {\r\n\t\treturn death;\r\n\t}", "public void removeTiming(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(TIMING$2, i);\r\n }\r\n }", "public synchronized void Kill() {\n\t dieDieDie = true;\n\t}", "public synchronized void Kill() {\n\t dieDieDie = true;\n\t}", "@Override\n protected void onDestroy() {\n mTimer.removeMessages(0);//메시지를 지워서 메모리릭 방지\n super.onDestroy();\n }", "private void cancelTimer() {\n Timer.cancelTimeout(this);\n responded = true;\n }", "private void worldTimerDecrementer() {\n worldTimer--;\n }", "public void removeTimeObserver(TimeObserver t) {\r\n\t\tif (observers.contains(t)) {\r\n\t\t\tobservers.remove(t);\r\n\t\t}\r\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tif (timerTask!=null) {\n\t\t\ttimerTask.cancel();\n\t\t\ttimerTask = null;\n\t\t}\n\t\t\n\t\tif (timer!=null) {\n\t\t\ttimer.cancel(); \n\t\t\ttimer = null;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tsuper.onDestroy();\n\t}", "public boolean deathTick(Game game) {\n\t\treturn false;\n\t}", "public static void stopTimer() {\n timerIsWorking = false;\r\n elapsedTime = 0;\r\n }", "public void decreaseLife() {\n this.terminate();\n }", "public void removeDeadHero(Hero h) {\r\n if (h.isDead()) {\r\n team.remove(h);\r\n }\r\n }", "private void removeDestroyedObjects ()\n {\n Collection<Asteroid> newAsteroids = new ArrayList<>(this.game.getAsteroids().size() * 2); // Avoid reallocation and assume every asteroid spawns successors.\n this.game.getAsteroids().forEach(asteroid -> {\n if (asteroid.isDestroyed()) {\n this.increaseScore();\n newAsteroids.addAll(asteroid.getSuccessors());\n }\n });\n this.game.getAsteroids().addAll(newAsteroids);\n // Remove all asteroids that are destroyed.\n this.game.getAsteroids().removeIf(GameObject::isDestroyed);\n // Remove any bullets that are destroyed.\n this.game.getBullets().removeIf(GameObject::isDestroyed);\n }", "@Override\n public void clear()\n {\n super.clear();\n \n /*\n * we handle the aborting timed events here so that it\n * doesn't occur in the write lock which could result\n * in deadlock since the events might have locks of their own\n */\n Collection<ITimedEvent> events = Collections.emptyList();\n try\n {\n getLock().readLock().lock();\n if (_pendingTimedEvents.size() != 0)\n events = new ArrayList<ITimedEvent>(_pendingTimedEvents);\n }\n finally\n {\n getLock().readLock().unlock();\n }\n \n for (ITimedEvent element : events)\n element.abort();\n \n }", "public void kill() {\r\n \t\tthis.isDead = true;\r\n \t}", "public void removePawn() {\n lives = 0;\n }", "public void deactivateInterArrivalTimeTally() {\n\t\tthis._interArrivalTimeActivated = false;\n\t}", "public void exitHospital()\n\t{\n\t\tworld.getHospital().dischargeIndividual();\n\t\tworld.dischargedIndividual();\n\t}", "public void stopTimer() {\n\t\trunFlag = false;\n\t\tses.shutdown();\n\t\tSystem.err.println(\"TIMER SHUTDOWN\");\n\t\tinstance = null;\n\t}", "public void removeServletTimer(ServletTimer servletTimer){\r\n \t\tservletTimers.remove(servletTimer);\r\n \t\tupdateReadyToInvalidateState();\r\n \t}", "public void blackout(TimePeriod t) {\n\t\t\n\t}", "@Override\n public void Die() {\n this.setAlive(false);\n }", "protected void stopTimeTask() {\n\t\tif (chatAsyncTask!=null) {\n\t\t\tchatAsyncTask.cancel(true);\n\t\t}\n\t\t\n\t\tif (liveAsyncTask!=null) {\n\t\t\tliveAsyncTask.cancel(true);\n\t\t}\n\t\t\n\t\tif (timerTask!=null) {\n\t\t\ttimerTask.cancel();\n\t\t\ttimerTask = null;\n\t\t}\n\t\t\n\t\tif (timer!=null) {\n\t\t\ttimer.cancel();\n\t\t\ttimer = null;\n\t\t}\n\t\t\n\t\t\n\t}", "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}", "void unsetRaceList();", "void unsetTimeInterval();", "private void onResponseTimerTick()\r\n {\r\n EneterTrace aTrace = EneterTrace.entering();\r\n try\r\n {\r\n cleanAfterConnection(true, true);\r\n }\r\n finally\r\n {\r\n EneterTrace.leaving(aTrace);\r\n }\r\n }", "public void\nstopTimer() {\n\t\n\tSystemDesign.logInfo(\"MetroParams.stopTimer: Killing annealing timer.\");\n\t\n\tif (metroTimer_ != null) {\n metroTimer_.stopPlease();\n\t metroTimer_ = null;\n }\n\tmetroThread_ = null;\n}", "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 unsetUseTimings()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(USETIMINGS$22);\n }\n }", "protected static void deleteTimedOutSessions() {\r\n Enumeration userLogins = activeUserLogins.keys();\r\n\r\n while (userLogins.hasMoreElements()) {\r\n long now = System.currentTimeMillis();\r\n String thisKey = (String)userLogins.nextElement();\r\n Login thisLogin = activeUserLogins.get(thisKey);\r\n if ((thisLogin.getTimeout() > 0) &&\r\n (now > (thisLogin.getLastAccessed().getTime() + thisLogin.getTimeout()))) {\r\n log.debug(\"Logging \" + thisLogin.getUserId() + \" out\");\r\n logout(thisKey);\r\n\r\n }\r\n }\r\n }", "public void removeAllTime() {\r\n\t\tBase.removeAll(this.model, this.getResource(), TIME);\r\n\t}", "public void removePendingTimeout() {\n if (logger.isTraceEnabled()) {\n logger.trace(\"Remove expired timeout event\");\n }\n try {\n queueLock.lock();\n if (pendingResponseEvents != null && !pendingResponseEvents.isEmpty()) {\n for (Iterator<Event> iterator = pendingResponseEvents.iterator(); iterator\n .hasNext();) {\n Event pendingEvent = iterator.next();\n if (pendingEvent instanceof TimeoutEvent) {\n iterator.remove();\n if (logger.isTraceEnabled()) {\n logger.trace(\"Expired timeout event: {} was removed from the context\",\n pendingEvent.getId());\n }\n break;\n }\n }\n }\n } finally {\n queueLock.unlock();\n }\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}", "private void deleteAttacks(){\n while(!attacksToDelete.isEmpty()){\n attacks.remove(attacksToDelete.remove());\n }\n }", "@Override\r\n\tpublic void onDeath() {\n\r\n\t}", "public void decLives()\n\t{\n\t\tlives--;\n\t\tshipSpawned = false;\t\n\t\tif(lives <= 0)\n\t\t{\n\t\t\tSystem.out.println(\"Game over\");\n\t\t\tif(isSound() && !isPaused())\n\t\t\t\tdeath.play();\n\t\t\tsetGameOver(true);\n\t\t\tnotifyObservers();\n\t\t\treturn;\n\t\t}\n\t\tthis.addPlayerShip();\n\t}", "private void unscheduleSlice() {\n nextSliceRunTime = Double.MAX_VALUE;\n timer.cancel();\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}" ]
[ "0.65099543", "0.64018655", "0.6285464", "0.6265112", "0.6262794", "0.6198268", "0.6184677", "0.615131", "0.6118025", "0.61076564", "0.595637", "0.59161884", "0.5912129", "0.5839179", "0.5797022", "0.57764655", "0.57447565", "0.57440674", "0.5720181", "0.5715429", "0.5696304", "0.5687628", "0.5685548", "0.56740236", "0.5673035", "0.56327486", "0.56279904", "0.56208086", "0.5612367", "0.56002766", "0.5594221", "0.5592053", "0.5580411", "0.5563567", "0.5551743", "0.55283785", "0.55175036", "0.5512042", "0.55024177", "0.54946953", "0.5478506", "0.5474926", "0.54731774", "0.5469814", "0.5458634", "0.5453196", "0.5453134", "0.5446344", "0.5445997", "0.54369265", "0.5428573", "0.5427198", "0.54224414", "0.54207677", "0.5417177", "0.54067165", "0.53989905", "0.5392906", "0.53820574", "0.5376027", "0.5372802", "0.5365616", "0.536315", "0.536315", "0.536078", "0.53590614", "0.53578234", "0.53501654", "0.53454465", "0.53394294", "0.53350514", "0.5334081", "0.5326625", "0.5323781", "0.5320598", "0.53176785", "0.5315637", "0.53128046", "0.53051364", "0.53020513", "0.5301032", "0.5299039", "0.52970827", "0.529232", "0.52919126", "0.52900195", "0.52852273", "0.52844584", "0.5283807", "0.5282666", "0.52794564", "0.5273749", "0.5267747", "0.52627397", "0.52603", "0.52524376", "0.52433765", "0.524292", "0.5225873", "0.5224101" ]
0.79325736
0
When individual is healed, it discharge from hospital to open place for other individuals. Also a user can get into hospital which is already dead. It immediately call that function to open place for already living individuals.
public void exitHospital() { world.getHospital().dischargeIndividual(); world.dischargedIndividual(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void goHospital()\n\t{\n\t\tsynchronized (this) {\n\t\tworld.hospitalizedIndividual();\n\t\tcurrentState.goHospital();\n\t\t}\n\t}", "void financialDistrict() {\n location = \"financialDistrict\";\n\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\n////// FINANCIAL DISTRICT //////\");\n System.out.println(\"\\nYou have entered the Financial District!\");\n System.out.println(\"People are everywhere, traffic is busy. The buildings are high, great for swinging!\");\n\n //Ask user if they want to explore financial district or go back to base\n System.out.println(\"Please enter [1] if you would like explore | Enter [2] if you would like to go back to base: \");\n userSwings = input.nextInt();\n\n if (userSwings == 1) {\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\nYour spider-sense goes off!!\");\n System.out.println(\"You hear sirens, it sounds like a crime!\");\n\n System.out.println(\"Do you wish to help? Enter 'yes' or 'no\");\n String userChoice = input.nextLine();\n userChoice = input.nextLine();\n\n //If user wishes to fight crime, run a crime method within the crime class\n if (userChoice.equals(\"yes\")) {\n c.kidnap();\n avengersTower();\n } else if (userChoice.equals(\"no\")) {\n avengersTower();\n }\n } else if (userSwings == 2) {\n avengersTower();\n } else {\n System.out.println(\"Please enter either 1 or 2!!\");\n financialDistrict();\n }\n }", "public void breath() {\n\t\tif (alive) {\n\t\t\t_age++;\n\t\t\t// Respiration process\n\t\t\tboolean canBreath = useEnergy(Math.min((_mass - _lowmaintenance) / Utils.SEGMENT_COST_DIVISOR, _energy));\n\t\t\tif ((_age >> 8) > _geneticCode.getMaxAge() || !canBreath) {\n\t\t\t\t// It's dead, but still may have energy\n\t\t\t\tdie(null);\n\t\t\t} else {\n\t\t\t\tif (_energy <= Utils.tol) {\n\t\t\t\t\talive = false;\n\t\t\t\t\t_world.decreasePopulation();\n\t\t\t\t\t_world.organismHasDied(this, null);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// The corpse slowly decays\n\t\t\tuseEnergy(Math.min(_energy, Utils.DECAY_ENERGY));\n\t\t}\n\t}", "void onDemandAsked(Vehicule newDemand);", "public void enterRoom(Person p) {\n if (p.poisoned) {\n System.out.println(\"The poison eats away at you. You take 5 damage.\");\n p.hp -= 5;\n System.out.println(\"You now have \" + p.hp + \"health\");\n if (p.hp <= 0) {\n\n gameOff();\n }\n }\n occupant = p;\n p.setxLoc(this.xLoc);\n p.setyLoc(this.yLoc);\n Scanner n = new Scanner(System.in);\n\n if (!m.sleep) {\n if (m.alive) {\n System.out.println(\"There's a monster in the room!\");\n } else {\n System.out.println(\"The monster's remains lies before you.\");\n }\n m.aggro = true;\n while (m.alive && m.aggro) {\n if (m.hp <= 0) {\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n }\n int damage = m.counterAttack(p);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n if (p.hp <= 0) {\n System.out.println(\"You died. No one knows you died.\");\n Runner.gameOff();\n }\n System.out.println(\"You have \" + p.hp + \" health.\");\n System.out.println(\"What do you do now? (Fight, Run)\");\n String re = n.nextLine();\n if (re.equalsIgnoreCase(\"run\")) {\n damage = (int) (m.counterAttack(p) / p.dex);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n m.aggro = false;\n }\n if (re.equalsIgnoreCase(\"Fight\")) {\n double dam = (p.str + p.str * Math.random()) / (m.resist + 1);\n\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \"damage.\");\n if (m.hp <= 0) {\n m.alive = false;\n System.out.println(\"The monster howls as you deal a finishing blow.\");\n int g = m.dropGold();\n System.out.println(\"You gain \" + p.gold + \" Gold\");\n p.gold += g;\n m.threat = false;\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n }\n }\n }\n if (m.alive) {\n if (m.sleep) {\n System.out.println(\"You find a sleeping monster. Do you attack it? (Y/N)\");\n\n String q = n.nextLine();\n if (q.equalsIgnoreCase(\"yes\") || q.equalsIgnoreCase(\"y\")) {\n\n double dam = p.str * (1.5) + p.str * Math.random();\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \" damage.\");\n m.aggro = true;\n if (m.hp <= 0) {\n System.out.println(\"The monster dies on the spot. Who's the real monster here?\");\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \" Gold\");\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n while (m.alive && m.aggro) {\n if (m.hp <= 0) {\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \"Gold\");\n }\n int damage = m.counterAttack(p);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n if (p.hp <= 0) {\n System.out.println(\"You died. Serves you right for hitting a sleeping monster.\");\n Runner.gameOff();\n }\n System.out.println(\"You have \" + p.hp + \" health.\");\n System.out.println(\"What do you do now? (Fight, Run)\");\n q = n.nextLine();\n if (q.equalsIgnoreCase(\"run\")) {\n damage = (m.counterAttack(p) / p.dex);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n m.aggro = false;\n }\n if (q.equalsIgnoreCase(\"Fight\")) {\n dam = (p.str + p.str * Math.random()) / (m.resist + 1);\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \"damage.\");\n if (m.hp <= 0) {\n m.alive = false;\n System.out.println(\"The monster howls as you deal a finishing blow.\");\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \" Gold\");\n m.threat = false;\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n }\n\n }\n } else {\n System.out.println(\"You let the sleeping monster be.\");\n m.threat = false;\n n.close();\n }\n\n }\n }\n else\n {\n System.out.println(\"The monster's remains are still here.\");\n }\n }", "private void handleRaiseFund()\n {\n\n Doctor selectedDoctor = selectDoctor(); // will be null if the doctor is occupied\n\n // TODO:\n // step 1. check to see if selectedDoctor is occupied, if the selectedDoctor is occupied, add the string\n // \"Please select a unoccupied doctor.\\n\" to the printResult ArrayList and output the ArrayList to the log\n // window by calling updateListViewLogWindow(), and then return from this method\n // step 2. if the selectedDoctor is not occupied,\n // a. use the doctor object to call raiseFund(), add the returned value to the money of the human\n // player using humanPlayer.collectMoney()\n // b. end the turn for the selectedDoctor\n // c. add the string selectedDoctor.getName() + \" raises \"+fundAmount+\" successfully.\\n\" to\n // printResult where fundAmount is the amount returned by raiseFund() in step 2a\n // d. output the printResult by updateListViewLogWindow()\n // e. now after the selecteddoctor raised the fund, the money of the player is changed, and also the\n // status of the selectedDoctor is also changed (from unoccupied to occupied). So we need to update\n // the display in UI to reflect the changes. To do that we call updateHumanPlayerMoney() and\n // updateListViewDoctorItems()\n // f. set listViewSelectedDoctor to null, this is a string holding all the name, specialty, skill level,\n // salary etc information of the doctor being selected to raise fund. The selectDoctor()\n // method extract the name to search for the doctor object from the doctors list of the player.\n // WE ASSUME DOCTOR NAMES ARE UNIQUE, if this is not the case, selectDoctor() will not work correctly\n if(selectedDoctor == null){ //1\n printResult.add(\"Please select a unoccupied doctor.\\n\");\n updateListViewLogWindow();\n return;\n }\n int fundAmount = selectedDoctor.raiseFund();//a\n humanPlayer.collectMoney(fundAmount);\n selectedDoctor.endTurn();//b\n printResult.add(selectedDoctor.getName() + \" raises \"+fundAmount+\" successfully.\\n\");//c\n updateListViewLogWindow();//d\n updateHumanPlayerMoney();//e\n updateListViewDoctorItems();\n listViewSelectedDoctor = null;//f\n }", "@Override\n\tpublic void landedOn() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(300);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 300 dollars by landing on Bonus Square\");\n\t\tMonopolyGameController.allowCurrentPlayerToEndTurn();\n\n\t}", "public void fundClosed(int time, int yourRevenue, int partnerRevenue) {\n /* Do nothing */\n }", "public abstract void fight(Individual otherIndividual);", "@Override\r\n public void fromFearToChase() {\r\n if (afraid()) {\r\n startChase();\r\n }\r\n }", "public void burry()\n\t{\n\t\tworld.death();\n\t\ttimerList.clear();\n\t\tif(hospitalNeed != null && hospitalNeed.isAlive())\n\t\t\thospitalNeed.interrupt();\n\t}", "public void discharge() {\n\t\tstate = loanState.DISCHARGED; //changed 'StAtE' to 'state' and lOaN_sTaTe.DISCHARGED to loanState.DISCHARGED\r\n\t}", "void setVillage(Village aVillage) {\n/* 380 */ MineDoorPermission md = MineDoorPermission.getPermission(this.tilex, this.tiley);\n/* 381 */ if (this.village == null || !this.village.equals(aVillage)) {\n/* */ \n/* 383 */ if (this.doors != null)\n/* */ {\n/* 385 */ for (Door door : this.doors) {\n/* */ \n/* 387 */ if (door instanceof FenceGate) {\n/* */ \n/* 389 */ if (aVillage != null) {\n/* 390 */ aVillage.addGate((FenceGate)door); continue;\n/* 391 */ } if (this.village != null)\n/* 392 */ this.village.removeGate((FenceGate)door); \n/* */ } \n/* */ } \n/* */ }\n/* 396 */ if (md != null)\n/* */ {\n/* 398 */ if (aVillage != null) {\n/* 399 */ aVillage.addMineDoor(md);\n/* 400 */ } else if (this.village != null) {\n/* 401 */ this.village.removeMineDoor(md);\n/* */ } } \n/* 403 */ if (this.creatures != null)\n/* */ {\n/* 405 */ for (Creature c : this.creatures) {\n/* */ \n/* 407 */ c.setCurrentVillage(aVillage);\n/* 408 */ if (c.isWagoner() && aVillage == null) {\n/* */ \n/* 410 */ Wagoner wagoner = c.getWagoner();\n/* 411 */ if (wagoner != null)\n/* 412 */ wagoner.clrVillage(); \n/* */ } \n/* 414 */ if (c.isNpcTrader() && c.getCitizenVillage() == null) {\n/* */ \n/* 416 */ Shop s = Economy.getEconomy().getShop(c);\n/* 417 */ if (s.getOwnerId() == -10L) {\n/* */ \n/* 419 */ if (aVillage != null) {\n/* */ \n/* */ \n/* */ try {\n/* 423 */ logger.log(Level.INFO, \"Adding \" + c.getName() + \" as citizen to \" + aVillage.getName());\n/* 424 */ aVillage.addCitizen(c, aVillage.getRoleForStatus((byte)3));\n/* */ }\n/* 426 */ catch (IOException iox) {\n/* */ \n/* 428 */ logger.log(Level.INFO, iox.getMessage());\n/* */ }\n/* 430 */ catch (NoSuchRoleException nsx) {\n/* */ \n/* 432 */ logger.log(Level.INFO, nsx.getMessage());\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ continue;\n/* */ } \n/* */ \n/* */ \n/* 441 */ c.setCitizenVillage(null);\n/* */ } \n/* */ } \n/* */ } \n/* */ }\n/* */ \n/* 447 */ if (this.vitems != null)\n/* */ {\n/* 449 */ for (Item i : this.vitems.getAllItemsAsSet()) {\n/* */ \n/* 451 */ if (i.getTemplateId() == 757) {\n/* */ \n/* 453 */ if (aVillage != null) {\n/* 454 */ aVillage.addBarrel(i); continue;\n/* 455 */ } if (this.village != null)\n/* 456 */ this.village.removeBarrel(i); continue;\n/* */ } \n/* 458 */ if (i.getTemplateId() == 1112) {\n/* */ \n/* 460 */ if (aVillage != null) {\n/* */ \n/* 462 */ Node node = Routes.getNode(i.getWurmId());\n/* 463 */ if (node != null)\n/* 464 */ node.setVillage(aVillage); continue;\n/* */ } \n/* 466 */ if (this.village != null) {\n/* */ \n/* 468 */ Node node = Routes.getNode(i.getWurmId());\n/* 469 */ if (node != null)\n/* 470 */ node.setVillage(null); \n/* */ } \n/* */ } \n/* */ } \n/* */ }\n/* 475 */ this.village = aVillage;\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 480 */ if (this.doors != null)\n/* */ {\n/* 482 */ for (Door door : this.doors) {\n/* */ \n/* 484 */ if (door instanceof FenceGate)\n/* 485 */ aVillage.addGate((FenceGate)door); \n/* */ } \n/* */ }\n/* 488 */ if (md != null)\n/* */ {\n/* 490 */ aVillage.addMineDoor(md);\n/* */ }\n/* */ } \n/* */ }", "public void openDoor() {\n\t\tSystem.out.println(\"The spaceship door has opened.\");\n\t\tSpaceship sp = getTheSpaceship();\n\t\tArrayList<GameObject> remove = new ArrayList<GameObject>();\n\t\tfor(GameObject object : gameObject) {\n\t\t\tif(object instanceof Opponents) {\n\t\t\t\tOpponents o = (Opponents) object;\n\t\t\t\tdouble x = Math.abs(sp.getLocation().getX() - o.getLocation().getX());\n\t\t\t\tdouble y = Math.abs(sp.getLocation().getY() - o.getLocation().getY());\n\t\t\t\tif(x >= 0 && x <= sp.getSize() && y >= 0 && y <= sp.getSize()) {\n\t\t\t\t\trescueAnObject(object);\n\t\t\t\t\tremove.add(object);\n\t\t\t\t\tSystem.out.println(\"You've rescued a \" + object);\n\t\t\t\t}\n\t\t\t}\n\t}\n\t\t/* Concurrency issue with for each loop, created delete ArrayList<GameObject>.\n\t\t * and remove after.\n\t\t */\n\t\tfor(GameObject object : remove)\n\t\t\tgameObject.remove(object);\n\t}", "private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}", "void unlockDoor() {\n }", "void dischargePatient(int id);", "private void haveFun() {\n\t\tint action = inputPrompt.funActivities(money);\r\n\t\tthis.money -= action;\r\n\t\t//has better effect depending on how much money you have spent\r\n\t\tthis.mentalHealth += FUNHEALTH + action;\r\n\t\tdailyTime--;\r\n\t\tinputPrompt.mainInfo(energy, physHealth, mentalHealth, money);\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void personalLoanInterest() {\n\t\t\r\n\t}", "public void iDoor(){ // is it because of void we don't need return method\n\t\tint numDoor=4;\n\t}", "@Override\n protected void defend(Territory attacker, double soldiersAttacking){\n // Example of a defending strategy: if the attacker is my subordinate, and attacks me with\n // more soldiers than my stock, then I will surender. Otherwise, attack will all soldiers\n if(myTerritory.getSubordinates().contains(attacker) && soldiersAttacking > myTerritory.getSoldiers()){\n defendingSoldiers = 0;\n }\n else defendingSoldiers = (myTerritory.getSoldiers())*3/4;\n }", "void defendAttack(IUnit attacker, int incomingDamage);", "private void checkIfRestaurantShouldOpen(CityTime time) {\n\t\tif (!(CityTime.timeDifference(time, morningShiftStart) >= 0 && CityTime.timeDifference(time, morningShiftEnd) < 0) &&\n\t\t\t\t!(CityTime.timeDifference(time, afternoonShiftStart) >= 0 && CityTime.timeDifference(time, closingTime) < 0)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (host.getPerson() != null && cashier.getPerson() != null && cook.getPerson() != null) {\n\t\t\tfor (RestaurantWaiterRole w : waiters) {\n\t\t\t\tif (w.getPerson() != null) {\n\t\t\t\t\tAlertLog.getInstance().logMessage(AlertTag.RESTAURANT, this.toString(), \"Open for business!\");\n\t\t\t\t\tthis.isOpen = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void checkin() {\r\n\t\tif (admittedinterns < 20) {\r\n\t\t\tDoctorManage();\r\n\t\t\taddinterns(1);\r\n\t\t\tScreentocharge();\r\n\t\t} else {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Por el dia no se admiten mas pacientes\");\r\n\t\t\t\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void doAction(MedcivGame game) {\n\t\ttry {\r\n\t\t\t((Livestock)game.matchingVillager(ownerId).getItemById(targetId)).setTendedToThisTurn(true);\r\n\t\t}catch(NullPointerException e) {\r\n\t\t\t//do nothing; the cow is dead, or you are\r\n\t\t}\r\n\t}", "private void bringToLife(){\n this.dead = false;\n }", "void noNewLoans();", "@Override\n\tpublic void rent() {\n\t\tcontactLandlord();\n\t\tli.rent();\n\t\tchargeAgency();\n\t}", "private final void maintain(){\n\t\tif(host.getStrength()>MAINTENANCE_COST){\n\t\t\thost.expend(MAINTENANCE_COST);\n\t\t}\n\t\telse{\n\t\t\tkill();\n\t\t}\n\t}", "private void selfHeal() {\n\t\t\n\t\t//IF the Droid is carrying an item...\n\t\tif (this.getItemCarried() != null){\n\t\t\t\n\t\t\t//If the item is an oil can...\n\t\t\tif (this.getItemCarried().getShortDescription() == \"an oil can\" ) {\n\t\t\t\n\t\t\t\t//If the Droids health is LOWER than half...\n\t\t\t\tif((this.getInitialHP()/2) > this.getHitpoints()) {\n\t\t\t\t\tsay(this.getShortDescription() + \" is at or below half HP. \"\n\t\t\t\t\t\t\t+ \" Healing itself...\");\n\t\t\t\t\t\n\t\t\t\t\t//Implementing a new HealDroid method (Droid heals on itself)\n\t\t\t\t\t//public HealDroid(SWEntityInterface theTarget, MessageRenderer m) {\n\t\t\t\t\tHealDroid droidHeal = new HealDroid(this, messageRenderer);\n\t\t\t\t\t\n\t\t\t\t\tscheduler.schedule(droidHeal, this, 1);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "private void functionalInterface1() {\n\t\tcharmander.heal();\n\n\t\tPokedex.printData(Arrays.asList(charmander));\n\n\t\tguilherme.powerUp(charmander, new BigDecimal(\"-10\"), psMinimalDamage); // -10\n\n\t\tPokedex.printData(Arrays.asList(charmander));\n\n\t\tguilherme.powerUp(charmander, new BigDecimal(\"-10\"), psHugeDamage); // -20\n\n\t\tPokedex.printData(Arrays.asList(charmander));\n\t}", "void hit(GameObject o){\r\n\t\tif (!shield){ // if sheild is on all hits do nothing\r\n\t\t\tif (!(o instanceof UpPower)){ // if didnt hit a power up the ship loses a life\r\n\t\t\t\tif (lives > 1) {\r\n\t\t\t\t\tlives--;\r\n\t\t\t\t\treset();\r\n\t\t\t\t}\r\n\t\t\t\telse { // once there is no life left the ship dies\r\n\t\t\t\t\tdead = true;\r\n\t\t\t\t\tlives--;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "@Override\n\tpublic void enterMain() {\n\t\tIsland island = game.getCurrentLocation();\n\t\tif (game.checkAccessibleIsland(island)) \n\t\t{\n\t\t\tboolean state = false;\n\t\t\twhile (state == false) {\n\t\t\t\tArrayList<Island> islands = game.getAvailableIslands();\n\t\t\t\tSystem.out.println(\"Your current money: \" + game.getMoney()+ \" coins.\");\n\t\t\t\tSystem.out.println(\"You have : \" + game.getRemainingDays() + \" days left.\");\n\t\t\t\tIsland currentLoc = game.getCurrentLocation();\n\t\t\t\tString islandName = currentLoc.getIslandName();\n\t\t\t\tSystem.out.println(\"Your current location is: \" + islandName + \" Island.\" + \"\\n\");\n\t\t\t\tSystem.out.println(\"What do you want to do? \");\n\t\t\t\tSystem.out.println(\"(1) See ship's specification\");\n\t\t\t\tSystem.out.println(\"(2) Go to other Island\");\n\t\t\t\tSystem.out.println(\"(3) Go to store in your current location\");\n\t\t\t\tSystem.out.println(\"(4) End game\");\n\t\t\t\ttry {\n\t\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\t\tif (selectedAction <= 4 && selectedAction > 0) {\n\t\t\t\t\t\tstate = true;\n\t\t\t\t\t\tif (selectedAction == 1) {\n\t\t\t\t\t\t\tgame.seeShipSpec();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (selectedAction == 2) {\n\t\t\t\t\t\t\tprintAvailableIslands(islands);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (selectedAction == 3) {\n\t\t\t\t\t\t\tgame.goToStore();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tgame.gameOver(\"You ended the game\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\t\tscanner.nextLine();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tboolean state = false;\n\t\t\twhile (state == false)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Your current money: \" + game.getMoney()+ \" coins.\");\n\t\t\t\tSystem.out.println(\"You have : \" + game.getRemainingDays() + \" days left.\");\n\t\t\t\tIsland currentLoc = game.getCurrentLocation();\n\t\t\t\tString islandName = currentLoc.getIslandName();\n\t\t\t\tSystem.out.println(\"Your current location is: \" + islandName + \" Island.\" + \"\\n\");\n\t\t\t\tSystem.out.println(\"What do you want to do? \");\n\t\t\t\tSystem.out.println(\"(1) See ship's specification\");\n\t\t\t\tSystem.out.println(\"(2) Go to store in your current location\");\n\t\t\t\tSystem.out.println(\"(3) End Game\");\n\t\t\t\ttry {\n\t\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\t\tif (selectedAction <= 3 && selectedAction > 0) {\n\t\t\t\t\t\tstate = true;\n\t\t\t\t\t\tif (selectedAction == 1) {\n\t\t\t\t\t\t\tgame.seeShipSpec();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (selectedAction == 2) {\n\t\t\t\t\t\t\tgame.goToStore();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tgame.gameOver(\"You ended the game\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\t\tscanner.nextLine();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void edicationLoan() {\n\t\tSystem.out.println(\"hsbc -- education loan\");\n\t\t\n\t}", "public void open( ) {\n System.out.println(\"Door is unlocked. \\n\" +\n \"Welcome to Park Extravaganza\\n\");\n }", "static void AdultItinerary(int location)\n {\n\t\tboatLock.acquire(); \n\n\t\twhile (true){ //continuous loop\n\t\t\t//check location\n if (location == 0){ //Oahu\n //may need while loop instead of if loop here...\n while ( childrenOnOahu > 1 || countOnBoat > 0 || boatLocation != 0){\n onOahu.sleep();\n }\n\t\t\t /*if( childrenOnOahu > 1) {\n\t\t\t\t\tonOahu.sleep();\n\t\t\t\t}\n\t\t\t\t//check number of children on boat | adults on boat\n\t\t\t\tif( countOnBoat > 0){\n\t\t\t\t\tonOahu.sleep();\n\t\t\t\t}\n\t\t\t\t//make sure boat is on Oahu\n\t\t\t\tif(boatLocation != 0){\n\t\t\t\t\tonOahu.sleep();\n\t\t\t\t} */\n\t\t\t//-------------------------------------------------------\n bg.AdultRowToMolokai();\n \n //update count and location\n adultsOnOahu--;\n adultsOnMolokai++;\n boatLocation = 1;\n location = 1;\n \n //communicating number of people on Molokai\n coms.speak(childrenOnMolokai + adultsOnMolokai);\n \n //wake everyone up and sleep on Molokai\n onMolokai.wakeAll();\n onMolokai.sleep();\n\t\t\t \n\t\t//Make sure there is at least ONE child on Molokai\n\t\tLib.assertTrue(childrenOnMolokai > 0);\n }\n else if (location == 1){ //Molokai\n onMolokai.sleep();\n }\n else{\n System.out.println(\"ERROR: Location other than 0 or 1\");\n Lib.assertTrue(false);\n break; \n }\n }\n\n boatLock.release(); \n }", "public void retireLead()\r\n\t{\r\n\t\tisleader = false;\r\n\t}", "public void leaveRoom(Person x)\n {\n occupant = null;\n }", "public void leaveRoom(Person x)\n {\n occupant = null;\n }", "@Override\n\tpublic void seeRoute() {\n\t\tRoute route = game.getIncidentRoutes();\n\t\tSystem.out.println(route);\n\t\tSystem.out.println(\"Total sailing days required is \"+ game.calculateSailingDays(route)+\" days\");\n\t\tboolean state = false;\n\t\twhile (state == false) {\n\t\t\tSystem.out.println(\"Choose your actions: \");\n\t\t\tSystem.out.println(\"(1) Go back!\");\n\t\t\tSystem.out.println(\"(2) Set Sail\");\n\t\t\ttry { \n\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\tif (selectedAction <= 2 && selectedAction > 0) {\n\t\t\t\tstate = true;\n\t\t\t\tif (selectedAction == 1) {\n\t\t\t\t\tgame.backToMain();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (game.isIslandReachable(route)) {\n\t\t\t\t\t\tif (game.checkMyShipHealth()) {\n\t\t\t\t\t\t\tgame.payCrew(route);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out.println(\"You should repair your ship first!\" + \"\\n\" + \"you will be redirected to store at your current Island\" + \"\\n\");\n\t\t\t\t\t\t\tgame.repairMyShip();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"This Island is not accessible because you don't have enough days left, you can choose other Island\");\n\t\t\t\t\t\tgame.backToMain();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Override\n protected void onDeath(final Creature killer) {\n getDeathPenalty().checkCharmOfLuck();\n\n if (isInStoreMode()) {\n setPrivateStoreType(Player.STORE_PRIVATE_NONE);\n }\n if (isProcessingRequest()) {\n final Request request = getRequest();\n if (isInTrade()) {\n final Player partner = request.getOtherPlayer(this);\n sendPacket(SendTradeDone.FAIL);\n partner.sendPacket(SendTradeDone.FAIL);\n }\n request.cancel();\n }\n //cubicdata\n deleteCubics();\n deleteAgathion();\n\n boolean checkPvp = true;\n if (ServerConfig.ALLOW_CURSED_WEAPONS) {\n if (isCursedWeaponEquipped()) {\n CursedWeaponsManager.getInstance().dropPlayer(this);\n checkPvp = false;\n } else if (killer != null && killer.isPlayer() && killer.isCursedWeaponEquipped()) {\n CursedWeaponsManager.getInstance().increaseKills(((Player) killer).getCursedWeaponEquippedId());\n checkPvp = false;\n }\n }\n\n if (checkPvp) {\n doPKPVPManage(killer);\n\n altDeathPenalty(killer);\n }\n\n //And in the end of process notify death penalty that owner died :)\n getDeathPenalty().notifyDead(killer);\n\n setIncreasedForce(0);\n\n if (isInParty() && getParty().isInReflection() && getParty().getReflection() instanceof DimensionalRift) {\n ((DimensionalRift) getParty().getReflection()).memberDead(this);\n }\n\n stopWaterTask();\n stopMountFeedTask();\n\n if (!isSalvation() && isOnSiegeField() && isCharmOfCourage()) {\n ask(new ConfirmDlg(SystemMsg.YOUR_CHARM_OF_COURAGE_IS_TRYING_TO_RESURRECT_YOU, 60000), new ReviveAnswerListener(this, 100, false, 60000));\n setCharmOfCourage(false);\n }\n\n if (AllSettingsConfig.AltKillAnnounce && killer != null && killer.isPlayer())\n AnnouncementUtils.announceToAll(killer.getName() + \" убил игрока \" + getName() + \"!\");\n\n super.onDeath(killer);\n }", "@Override\n @SuppressWarnings(\"empty-statement\")\n public void attack(){\n\n if (myTerritory.getAlpha() <= 0.5){\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getSoldiers()/4;\n defendingSoldiers = myTerritory.getSoldiers()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }\n else\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getFoodGrowth()/4;\n defendingSoldiers = myTerritory.getFoodGrowth()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }", "public void causeFoodExhaustion(float debug1) {\n/* 1797 */ if (this.abilities.invulnerable) {\n/* */ return;\n/* */ }\n/* */ \n/* 1801 */ if (!this.level.isClientSide) {\n/* 1802 */ this.foodData.addExhaustion(debug1);\n/* */ }\n/* */ }", "public void getCovid()\n\t{\n\t\tsetHealthStatus(HealthStatus.INFLECTED);\n\t\tdeathTimer = new PlayPauseTimer((int) (100*(1 - world.getMortalityRate())), new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjustDie();\n\t\t\t\ttimerList.remove(deathTimer);\n\t\t\t}\n\t\t\t\n\t\t}, world.getRefreshTime());\n\t\ttimerList.add(deathTimer);\n\t\t\n\t\thospitalNeed = new Thread(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tworld.getHospital().acceptIndividual();\n\t\t\t\t\tgoHospital();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\tgoHospitalTimer = new PlayPauseTimer(25, new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\thospitalNeed.start();\n\t\t\t\ttimerList.remove(goHospitalTimer);\n\t\t\t}\n\t\t\t\n\t\t}, world.getRefreshTime());\n\t\ttimerList.add(goHospitalTimer);\n\t\tworld.infect();\n\t}", "public void educationLoan(){\r\n\t\tSystem.out.println(\"HSBC ----educationLoan method called from HSBCBank class\");\r\n\t}", "protected void incrementHunger()\n {\n food_level--;\n if(food_level <= 0) {\n setDead();\n }\n }", "@Override\n\tpublic void passedBy() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(250);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 250 dollars by landing on Bonus Square\");\n\n\t}", "private void SecondStateFiringChecks()\n {\n List<Player> AffectedPlayers = game.GetAffectedPlayers(geoTarget, game.GetConfig().GetBlastRadius(missileType));\n\n if(AffectedPlayers.size() == 1)\n {\n final Player affectedPlayer = AffectedPlayers.get(0);\n\n if(lLastWarnedID != affectedPlayer.GetID() && affectedPlayer.GetRespawnProtected())\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_respawn_protected, affectedPlayer.GetName(), TextUtilities.GetTimeAmount(affectedPlayer.GetStateTimeRemaining())));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else if(lLastWarnedID != affectedPlayer.GetID() && game.GetNetWorthMultiplier(game.GetOurPlayer(), affectedPlayer) < Defs.NOOB_WARNING)\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_noob, affectedPlayer.GetName()));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else if(lLastWarnedID != affectedPlayer.GetID() && game.GetNetWorthMultiplier(game.GetOurPlayer(), affectedPlayer) > Defs.ELITE_WARNING)\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_elite, affectedPlayer.GetName()));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else\n {\n Launch();\n }\n }\n else\n {\n Launch();\n }\n }", "@Override\n public void action() {\n DFAgentDescription appointmentAgentDescription = dfSubscription.getAgentDescription();\n List<AllocationState> preferredAllocations = patientAgent.getAllocationStates();\n\n if (patientAgent.getCurrentAllocation() == GlobalAgentConstants.APPOINTMENT_UNINITIALIZED) {\n /* Patient agent has not got any appointment from the hospital agent yet */\n return;\n\n } else if (preferredAllocations.isEmpty()) {\n /* Patient Agent has its most preferred appointment */\n isHappyWithAppointment = true;\n\n } else if (appointmentAgentDescription != null) {\n\n /* Loop executed when action is executed for the first time */\n if (preferredAllocationsIterator == null) {\n /* Querying patient preferences */\n preferredAllocationsIterator = patientAgent.getAllocationStates().iterator();\n currentSize = patientAgent.getAllocationStates().size();\n }\n\n\n if (!preferredAllocationsIterator.hasNext()) {\n /* Condition executed when no more swaps available */\n updatePreferences();\n\n } else if (expectedMessageTemplate == null) {\n\n /* We are not expecting any response, we can make another swap proposal */\n proposeSwap(preferredAllocationsIterator.next(), appointmentAgentDescription);\n\n } else {\n /* Some message has been sent, awaiting a response */\n ACLMessage expectedMessage = patientAgent.receive(expectedMessageTemplate);\n if (expectedMessage != null) {\n boolean wasSwapSuccessful = receiveResponse(expectedMessage, appointmentAgentDescription);\n expectedMessageTemplate = null;\n currentlyProposedAllocationSwap = null;\n\n /* If swap has been successful, we need to update our preference list\n as the patient agent has got new appointment */\n if (wasSwapSuccessful) {\n updatePreferences();\n }\n }\n }\n }\n }", "public void stayDoor() {\n if (stage != Stage.DOOR_CHOSEN) {\n throw new RuntimeException(\"Invalid Stage\");\n }\n\n stage = Stage.END;\n for (Door door : doors) {\n if (door.getState() == State.CLOSED) {\n door.open();\n }\n continue;\n }\n total_stayed++;\n if (chosen_door.getContains() == Contains.CAR) {\n won_stayed++;\n }\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 raiseFoodFlag(){\n\t\tif(foodFlag != true && amountWorms > 0){\n\t\t\tfoodFlag = true;\n\t\t\tsw.getInstance(this);\n\t\t\tamountWorms--;\n\t\t\tAquaFrame.initWormStatus(amountWorms);\n\t\t}\n\t\telse{\n\t\t\tint num = 0;\n\t\t\tif(amountWorms == 0){\n\t\t\t\tupdate();\n\t\t\t}\n\t\t}\n\t}", "private void Dead() {\n\t\thunger -= 5;\n\t\tthirst -= 5;\n\t\tif ((thirst < 25) && (hunger < 25)){\t\t\t// Player is very weak\n\t\t\thealth -= 15;\n\t\t}else if ((thirst < 25) || (hunger < 25)){\t\t// Player is kinda weak\n\t\t\thealth -= 5;\n\t\t}\n\t\tif (health <= 0){\t\t\t\t\t\t\t\t// Player is dead\n\t\t\taddMessage(\"Overcome by your weakness you succumb.\", \"AI\");\n\t \t\taddMessage(\"You have died\", \"AI\");\n\t \t\tmenu = MENU.GAME_OVER;\n\t\t}\n\t}", "public void fireEmergencyRequest() {\n\t\televatorManager.handleEmergency();\n\t}", "@Override\n\tpublic void seeIsland(Island island) {\n\t\tString name = island.getIslandName();\n\t\tStore store = island.getStore();\n\t\tHashMap<Goods, Integer> sellGoods = store.getSellGoods();\n\t\tHashMap<Goods, Integer> interestedGoods = store.getInteresedGoods();\n\t\tEquipment sellEquipment = store.getEquipment();\n\t\tgame.setCurrentChosenIsland(island);\n\t\tSystem.out.println(\"Island's name: \" + name);\n\t\tprintGoods(sellGoods, \"The goods that the store in this Island sell: \");\n\t\tprintGoods(interestedGoods, \"The Goods that the store in this island want to buy:\");\n\t\tSystem.out.println(\"\\n\" + \"Equipment: \" + sellEquipment.getName() + \" Price : \" + sellEquipment.getSellingPrice() + \"\\n\");\t\n\t\tboolean state = false;\n\t\twhile (state == false) {\n\t\t\tSystem.out.println(\"Choose your actions: \");\n\t\t\tSystem.out.println(\"(1) Go back!\");\n\t\t\tSystem.out.println(\"(2) See the routes to this Island\");\n\t\t\ttry \n\t\t\t{\n\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\tif (selectedAction <= 2 && selectedAction > 0) {\n\t\t\t\tstate = true;\n\t\t\t\tif (selectedAction == 1) {\n\t\t\t\t\tgame.backToMain(); \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tgame.showTheRoute();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t}\t\n\t}", "private void returnToHive() {\n\t\tGridPoint hiveLoc = grid.getLocation(hive);\n\t\t// if bee is inside hive\n\t\tif(grid.getDistance(grid.getLocation(this), hiveLoc) < 10) {\n\t\t\t// decide whether or not to dance (biased by nectar of last resource)\n\t\t\tif((RandomHelper.nextIntFromTo((int)(maxFlowerNectar/3), \n\t\t\t (int)(maxFlowerNectar/danceProbability)) < lastFlowerNectar)\n\t\t\t && waggle && targetFlower != null){\n\t\t\t\tdanceDuration = lastFlowerNectar/5;\n\t\t\t\thive.dancingBees.add(this);\n\t\t\t\tstate = \"DANCING\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstate = \"SLEEPING\";\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t// otherwise continue toward hive\n\t\t\tmoveTowards(hiveLoc, 5);\n\t\t\tfood -= highMetabolicRate;\n\t\t}\n\t}", "void centralPark() {\n location = \"centralPark\";\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\n////// CENTRAL PARK //////\");\n System.out.println(\"\\nYou have entered Central Park!\");\n System.out.println(\"The park is busy, birds are tweeting, families are having picnic's. The trees are low, swinging is not great here!\");\n\n System.out.println(\"Please enter [1] if you would like explore | Enter [2] if you would like to go back to base: \");\n userSwings = input.nextInt();\n\n if (userSwings == 1) {\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\nYour spider-sense goes off!!\");\n System.out.println(\"You hear sirens, it sounds like a crime!\");\n\n System.out.println(\"Do you wish to help? Enter 'yes' or 'no\");\n String userChoice = input.nextLine();\n userChoice = input.nextLine();\n\n //If user wishes to fight crime, run a crime method within the crime class\n if (userChoice.equals(\"yes\")) {\n c.burgulary();\n avengersTower();\n } else if (userChoice.equals(\"no\")) {\n avengersTower();\n }\n } else if (userSwings == 2) {\n avengersTower();\n } else {\n System.out.println(\"Please enter either 1 or 2!!\");\n centralPark();\n }\n }", "@ScheduledMethod(start =1, interval = 1, priority = 5)\n\tpublic void diningIn() {\n\t\t//i = 0;\n\t\tif(CFG.chooseContext() &&isEating &&!isLocated){\n\t\t\t//if(CFG.isMeetUp()) System.out.println(\"Something wrent wrong\");\n\t\t\tif(RandomHelper.nextDoubleFromTo(0, 1) > diningOutRatio)\n\t\t\t\tgoTo(myHome);\n\t\t}\n\t}", "public Hospital(String hospName, String mainUse, int qualifiedStaff, int otherStaff, int spaces, boolean stateFunded) {\n noOfHospitals++;\n this.name = hospName;\n this.mainUse = mainUse;\n this.qualifiedStaff = qualifiedStaff;\n this.otherStaff = otherStaff;\n this.spaces = spaces;\n this.stateFunded = stateFunded;\n }", "public static void attemptFinishDeclareAttack (SummonedMonster SumMonster){\r\n if (SumMonster.isExisting && !SumMonster.isPlayersMonster && Game.ActiveAttackingMonster.sumMonsterNumber!=0) { // only do something, if the monster exists at all and one has already chosen the attacking monster\r\n Game.ActiveGuardingMonster=SumMonster;\r\n updateDeclareAttackStatistic();\r\n declareAttackOnMonster(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster);\r\n }\r\n }", "public void attack() {\n //Grab an attacker.\n Territory attacker = potentialAttackers.remove(0);\n \n //Find the weakest adjacent territory\n int victimStrength = Integer.MAX_VALUE;\n Territory victim = null;\n List<Territory> adjs = gameController.getBoard().getAdjacentTerritories(attacker);\n for(Territory adj : adjs){\n \n //Verify that our odds are good enough for this attack to consider it.\n int aTroops = attacker.getNumTroops() - 1;\n int dTroops = adj.getNumTroops();\n double odds = MarkovLookupTable.getOddsOfSuccessfulAttack(aTroops, dTroops);\n boolean yes = Double.compare(odds, ACCEPTABLE_RISK) >= 0;\n \n //If we have a chance of winning this fight and its the weakest opponent.\n if(yes && adj.getNumTroops() < victimStrength && !adj.getOwner().equals(this)){\n victim = adj;\n victimStrength = adj.getNumTroops();\n }\n }\n \n //Resolve the Attack by building forces and settle the winner in Victim's land\n Force atkForce = attacker.buildForce(attacker.getNumTroops() - 1);\n Force defForce = victim.buildForce(victimStrength); //Guaranteed not null\n Force winner = atkForce.attack(defForce);\n victim.settleForce(winner);\n }", "public void dischargeLoan(boolean isDamaged) {\n\t\tif (!state.equals(ControlState.INSPECTING)) {\r\n\t\t\tthrow new RuntimeException(\"ReturnBookControl: cannot call dischargeLoan except in INSPECTING state\");\r\n\t\t}\t\r\n\t\tlibrary.dischargeLoan(currentLoan, isDamaged); //Changed method name to verb starting with lowercase and in camelBack\r\n\t\tcurrentLoan = null; //Changed variable name to a meaningful word\r\n\t\tuserInterface.setState(ReturnBookUI.UI_STATE.READY);\r\n\t\tstate = ControlState.READY;\t\t\t\t\r\n\t}", "void hellsKitchen() {\n location = \"hellsKitchen\";\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\n////// HELLS KITCHEN //////\");\n System.out.println(\"\\nYou have entered Hells Kitchen!\");\n System.out.println(\"Hells Kitchen looks dark and gloomy. Dark allys everywhere.\");\n\n System.out.println(\"Please enter [1] if you would like explore | Enter [2] if you would like to go back to base: \");\n userSwings = input.nextInt();\n\n if (userSwings == 1) {\n System.out.print(\"______________________________________________________________\\n\");\n System.out.println(\"\\nYour spider-sense goes off!!\");\n System.out.println(\"You hear sirens, it sounds like a crime!\");\n\n System.out.println(\"Do you wish to help? Enter 'yes' or 'no\");\n String userChoice = input.nextLine();\n userChoice = input.nextLine();\n\n //If user wishes to fight crime, run a crime method within the crime class\n if (userChoice.equals(\"yes\")) {\n c.carHijack();\n avengersTower();\n } else if (userChoice.equals(\"no\")) {\n avengersTower();\n }\n } else if (userSwings == 2) {\n avengersTower();\n } else {\n System.out.println(\"Please enter either 1 or 2!!\");\n hellsKitchen();\n }\n }", "public void expand() {\n\t\tSpaceship sp = getTheSpaceship();\n\t\tsp.expandDoor();\n\t}", "void opponentInRoom();", "public synchronized void enterHall(){\n\t\twhile(nbPlaces==0 || sessionStarted==false){ //This is a while because the customer thread must check every time after waking up\n\t\t\t \t\t\t\t\t\t\t\t\t\t //whether the session has started or not.\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"The customer \"+Thread.currentThread().getId()+\" is waiting to enter the projection hall.\");\n\t\t\t\twait();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tnbPlaces--;\n\t\tSystem.out.println(\"The customer \"+Thread.currentThread().getId()+\" is going to enter the projection hall.\");\n\t}", "public void manage(int employeeID){\n ID = employeeID;\n int choice;\n do {\n choice = GetChoiceFromUser.getSubChoice(5,new MenuForBranchEmployee(data.getBranchEmployee(employeeID).getFirstName()));\n if (choice==1) {\n enterShipment();\n } else if (choice == 2){\n removeShipment();\n }\n else if(choice == 3){\n addCustomer();\n }\n else if(choice == 4){\n removeCustomer();\n }\n else if(choice == 5){\n updateStatusOfShipment(data.getBranchEmployee(ID).getFirstName(),data.getBranchEmployee(ID).getBranchID());\n }\n\n }while (choice!=0);\n }", "public void resolve(){\n logger.log(Level.FINE,attacker.getName()+\" withering attacked \"+defender.getName());\n AttackState state=new AttackState();\n state.weaponDamage=weapon.getDamage();\n state.initialAttackpool=baseAttackdice+baseAccuracy-woundpenalty;\n attacker.declareWitheringAttack(state); // If the attacker wants to change the pool, he modifies the state accordingly.\n defender.declareWitheringDV(state); // Defender declares their dv against this specific attack. This sets both initialdv and changedDv\n state.initialAttackRoll= new DiceThrow(state.changedAttackpool);\n attacker.modifyWitheringAttackRollAttacker(state); //This sets stuff like modifiedAttackRollAttacker and AttackerRollValuation\n defender.modifyWitheringAttackRollDefender(state); //This sets defender modifiedAttackRollDefender\n state.attackRollSuccesses=state.modifiedAttackRollDefender.evaluateResults(state.AttackRollValuationAttacker);\n state.threshholdSuccesses=state.attackRollSuccesses-state.changedDv;\n logger.log(Level.FINE,attacker.getName()+\" rolled \"+state.changedAttackpool+\" dice against \"+defender.getName()+\"'s dv of \"+state.changedDv+\" and gained \"+state.attackRollSuccesses+\" successes.\");\n attacker.changeWitheringThreshholdAttacker(state); //This sets thresholdModifiedAttacker\n defender.changeWitheringThreshholdDefender(state); //This sets thresholdModifiedDefender\n if(state.thresholdModifiedDefender>=0) {\n logger.log(Level.FINE,attacker.getName()+\" hit \"+defender.getName()+\" with \"+state.thresholdModifiedDefender+\" threshhold successes.\");\n attacker.modifyWitheringRawDamageAttacker(state); //Sets normal raw damageType, based on strength and weapon damageType, and then sets rawDamagemModifiedAttacker\n defender.modifyWitheringRawDamageDefender(state); //this sets rawDamageModifiedDefender, and sets up the various soak values, so natural soak and armor soak.\n logger.log(Level.FINE, \"The raw damage of the attack is: \"+state.rawDamageModifiedDefender);\n state.totalSoak = Math.max(state.defenderArmorSoak - ignoredArmorSoak, 0) + state.defenderNaturalSoak; //\n attacker.modifyTotalSoakAttacker(state); //This sets totalSoakmodifiedAttacker. Don't think this actually has support in the solar charmset, but giving opportunities to work with.\n defender.modifyTotalSoakDefender(state); // This sets totalSoakmodifiedDefender.\n state.postSoakSuccesses=Math.max(state.rawDamageModifiedDefender-state.totalSoakModifiedDefender,weapon.getOverwhelming());\n logger.log(Level.FINE,state.totalSoakModifiedDefender+\" damage is soaked, leading to post soak dice of \"+state.postSoakSuccesses);\n attacker.declarePostSoakAttacker(state); //sets postSoakSuccessesModifiedAttacker\n defender.declarePostSoakDefender(state); //sets postSoakSuccessesModifiedDefender\n DiceThrow droll=new DiceThrow(state.postSoakSuccessesModifiedDefender);\n state.damageRoll=droll;\n attacker.modifyWitheringDamageRollAttacker(state); //sets damageRollmodifiedAttacker and damageRollvValuation\n defender.modifyWitheringDamageRollDefender(state); //sets damageRollmodifiedDefender\n state.initiativeDamageDone=state.damageRollModifiedDefender.evaluateResults(state.damageRollValuation);\n logger.log(Level.FINE,attacker.getName()+\" rolls \"+state.postSoakSuccessesModifiedDefender+\" dice and achieves \"+state.initiativeDamageDone+\" successes.\");\n attacker.modifyInitiativeDamageAttacker(state);\n defender.modifyInitiativeDamageDefender(state); //Since this is the last change of initiative, we can check whether the defender was crashed here.\n attacker.updateInitiativeAttacker(state);\n defender.updateInitiativeDefender(state);//Here we should handle all the initiative changes respectively, with checking if people are crashed etc.\n }\n else{\n attacker.failedWitheringAttackAttacker(state);\n defender.failedWitheringAttackDefender(state);\n }\n\n }", "public void hungry()\r\n {\r\n \tSystem.out.println(\"I'm hungry!! Feed me!!\");\r\n \tbarking();\r\n }", "@Override\n\tpublic void decide() {\n\t\tif (this.isDead) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(this.age >= this.lifeSpan) {\n\t\t\t// DIE\n\t\t\tthis.environment.removeAgent(this.getPosX(), this.getPosY());\n\t\t\tthis.isDead = true;\n\n\t\t\t// Print if required\n\t\t\tif (this.appConfig.hasTrace()) {\n\t\t\t\tSystem.out.println(\"Agent;Death;Fish;\" + this.getPosX() + \";\" + this.getPosY());\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\tthis.age++;\n\t\tthis.color = Color.GREEN;\n\t\tboolean canFuck = this.breedTime == 0;\n\n\t\tint[] coordinates = this.chooseCoordinates();\n\n\t\t// fish cannot move or fuck because there is no place to do so\n\t\tif (coordinates == null) {\n\t\t\tthis.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.environment.moveAgent(this, coordinates[0], coordinates[1]);\n\n\t\t// Time to fuck-zer\n\t\tif (canFuck) {\n\t\t\tthis.fuck(this.getPosX(), this.getPosY());\n\t\t}\n\t\t// Update breedtime in order to wait the holy fuck time\n\t\telse {\n\t\t\tthis.breedTime = this.breedTime > 0 ? this.breedTime - 1 : this.breedTime;\n\t\t}\n\t\tthis.posX = coordinates[0];\n\t\tthis.posY = coordinates[1];\n\t}", "@Suspendable\n @Override\n public Void call() throws FlowException {\n // We retrieve the notary identity from the network map.\n final Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);\n QueryCriteria queryCriteria = new QueryCriteria.LinearStateQueryCriteria(null, ImmutableList.of(this.linearId),\n Vault.StateStatus.UNCONSUMED, null);\n List<StateAndRef<NDAState>> ndaStates = getServiceHub().getVaultService().queryBy(NDAState.class, queryCriteria).getStates();\n\n // We create the transaction components.\n NDAState outputState = new NDAState(getOurIdentity(), crmParty, \"APPROVED\");\n StateAndContract outputStateAndContract = new StateAndContract(outputState, LEGAL_CONRACT_ID);\n List<PublicKey> requiredSigners = ImmutableList.of(getOurIdentity().getOwningKey(), crmParty.getOwningKey());\n Command cmd = new Command<>(new LegalContract.Approve(), requiredSigners);\n\n // We create a transaction builder and add the components.\n final TransactionBuilder txBuilder = new TransactionBuilder();\n txBuilder.addInputState(ndaStates.get(0));\n txBuilder.setNotary(notary);\n txBuilder.withItems(outputStateAndContract, cmd);\n\n // Signing the transaction.\n final SignedTransaction signedTx = getServiceHub().signInitialTransaction(txBuilder);\n // Creating a session with the other party.\n FlowSession otherpartySession = initiateFlow(crmParty);\n // Obtaining the counterparty's signature.\n SignedTransaction fullySignedTx = subFlow(new CollectSignaturesFlow(\n signedTx, ImmutableList.of(otherpartySession), CollectSignaturesFlow.tracker()));\n // Finalising the transaction.\n subFlow(new FinalityFlow(fullySignedTx));\n return null;\n }", "public int performAction()\n {\n if(stunCountdown > 0) \n {\n ERROR_LOG.writeToLog(\"The saboteur is not supposed to call performAction() while stuunned. Remaining time stunned: \" + stunCountdown + '.');\n \n chasingPlayer = false;\n return stunCountdown;\n }\n \n if(chasingPlayer)\n {\n setRoom(Game.getInstance().getPlayer().getCurrentRoom());\n }\n else\n {\n if(((getCurrentRoom().isOperating() && getCurrentRoom() instanceof ItemRoom) || Game.getInstance().getGameInfo().getHackedExit() == null) && Math.random() < chanceOfSabotage)\n {\n if(!getCurrentRoom().isOperating() || !(getCurrentRoom() instanceof ItemRoom))\n {\n int sabotageExit = (int) Math.floor(Math.random() * getCurrentRoom().getCollectionOfExits().size());\n getCurrentRoom().getCollectionOfExits().get(sabotageExit).setOperating(false);\n Game.getInstance().getGameInfo().setHackedExit(getCurrentRoom().getCollectionOfExits().get(sabotageExit));\n ACTION_LOG.writeToLog(\"Sabotaged the exit between \\\"the \" + getCurrentRoom().getName() + \"\\\" and \\\"the \" + getCurrentRoom().getExit(getCurrentRoom().getCollectionOfExits().get(sabotageExit)).getName() + \"\\\".\");\n }\n else if(Game.getInstance().getGameInfo().getHackedExit() != null)\n {\n getCurrentRoom().setOperating(false);\n ACTION_LOG.writeToLog(\"Sabotaged the room: \\\"\" + getCurrentRoom().getName() + \"\\\".\");\n }\n else if(Math.random() < CHANCE_OF_DOOR_SABOTAGE)\n {\n int sabotageExit = (int) Math.floor(Math.random() * getCurrentRoom().getCollectionOfExits().size());\n getCurrentRoom().getCollectionOfExits().get(sabotageExit).setOperating(false);\n Game.getInstance().getGameInfo().setHackedExit(getCurrentRoom().getCollectionOfExits().get(sabotageExit));\n ACTION_LOG.writeToLog(\"Sabotaged the exit between \\\"the \" + getCurrentRoom().getName() + \"\\\" and \\\"the \" + getCurrentRoom().getExit(getCurrentRoom().getCollectionOfExits().get(sabotageExit)).getName() + \"\\\".\");\n }\n else\n {\n getCurrentRoom().setOperating(false);\n ACTION_LOG.writeToLog(\"Sabotaged the room: \\\"\" + getCurrentRoom().getName() + \"\\\".\");\n }\n \n chanceOfSabotage = DEFAULT_CHANCE_OF_SABOTAGE;\n }\n else\n {\n List<Exit> neighbors = getCurrentRoom().getCollectionOfExits();\n \n for(int i = neighbors.size() - 1; i >= 0; i--)\n if(getCurrentRoom().getExit(neighbors.get(i)).isControlRoom() || !neighbors.get(i).isOperating())\n neighbors.remove(i);\n \n if (neighbors.isEmpty())\n {\n ACTION_LOG.writeToLog(\"Saboteur tried to move, but all exits where removed. Current room: \\\"\" + getCurrentRoom().getName() + \"\\\".\");\n return -1;\n }\n \n int exitIndex = (int) (Math.floor(Math.random() * neighbors.size()));\n \n setRoom(getCurrentRoom().getExit(neighbors.get(exitIndex)));\n \n chanceOfSabotage += CHANCE_OF_SABOTAGE_GROWTH;\n \n //ACTION_LOG.writeToLog(\"Moved to \\\"the \" + getCurrentRoom().getName() + \"\\\".\");\n \n checkChasingPlayer();\n }\n }\n \n return(5 + (int) Math.floor(Math.random() * 6));\n }", "public void callHouseOwner() {\n\t\tSystem.out.println(\"联系房东\");\n\t}", "@Override\n protected void battleOutcome(long period, int attackerID, double soldiersAttack,\n int deffenderID, double soldiersDefend, boolean youWon){\n // This method provides information about the outcome of the battle, so I will leave this open to you,\n // to do whatever you want to do with the info.\n\n // period: step of the simulation in which the battle occured\n // attackerID: id of the territory that took the offensive position during the battle\n // soldiersAttack: number of soldiers that attacked\n // deffenderID: id of the territory that took the defensive position during the battle\n // soldiersDefend: number of soldiers that defended\n // youWon: indicator if the current territory won or lost the battle (true if victorius, false if not)\n }", "static void portal_denied() {\n System.out.println(\"Ok...let's turn left and go to the living room\");\n enter = next.nextLine();\n System.out.println(\"Wait!\");\n enter = next.nextLine();\n System.out.println(\"What is that noice?\");\n enter = next.nextLine();\n System.out.println(\"Creak...Creak...Creak...\");\n System.out.println(username + \" sees a thousand of creatures surrounding the living room.\");\n System.out.println(\"I don't think it is a very good idea to take them on at once. They might look small,\");\n System.out.println(\"but are extremely ferocious...I suggest you turn back\");\n enter = next.nextLine();\n System.out.println( username + \" returns to the portals\");\n enter = next.nextLine();\n portal_introduction(); //this will take the player back to the portals that the player first had a choice to decide\n //whether or not he/she wanted to open the massive gate\n }", "@Override\n public void onPourWaterRaised() {\n if (theFSM.getCupPlaced()) {\n pouringState = true;\n }\n }", "public MyHouseKeeper hireHouseKeeper(int id){\n return mKeeperStaff.startHouseKeeper(id);\n }", "public abstract void enterRoom();", "public boolean checkOpen(float x, float y)\r\n/* 483: */ {\r\n/* 484:580 */ if (!tileWalkable(x, y)) {\r\n/* 485:582 */ return false;\r\n/* 486: */ }\r\n/* 487:585 */ AgentModel a = getAgentOnTile(x, y);\r\n/* 488:586 */ if ((a != null) || (((a instanceof DoorModel)) && (!((DoorModel)a).isOpen()))) {\r\n/* 489:588 */ return false;\r\n/* 490: */ }\r\n/* 491:591 */ return true;\r\n/* 492: */ }", "public void checkGrowth() {\n if (age == 100) {\n double h = ((Growable)delegate).currentHealth;\n delegate = new Sprout(gc, x, y, h);\n }\n if (age == 200) {\n double h = ((Growable)delegate).currentHealth;\n delegate = new Bud(gc, x, y, h);\n }\n if (age == 300) {\n double h = ((Growable)delegate).currentHealth;\n delegate = new Blossom(gc, x, y, h);\n }\n if (age == 400) {\n double h = ((Growable)delegate).currentHealth;\n delegate = new Bloom(gc, x, y, h);\n }\n if (age == 500) {\n delegate = new Seed(gc, x, y);\n age = 0;\n GameManager.score += 100;\n }\n\n if (getCurrentHealth() <= 0) {\n delegate = new Seed(gc, x, y);\n GameManager.lives--;\n }\n delegate.wilt();\n delegate.update();\n }", "public void soin() {\n if (!autoriseOperation()) {\n return;\n }\n if (tamagoStats.getXp() >= 2) {\n incrFatigue(-3);\n incrHumeur(3);\n incrFaim(-3);\n incrSale(-3);\n incrXp(-2);\n\n if (tamagoStats.getPoids() == 0) {\n incrPoids(3);\n } else if (tamagoStats.getPoids() == TamagoStats.POIDS_MAX) {\n incrPoids(-3);\n }\n\n setEtatPiece(Etat.NONE);\n tamagoStats.setEtatSante(Etat.NONE);\n\n setChanged();\n notifyObservers();\n }\n }", "private void stateReturnToHomeBase() {\n\t\tif (isCloserToBall()) {\n\t\t\tstate = State.ATTACKING;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isCloseTo(playerDeafaultPosition)) {\n\t\t\tif (isAlignedTo(playerDeafaultPosition)) {\n\t\t\t\tcommander.doDashBlocking(50.0d);\n\t\t\t} else {\n\t\t\t\tturnTo(playerDeafaultPosition);\n\t\t\t}\n\t\t}\n\t}", "public void reopenClosedStreet()\r\n {\r\n int detour_index = 0;\r\n for (Street s : this.getStreetsMap()) {\r\n if (this.getDetourStreets().contains(s)) {\r\n detour_index = (this.getStreetsMap().indexOf(s));\r\n break;\r\n }\r\n }\r\n\r\n for (int i = 0; i < this.getDetourStreets().size(); i++)\r\n {\r\n this.getStreetsMap().remove(detour_index);\r\n }\r\n\r\n this.getStreetsMap().add(detour_index, this.getClosedStreet());\r\n this.getStopsMap().add(this.getClosedStopIndex(), this.getClosedStop());\r\n this.clearDetourStreet();\r\n }", "void evadeAttack(IUnit attacker, int incomingDamage);", "private void harvest() {\n\t\t// if VERY far from flower, it must have died. start scouting\n\t\tif(grid.getDistance(grid.getLocation(targetFlower),grid.getLocation(this)) > 200) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// if crop storage is full, return to hive with information\n\t\telse if(food >= maxCrop) {\n\t\t\tif(targetFlower != null) {\n\t\t\t\tlastFlowerNectar = targetFlower.food;\n\t\t\t}\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if daylight is diminishing, return to hive\n\t\telse if(clock.time > (endForagingTime + 1.0)){\n\t\t\tlastFlowerNectar = 0;\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if flower loses all nectar, start scouting for new flower\n\t\telse if(targetFlower.food <= 0){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// semi-random decision to scout for new flower if current flower has low food\n\t\telse if(RandomHelper.nextIntFromTo(0,(int)(maxFlowerNectar/4)) > targetFlower.food &&\n\t\t\t\tRandomHelper.nextDoubleFromTo(0,1) < forageNoise){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// otherwise continue harvesting current flower\n\t\telse{\n\t\t\thover(grid.getLocation(targetFlower));\n\t\t\ttargetFlower.food -= foragingRate;\n\t\t\tfood += foragingRate;\n\t\t\tfood -= lowMetabolicRate;\n\t\t}\n\t}", "public void actionCombat(Party p1) {\n System.out.println(\"______________________________________________________________________________\\n\");\n System.out.println(this.Name + \" is attacking ...\");\n int choice = (int)(Math.random() * p1.getTeam().size());\n Character target = p1.getTeam().get(choice);\n System.out.println(this.Name + \" attacks \" + target.getName() + \"!\");\n\n if (this.SPEED - target.getSPEED() < 5) {\n int damage = Math.max(this.ATK - target.getDEF(), 0);\n System.out.println(this.Name + \" has inflicted \" + damage + \" damages to \" + target.getName() + \"!\");\n target.setActualHP(Math.max(0, target.getActualHP() - damage));\n if (target.getActualHP() == 0) {\n System.out.println(\"\\n\" + target.getName() + \" is down!\\n\");\n target.setIsDead(true);\n }\n }\n else {\n int n = 0;\n while ((target.actualHP != 0) && (n < 2)) {\n if (n == 1) {\n choice = (int)(Math.random() * p1.getTeam().size() + 1);\n target = p1.getTeam().get(choice);\n System.out.println(this.Name + \" attacks \" + target.getName() + \"!\");\n }\n int damage = Math.max(this.ATK - target.getDEF(), 0);\n System.out.println(this.Name + \" has inflicted \" + damage + \" damages to \" + target.getName() + \"!\");\n target.setActualHP(Math.max(0, target.getActualHP() - damage));\n if (target.getActualHP() == 0) {\n System.out.println(\"\\n\" + target.getName() + \" is down!\\n\");\n target.setIsDead(true);\n }\n if (n == 0) System.out.println(this.Name + \" attacks again ...\");\n n++;\n }\n }\n }", "public void leaveTheBus(int pid, int seat);", "public void sendToOutpatients(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "@Override\n\tpublic void DoExitRestaurant() {\n\t\t\n\t}", "@Override\n\tpublic void act() {\n\n\t\t//Location symbol of a Droid (Stack Overflow 2010)\n\t\tchar locationSymbol = this.world.getEntityManager().whereIs(this).getSymbol();\n\t\t\n\t\t//Begin act\n\t\tsay(describeLocation());\t\t\n\t\t\n\t\t//Check for the lose condition that R2 is disassembled\n\t\t//If R2's HP is <=0\n\t\tif (this.isDead())\n\t\t{\n\t\t\t//If R2 is disassembled\n\t\t\tif(this.getIsDisassembled())\n\t\t\t{\n\t\t\t\t//Is the symbol of the disassembled Droid is R2's\n\t\t\t\tif(this.getSymbol().contains(\"{R2}\"))\n\t\t\t\t{\n\t\t\t\t\t//Message stating R2 was disassembled\n\t\t\t\t\tthis.messageRenderer.render(\"\\n\\nR2-D2 has been disassembled!\");\n\t\t\t\t\t\n\t\t\t\t\t//Scheduler schedules the loss\n\t\t\t\t\tscheduler.lossSchedule(this.messageRenderer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//If a Droid is immobile (Dead)\n\t\tif (this.getIsImmobile() == true) {\n\t\t\tsay(this.getShortDescription() + \" is immobile. \");\n\t\t\t\t\t\t\n\t\t\tif(this.getOwner() != null)\n\t\t\t{\n\t\t\t\tsay(\"Owned. checking in owners follow list\");\n\t\t\t\t\n\t\t\t\tString thisDroidNoBraces = this.getSymbol().substring(1, this.getSymbol().length()-1);\n\n\t\t\t\tint indexofDroid = this.getOwner().getFollowerList().indexOf(thisDroidNoBraces);\n\t\t\t\t\n\t\t\t\tif (this.getOwner().getFollowerList().get(indexofDroid).equals(thisDroidNoBraces))\n\t\t\t\t{\n\t\t\t\t\tsay(\"Removing\");\n\t\t\t\t\tthis.getOwner().getFollowerList().remove(thisDroidNoBraces);\n\t\t\t\t\tthis.getOwner().getFollowerListSWActors().remove(this);\n\t\t\t\t\tthis.setOwner(null);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If a Droid is mobile and human controlled\n\t\telse if (this.humanControlled == true) {\n\t\t\t\n\t\t\t//Following Owner - since humancontrolled.\n\t\t\t\n\t\t\t\n\t\t\tif (isDead()) \n\t\t\t{\n\t\t\t\tthis.setIsImmobile(true);\n\t\t\t\treturn;\n\t\t\t} \n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t//Get owners' location\n\t\t\t\tSWLocation ownerloc = this.world.getEntityManager().whereIs(this.getOwner());\n\t\t\t\t\n\t\t\t\t//Set Droids' position to owners' location (follow)\n\t\t\t\tthis.world.getEntityManager().setLocation(this, ownerloc);\n\t\t\t\t\n\t\t\t\t//Take damage if moving to the Badlands\n\t\t\t\tif (locationSymbol == 'b') { //IF the Droid is at the Badlands\n\t\t\t\t\tint NewHP = this.getHitpoints() - 2;\t//Take 2 from the Droids' health\n\t\t\t\t\tthis.setHitpoints(NewHP);\n\t\t\t\t\n\t\t\t\t\tsay(this.getShortDescription() + \" has lost health by moving into the Badlands!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tselfHeal();\n\t\t\t}\t\n\t\t} \n\t\t\n\t\t//C-3PO Droid specific act ()code\n\t\telse if (this.getSymbol() == \"C3\") {\n\t\t\t\n\t\t\t//Double precision number to represenet C-3PO's chance of speaking\n\t\t\tdouble c3Speak = Math.random();\n\t\t\t\n\t\t\t//10% chance of occuring a 0.9 or above\n\t\t\tif (c3Speak >= 0.9) {\n\t\t\t\t//Call C-3PO speak method (he talks!)\n\t\t\t\tc3POSpeaks();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//R2-D2 Repair droid specific act() code\n\t\telse if (this.getSymbol() == \"R2\") {\n\t\t\t\n\t\t\tthis.messageRenderer.render(\"R2 DISS: \" + this.isDisassembled);\n\t\t\t\n\t\t\t//Describe who R2 can see\n\t\t\t//get the contents of the location\n\t\t\tList<SWEntityInterface> r2contents = this.world.getEntityManager().contents(this.world.getEntityManager().whereIs(this));\n\t\t\t\n\t\t\t//and describe the contents\n\t\t\tif (r2contents.size() > 1) { // if it is equal to one, the only thing here is R2, so there is nothing to report\n\t\t\t\tfor (SWEntityInterface r2entity : r2contents) {\n\t\t\t\t\tif (r2entity.getSymbol().contains(\"D\")) { // If R2 comes across a Droid (Stack Overflow 2010)\n\t\t\t\t\t\tsay(this.getShortDescription() + \" has come accross a Droid!\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Cast target entity as a Droid for checking what it needs from R2\n\t\t\t\t\t\tDroid targetr2 = (Droid) r2entity;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//R2 attempts to disassemble the Droid if its immobile\n\t\t\t\t\t\tif (targetr2.isImmobile && targetr2.isDisassembled == false) {\n\t\t\t\t\t\t\tDisassemble r2diss = new Disassemble(r2entity, messageRenderer);\n\t\t\t\t\t\t\tscheduler.schedule(r2diss, this, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//R2 tries to repair a droid who is immobile and disassembled\n\t\t\t\t\t\telse if (targetr2.isImmobile && targetr2.isDisassembled) {\n\t\t\t\t\t\t\tif (this.getItemCarried() != null) {\n\t\t\t\t\t\t\t\tRepair r2rep = new Repair(r2entity, messageRenderer);\n\t\t\t\t\t\t\t\tscheduler.schedule(r2rep, this, 1);\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//R2 attempts to Heal a Droid if active and not disassembled\n\t\t\t\t\t\telse if (targetr2.isDisassembled == false && targetr2.isImmobile == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tHealDroid r2heal = new HealDroid(r2entity, messageRenderer);\n\t\t\t\t\t\t\tscheduler.schedule(r2heal, this, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t\t//Heals himself if he can\n\t\t\t\n\t\t\tHealDroid droidHealR2 = new HealDroid(this, messageRenderer);\n\t\t\tscheduler.schedule(droidHealR2, this, 1);\n\t\t\t\n\t\t\t//R2 moves\n\t\t\tDirection R2Direction = this.getDroidPatrol().getNext();\n\t\t\tsay(getShortDescription() + \" moves \" + R2Direction);\n\t\t\tMove myMove = new Move(R2Direction, messageRenderer, world);\n\n\t\t\tscheduler.schedule(myMove, this, 1);\n\t\n\t\t}\n\t\t\n\t\t//If a Droid is not immobile, and not human controlled (roaming)\n\t\telse {\t\n\t\t\t\n\t\t\t//Picking up an oil can\n\t\t\t//Get contents of the current location\n\t\t\tList<SWEntityInterface> contents = this.world.getEntityManager().contents(this.world.getEntityManager().whereIs(this));\n\t\t\t\n\t\t\t//and describe the contents\n\t\t\tif (contents.size() > 1) { // if it is equal to one, the only thing here is this Player, so there is nothing to report\n\t\t\t\tfor (SWEntityInterface entity : contents) {\n\t\t\t\t\tif (entity != this) { // don't include self in scene description\n\t\t\t\t\t\tif (entity.getSymbol() == \"x\") {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//The Droid is standing over a oil can. Does it pick it up?\n\t\t\t\t\t\t\tif (Math.random() > 0.5){ //Half a chance...\n\t\t\t\t\t\t\t\tsay(this.getShortDescription() + \" decided to pick up \" + entity.getShortDescription());\n\t\n\t\t\t\t\t\t\t\t//Droid takes the oil can. Scheduler implements the Take.\n\t\t\t\t\t\t\t\tTake droidTakes = new Take(entity, messageRenderer);\n\t\t\t\t\t\t\t\tscheduler.schedule(droidTakes, this, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse { //The Droid passes over the oil can.\n\t\t\t\t\t\t\t\tsay(this.getShortDescription() + \" decided not to pick up\" + entity.getShortDescription());\n\t\t\t\t\t\t\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\t\n\t\t\t\n\t\t\tif (Math.random() > 0.8){\n\t\t\t\trandomMovement();\n\t\t\t}\n\t\t\t\n\t\t\t//If a Roaming Droid is at the Badlands, they lose health\n\t\t\t\n\t\t\tif (locationSymbol == 'b') { //IF the Droid is at the Badlands\n\t\t\t\tint NewHP = this.getHitpoints() - 2;\t//Take 2 from the Droids' health\n\t\t\t\tthis.setHitpoints(NewHP);\n\t\t\t\n\t\t\t\tsay(this.getShortDescription() + \" has lost health by moving into the Badlands!\");\n\t\t\t}\n\t\t\t\n\t\t\t/*Self healing\n\t\t\tImplementation that if a Droids' health gets below half, they will attempt to heal themselves IF they \n\t\t\tare carrying an oil can\n\t\t\t*/\n\t\t\tselfHeal();\n\t\t\t\n\t\t\t\n\t\t}\t\n\t}", "@Override\r\n public boolean onPlace(BlockPlaceEvent event, BlockVector vector) {\n BlockVector doubleDoor = DoorHelper.getSecondIronDoor(vector);\r\n if (doubleDoor == null) {\r\n return false;\r\n }\r\n \r\n // check if there is a protection\r\n Protection protection = Core.protectionManager.getProtection(doubleDoor);\r\n if (protection == null) {\r\n return false;\r\n }\r\n \r\n // check permissions\r\n if (!protection.canEdit(event.getPlayer())) {\r\n PlayerUtils.sendError(event.getPlayer(), Core.NAME, \"You cannot place a door here.\");\r\n PlayerUtils.sendInfo(event.getPlayer(), \"The neighbour is a protected door.\");\r\n event.setCancelled(true);\r\n return true;\r\n }\r\n \r\n // send info\r\n PlayerUtils.sendInfo(event.getPlayer(), Core.NAME, \"Subprotection created.\");\r\n \r\n // return true to abort the event\r\n return true;\r\n }", "public static void change(int userID, int orderNumber, int adult, int child) throws NoOrderException, InsufficientPeopleException{\n\t\t\n\t\t// Use methed provided by OrderDataHandler to get the order data from database.\n\t\tOrderData tmp = OrderDataHandler.getOrderData(userID, orderNumber);\n\t\t\n\t\t// If tmp is null, then there is no such order.\n\t\tif(tmp == null){\t\n\t\t\tthrow new NoOrderException();\n\t\t}\n\t\t\n\t\t// Get tour data from database by method provided by TourDataHandler\n\t\tArrayList<TourData> td = TourDataHandler.getResultFromDatabase(tmp.getTravelCode(), tmp.getStartDateYear(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttmp.getStartDateMonthValue(), tmp.getStartDateDay());\n\t\t\n\t\t\n\t\t//System.out.printf(\"%d %d %d %d %d %d\\n\", td.get(0).getUpperBound(), td.get(0).getPeopleCount(), adult, child, tmp.getNumberOfAdults(), tmp.getNumberOfChildren());\n\t\t\n\t\t// to calculate if the remaining of people count is enough for the order to change the order.\n\t\tif(td.get(0).getUpperBound() - td.get(0).getPeopleCount() >= (adult + child - tmp.getNumberOfAdults() - tmp.getNumberOfChildren())){\n\t\t\t\n\t\t\t// If enough, change the perple count of the tour in database.\n\t\t\tTourDataHandler.changePeopleCount(tmp.getTravelCode(), tmp.getStartDateYear(), \n\t\t\t\t\t\t\t\t\t\ttmp.getStartDateMonthValue(), tmp.getStartDateDay(), \n\t\t\t\t\t\t\t\t\t\ttd.get(0).getPeopleCount() + adult + child - tmp.getNumberOfAdults() - tmp.getNumberOfChildren());\n\t\t\t// Change the people count to desired number.\n\t\t\ttmp.setNumberOfAdults(adult);\n\t\t\ttmp.setNumberOfChildren(child);\n\t\t\t\n\t\t\t// write record to database.\n\t\t\tOrderDataHandler.changeOrderData(tmp);\n\t\t}\t\n\t\telse{\n\t\t\t// If there is not enough, throw the exception.\n\t\t\tthrow new InsufficientPeopleException();\n\t\t}\n\t\treturn;\n\t}", "int defend(Unit unit, Unit enemy);", "public void act()\n\t{\n\t\tif(getFirstDriver().isAtPump())\n\t\t{\n\t\t\tif(!getFirstDriver().isDoneRefilling())\n\t\t\t{\n\t\t\t\tgetFirstDriver().act(priceOfFuel);\n\t\t\t}\n\t\t}\n\t\telse if(getFirstDriver().isDone())\n\t\t{\n\t\t\tremoveDriver();\n\t\t}\n\t}", "public void youWinByAbandonment() {\n try {\n if (getClientInterface() != null)\n getClientInterface().gameEndedByAbandonment(\"YOU WON BECAUSE YOUR OPPONENTS HAVE ABANDONED!!\");\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending ended by abandonment error\");\n }\n }", "public void changeOutofService(Room room);", "@Override\n\tpublic void complete(Door d) {\n\t}", "void askLeaderCardThrowing();", "void toyPlacingfStuff(){\n //nu stiu daca asta ramane\n gettingBackToInitial();\n nearingTheWallBefore();\n parallelToTheWall();\n actualToyPlacing();\n }", "HospitalSystem(Patient patient, Action action){\r\n\t\tthis.patient=patient;\r\n\t\treferredTo=action;\r\n\t\t\r\n\t\t//call the selection action method which will process the patient\r\n\t\tselectAction();\r\n\t\t\r\n\t}" ]
[ "0.6631422", "0.5501416", "0.54838043", "0.5430207", "0.5366517", "0.53589875", "0.5356882", "0.5349171", "0.5343307", "0.5340172", "0.5314547", "0.5258821", "0.52263975", "0.5198683", "0.5188352", "0.5179164", "0.51718736", "0.5154377", "0.51376927", "0.5133627", "0.5132119", "0.51289976", "0.5128194", "0.5112933", "0.51021427", "0.50822973", "0.5066908", "0.50630945", "0.5046627", "0.5030457", "0.5030255", "0.50295246", "0.5028891", "0.5014442", "0.49825227", "0.49644223", "0.49630344", "0.49524176", "0.49524176", "0.49490798", "0.4943809", "0.49435988", "0.49393755", "0.4938494", "0.4913111", "0.49119925", "0.49016422", "0.4890263", "0.48886007", "0.4883254", "0.48773095", "0.48749414", "0.48732978", "0.48712057", "0.48607087", "0.48592144", "0.4857625", "0.48537162", "0.48500144", "0.48457772", "0.4844843", "0.48437628", "0.4839014", "0.48354104", "0.48332855", "0.4828186", "0.4817282", "0.48150736", "0.4813642", "0.4803904", "0.48038694", "0.479796", "0.47967646", "0.47900152", "0.47893694", "0.47890556", "0.4784695", "0.4779828", "0.47794682", "0.47794235", "0.47732753", "0.47716922", "0.47713283", "0.47656947", "0.4763651", "0.47627628", "0.47613806", "0.47607082", "0.47560996", "0.47537985", "0.47469074", "0.47422218", "0.47408548", "0.47405088", "0.4736581", "0.47213838", "0.4717459", "0.47172347", "0.47122452", "0.47099984" ]
0.6078436
1
This function used to start healing process when individual is get into hospital right in time. It removes all timer list of individual, and starts a 10 second healing process. After that healing, individual inform world of its healthiness, change state to "moving" to return back to population and exits hospital to open place for other infected individuals.
public void startHealing() { timerList.clear(); inHospitalTimer = new PlayPauseTimer(10, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { world.heal(); x = random.nextInt(world.getSIMULATION_WIDTH() - individualSize); y = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize); moveInPopulation(); exitHospital(); healthStatus = HealthStatus.HEALTHY; timerList.remove(inHospitalTimer); } }, world.getRefreshTime()); timerList.add(inHospitalTimer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void burry()\n\t{\n\t\tworld.death();\n\t\ttimerList.clear();\n\t\tif(hospitalNeed != null && hospitalNeed.isAlive())\n\t\t\thospitalNeed.interrupt();\n\t}", "public void goHospital()\n\t{\n\t\tsynchronized (this) {\n\t\tworld.hospitalizedIndividual();\n\t\tcurrentState.goHospital();\n\t\t}\n\t}", "public void run()\n {\n List<Entity> ms = new LinkedList<Entity>(monsters);\n for (Entity e : ms)\n if (e.isDead())\n monsters.remove(e);\n \n // Compare the current size with the previous size.\n if (monsters.size() < spawnThread.getPreviousSize() || spawnThread.getPreviousSize() == 0 || bossWave != null)\n {\n resetIdleTimer();\n return;\n }\n \n // Clear all player inventories, and \"kill\" all players.\n List<Player> ps = new LinkedList<Player>(arenaPlayers);\n for (Player p : ps)\n {\n MAUtils.clearInventory(p);\n MAUtils.tellPlayer(p, Msg.FORCE_END_IDLE);\n playerDeath(p);\n }\n }", "public void startAi(int num){\n int times = num;\n int test = 0;\n while(test < times){\n\n if (currentRoom.containsEnemy())\n {\n int eHealth = currentRoom.getEnemyHealth();\n int pHealth = player.getHealth();\n int pAD = player.getAttackDamage();\n int eAD = currentRoom.getEnemyDamage();\n ai.fightMath(eHealth, pHealth, pAD, eAD);\n player.setHealthExact(ai.getHealth());\n if (player.getHealth() > 0)\n {\n currentRoom.removeEnemy();\n System.out.println(\"\\n\" + \"AI defeated an enemy. Current health: \" + player.getHealth() + \"\\n\");\n }\n else{\n times = 0;\n }\n\n }\n \n else if(currentRoom.equals(prison))\n {\n ai.scheduleCommand(\"go\", \"up\", null);\n processCommand(command); \n test++;\n }\n\n else if(currentRoom.equals(promenade)){\n currentRoom = promenade;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"take\", \"wood\", \"sword\");\n processCommand(command);\n ai.scheduleCommand(\"take\", \"rope\", null);\n processCommand(command);\n ai.scheduleCommand(\"go\", \"up\", \"sword\"); \n processCommand(command);\n test++; \n } \n \n else if(currentRoom.equals(ossuary)){\n currentRoom = ossuary;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"open\", \"chest\", null);\n processCommand(command);\n ai.scheduleCommand(\"drop\", \"wood\", \"sword\");\n player.dropWeapon(command);\n ai.scheduleCommand(\"take\", \"silver\", \"sword\");\n processCommand(command);\n ai.scheduleCommand(\"take\", \"potion\", null);\n processCommand(command); \n ai.scheduleCommand(\"go\", \"straight\", null);\n processCommand(command);\n test++;\n\n }\n else if(currentRoom.equals(crypt))\n {\n currentRoom = crypt;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"take\", \"shovel\", null);\n processCommand(command); \n ai.scheduleCommand(\"go\", \"up\", null);\n processCommand(command);\n test++;\n }\n else if(currentRoom.equals(graveyard))\n {\n currentRoom = graveyard;\n player.setRoom(currentRoom);\n ai.scheduleCommand(\"go\", \"right\", null);\n processCommand(command);\n test++;\n }\n else if(currentRoom.equals(forest))\n {\n currentRoom = forest;\n player.setRoom(currentRoom);\n ai.runRope(player.getInventory());\n processCommand(command);\n ai.setCommand(\"go\", \"up\", null);\n processCommand(command);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n test++;\n\n\n }\n \n else if(currentRoom.equals(tower))\n {\n currentRoom = tower;\n player.setRoom(currentRoom);\n ai.setCommand(\"take\", \"potion\", null);\n processCommand(command);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"go\", \"straight\", null);\n processCommand(command);\n }\n else if(currentRoom.equals(ramparts))\n {\n currentRoom = ramparts;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"go\", \"straight\", null);\n processCommand(command);\n\n\n }\n else if(currentRoom.equals(castle))\n {\n currentRoom = castle;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"open\", \"chest\", null);\n processCommand(command);\n ai.setCommand(\"take\", \"potion\", null);\n processCommand(command);\n \n\n\n }\n\n else if(currentRoom.equals(throne))\n {\n currentRoom = throne;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n }\n\n else if(currentRoom.equals(sewers))\n {\n currentRoom = sewers;\n player.setRoom(currentRoom);\n ai.potionCheck(player.getHealth());\n processCommand(command);\n ai.setCommand(\"go\", \"down\", null);\n processCommand(command);\n\n }\n else if(currentRoom.equals(depths))\n {\n currentRoom = depths;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"right\", null);\n processCommand(command);\n }\n else if(currentRoom.equals(crypt))\n {\n currentRoom = crypt;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"up\", null);\n processCommand(command);\n\n }\n else if(currentRoom.equals(graveyard))\n {\n currentRoom = graveyard;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"straight\", null);\n processCommand(command);\n }\n else if(currentRoom.equals(bridge))\n {\n currentRoom = bridge;\n player.setRoom(currentRoom);\n ai.setCommand(\"go\", \"up\", null);\n processCommand(command);\n }\n\n \n } \n }", "public void startTimer() {\n // TODO = handle more aspects of the behaviour required by the specification\n System.out.println(\"starting timer\");\n initialHeroCastle();\n isPaused = false;\n // trigger adding code to process main game logic to queue. JavaFX will target\n // framerate of 0.3 seconds\n timeline = new Timeline(new KeyFrame(Duration.seconds(0.1), event -> {\n if (world.getMode() == -1){\n modeSelectionSwitchToMainMenu();\n }\n world.runTickMoves();\n world.runBattles();\n world.updateGoal();\n if (world.goalAchieved()) {\n world.gameOver();\n deadSwitchToMainMenu(true);\n return;\n }\n List<Soldier> soldiers = world.possiblySpawnSoldiers();\n for (Soldier s : soldiers) {\n loadSoldier(s);\n }\n List<BasicEnemy> deadEnemies = world.cleanEnemies();\n for (BasicEnemy e : deadEnemies) {\n reactToEnemyDefeat(e);\n }\n List<BasicEnemy> newEnemies = world.possiblySpawnEnemies();\n for (BasicEnemy newEnemy : newEnemies) {\n loadEnemies(newEnemy);\n }\n printThreadingNotes(\"HANDLED TIMER\");\n loopNumber.setText(\"Loop: \" + (int) world.getCurrentLoop().get());\n if (world.isCharacterDead()) {\n if (!world.useOneRing())\n deadSwitchToMainMenu(false);\n return;\n }\n if (world.isAtHeroCastle() && world.shouldShopAppear()) {\n System.out.println(\"At Hero Castle. Shopping!\");\n shopSwitchToMainMenu();\n }\n }));\n timeline.setCycleCount(Animation.INDEFINITE);\n timeline.play();\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 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}", "protected abstract void scheduleSuspicions();", "public void run() {\n Set<Philosopher> disabledPhils = new HashSet<Philosopher>();\r\n // True if last philosopher who tried to eat succeed\r\n boolean wasAttemptSuccessful = false;\r\n final long startTime = System.currentTimeMillis();\r\n while (System.currentTimeMillis() - startTime < runningTime) {\r\n if (wasAttemptSuccessful || hungryPhils.isEmpty()) {\r\n hungryPhils.addAll(disabledPhils);\r\n disabledPhils.clear();\r\n }\r\n Philosopher philBeingServed = null;\r\n try {\r\n philBeingServed = hungryPhils.take(); // get phil with the highest priority\r\n disabledPhils.add(philBeingServed);\r\n if (forks.get(philBeingServed.id).attempt(1)) { // Could use tryLock instead\r\n if (FireStarter.isDebugEnabled) {\r\n System.out.println(\"[\" + philBeingServed.id + \"] took left fork\");\r\n }\r\n if (forks.get(philBeingServed.id + 1).attempt(Math.round(Math.random() *\r\n (MAX_ATTEMPT_TIME + 1)))) {\r\n if (FireStarter.isDebugEnabled) {\r\n System.out.println(\"[\" + philBeingServed.id + \"] took right fork\");\r\n }\r\n philBeingServed.giveMeal();\r\n disabledPhils.remove(philBeingServed);\r\n wasAttemptSuccessful = true;\r\n } else {\r\n wasAttemptSuccessful = false;\r\n forks.get(philBeingServed.id).release();\r\n if (FireStarter.isDebugEnabled) {\r\n System.out.println(\"[\" + philBeingServed.id + \"] put left fork\");\r\n }\r\n }\r\n } else {\r\n wasAttemptSuccessful = false;\r\n }\r\n } catch (InterruptedException e) {\r\n if (philBeingServed != null) {\r\n forks.get(philBeingServed.id).release();\r\n forks.get(philBeingServed.id + 1).release();\r\n }\r\n e.printStackTrace();\r\n }\r\n if (FireStarter.isDebugEnabled) {\r\n System.out.printf(\"\\n\\n\"); // Kinda delimiter\r\n FireStarter.isDebugEnabled = false; // Stop producing messages from philosophers\r\n }\r\n }\r\n }", "public void run(){\n\t\twhile(true){\n\n\t\t\ttry {\n\t\t\t\tsleep(200);\n\t\t\t} catch (InterruptedException e) {\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t// sleep mode\n\t\t\tif(isSuspended==true)\n\t\t\t\tsynchronized (this) {\n\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\twait();\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t//movement\n\t\t\tif(isSuspended==false)\n\t\t\t{\n\n\t\t\t\tif(state.toString() == \"Satiated\"&&counter%Frequency==0&&(!Singleton.getInstance().getFood())){\n\t\t\t\t\tnew Hungry().SetState(this);\t\n\t\t\t\t\tnotifyObservers();\n\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t\tcounter++;\n\n\t\t\t\t//checking food\n\t\t\t\tif(Singleton.getInstance().getFood() && state.toString() == \"Hungry\") //, set movement to the center\n\t\t\t\t{\n\t\t\t\t\ttry {\n\t\t\t\t\t\tbarrier.await();\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} catch (BrokenBarrierException 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\n\t\t\t\t\tv_old = Math.sqrt(x_speed*x_speed + y_speed*y_speed); \t\t\t\t\t\t\t\n\t\t\t\t\tdouble K = Math.abs( (double)(y_front - MyFrame.getHeight()/2) / (double)(x_front - MyFrame.getWidth()/2));\n\t\t\t\t\tv_hor_new = v_old / Math.sqrt(K*K+1);\t\t\t\t\t\n\t\t\t\t\tv_ver_new = v_hor_new * K;\t\t\t\t\t\t\t\t\t\t\t\n\n\n\t\t\t\t\twhile(Singleton.getInstance().getFood()==true)\n\t\t\t\t\t{\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tsleep(200);\n\t\t\t\t\t\t} catch (InterruptedException e) {\t\t\t\t\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(x_front>MyFrame.getWidth()/2)\n\t\t\t\t\t\t\tx_dir = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tx_dir=1;\n\t\t\t\t\t\tif(y_front>MyFrame.getHeight()/2)\n\t\t\t\t\t\t\ty_dir=-1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ty_dir=1;\n\n\t\t\t\t\t\tx_front+=(int)v_hor_new*x_dir;\n\t\t\t\t\t\ty_front+=(int)v_ver_new*y_dir;\n\n\t\t\t\t\t\tif((Math.abs(x_front-MyFrame.getWidth()/2) <= 5) && (Math.abs(y_front-MyFrame.getHeight()/2) <= 5))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.eatInc();\n\t\t\t\t\t\t\tSingleton.getInstance().eatFood();\n\t\t\t\t\t\t\tnew Satiated().SetState(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tMyFrame.repaint();\n\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\t\t\t\telse //no food\n\t\t\t\t{\n\t\t\t\t\tx_front+=x_speed*x_dir;\n\t\t\t\t\ty_front+=y_speed*y_dir;\n\t\t\t\t\tMyFrame.repaint();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//check if direction changed\n\n\t\t\tif(x_front>=MyFrame.getWidth())\n\t\t\t{\n\t\t\t\tx_dir=-1;\n\n\t\t\t}\n\t\t\tif(y_front>=MyFrame.getHeight())\n\t\t\t{\n\t\t\t\ty_dir=-1;\n\n\t\t\t}\n\t\t\tif(x_front<=0)\n\t\t\t{\n\t\t\t\tx_dir=1;\n\n\t\t\t}\n\n\t\t\tif(y_front<=0)\n\t\t\t{\n\t\t\t\ty_dir=1;\n\n\t\t\t}\n\n\t\t\tMyFrame.repaint();\n\n\n\n\t\t}\n\n\t}", "public void processStimulus(java.util.Enumeration en) {\n//\t\tSystem.out.println(\"physics\");\n// performPhysics();\n\n//\t\tSystem.out.println(\"behavior\");\n doEveryFrame();\n\n//\t\tobjHPindicator\n// hpAppear.setColoringAttributes(new ColoringAttributes(1.0f - (float) hitpoints / (float) maxHitpoints, (float) hitpoints / (float) maxHitpoints, 0.0f, ColoringAttributes.NICEST));\n\n// refreshPosition();\n\n if (isAlive()) {\n wakeupOn(w);\n } else {\n kill();\n }\n }", "public void autosimulateCombat() {\n\n int monstersRemainingHealth = monster.getHealth() - player.getPower();\n int playersRemainingHealth = player.getHealth() - monster.getPower();\n\n while (player.getHealth() > 0 && monster.getHealth() > 0) {\n\n monster.setHealth(monstersRemainingHealth);\n monstersRemainingHealth = monster.getHealth() - player.getPower();\n\n\n player.setHealth(playersRemainingHealth);\n playersRemainingHealth = player.getHealth() - monster.getPower();\n\n }\n isPlayerDefeated();\n return;\n }", "public void pickUpTimer()\r\n\t{\t\t\r\n\t\tSystem.out.println(timer.get());\r\n\t\tif(timer.get() < Config.Auto.timeIntakeOpen)\r\n\t\t{\r\n\t\t\t//claw.openClaw();\r\n\t\t\tSystem.out.println(\"in second if\");\r\n\t\t}\r\n\t\t\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeElevatorStack)\r\n\t\t{\r\n\t\t\t//elevator.setLevel(elevatorLevel);\r\n\t\t\t//elevatorLevel++;\r\n\t\t}\r\n\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeIntakeClose)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"in first if\");\r\n\t\t\t//claw.closeClaw();\r\n\t\t}\r\n\t\t\r\n\t\telse\r\n\t\t\tendRoutine();\r\n\t}", "@Override\n\tpublic void doTimeStep() {\n\t\tint activity = Critter.getRandomInt(3);\n\t\tif(activity == 0) {\n\t\t\twalk(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(activity == 1) {\t\t\t\t\n\t\t\trun(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(this.getEnergy() >= Params.min_reproduce_energy) {\n\t\t\tCritter4 egg = new Critter4();\n\t\t\tthis.reproduce(egg,Critter.getRandomInt(8));\n\t\t}\n\t\telse {\n\t\t}\n\t}", "public static void worldTimeStep() {\n\t\t\n\t//Do time step for all critters\n\t\tfor (Critter c: population) {\n\t\t\tc.doTimeStep();\t\t\t\n\t\t}\n\t\n\t\t\n\t//Resolve encounters\n\t\tIterator<Critter> it1 = population.iterator();\n\t\tfightMode = true;\n\t\twhile(it1.hasNext())\n\t\t{\n\t\t\tCritter c = it1.next();\n\t\t\tIterator<Critter> it2 = population.iterator();\n\t\t\twhile(it2.hasNext()&&(c.energy > 0)) \n\t\t\t{\t\n\t\t\t\tCritter a =it2.next();\n\t\t\t\tif((c != a)&&(a.x_coord==c.x_coord)&&(a.y_coord==c.y_coord))\n\t\t\t\t{\n\t\t\t\t\tboolean cFighting = c.fight(a.toString());\n\t\t\t\t\tboolean aFighting = a.fight(c.toString());\n\t\t\t\t//If they are both still in the same location and alive, then fight\n\t\t\t\t\tif ((a.x_coord == c.x_coord) && (a.y_coord == c.y_coord) && (a.energy > 0) && (c.energy > 0)) {\t\t\n\t\t\t\t\t\tint cFight=0;\n\t\t\t\t\t\tint aFight=0;\n\t\t\t\t\t\tif(cFighting)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcFight = getRandomInt(100);\n\t\t\t\t\t\t\tcFight++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(aFighting)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\taFight =getRandomInt(100);\n\t\t\t\t\t\t\taFight++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(cFight>aFight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tc.energy+=(a.energy/2);\n\t\t\t\t\t\t\t//it2.remove();\n\t\t\t\t\t\t\ta.energy=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(aFight>cFight)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta.energy+=(c.energy/2);\n\t\t\t\t\t\t\t//it1.remove()\n\t\t\t\t\t\t\tc.energy=0;\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\tif(aFight>50)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ta.energy+=(c.energy/2);\n\t\t\t\t\t\t\t\t//it1.remove();\n\t\t\t\t\t\t\t\tc.energy=0;\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\tc.energy+=(a.energy);\n\t\t\t\t\t\t\t\t//it2.remove();\n\t\t\t\t\t\t\t\ta.energy=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfightMode = false;\n\t\t\n\t//Update rest energy and reset hasMoved\n\t\tfor (Critter c2: population) {\n\t\t\tc2.hasMoved = false;\n\t\t\tc2.energy -= Params.rest_energy_cost;\n\t\t}\n\t\t\n\t//Spawn offspring and add to population\n\t\tpopulation.addAll(babies);\n\t\tbabies.clear();\n\t\t\n\t\tIterator<Critter> it3 = population.iterator();\n\t\twhile(it3.hasNext())\n\t\t{\n\t\t\tif(it3.next().energy<=0)\n\t\t\t\tit3.remove();\n\t\t}\n\t//Create new algae\n\t\tfor (int i = 0; i < Params.refresh_algae_count; i++) {\n\t\t\ttry {\n\t\t\t\tmakeCritter(\"Algae\");\n\t\t\t} catch (InvalidCritterException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\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 teleopPeriodic() {\n Scheduler.getInstance().run();\n rumbleInYourPants();\n turnSpindleIfNeeded();\n turnWinchIfNeeded();\n if (arcadeDrive != null) \n arcadeDrive.start();\n }", "@Override\n\t\tpublic void run() {\n\n\n\t\t\tif (((CitizensNPC)myNPC).getHandle() == null ) sentryStatus = Status.isDEAD; // incase it dies in a way im not handling.....\n\n\t\t\tif (sentryStatus != Status.isDEAD && System.currentTimeMillis() > oktoheal && HealRate > 0) {\n\t\t\t\tif (myNPC.getBukkitEntity().getHealth() < sentryHealth) {\n\t\t\t\t\tmyNPC.getBukkitEntity().setHealth(myNPC.getBukkitEntity().getHealth() + 1);\n\t\t\t\t\tif (healanim!=null)net.citizensnpcs.util.Util.sendPacketNearby(myNPC.getBukkitEntity().getLocation(),healanim , 64);\n\n\t\t\t\t\tif (myNPC.getBukkitEntity().getHealth() >= sentryHealth) _myDamamgers.clear(); //healed to full, forget attackers\n\n\t\t\t\t}\n\t\t\t\toktoheal = (long) (System.currentTimeMillis() + HealRate * 1000);\n\t\t\t}\n\n\t\t\tif (sentryStatus == Status.isDEAD && System.currentTimeMillis() > isRespawnable && RespawnDelaySeconds != 0) {\n\t\t\t\t// Respawn\n\n\t\t\t\t// Location loc =\n\t\t\t\t// myNPC.getTrait(CurrentLocation.class).getLocation();\n\t\t\t\t// if (myNPC.hasTrait(Waypoints.class)){\n\t\t\t\t// Waypoints wp = myNPC.getTrait(Waypoints.class);\n\t\t\t\t// wp.getCurrentProvider()\n\t\t\t\t// }\n\n\t\t\t\t// plugin.getServer().broadcastMessage(\"Spawning...\");\n\t\t\t\tif (guardEntity == null) {\n\t\t\t\t\tmyNPC.spawn(Spawn);\n\t\t\t\t} else {\n\t\t\t\t\tmyNPC.spawn(guardEntity.getLocation().add(2, 0, 2));\n\t\t\t\t}\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\telse if (sentryStatus == Status.isHOSTILE && myNPC.isSpawned()) {\n\n\t\t\t\tif (projectileTarget != null && !projectileTarget.isDead()) {\n\t\t\t\t\tif (_projTargetLostLoc == null)\n\t\t\t\t\t\t_projTargetLostLoc = projectileTarget.getLocation();\n\n\t\t\t\t\tfaceEntity(myNPC.getBukkitEntity(), projectileTarget);\n\n\t\t\t\t\tif (System.currentTimeMillis() > oktoFire) {\n\t\t\t\t\t\t// Fire!\n\t\t\t\t\t\toktoFire = (long) (System.currentTimeMillis() + AttackRateSeconds * 1000.0);\n\t\t\t\t\t\tFire(projectileTarget);\n\t\t\t\t\t}\n\t\t\t\t\tif (projectileTarget != null)\n\t\t\t\t\t\t_projTargetLostLoc = projectileTarget.getLocation();\n\n\t\t\t\t\treturn; // keep at it\n\n\t\t\t\t}\n\n\t\t\t\telse if (meleeTarget != null && !meleeTarget.isDead()) {\n\t\t\t\t\t// Did it get away?\n\t\t\t\t\tif (meleeTarget.getLocation().distance(myNPC.getBukkitEntity().getLocation()) > sentryRange) {\n\t\t\t\t\t\t// it got away...\n\t\t\t\t\t\tsetTarget(null);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// target died or null\n\t\t\t\t\tsetTarget(null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse if (sentryStatus == Status.isLOOKING && myNPC.isSpawned()) {\n\n\t\t\t\tif (guardTarget != null && guardEntity == null) {\n\t\t\t\t\t// daddy? where are u?\n\t\t\t\t\tsetGuardTarget(guardTarget);\n\t\t\t\t}\n\n\t\t\t\tLivingEntity target = findTarget(sentryRange);\n\n\t\t\t\tif (target != null) {\n\t\t\t\t\t// plugin.getServer().broadcastMessage(\"Target selected: \" +\n\t\t\t\t\t// target.toString());\n\t\t\t\t\tsetTarget(target);\n\t\t\t\t} else\n\t\t\t\t\tsetTarget(null);\n\n\t\t\t}\n\n\t\t}", "private void attack() {\n final Random rnd = new Random();\n // Создаем WorkerThread\n attackerExecutor = Executors.newScheduledThreadPool(1);\n mAttackExecuter = attackerExecutor.scheduleWithFixedDelay(new Runnable() {\n @Override\n public void run() {\n for (int i =0; i<enemyPerWave;i++){\n int x = (int) (rnd.nextInt((int) (rightBorder-leftBorder))+leftBorder);\n\n createBossBall(x,0);\n }\n attackRatee-=attackLiveRate;\n if (attackRatee < 100){\n mAttackExecuter.cancel(true);\n attackerExecutor.shutdownNow();\n\n }\n }\n }, 0,attackLiveRate , TimeUnit.MILLISECONDS);\n\n }", "public void fullyHeal() {\n removeStatus();\n getActualMoves().restoreAllPP();\n healHealthFraction(1);\n }", "@Override\r\n\tpublic void run() {\r\n\r\n\t\ttry {\r\n\t\t\tThread.sleep(INITIAL_DELAY);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace(System.err);\r\n\t\t}\r\n\r\n\t\tShapedEnemy aimedEnemy = null;\r\n\r\n\t\twhile (attacking) {\r\n\t\t\tif(!aiming){\r\n\t\t\t\taimedEnemy = new AimingAI(enemies, tower, GameConsts.PREFERRED_AIMING_STRATEGY).getBestOption();\r\n\t\t\t\tif(aimedEnemy != null){\r\n\t\t\t\t\taiming = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(15);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\te.printStackTrace(System.err);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\tif(aimedEnemy != null){\r\n\t\t\t\tthis.tower.setAngle(270D - MathUtil.calculateAngle(\r\n\t\t\t\t\t\t(int) tower.getCenter().getX(), (int) tower.getCenter().getY(),\r\n\t\t\t\t\t\t(int) aimedEnemy.getCenter().getX(), (int) aimedEnemy.getCenter().getY()));\r\n\r\n\t\t\t\tfor (int i = 0; i < tower.getRotatedFrames().length; i++) {\r\n\t\t\t\t\tthis.tower.setNextFrame();// animacion de disparo\r\n\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(30);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\te.printStackTrace(System.err);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tgridPanel.shootEnemy(new Point2D.Double(tower\r\n\t\t\t\t\t\t.getShape().getBounds2D().getCenterX(), tower\r\n\t\t\t\t\t\t.getShape().getBounds2D().getCenterY()),\r\n\t\t\t\t\t\tnew Point2D.Double(ConversorUtil\r\n\t\t\t\t\t\t\t\t.logicToPixels(aimedEnemy.getX()) + ConversorUtil.logicToPixels(1) / 2,\r\n\t\t\t\t\t\t\t\tConversorUtil.logicToPixels(aimedEnemy.getY()) + ConversorUtil.logicToPixels(1) / 2), tower\r\n\t\t\t\t\t\t\t\t.getTowerClr(), tower.getShootStyle());\r\n\r\n\t\t\t\tplayAttackSound();\r\n\r\n\t\t\t\taimedEnemy.reduceLife(tower.getShootDamage());\r\n\r\n\t\t\t\tif(!ModelUtil.isValidTarget(aimedEnemy, tower)){\r\n\t\t\t\t\taiming = false;\r\n\r\n\t\t\t\t\tif(aimedEnemy.getRemainingLife() <= 0){\r\n\t\t\t\t\t\tif(ModelUtil.countDeadEnemies(enemies) == enemies.size()){\r\n\t\t\t\t\t\t\tattacking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(tower.getShootDelay().longValue());\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\te.printStackTrace(System.err);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\ttower.setAngle(0.0D);\r\n\t\tSystem.out.println(\"[ INFO] TowerAttack Finished - \"\r\n\t\t\t\t+ Thread.currentThread().toString());\r\n\t}", "public void tick(){\n oilLevel --;\n maintenance --;\n happiness --;\n health --;\n boredom ++;\n }", "public void passTime(){\n growPop();\n growGdp();\n growSocial();\n growLiving();\n }", "public static void doEncounters() {\r\n \t\r\n \tIterator<String> populationIter = population.keySet().iterator();\r\n\t\twhile (populationIter.hasNext()) { \r\n\t String pos = populationIter.next();\r\n\t ArrayList<Critter> critterList = population.get(pos);\r\n\t if(critterList.size() > 1) {\r\n\t \tint[] coords = stringToPos(pos);\r\n\t \t//get the integer value of the coordinates from the String key\r\n\t \tint x_copy = coords[0];\r\n\t \tint y_copy = coords[1];\r\n\t \t\r\n\t \tfor(int i = 0; i < critterList.size(); i++) {\r\n\t \t\tfor (int j = i+1; j < critterList.size(); j++) {\r\n\t \t\t\tCritter A = critterList.get(i);\r\n\t \t\t\tCritter B = critterList.get(j);\r\n\t \t\t\tif(A.getEnergy() > 0 && B.getEnergy() > 0 && A.x_coord == x_copy && A.y_coord == y_copy && B.x_coord == x_copy && B.y_coord == y_copy) {\r\n\t \t\t\t\t\r\n\t \t\t\t\t//Critters A and B are fighting\r\n\t \t\t\t\tA.isFight = true;\r\n\t \t\t\t\tB.isFight = true;\r\n\t \t\t\t\t\r\n\t \t\t\t\t//boolean AWantsToFight = A.fight(B.toString());\r\n\t \t\t\t\t//boolean BWantsToFight = B.fight(A.toString());\r\n\t \t\t\t\tint skillA = 0;\r\n\t \t\t\t\tint skillB = 0;\r\n\t \t\t\t\t\r\n\t \t\t\t\t//determine how A wants to respond\r\n\t \t\t\t\tif(A.fight(B.toString()) == true) {\r\n\t \t\t\t\t\tskillA = getRandomInt(A.energy);\r\n\t \t\t\t\t}\r\n\t \t\t\t\t\r\n\t \t\t\t\t//determine how B wants to respond\r\n\t \t\t\t\tif(B.fight(A.toString()) == true) {\r\n\t \t\t\t\t\tskillB = getRandomInt(B.energy);\r\n\t \t\t\t\t}\r\n\t \t\t\t\tif(A.x_coord == x_copy && B.x_coord == x_copy && A.y_coord == y_copy && B.y_coord == y_copy) {\r\n\t \t\t\t\t\tif(skillA > skillB) { // A wins\r\n\t \t\t\t\t\t\tA.energy += (int) Math.floor(B.energy*1.0*0.5);\r\n\t \t\t\t\t\t\tB.energy = 0;\r\n\t \t\t\t\t\t} else if (skillB > skillA) {\r\n\t \t\t\t\t\t\tB.energy += (int) Math.floor(A.energy*1.0*0.5); //B wins\r\n\t \t\t\t\t\t\tA.energy = 0;\r\n\t \t\t\t\t\t} else {\r\n\t \t\t\t\t\t\tif(getRandomInt(1) == 0) { // A wins\r\n\t\t \t\t\t\t\t\tA.energy += (int) Math.floor(B.energy*1.0*0.5);\r\n\t\t \t\t\t\t\t\tB.energy = 0;\r\n\t \t\t\t\t\t\t} else {\r\n\t\t \t\t\t\t\t\tB.energy += (int) Math.floor(A.energy*1.0*0.5); //B wins\r\n\t\t \t\t\t\t\t\tA.energy = 0;\r\n\t \t\t\t\t\t\t}\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t}\r\n\t \t\t\t\t\r\n\t \t\t\t\t//Critters A and B have completed their fight\r\n\t \t\t\t\tA.isFight = false;\r\n\t \t\t\t\tB.isFight = false;\r\n\t \t\t\t\t\r\n\t \t\t\t\tcritterList.set(i, A);\r\n\t \t\t\t\tcritterList.set(j, B);\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t}\r\n\t \t\r\n\t \t//Iterate through the critters in that position\r\n\t \tIterator<Critter> crittIter = critterList.iterator();\r\n\t \twhile(crittIter.hasNext()) {\r\n\t \t\tCritter c = crittIter.next();\r\n\t \t\t//remove critters who have moved out of that grid position or who have died\r\n\t \t\tif(c.x_coord != x_copy || c.y_coord != y_copy || (c.energy <= 0)) {\r\n\t \t\t\tcrittIter.remove();\r\n\t \t\t}\r\n\t \t}\r\n\t \tpopulation.replace(pos, critterList);\r\n\t }\r\n\t\t}\r\n }", "private void combatPhase() {\n \t\n \tpause();\n \tDice.setFinalValMinusOne();\n\n \t// Go through each battle ground a resolve each conflict\n \tfor (Coord c : battleGrounds) {\n \t\t\n \tClickObserver.getInstance().setTerrainFlag(\"\");\n \t\n \tSystem.out.println(\"Entering battleGround\");\n \t\tfinal Terrain battleGround = Board.getTerrainWithCoord(c);\n \t\t\n \t\t// find the owner of terrain for post combat\n \tPlayer owner = battleGround.getOwner();\n \t\n \t\t// simulate a click on the first battleGround, cover all other terrains\n \t\tClickObserver.getInstance().setClickedTerrain(battleGround);\n \t\tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\tClickObserver.getInstance().whenTerrainClicked();\n \t\tBoard.applyCovers();\n \t\tClickObserver.getInstance().getClickedTerrain().uncover();\n \tClickObserver.getInstance().setTerrainFlag(\"Disabled\");\n }\n });\n \t\t\n \t\t// Get the fort\n \t Fort battleFort = battleGround.getFort(); \n \t\t\n \t\t// List of players to battle in the terrain\n \t\tArrayList<Player> combatants = new ArrayList<Player>();\n \t\t\n \t\t// List of pieces that can attack (including forts, city/village)\n \t\tHashMap<String, ArrayList<Piece>> attackingPieces = new HashMap<String, ArrayList<Piece>>();\n \t\t\n \t\tSystem.out.println(battleGround.getContents().keySet());\n \t\t\n \t\tIterator<String> keySetIterator = battleGround.getContents().keySet().iterator();\n\t \twhile(keySetIterator.hasNext()) {\n\t \t\tString key = keySetIterator.next();\n\t \t\t\n \t\t\tcombatants.add(battleGround.getContents().get(key).getOwner());\n \t\t\tattackingPieces.put(battleGround.getContents().get(key).getOwner().getName(), (ArrayList<Piece>) battleGround.getContents().get(key).getStack().clone()); \n \t\t\t\n\t \t}\n\t \t\n\t \t\n\t \t\n\t \t// if the owner of the terrain has no pieces, just a fort or city/village\n\t\t\tif (!combatants.contains(battleGround.getOwner()) && battleFort != null) {\n\t\t\t\tcombatants.add(battleGround.getOwner());\n\t\t\t\tattackingPieces.put(battleGround.getOwner().getName(), new ArrayList<Piece>());\n\t\t\t}\n\n \t\t// add forts and city/village to attackingPieces\n \t\tif (battleFort != null) {\n \t\t\tattackingPieces.get(battleGround.getOwner().getName()).add(battleFort);\n \t\t}\n \t\t\n \t\tkeySetIterator = attackingPieces.keySet().iterator();\n\t \twhile (keySetIterator.hasNext()) {\n\t \t\tString key = keySetIterator.next();\n\t \t\t\n\t \t\tfor (Piece p : attackingPieces.get(key)) {\n\t \t\t\tif (p.getName().equals(\"Baron Munchhausen\") || p.getName().equals(\"Grand Duke\")) {\n\t \t\t\t\tif (p.getOwner() != battleGround.getOwner())\n\t \t\t\t\t\t((Performable)p).specialAbility();\n\t \t\t\t}\n\t \t\t\t\t\n\t \t\t}\n\t \t}\n \t\t// TODO implement city/village\n// \t\tif (City and village stuff here)\n \t\tSystem.out.println(combatants);\n \t\t\n \t\tboolean exploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t// Fight until all attackers are dead, or until the attacker becomes the owner of the hex\n \t\twhile (combatants.size() > 1 || exploring) {\n \t\t\t\n /////////////Exploration\n \t// Check if this is an exploration battle:\n \t\t// Must fight other players first\n \t\t\tboolean fightingWildThings = false;\n \tif (exploring) {\n\n \t\t\t\t// Set the battleGround explored\n \t\t\t\tbattleGround.setExplored(true);\n \t\n \t\tString exploringPlayer = null;\n \t\tIterator<String> keySetIter = battleGround.getContents().keySet().iterator();\n \t \twhile(keySetIter.hasNext()) {\n \t \t\tString key = keySetIter.next();\n \t \t\texploringPlayer = key;\n \t \t}\n \t\tplayer = battleGround.getContents(exploringPlayer).getOwner();\n \t\tplayer.flipAllUp();\n \t \t\n \t\t// Get user to roll die to see if explored right away\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \tDiceGUI.getInstance().uncover();\n \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n \t \t\t\t+ \", roll the die. You need a 1 or a 6 to explore this terrain without a fight!\");\n \t }\n \t\t\t\t});\n \t\t\t\t\n \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\tint luckyExplore = -1;\n \t\t\t\twhile (luckyExplore == -1) {\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\tluckyExplore = Dice.getFinalVal();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// If success TODO FIX this \n \t\t\t\tif (luckyExplore == 1 || luckyExplore == 6) {\n \t\t\t\t\t\n \t\t\t\t\t// Cover die. Display msg\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \tDiceGUI.getInstance().cover();\n \t\t \tGUI.getHelpText().setText(\"Attack phase: Congrats!\" + player.getName() \n \t\t \t\t\t+ \"!, You get the terrain!\");\n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\texploring = false;\n \t\t\t\t\tbreak;\n \t\t\t\t\t\n \t\t\t\t} else { // Else failure. Must fight or bribe\n \t\t\t\t\t\n \t\t\t\t\tfightingWildThings = true;\n \t\t\t\t\t\n \t\t\t\t\t// Cover die. Display msg\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \tDiceGUI.getInstance().cover();\n \t\t \tbattleGround.coverPieces();\n \t\t \tGUI.getHelpText().setText(\"Attack phase: Boooo!\" + player.getName() \n \t\t \t\t\t+ \"!, You have to bribe, or fight for your right to explore!\");\n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t// add luckyExplore amount of pieces to terrain under wildThing player\n \t\t\t\t\tfinal ArrayList<Piece> wildPieces = TheCup.getInstance().draw(luckyExplore);\n \t\t\t\t\t\t\n \t\t\t\t\t// Update the infopanel with played pieces. Active done button\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t @Override\n \t\t public void run() {\n \t\t \twildThings.playWildPieces(wildPieces, battleGround);\n \t\t GUI.getDoneButton().setDisable(false);\n \t\t battleGround.coverPieces();\n \t\t \tInfoPanel.showTileInfo(battleGround);\n \t\t \n \t\t }\n \t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t//////Bribing here\n \t\t\t\t\tpause();\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectCreatureToBribe\");\n \t\t\t\t\t\n \t\t\t\t\t// Uncover the pieces that the player can afford to bribe\n \t\t\t\t\t// canPay is false if there are no Pieces that the user can afford to bribe\n \t\t\t\t\tboolean canPay = false;\n \t\t\t\t\tfor (final Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n \t\t\t\t\t\tif (((Combatable)p).getCombatValue() <= player.getGold()) {\n \t\t\t\t\t\t\tcanPay = true;\n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t\t\t @Override\n \t\t\t\t public void run() {\n \t\t\t\t \tp.uncover();\n \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\ttry { Thread.sleep(50); } catch( Exception e ){ return; }\n \t\t\t\t\t\n \t\t\t\t\t// Continue looping until there are no more pieces user can afford to bribe, or user hits done button\n \t\t\t\t\twhile (canPay && isPaused) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t\t @Override\n\t \t\t public void run() {\n\t \t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t \t\t \t\t\t+ \", Click on creatures you would like to bribe\");\n\t \t\t }\n \t\t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t\t// wait for user to hit done, or select a piece\n \t\t\t\t\t\tpieceClicked = null;\n \t\t\t\t\t\twhile(pieceClicked == null && isPaused) {\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (pieceClicked != null) {\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// spend gold for bribing. Remove clicked creature\n \t\t\t\t\t\t\tplayer.spendGold(((Combatable)pieceClicked).getCombatValue());\n \t\t\t\t\t\t\t((Combatable)pieceClicked).inflict();\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// cover pieces that are too expensive\n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t\t\t\t @Override\n \t\t\t\t public void run() {\n \t\t\t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n \t\t\t \t\t\t+ \" bribed \" + pieceClicked.getName());\n \t\t\t\t \tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t \tif (battleGround.getContents(wildThings.getName()) != null) {\n\t \t\t\t\t for (Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n\t \t\t\t\t \tif (((Combatable)p).getCombatValue() > player.getGold())\n\t \t\t\t\t \t\tp.cover();\n\t \t\t\t\t }\n \t\t\t\t \t}\n \t\t\t\t }\n \t\t\t\t\t\t\t});\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\t// Check if there are any pieces user can afford to bribe and set canPay to true if so\n \t\t\t\t\t\t\tcanPay = false;\n \t\t\t\t\t\t\tif (battleGround.getContents(wildThings.getName()) == null || battleGround.getContents(wildThings.getName()).getStack().size() == 1)\n \t\t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\telse {\n\t \t\t\t\t\t\t\tfor (final Piece p : battleGround.getContents(wildThings.getName()).getStack()) {\n\t \t\t\t\t\t\t\t\tif (((Combatable)p).getCombatValue() <= player.getGold()) {\n\t \t\t\t\t\t\t\t\t\tcanPay = true;\n\t \t\t\t\t\t\t\t\t\tbreak;\n\t \t\t\t\t\t\t\t\t}\n\t \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t @Override\n\t\t\t public void run() {\n\t\t\t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t\t \t\t\t+ \" done bribing\");\n\t\t\t }\n \t\t\t\t\t});\n \t\t\t\t\tSystem.out.println(\"Made it past bribing\");\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\t\n \t\t\t\t\t// Done bribing, on to fighting\n \t\t\t\t\t\n \t\t\t\t\t// find another player to control wildThings and move on to regular combat\n \t\t\t\t\t// to be used later \n \t\t\t\t\tPlayer explorer = player;\n \t\t\t\t\tPlayer wildThingsController = null;\n \t\t\t\t\tfor (Player p : playerList) {\n \t\t\t\t\t\tif (!p.getName().equals(player.getName()))\n \t\t\t\t\t\t\twildThingsController = p;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t// If wild things still has pieces left:\n \t\t\t\t\tif (battleGround.getContents().containsKey(wildThings.getName())) {\n\t \t\t\t\t\tcombatants.add(battleGround.getContents().get(wildThings.getName()).getOwner());\n\t \t \t\t\tattackingPieces.put(wildThings.getName(), (ArrayList<Piece>) battleGround.getContents().get(wildThings.getName()).getStack().clone()); \n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// cover pieces again\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \tbattleGround.coverPieces();\n \t }\n \t\t\t\t});\n \t\t\t\t\n \t\t\t\tplayer.flipAllDown();\n \t} // end if (exploring)\n \t\t\t\n \t\t\tSystem.out.println(\"combatants.size() > 1 : \" + combatants.size());\n \t\t\tSystem.out.println(combatants);\n \t\t\t\n \t\t\t// This hashMap keeps track of the player to attack for each player\n \t\t\tHashMap<String, Player> toAttacks = new HashMap<String, Player>();\n\n\t\t\t\t// each player selects which other player to attack in case of more than two combatants\n \t\t\tif (combatants.size() > 2) {\n \t\t\t\t\n \t\t\t\tfor (final Player p : combatants) {\n \t\t\t\t\tif (!p.isWildThing()) {\n\t \t \t\tpause();\n\t \t \t\tClickObserver.getInstance().setPlayerFlag(\"Attacking: SelectPlayerToAttack\");\n\t \t \t\tplayer = p;\n\t\t \tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t \tPlayerBoard.getInstance().applyCovers();\n\t\t \t \tbattleGround.coverPieces();\n\t\t \t \t GUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t\t \t + \", select which player to attack\");\n\t\t\t \t \t}\n\t\t \t });\n\t\t \tfor (final Player pl : combatants) {\n\t\t \t\tif (!pl.getName().equals(player.getName())) {\n\t\t \t\t\tPlatform.runLater(new Runnable() {\n\t\t \t \t @Override\n\t\t \t \t public void run() {\n\t\t \t \t \tPlayerBoard.getInstance().uncover(pl);\n\t\t \t \t }\n\t\t \t\t\t});\n\t\t \t\t}\n\t\t \t}\n\t\t \twhile (isPaused) {\n\t\t \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t\t \t }\n\t\t \t\n\t\t \t// ClickObserver sets playerClicked, then unpauses. This stores what player is attacking what player\n\t\t \ttoAttacks.put(p.getName(), playerClicked);\n\t \t \t\tClickObserver.getInstance().setPlayerFlag(\"\");\n\t\t \t\n\t \t \t} \n \t\t\t\t}\n \t\t\t\tcombatants.remove(wildThings);\n \t\t\t\tPlayerBoard.getInstance().removeCovers();\n \t\t\t\t\n \t } else { // Only two players fighting\n \t \t\n \t \tfor (Player p1 : combatants) {\n \t \t\tfor (Player p2 : combatants) {\n \t \t\t\tif (!p1.getName().equals(p2.getName())) {\n \t \t \ttoAttacks.put(p1.getName(), p2);\n \t \t\t\t}\n \t \t\t}\n \t \t}\n \t }\n \t\t\t\n ///////////////////Call out bluffs here:\n \t\t\tbattleGround.flipPiecesUp();\n \t\t\tfor (final Player p : combatants) {\n \t\t\t\t\n \t\t\t\t// Make sure not wildThings\n \t\t\t\tif (!p.isWildThing()) {\n \t\t\t\t\t\n \t\t\t\t\tArrayList <Piece> callOuts = new ArrayList<Piece>();\n \t\t\t\t\t\n \t\t\t\t\tfor (final Piece ap : attackingPieces.get(p.getName())) {\n \t\t\t\t\t\t\n \t\t\t\t\t\t// If not supported the gtfo\n \t\t\t\t\t\tif (!ap.isSupported()) {\n\n \t\t\t\t\t\t\tcallOuts.add(ap);\n \t\t\t\t\t\t\t((Combatable)ap).inflict();\n \t\t\t\t\t\t\ttry { Thread.sleep(250); } catch( Exception e ){ return; } \n \t\t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t \t @Override\n\t \t \t public void run() {\n\t \t \t \tInfoPanel.showTileInfo(battleGround);\n\t \t \t \tGUI.getHelpText().setText(\"Attack phase: \" + p.getName()\n\t\t\t \t + \" lost their \" + ap.getName() + \" in a called bluff!\");\n\t \t \t }\n\t \t\t\t});\n \t\t\t\t\t\t\ttry { Thread.sleep(250); } catch( Exception e ){ return; } \n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tfor (Piece co : callOuts) {\n \t\t\t\t\t\tattackingPieces.get(p.getName()).remove(co);\n \t\t\t\t\t}\n\t\t\t\t\t\tif (attackingPieces.get(p.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(p.getName());\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tPlayer baby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\t// Set up this HashMap that will store successful attacking pieces\n \t\t\tHashMap<String, ArrayList<Piece>> successAttacks = new HashMap<String, ArrayList<Piece>>();\n \t\t\t// Set up this HashMap that will store piece marked to get damage inflicted\n\t\t\t\tHashMap<String, ArrayList<Piece>> toInflict = new HashMap<String, ArrayList<Piece>>();\n \t\t\tfor (Player p : combatants) {\n \t\t\t\t\n \t\t\t\tsuccessAttacks.put(p.getName(), new ArrayList<Piece>());\n \t\t\t\ttoInflict.put(p.getName(), new ArrayList<Piece>());\n \t\t\t}\n \t\t\t\n \t\t\t// Array List of pieces that need to be used during a particular phase\n\t\t\t\tfinal ArrayList<Piece> phaseThings = new ArrayList<Piece>();\n\t\t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Magic!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n/////////////////////// Magic phase\n \t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its magic. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && ((Combatable)p).isMagic() && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover magic pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece mag : phaseThings) \n\t \t\t\t\t\tmag.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n\n\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"----------------------------------------------------------------\");\n\t\t\t\t\tSystem.out.println(\"attackingPieces.size(): \" + attackingPieces.size());\n\t\t\t\t\tSystem.out.println(\"attackingPieces.keySet(): \" + attackingPieces.keySet());\n\t\t\t\t\tIterator<String> keySetIte = battleGround.getContents().keySet().iterator();\n \t \twhile(keySetIte.hasNext()) {\n \t \t\tString key = keySetIte.next();\n\n \t\t\t\t\tSystem.out.println(\"key: \" + key);\n \t\t\t\t\tSystem.out.println(\"attackingPieces.get(key).size():\\n\" + attackingPieces.get(key).size());\n \t\t\t\t\tSystem.out.println(\"attackingPieces.get(key):\\n\" + attackingPieces.get(key));\n \t \t}\n\t\t\t\t\tSystem.out.println(\"----------------------------------------------------------------\");\n\t\t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more magic pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a magic piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a magic piece to attack with\");\n\t \t }\n\t \t });\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tpieceClicked.highLight();\n\t \t \tDiceGUI.getInstance().uncover();\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() \n\t \t \t\t\t+ \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\n\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\t\tint attackStrength = -1;\n \t\t\t\t\twhile (attackStrength == -1) {\n \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n \t\t\t\t\t}\n\t\t\t\t\t\t\n \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t \t @Override\n \t \t public void run() {\n \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n \t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n \t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\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\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName()); // 'defender'\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\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// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ti++;\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\t\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Ranged!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n//////////////////// Ranged phase\n\t\t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its ranged. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && ((Combatable)p).isRanged() && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover ranged pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece ran : phaseThings) \n\t \t\t\t\t\tran.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more ranged pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a ranged piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a ranged piece to attack with\");\n\t \t }\n\t \t });\n\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tpieceClicked.highLight();\n\t \t \tDiceGUI.getInstance().uncover();\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t \t + \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\n\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n \t\t\t\t\tint attackStrength = -1;\n \t\t\t\t\twhile (attackStrength == -1) {\n \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n \t\t\t\t\t}\n\t\t\t\t\t\t\n \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n \t\t\t\t\t\t\n \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n \t \t @Override\n \t \t public void run() {\n \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n \t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n \t \t }\n \t\t\t\t\t});\n \t\t\t\t\t\t\n \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t \t\t\t\t\t\tpieceClicked.cover();\n \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\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\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName());\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\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// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\ti++;\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n\t\t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Melee!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t\n\n///////////////////////////// Melee phase\n\t\t\t\tfor (final Player pl : combatants) {\n \t\t\t\t\n \t\t\t\tplayer = pl;\n \t\t\t\t// Cover all pieces\n \t\t\t\tPlatform.runLater(new Runnable() {\n \t @Override\n \t public void run() {\n \t \t\tbattleGround.coverPieces();\n \t }\n \t });\n \t\t\t\t\n \t\t\t\t// For each piece, if its melee. Add it to the phaseThings array\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) {\n \t\t\t\t\tif (p instanceof Combatable && !(((Combatable)p).isRanged() || ((Combatable)p).isMagic()) && !(p instanceof Fort && ((Fort)p).getCombatValue() == 0)) \n \t\t\t\t\t\tphaseThings.add(p);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// uncover melee pieces for clicking\n \t\t\t\tif (phaseThings.size() > 0) {\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \t\t\t\tfor (Piece mel : phaseThings) \n\t \t\t\t\t\tmel.uncover();\n\t \t }\n\t \t });\n \t\t\t\t}\n \t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n \t\t\t\t\n \t\t\t\t// Have user select a piece to attack with until there are no more melee pieces\n \t\t\t\twhile (phaseThings.size() > 0) {\n \t\t\t\t\t\n \t\t\t\t\t// Display message prompting user to select a melee piece\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", select a melee piece to attack with\");\n\t \t }\n\t \t });\n\n \t\t\t\t\t// Wait for user to select piece\n \t\t\t\tpieceClicked = null;\n \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToAttackWith\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t \t\t\t\t\n\t \t\t\t\t// Is it a charging piece?\n\t \t\t\t\tint charger;\n\t \t\t\t\tif (((Combatable)pieceClicked).isCharging()) {\n\t \t\t\t\t\tcharger = 2;\n\t \t\t\t\t} else\n\t \t\t\t\t\tcharger = 1;\n\t \t\t\t\t\n\t \t\t\t\t// do twice if piece is a charger\n\t \t\t\t\tfor (int i = 0; i < charger; i++) {\n\t \t\t\t\t\t\n\t\t \t\t\t\t// hightlight piece that was selected, uncover the die to use, display message about rolling die\n\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t \t @Override\n\t\t \t public void run() {\n\t\t \t \tpieceClicked.highLight();\n\t\t \t \tDiceGUI.getInstance().uncover();\n\t\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName()\n\t\t \t + \", roll the die. You need a \" + ((Combatable)pieceClicked).getCombatValue() + \" or lower\");\n\t\t \t }\n\t \t\t\t\t\t});\n\t \t\t\t\t\t\n\t\t \t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n\t \t\t\t\t\tint attackStrength = -1;\n\t \t\t\t\t\twhile (attackStrength == -1) {\n\t \t\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\t\t\tattackStrength = Dice.getFinalVal();\n\t \t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t \t\t\t\t\t// If the roll was successful. Add to successfulThings Array, and change it image. prompt Failed attack\n\t \t\t\t\t\tif (attackStrength <= ((Combatable)pieceClicked).getCombatValue()) {\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t\tsuccessAttacks.get(player.getName()).add(pieceClicked);\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t \t @Override\n\t \t \t public void run() {\n\t \t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(true);\n\t \t \t\t\t\t\t\tpieceClicked.cover();\n\t \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t \t \t \tGUI.getHelpText().setText(\"Attack phase: Successful Attack!\");\n\t \t \t }\n\t \t\t\t\t\t});\n\t \t\t\t\t\t\t\n\t \t\t\t\t\t} else { // else failed attack, update image, prompt Failed attack\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t \t\t\t\t\t\t((Combatable)pieceClicked).setAttackResult(false);\n\t\t\t \t\t\t\t\t\tpieceClicked.cover();\n\t \t \t\t\t\t\t\tpieceClicked.unhighLight();\n\t\t\t \t \tGUI.getHelpText().setText(\"Attack phase: Failed Attack!\");\n\t\t\t \t }\n\t\t \t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \t\t\t\t\t// If piece is charging, and it is its first attack, remove the cover again\n\t \t\t\t\t\tif (((Combatable)pieceClicked).isCharging() && i == 0) {\n\t \t\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t \t \tpieceClicked.uncover();\n\t\t\t \t }\n\t \t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t\t\n\t \t\t\t\t\t// Pause to a second for easy game play, remove the clicked piece from phaseThings\n\t \t\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n\t \t\t\t\t}\n\n \t\t\t\t\tphaseThings.remove(pieceClicked);\n \t\t\t\t}\n \t\t\t}\n\n\t\t\t\t// For each piece that had success, player who is being attacked must choose a piece\n \t\t\t// Gets tricky here. Will be tough for Networking :(\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Active player is set to the player who 'pl' is attack based on toAttack HashMap\n \t\t\t\tplayer = toAttacks.get(pl.getName());\n \t\t\t\tfinal String plName = pl.getName();\n \t\t\t\t\n \t\t\t\t// For each piece of pl's that has a success (in successAttacks)\n \t\t\t\tint i = 0;\n \t\t\t\tfor (final Piece p : successAttacks.get(plName)) {\n \t\t\t\t\t\n \t\t\t\t\t// If there are more successful attacks then pieces to attack, break after using enough attacks\n \t\t\t\t\tif (i >= attackingPieces.get(player.getName()).size()) {\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// Display message, cover other players pieces, uncover active players pieces\n\t \t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tGUI.getHelpText().setText(\"Attack phase: \" + player.getName() + \", Select a Piece to take a hit from \" + plName + \"'s \" + p.getName());\n\t \t \tbattleGround.coverPieces();\n\t \t \tbattleGround.uncoverPieces(player.getName());\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\t\n\t \t\t\t\t// Cover pieces already choosen to be inflicted. Wait to make sure runLater covers pieces already selected\n\t \t\t\t\tfor (final Piece pi : toInflict.get(player.getName())) {\n\t \t\t\t\t\tif (!((pi instanceof Fort) && ((Fort)pi).getCombatValue() > 0)) {\n\t\t \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t \t @Override\n\t\t\t \t public void run() {\n\t\t\t\t \t\t\t\t\tpi.cover();\n\t\t\t \t }\n\t\t\t\t\t\t\t\t});\n\t \t\t\t\t\t}\n\t \t\t\t\t}//TODO here is where a pause might be needed\n\t \t\t\t\t\n\t \t\t\t\t// Wait for user to select piece\n \t\t\t\t\tpieceClicked = null;\n\t \t\t\t\tClickObserver.getInstance().setCreatureFlag(\"Combat: SelectPieceToGetHit\");\n\t \t\t\t\tClickObserver.getInstance().setFortFlag(\"Combat: SelectPieceToGetHit\");\n \t\t\t\t\twhile (pieceClicked == null) { try { Thread.sleep(100); } catch( Exception e ){ return; } }\n \t\t\t\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n \t\t\t\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\t \t\t\t\n \t\t\t\t\t// Add to arrayList in HashMap of player to mark for future inflict. Cover pieces\n \t\t\t\t\ttoInflict.get(player.getName()).add(pieceClicked);\n \t\t\t\t\tPlatform.runLater(new Runnable() {\n\t \t @Override\n\t \t public void run() {\n\t \t \tbattleGround.coverPieces();\n\t \t }\n\t\t\t\t\t\t});\n \t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t \t\t\t\ti++;\n \t\t\t\t}\n \t\t\t\t// Clear successful attacks for next phase\n \t\t\t\tsuccessAttacks.get(pl.getName()).clear();\n \t\t\t}\n \t\t\t\n \t\t\t// Remove little success and failure images, inflict if necessary\n \t\t\tfor (Player pl : combatants) {\n \t\t\t\t\n \t\t\t\t// Change piece image of success or failure to not visible\n \t\t\t\tfor (Piece p : attackingPieces.get(pl.getName())) \n \t\t\t\t\t((Combatable)p).resetAttack();\n \t\t\t\t\n\t\t\t\t\t// inflict return true if the piece is dead, and removes it from attackingPieces if so\n \t\t\t\t// Inflict is also responsible for removing from the CreatureStack\n \t\t\t\tfor (Piece p : toInflict.get(pl.getName())) {\n\t\t\t\t\t\tif (((Combatable)p).inflict()) \n\t\t\t\t\t\t\tattackingPieces.get(pl.getName()).remove(p);\n\t\t\t\t\t\tif (attackingPieces.get(pl.getName()).size() == 0)\n\t\t\t\t\t\t\tattackingPieces.remove(pl.getName());\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t// Clear toInflict for next phase\n \t\t\t\ttoInflict.get(pl.getName()).clear();\n \t\t\t}\n\n\t\t\t\t// Update the InfoPanel gui for changed/removed pieces\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n \t\t\t\t\tInfoPanel.showTileInfo(battleGround);\n \t\t\t\t\tbattleGround.coverPieces();\n\t }\n\t\t\t\t});\n \t\t\t\n \t\t\t// Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n\t\t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\t\t\t\t// Notify next phase, wait for a second\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tbattleGround.coverPieces();\n\t \tGUI.getHelpText().setText(\"Attack phase: Next phase: Retreat!\");\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Pause for 2 seconds between phases\n\t\t\t\ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n \t\t\t\n \t\t\t\n//////////////////////// Retreat phase\n\t\t\t\t// Can only retreat to a Terrain that has been explored and has no ememies on it\n\t\t\t\t\n\t\t\t\t// Display message, activate done button\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tGUI.getHelpText().setText(\"Attack phase: Retreat some of your armies?\");\n\t\t GUI.getDoneButton().setDisable(false);\n\t }\n\t }); \t\t\t\t\n\t\t\t\t\n\t\t\t\t// For each combatant, ask if they would like to retreat\n\t\t for (Player pl : combatants) {\n\t\t \t\n\t\t \t// Make sure wildThings aren't trying to get away\n\t\t \tif (!pl.isWildThing()) {\n\t\t\t \tplayer = pl;\n\t \t InfoPanel.uncover(player.getName());\n\t\t\t\t ClickObserver.getInstance().setActivePlayer(player);\n\t\t\t\t ClickObserver.getInstance().setCreatureFlag(\"Combat: SelectRetreaters\");\n\t\t\t\t \n\t\t\t\t // Pause and wait for player to hit done button\n\t\t\t\t pause();\n\t\t\t Platform.runLater(new Runnable() {\n\t\t\t @Override\n\t\t\t public void run() {\n\t\t\t \tbattleGround.coverPieces();\n\t\t\t \tbattleGround.uncoverPieces(player.getName());\n\t\t\t \tbattleGround.coverFort();\n\t\t\t \t GUI.getHelpText().setText(\"Attack Phase: \" + player.getName() + \", You can retreat your armies\");\n\t\t\t }\n\t\t\t });\n\t\t\t\t while (isPaused && battleGround.getContents(player.getName()) != null) {\n\t\t\t \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t\t\t\t }\t \n\t\t\t\t ClickObserver.getInstance().setTerrainFlag(\"Disabled\");\n\t\t\t\t \n\t\t\t\t // TODO, maybe an if block here asking user if they would like to attack \n\t\t\t\t System.out.println(attackingPieces + \"---BEFORE CLEARING\");\n\t\t\t\t // Re-populate attackingPieces to check for changes\n\t\t\t\t attackingPieces.clear();\n\t\t\t\t Iterator<String> keySetIterator2 = battleGround.getContents().keySet().iterator();\n\t\t\t\t \twhile(keySetIterator2.hasNext()) {\n\t\t\t\t \t\tString key = keySetIterator2.next();\n System.out.println(key + \"=====key\");\n\t\t\t \t\t\tattackingPieces.put(battleGround.getContents().get(key).getOwner().getName(), (ArrayList<Piece>) battleGround.getContents().get(key).getStack().clone()); \n\t\t\t\t \t}\n // System.out.println(attackingPieces);\n\t\t\t\t \t// if the owner of the terrain has no pieces, just a fort or city/village\n System.out.println(\"===battleground\"+battleGround);\n System.out.println(\"===attackingPieces\"+attackingPieces);\n System.out.println(combatants.contains(battleGround.getOwner()) ? \"TRUE\" : \"FALSE\");\n\t\t\t\t\t\tif (combatants.contains(battleGround.getOwner()) && battleFort != null) {\n System.out.println(battleGround + \"===battleground\");\n\t\t\t\t\t\t\tattackingPieces.put(battleGround.getOwner().getName(), new ArrayList<Piece>());\n System.out.println(attackingPieces + \"===attacking pieces\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (battleFort != null) {\n System.out.println(battleFort.getName() + \"===battlefort\");\n System.out.println(battleFort.getOwner().getName() + \"===battlefort's owner\");\n \n\t\t\t\t\t\t\tattackingPieces.get(battleFort.getOwner().getName()).add(battleFort);\n System.out.println(attackingPieces.get(battleFort.getOwner().getName()));\n\t\t\t\t\t\t}\n\t//\t\t\t\t\tif (battleGround city/village)\n\t\t\t\t\t\t// TODO city/village\n\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t // Check if all the players pieces are now gone\n\t\t\t\t if (!attackingPieces.containsKey(player.getName())) {\n\t\t\t\t \t\n\t\t\t\t \t// Display message, and remove player from combatants\n\t\t\t\t \tPlatform.runLater(new Runnable() {\n\t\t\t\t @Override\n\t\t\t\t public void run() {\n\t\t\t\t \t GUI.getHelpText().setText(\"Attack Phase: \" + player.getName() + \" has retreated all of their pieces!\");\n\t\t\t\t }\n\t\t\t\t });\n\t\t\t\t \t\n\t\t\t\t \t// If there is only 1 player fighting for the hex, \n\t\t\t\t \tif (attackingPieces.size() == 1) \n\t\t\t\t \t\tbreak;\n\t\t\t\t \t\n\t\t\t\t \t// Pause because somebody just retreated\n\t\t\t\t \ttry { Thread.sleep(2000); } catch( Exception e ){ return; }\n\t\t\t\t }\n\t\t\t\t \n\n\t \t InfoPanel.cover(player.getName());\n\t\t\t\t \n\t\t\t }\n\t\t }\n\t\t \n\t\t // Done button no longer needed\n\t\t Platform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t GUI.getDoneButton().setDisable(true);\n\t\t }\n\t\t });\n\t\t ClickObserver.getInstance().setCreatureFlag(\"\");\n\t\t ClickObserver.getInstance().setFortFlag(\"\");\n\t\t \n\t\t // Check for defeated armies:\n\t\t\t\t// - find player with no more pieces on terrain\n\t\t\t\t// - remove any such players from combatants\n\t\t\t\t// - if only one combatant, end combat\n \t\t\tbaby = null;\n \t\t\twhile (combatants.size() != attackingPieces.size()) {\n\t\t\t\t\tfor (Player pl : combatants) {\n\t\t\t\t\t\tif (!attackingPieces.containsKey(pl.getName())) {\n\t\t\t\t\t\t\tbaby = pl;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcombatants.remove(baby);\n \t\t\t}\n \t\t\tif (combatants.size() == 1) {\n \t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n\n\t\t\t\texploring = (!battleGround.isExplored() && battleGround.getContents().size() == 1);\n\t\t\t\t\n\t\t\t\t// Add wildthings back to combatants if they were removed\n\t\t\t\tif (battleGround.getContents().containsKey(wildThings.getName()) && !combatants.contains(wildThings))\n\t\t\t\t\tcombatants.add(wildThings);\n\t\t\t\t\n \t\t} // end while (combatants.size() > 1 || exploring)\n \t\tbattleGround.coverFort();\n \t\t\n////////////////// Post Combat\n \t\t\n \t\t// sets player as the winner of the combat\n \t\t// Can be null if battle takes place on a hex owned by nobody, and each player lost all pieces\n \t\tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n \tbattleGround.removeBattleHex();\n }\n \t\t});\n \t\t\n \t\tif (combatants.size() == 0)\n \t\t\tplayer = battleGround.getOwner();\n \t\telse if (combatants.size() == 1 && combatants.get(0).getName().equals(wildThings.getName()))\n \t\t\tplayer = null;\n \t\telse\n \t\t\tplayer = combatants.get(0);\n \t\t\n \t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n \t\tSystem.out.println(\"combatants: \" + combatants);\n \t\tfor (Player p : combatants) {\n \t\tSystem.out.println(\"p.getName(): \"+ p.getName());\n \t\t\t\n \t\t}\n \t\tSystem.out.println(\"owner: \" + owner);\n \t\tSystem.out.println(\"combatants.get(0): \" + combatants.get(0));\n \t\tSystem.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n \t\t\n \t\t\n \t\t// Change ownership of hex to winner\n \t\tboolean ownerChanged = false;\n \t\tif (owner != null && combatants.size() > 0 && !battleGround.getOwner().equals(combatants.get(0))) {\n \t\t\tbattleGround.getOwner().removeHex(battleGround);\n \t\t\tcombatants.get(0).addHexOwned(battleGround);\n \t\t\townerChanged = true;\n \t\t}\n\t\t\t\n \t\t// See if fort is kept or downgraded.\n \t\tif (battleFort != null) {\n if (battleFort.getName().equals(\"Citadel\")) {\n owner.setCitadel(false);\n player.setCitadel(true);\n battleFort.healFort();\n player.addHexOwned(battleGround);\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", you get to keep the fort!\");\n }\n });\n checkWinners();\n return;\n }\n \t\t\n\t\t\t\t// Get player to click dice to see if fort is kept\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", roll the die to see if the fort is kept or downgraded\");\n\t \tDiceGUI.getInstance().uncover();\n\t \tInfoPanel.showTileInfo(battleGround);\n\t }\n\t });\n\t\t\t\t\n\t\t\t\t// Dice is set to -1 while it is 'rolling'. This waits for the roll to stop, ie not -1\n\t\t\t\tint oneOrSixGood = -1;\n\t\t\t\twhile (oneOrSixGood == -1) {\n\t\t\t\t\ttry { Thread.sleep(100); } catch( Exception e ){ return; }\n\t\t\t\t\toneOrSixGood = Dice.getFinalVal();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if a 1 or 6, keep fort (Keep it.... not turn it into a keep)\n\t\t\t\tif (oneOrSixGood == 1 || oneOrSixGood == 6) {\n\t\t\t\t\tbattleFort.healFort();\n\t\t\t\t\tplayer.addHexOwned(battleGround);\n\t\t\t\t\tPlatform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", you get to keep the fort!\");\n\t\t }\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tbattleFort.downgrade();Platform.runLater(new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t \tGUI.getHelpText().setText(\"Post combat: \" + player.getName() + \", the fort was destroyed!\");\n\t\t }\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tPlatform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \tInfoPanel.showTileInfo(battleGround);\n\t }\n\t });\n\t\t\t\t\n\t\t\t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n\t\t\t\t\n\t\t\t\t\n \t\t}\n\n \t\tbattleGround.flipPiecesDown();\n\t\t\t// TODO city/village and special incomes if they are kept or lost/damaged \n \t\t\n \t\ttry { Thread.sleep(1000); } catch( Exception e ){ return; }\n \t}/// end Post combat\n\n \tPlatform.runLater(new Runnable() {\n @Override\n public void run() {\n//\t\t\t\tInfoPanel.showBattleStats();\n \tBoard.removeCovers();\n }\n\t\t});\n \t\n\t\tClickObserver.getInstance().setTerrainFlag(\"\");\n\t\tClickObserver.getInstance().setPlayerFlag(\"\");\n\t\tClickObserver.getInstance().setCreatureFlag(\"\");\n\t\tClickObserver.getInstance().setFortFlag(\"\");\n\t\tbattleGrounds.clear();\n }", "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}", "private void hours(){\n \n companyDriver.startHourStage();\n this.close();\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 }", "public void teleopPeriodic() {\n\t\tScheduler.getInstance().run();\n\t\t\n\t\t// Light/flash LEDs as needed\n\t\tif (timerLEDs.get() >= timerLEDsHalfPeriod) {\n\t timerLEDs.reset();\n\t timerLEDsCycleHigh = !timerLEDsCycleHigh;\n\t if (timerLEDsCycleHigh) {\n\t \tshooter.setFlywheelSpeedLight(shooter.bLEDsArmAtAngle);\n\t } else {\n\t \tshooter.setFlywheelSpeedLight(shooter.bLEDsArmAtAngle /*&& !shooter.bLEDsFlywheelAtSpeed*/);\t \t\n\t }\n\t\t}\n/*\t\t\n\t\t// Rumble as needed\n\t\tboolean ballLoaded = shooter.isBallLoaded(); \n\t\tif (ballLoaded && !prevBallLoaded) {\n\t\t\ttimerRumble.reset();\n\t\t\toi.xboxController.setRumble(RumbleType.kLeftRumble, 1);\n\t\t}\n\t\tprevBallLoaded = ballLoaded;\n\n\t\tboolean readyToShoot = shooter.bLEDsArmAtAngle && shooter.bLEDsFlywheelAtSpeed;\n\t\tif (readyToShoot && !prevReadyToShoot) {\n\t\t\ttimerRumble.reset();\n\t\t\toi.xboxController.setRumble(RumbleType.kRightRumble, 1);\n\t\t}\n\t\tprevReadyToShoot = readyToShoot;\n\n\t\tif (timerRumble.get() > 0.5) {\n\t \toi.xboxController.setRumble(RumbleType.kLeftRumble, 0);\n\t \toi.xboxController.setRumble(RumbleType.kRightRumble, 0);\n\t\t}\n*/\t\t\n\t\t// Show arm angle\n shooterArm.updateSmartDashboard();\n \n\t\t// Other printouts\n\t\tshooter.updateSmartDashboard();\n\t\tshooter.isBallLoaded();\n\t\tintake.updateSmartDashboard();\n\t\tintake.intakeIsUp();\n\t\tdriveTrain.getDegrees();\n\t\t\n\t\tvision.findGoal();\n\t\tvision.getGoalXAngleError();\n\t\tvision.getGoalArmAngle();\n\t\t\t\t\n\t\tif (smartDashboardDebug) {\n\t\t\t// Uncomment the following line to read coPanel knobs.\n//\t\t\toi.updateSmartDashboard();\n\n\t\t\t// Uncomment the following line for debugging shooter motors PIDs.\n//\t\t\tshooter.setPIDFromSmartDashboard();\n\t\t\t\n\t\t\t// Uncomment the following line for debugging the arm motor PID.\n//\t shooterArm.setPIDFromSmartDashboard();\n\t\t\t\n\t\t\t// Uncomment the following lines to see drive train data\n\t \tdriveTrain.getLeftEncoder();\n\t \tdriveTrain.getRightEncoder();\n\t\t\tdriveTrain.smartDashboardNavXAngles();\n\t\t\t\n\t\t\t//\t\tSmartDashboard.putNumber(\"Panel voltage\", panel.getVoltage());\n\t\t\t//\t\tSmartDashboard.putNumber(\"Panel arm current\", panel.getCurrent(0));\n\t\t}\n\n\t}", "public void sleep() {\n \t\thealth = maxHealthModifier;\n \t\ttoxicity = 0;\n \t}", "public void setupSimulation() {\n final Timer timerStatus = new Timer();\n\n TimerTask taskUpdateFood = new TimerTask() {\n @Override\n public void run() {\n terrain.toggleFood();\n }\n };\n timerStatus.schedule(taskUpdateFood, 0, 1000);\n\n startTime = System.currentTimeMillis();\n }", "public void attack(){\n activity = CreatureActivity.ATTACK;\n createWeapon();\n endAttack = new CountDown(20); //100\n endAnimationAttack = new CountDown(100);\n }", "@Override\n public void poll() {\n if( state == State.attacking ) {\n if( !ctx.movement.running() && ctx.movement.energyLevel() >= 75) {\n stateText = \"Setting running\";\n ctx.movement.running(true);\n }\n stateText = \"\";\n if( isAttacking() ) {\n stateText = \"Attacking\";\n Item ammo = inventory.getFirst(ammoUsed);\n if( ammo != null && ammo.valid() ){\n inventory.clickItem(ammo);\n sleep(100);\n }\n } else {//TODO find out why it stops picking up arrows after some time\n if (!inventory.full() && (targetBone == null || !targetBone.valid() || !misc.pointOnScreen(targetBone.centerPoint())) ) {\n targetBone = getNextGroundBone();\n clickedGroundItem = false;\n }\n if (!inventory.full() && targetBone != null && targetBone.valid() && misc.pointOnScreen(targetBone.centerPoint())) {\n stateText = \"Picking up bones\";\n if( !ctx.players.local().inMotion() )\n clickedGroundItem = false;\n if (!clickedGroundItem ) {\n clickedGroundItem = groundItems.pickup(targetBone);\n }\n } else if( inventory.full() && inventory.contains(bones) ) {\n state = State.burying;\n } else {\n if( !clickedMonster || !target.valid() || target.health() <= 0 || target.interacting() != ctx.players.local() ) {\n target = getNextTarget();\n clickedMonster = false;\n }\n if (!misc.pointOnScreen(target.centerPoint())) {\n if (target.tile().matrix(ctx).onMap()) {\n stateText = \"Walking to monster\";\n movement.walkTile(target.tile());\n }\n } else {\n stateText = \"Attacking monster\";\n if( !clickedMonster ) {\n clickedMonster = npcs.attackMonster(target);\n }\n }\n }\n }\n }else if( state == State.burying){\n Item invBones = inventory.getFirst(bones);\n if( invBones!= null && invBones.valid()) {\n stateText = \"Clicking bones\";\n inventory.clickItem(invBones);\n }else {\n state = State.attacking;\n }\n }\n checkIfBeingAttacked();\n }", "private void GenerateHealth(){\t\t\n\t\t\n\t\t//Update for the health powerup\n\t\tint randGen = rand.nextInt((int)((float)HEALTH_FREQUENCY * RANDOM_DEVIATION));\n\t\trandGen = (rand.nextBoolean()) ?-randGen :randGen;\n\t\t\n\t\t//D.BUG(\"RandGen is: \" + String.valueOf(randGen));\n\t\t\n\t\tif(timeSinceLastSpawns.get(CollectibleType.Health.ordinal()).intValue() > (HEALTH_FREQUENCY + randGen)){\n\t\t\t\n\t\t\t//D.BUG(\"We have Spawned another health collectible after \" + String.valueOf(randGen + HEALTH_FREQUENCY) + \" milliseconds!\");\n\t\t\ttimeSinceLastSpawns.set(CollectibleType.Health.ordinal(), 0);\n\t\t\t\n\t\t\t//SPAWN HEALTH COLLECTIBLE HERE\n\t\t}\n\t}", "@Override\n public void handle(long now) {\n int frame = (int) (now / 16666666.6667);\n if (frame % 600 == 0) new SimpleEnemy(game); // 10 seconds\n if (frame % 900 == 0) new SimplePowerUp(game); // 15 seconds\n if (frame % 1950 == 0) new HealthPack(game); // 32.5 seconds\n if (frame % 2100 == 0) new Shield(game); // 35 seconds\n for (GameEntity gameObject : Globals.gameObjects) {\n if (gameObject instanceof Animatable) {\n Animatable animObject = (Animatable) gameObject;\n animObject.step();\n }\n }\n Globals.gameObjects.addAll(Globals.newGameObjects);\n Globals.newGameObjects.clear();\n\n Globals.gameObjects.removeAll(Globals.oldGameObjects);\n Globals.oldGameObjects.clear();\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 startClock(){\n\n final Timer gTimer = new Timer();\n gTimer.schedule(new TimerTask() {\n @Override\n public void run() {\n //Log.e(\"GLOBAL TIMER\",\"RUNNING...\");\n if(!((MainActivity)context).isPaused) {\n //if they are dead, remove them from list\n Iterator<EnemyCharacter> iter0 = enemyFactory.enemies.iterator();\n while (iter0.hasNext()) {\n EnemyCharacter enemyCharacter = iter0.next();\n\n if (enemyCharacter.isDead) {\n iter0.remove();\n }\n }\n\n gTime++;\n //Reset the power ups on set intervals.\n if (gTime % 2000 == 0) {\n canGrowl = true;\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n bottomFragment.growl.setBackgroundResource(R.drawable.growl_btn);\n }\n });\n\n }\n if (gTime % 7000 == 0) {\n canTebow = true;\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n bottomFragment.tebow.setBackgroundResource(R.drawable.tebow_btn);\n }\n });\n }\n if (gTime % 5000 == 0) {\n canAlberta = true;\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n bottomFragment.alberta.setBackgroundResource(R.drawable.alberta_btn);\n }\n });\n }\n\n //INCREASE DIFFICULTY OVER TIME\n if (gTime < 1000) {\n difficulty = 1;\n } else if (gTime < 3000) {\n difficulty = 2;\n } else if (gTime < 7000) {\n difficulty = 3;\n } else if (gTime < 12000) {\n difficulty = 4;\n } else {\n difficulty = 5;\n }\n\n //USE DIFFICULTY TO CREATE ENEMIES\n if (difficulty == 1) {\n if (gTime % 400 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else if (difficulty == 2) {\n if (gTime % 300 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else if (difficulty == 3) {\n if (gTime % 300 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else if (difficulty == 4) {\n if (gTime % 200 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else {\n //Log.e(\"MAX\", \"Difficulty\");\n if (gTime % 100 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n }\n\n //DO THE ANIMATIONS\n Iterator<EnemyCharacter> iter3 = enemyFactory.enemies.iterator();\n while (iter3.hasNext()) {\n EnemyCharacter enemyCharacter = iter3.next();\n\n //Do the animation and moving every ten times this timer runs\n if (gTime % 10 == 0) {\n enemyCharacter.animate();\n enemyCharacter.move();\n }\n }\n\n //TEBOW TO THE RESCUE WITH THE POWER OF JEEESUUUSS!\n if (drawTebow) {\n Iterator<EnemyCharacter> iter = enemyFactory.enemies.iterator();\n while (iter.hasNext()) {\n EnemyCharacter enemyCharacter = iter.next();\n if (enemyCharacter.x < maxWidth / 2) {\n tebow.setX(enemyCharacter.x - 100);\n tebow.setY(enemyCharacter.y);\n iter.remove();\n drawTebowCounter++;\n }\n if (drawTebowCounter >= 10) {\n drawTebow = false;\n drawTebowCounter = 0;\n }\n }\n }\n\n //REDRAW EVERYTHING CONSTANTLY\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n canvasView.invalidate();\n }\n });\n\n //CHECK TO SEE IF THE PLAYER LOST THE GAME OR IF ENEMY GETS AUTO-MAGICALLY CHOMPED\n Iterator<EnemyCharacter> iter1 = enemyFactory.enemies.iterator();\n while (iter1.hasNext()) {\n EnemyCharacter enemyCharacter = iter1.next();\n\n //Check if the player lost\n if (enemyCharacter.x < -50) {\n gameOver = true;\n }\n if (enemyCharacter.x < 50) {\n if ((enemyCharacter.y + enemyCharacter.bitmap.getHeight() / 2) > canvasView.albert.y) {\n if ((enemyCharacter.y + enemyCharacter.bitmap.getHeight() / 2) < canvasView.albert.y + canvasView.albert.bitmap.getHeight()) {\n //Enemy in range. Chomp him.\n enemyCharacter.isDead = true;\n score++;\n canvasView.albert.chomp(canvasView);\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n bottomFragment.updateScores();\n }\n }\n }\n }\n\n if (gameOver) {\n gTimer.purge();\n gTimer.cancel();\n restart();\n\n //launch play fragment dialog\n DialogFragment gameOverDialog = new PlayFragment.GameOverDialog();\n gameOverDialog.show(((MainActivity) context).getFragmentManager(), \"Game Over\");\n }\n }\n }//END OF GLOBAL TIMER RUN METHOD\n },0,10);\n }", "@Override\n\tpublic void run()\n\t{\n\t\tlong startTime = System.currentTimeMillis();\n\t\tlong startTimeGun = startTime;\n\t\tlong startTimeEnemyGun = startTime;\n\t\tlong startTimeClouds = startTime;\n\t\tlong startTimeBoss = startTime;\n\t\tlong startTimeBossBullet = startTime;\n\t\t\n\t\t//start player gun sound, this will run till player dies\n\t\tif (GameState._weapons.get(0).getWeaponName()==(Constants.PLAYER) && GameState._weapons.get(0).getDestroyedFlag() == false)\n\t\t{\n\t\t\tAudioPlayer.resumePlayerGun();\n\t\t}\n\t\t\n\t\t//main game loop\n\t\twhile(GameState.mIsRunning == true)\n\t\t{\t\n\t\t\tlong currentTime = System.currentTimeMillis();\n\t\t\ttry\n\t\t\t{\t\n\t\t\t\t//create clouds \n\t\t\t\tint cloudCount = GameUtils.getTypeCount(Constants.CLOUD); \n\t\t\t\tlong currentTimeClouds = currentTime;\n\t\t\t\tif (currentTimeClouds - startTimeClouds > 1000 && cloudCount < 6)\n\t\t\t\t{\n\t\t\t\t\tstartTimeClouds = currentTimeClouds;\n\t\t\t\t\tEnvBuilder.generateCloud(GameState._weapons.get(0).getX(), GameState._weapons.get(0).getY(), GameState._weapons.get(0).getCurrentDirection());\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t \t//generate a new ship. \t\n\t\t \tint enemyCount = GameUtils.getTypeCount(Constants.ENEMY_FIGHTER); \n\t\t \t// System.out.println(\"enemyCount: \" + enemyCount);\n\t\t\t\tif (GameState.mWaitTimeBetweenLevels == false && (currentTime - startTime) > 300 && enemyCount < 4)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t \tEnvBuilder.generateEnemy(GameState._weapons.get(0).getX()\n\t\t\t \t\t\t, GameState._weapons.get(0).getY());\t\t\n\t\t\t \tstartTime = currentTime;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//generate a boss ship\t\t\t\t\n\t\t\t\tif (GameState.mWaitTimeBetweenLevels == false && (currentTime - startTimeBoss) > 6000)\n\t\t\t\t{\n\t\t\t\t\tEnvBuilder.generateEnemyBoss(GameState._weapons.get(0).getX()\n\t\t\t\t\t \t\t, GameState._weapons.get(0).getY());\n\t\t\t\t\tstartTimeBoss = currentTime;\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t// fire enemy guns constantly\t\n\t\t\t\tlong currentTimeEnemyGun = System.currentTimeMillis();\n\t\t\t\tif (currentTimeEnemyGun - startTimeEnemyGun > 850 && GameState._weapons.get(0).getWeaponName()==(Constants.PLAYER) == true && GameState.sFireEnemyGuns == true)\n\t\t\t\t{\n\t\t\t\t\tfor(int i = 0; i < GameState._weapons.size(); i ++)\n\t\t\t\t\t{\t\n\t\t\t\t\t\tif (currentTime - startTimeBossBullet > 500)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (GameState._weapons.get(i).getWeaponName() == (Constants.ENEMY_BOSS))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tint targetTrack = (int)GameUtils.getTargetTrack(GameState._weapons.get(i), GameState._weapons.get(0));\t\n\t\t\t\t\t\t\t\tMovementEngine bossBullet = new BossBullet(targetTrack, targetTrack\n\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getX() \n\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getY()\n\t\t\t\t\t\t\t\t\t\t, 3, 3, 1, 1\n\t\t\t\t\t\t\t\t\t\t, Constants.GUN_ENEMY, GameState._weapons.get(i), 50, 1); \n\t\t\t\t\t\t\t\tGameState._weapons.add(bossBullet);\n\t\t\t\t\t\t\t\tstartTimeBossBullet = currentTime;\n\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}\n\t\t\t\t\t\tif ((int)(Math.random() * 100) > 98)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (Math.random() * 100 > 20)\n\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (GameState._weapons.get(i).getWeaponName()==(Constants.ENEMY_FIGHTER) && GameUtils.getRange(GameState._weapons.get(i), GameState._weapons.get(0)) > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstartTimeEnemyGun = currentTimeEnemyGun;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// get player track\n\t\t\t\t\t\t\t\t\tint targetTrack = (int)GameUtils.getTargetTrack(GameState._weapons.get(i), GameState._weapons.get(0));\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\tMovementEngine bullet = new Bullet(targetTrack, targetTrack\n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getX() \n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getY()\n\t\t\t\t\t\t\t\t\t\t\t, 3, 3, 1, 1\n\t\t\t\t\t\t\t\t\t\t\t, Constants.GUN_ENEMY, GameState._weapons.get(i), 100, 1); \n\t\t\t\t\t\t\t\t\tGameState._weapons.add(bullet);\n\t\t\t\t\t\t\t\t\tif (GameState._muted == false)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tAudioPlayer.playEnemyGun();\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\telse\n\t\t\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (GameState._weapons.get(i).getWeaponName()==(Constants.ENEMY_FIGHTER) && GameUtils.getRange(GameState._weapons.get(i), GameState._weapons.get(0)) > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstartTimeEnemyGun = currentTimeEnemyGun;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// get player track\n\t\t\t\t\t\t\t\t\tint targetTrack = (int)GameUtils.getTargetTrack(GameState._weapons.get(i), GameState._weapons.get(0));\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\tMovementEngine missile = new Missile(targetTrack, targetTrack\n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getX()\n\t\t\t\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(i).getY()\n\t\t\t\t\t\t\t\t\t\t\t, GameState._weapons.get(i).getCurrentSpeed(), 3, 1, 1\n\t\t\t\t\t\t\t\t\t\t\t, Constants.MISSILE_ENEMY, GameState._weapons.get(0), GameState._weapons.get(i), 200); \n\t\t\t\t\t\t\t\t\tGameState._weapons.add(missile);\n\t\t\t\t\t\t\t\t\tif (GameState._muted == false)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tAudioPlayer.playMissileSound();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t// fire gun constantly\n\t\t\t\t// System.out.println(\"gunModifier:\" + _gunModifier);\n\t\t\t\tif (GameState._weapons.get(0).getDestroyedFlag() == false && (GameState._weapons.get(0).getWeaponName()==(Constants.PLAYER)))\n\t\t\t\t{\n\t\t\t\t\tlong currentTimeGun = currentTime;\n\t\t\t\t\tif (currentTimeGun - startTimeGun > 40)\n\t\t\t\t\t{\n\t\t\t\t\t\tstartTimeGun = currentTimeGun;\n\t\t\t\t\t\tMovementEngine bullet = new Bullet(GameState._weapons.get(0).getCurrentDirection() + _gunModifier, GameState._weapons.get(0).getCurrentDirection() + _gunModifier\n\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(0).getX()\n\t\t\t\t\t\t\t\t, (int)GameState._weapons.get(0).getY(),10, 10, 1, 1, Constants.GUN_PLAYER, GameState._weapons.get(0), 200, 1); \n\t\t\t\t\t\tGameState._weapons.add(bullet);\n\t\t\t\t\t\tgunModifier();\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t// move the ships around, check for collisions.\n\t\t\t\tfor(int i = 0; i < GameState._weapons.size(); i ++)\n\t\t \t{\t\t \t\t\n\t\t \t\tMovementEngine ship = GameState._weapons.get(i);\n\t\t \t\tif(ship.getWeaponName()==(Constants.MISSILE_PLAYER) || ship.getWeaponName()==(Constants.MISSILE_ENEMY))\n\t\t\t\t\t{\n\t\t \t\t\t// make smoke trail\n\t\t \t\t\tMovementEngine missileSmokeTrail = new ExplosionParticle(ship.getCurrentDirection(), ship.getCurrentDirection()\n\t\t\t\t\t\t\t\t, (int)ship.getX()\n\t\t\t\t\t\t\t\t, (int)ship.getY(),0, 0, 0, 0, Constants.MISSILE_SMOKE, null, 5, 1); \t\t \t\t\t\n\t\t \t\t\tGameState._weapons.add(missileSmokeTrail);\n\t\t\t\t\t}\n\n\t\t \t\t// make boss damage smoke trail\n\t\t \t\tif (ship.getWeaponName()==(Constants.ENEMY_BOSS))\n\t\t \t\t{\n\t\t\t \t\tif (ship.getHitpoints() < 10 )\n\t\t\t \t\t{\t\t\t \t\t\n\t\t\t\t\t\t\tint particleDirection = (int)(Math.random() * 360);\n\t\t\t\t\t\t\tint particleSpeed = (int)(Math.random() * 10);\n\t\t\t\t\t\t\tint particleEndurance = (int)(Math.random() * 50);\n\t\t\t\t\t\t\tMovementEngine explosionParticle = new ExplosionParticle(particleDirection, particleDirection\n\t\t\t\t\t\t\t\t\t, ship.getX(), ship.getY(), particleSpeed, 1, 1, 1, Constants.BOSS_SMOKE\n\t\t\t\t\t\t\t\t\t, null, particleEndurance, 1); \n\t\t\t\t\t\t\tGameState._weapons.add(explosionParticle);\n\t\t\t \t\t}\n\t\t \t\t}\n\t\t \t\tship.run();\t\n\t\t \t\t\n\t\t \t\t//TODO O(n^2) function unfortunately, any other way to make this faster? \n\t\t \t\tcheckCollisions(ship);\n\t\t \t}\n\t\t\t\t\n\t\t\t\t//check destroyed and remove from list if so, remove all objects that are over 450 units away from the player\n\t\t\t\tfor(int i = 1; i < GameState._weapons.size(); i ++)\n\t\t \t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((i > 0 && GameUtils.getRange(GameState._weapons.get(0), GameState._weapons.get(i)) > 450) \n\t\t\t\t\t\t\t\t|| (GameState._weapons.get(i).getDestroyedFlag() == true))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGameState._weapons.remove(i);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\tcatch(ArrayIndexOutOfBoundsException e)\n\t\t\t\t\t{\n\t\t\t\t\t\t// ignore and continue\n\t\t\t\t\t}\n\t\t \t}\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tlong singleLoopTime = System.currentTimeMillis() - currentTime;\n\t\t\t\tif (singleLoopTime < 16)\n\t\t\t\t{\n\t\t\t\t\tsleep(16 - singleLoopTime);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(InterruptedException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private void handleStandardGameplay(float deltaTime) {\n\t\t// Decrease time to next revived enemy\n\t\tmSpawnTime--;\n\n\t\t// Accumulate time elapsed while playing\n\t\tmRoundTimeElapsed += deltaTime;\n\n\t\t/**\n\t\t * Input Handling\n\t\t * When the screen is touched, kill touched attackers\n\t\t */\n\t\tif(Gdx.input.justTouched()) {\n\t\t\t// Grab the touch position, saved as a Vector3\n\t\t\tmLastTouch.set(Gdx.input.getX(), Gdx.input.getY(), 0);\n\t\t\tmCamera.unproject(mLastTouch); // Translates to game world coordinates\n\n\t\t\t// Find the first attacker located at the touch position, if any\n\t\t\tint indexOfAttacker = getFirstAttackerAt(mLastTouch.x, mLastTouch.y);\n\t\t\t// If the index is greater than negative one, kill the attacker and add points\n\t\t\tif(indexOfAttacker > -1){\n\t\t\t\tmAttackers[indexOfAttacker].kill();\n\t\t\t\tmLivingAttackerCount--;\n\t\t\t\tmMonsterHouseSpawn--;\n\t\t\t\tmRoundScore += 100f;\n\t\t\t\tif(indexOfAttacker > ATTACKER_HALF_SIZE - 1)\n\t\t\t\t\tmRoundScore += 150f; // 150 Bonus points for killing a knight\n\t\t\t}\n\t\t}\n\n\t\t// Spawns a new enemy once the respawn timer hits less than 0\n\t\tif(mSpawnTime <0) {\n\t\t\t// Revive an attacker\n\t\t\treviveAttacker();\n\n\t\t\t// Randomly select a new respawn timer within min and max bounds\n\t\t\tmSpawnTime = mRandom.nextInt(mSpawnTimeMax - mSpawnTimeMin + 1) + mSpawnTimeMin;\n\t\t}\n\n\t\t//spawns a row of enemy units if player is doing well\n\t\tif(mMonsterHouseSpawn <0) {\n\t\t\tint monsterHouseRush = 3;\n\t\t\twhile(monsterHouseRush > 0) {\n\t\t\t\tfor (float i = 0; i < 5f; i++) {\n\t\t\t\t\treviveAttacker();\n\t\t\t\t}\n\t\t\t\tmonsterHouseRush--;\n\t\t\t}\n\t\t\tmMonsterHouseSpawn = 10;\n\t\t}\n\n\t\t// Loop through the array of attackers and update each (dead attackers' update does nothing)\n\t\tfor (int i = 0; i < ATTACKER_ARRAY_SIZE; i++) {\n\t\t\tAttacker a = mAttackers[i];\n\t\t\ta.update(deltaTime);\n\n\t\t\tif(a.getX() > MIN_STOP_X) {\n\t\t\t\t// Play the attacker's \"attack\" animation\n\t\t\t\ta.play(\"attack\", true);\n\t\t\t\t// The attacker stops at the castle and the castle begins losing health\n\t\t\t\ta.setPosition(MIN_STOP_X, a.getY());\n\t\t\t\tmCastleHealth -= a.getHitDamage();\n\t\t\t\t// Only bother checking castle damage stage here - only when damage is being dealt\n\t\t\t\tfloat percentDamage = (mCastleMaxHealth - mCastleHealth) / mCastleMaxHealth;\n\t\t\t\tif(percentDamage < 0.5f) {\n\t\t\t\t\tmCastleDamageStage = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmCastleDamageStage = 1;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.15f) {\n\t\t\t\t\tmCastleDamageStage = 2;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.35f) {\n\t\t\t\t\tmCastleDamageStage = 3;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.65f) {\n\t\t\t\t\tmCastleDamageStage = 4;\n\t\t\t\t}\n\t\t\t\tif(percentDamage > 0.85f) {\n\t\t\t\t\tmCastleDamageStage = 5;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check if the game is over, where mCastleHealth <= 0\n\t\tif(mCastleHealth <= 0) {\n\t\t\t// The castle has fallen to the attackers\n\t\t\t// Currently, the game will pause and add text that states the game is over\n\t\t\tmCastleHealth = 0f;\n\t\t\tmHealthText = \"Castle Strength: \" + mCastleHealth;\n\t\t\tmGameState = STATE_GAME_OVER;\n\t\t\thideAllButtons();\n\t\t}\n\n\t\t// If the round time is up, end the round and go to a new state\n\t\tif(mRoundTimeElapsed > mRoundMaxTime) {\n\t\t\tmGameState = STATE_ROUND_OVER;\n\t\t\tmTotalScore += mRoundScore;\n\t\t\tmRoundNumber++;\n\t\t\thideAllButtons();\n\t\t}\n\t}", "@Override\r\n\tpublic void update() {\n\t\tAlly.update();\r\n\t\tEnemy.update();\r\n\t\tfor(int i = 0 ; i < GroundList.size();i++){\r\n\t\t\tif(GroundList.get(i).kill) {\r\n\t\t\t\tGroundList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < BarelList.size(); i++) {\r\n\t\t\tif(BarelList.get(i).kill) {\r\n\t\t\t\tBarelList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < WoodList.size(); i++) {\r\n\t\t\tif(WoodList.get(i).kill) {\r\n\t\t\t\tWoodList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < FireBallList.size(); i++) {\r\n\t\t\tif(FireBallList.get(i).kill) {\r\n\t\t\t\tFireBallList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < BulletList.size(); i++) {\r\n\t\t\tif(BulletList.get(i).kill) {\r\n\t\t\t\tBulletList.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0 ; i < GroundList.size();i++){\r\n\t\t\tGroundList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0 ; i < BarelList.size(); i++) {\r\n\t\t\tBarelList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < BulletList.size(); i++) {\r\n\t\t\tBulletList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < FireBallList.size(); i++) {\r\n\t\t\tFireBallList.get(i).update();\r\n\t\t}\r\n\t\tfor(int i = 0; i < WoodList.size(); i++) {\r\n\t\t\tWoodList.get(i).update();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(GamePanel.updateTimes%60 == 0) {\r\n\t\t\tEnemy.PushEntity(2, new Vector2f(width*1/2, height/4),enemy);\r\n\t\t}\r\n\t\tfor(int i = 0; i < AllyDeadList.size(); i++) {\r\n\t\t\tAlly.entityList.remove(AllyDeadList.get(i)-i);\r\n\t\t}\r\n\t\tfor(int i = 0; i < EnemyDeadList.size(); i++) {\r\n\t\t\tEnemy.entityList.remove(EnemyDeadList.get(i)-i);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tAllyDeadList.clear();\r\n\t\tEnemyDeadList.clear();\r\n\t\tfor(int i = 0; i < Ally.entityList.size(); i++) {\r\n\t\t\tif(Ally.entityList.get(i).returnHealth() <= 0) {\r\n\t\t\t\tAllyDeadList.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < Enemy.entityList.size(); i++) {\r\n\t\t\tif(Enemy.entityList.get(i).returnHealth() <= 0) {\r\n\t\t\t\tEnemyDeadList.add(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void selfHeal() {\n\t\t\n\t\t//IF the Droid is carrying an item...\n\t\tif (this.getItemCarried() != null){\n\t\t\t\n\t\t\t//If the item is an oil can...\n\t\t\tif (this.getItemCarried().getShortDescription() == \"an oil can\" ) {\n\t\t\t\n\t\t\t\t//If the Droids health is LOWER than half...\n\t\t\t\tif((this.getInitialHP()/2) > this.getHitpoints()) {\n\t\t\t\t\tsay(this.getShortDescription() + \" is at or below half HP. \"\n\t\t\t\t\t\t\t+ \" Healing itself...\");\n\t\t\t\t\t\n\t\t\t\t\t//Implementing a new HealDroid method (Droid heals on itself)\n\t\t\t\t\t//public HealDroid(SWEntityInterface theTarget, MessageRenderer m) {\n\t\t\t\t\tHealDroid droidHeal = new HealDroid(this, messageRenderer);\n\t\t\t\t\t\n\t\t\t\t\tscheduler.schedule(droidHeal, this, 1);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "public void act() \r\n {\r\n addDrone();\r\n if(droneTimer>0)\r\n {\r\n droneTimer--;\r\n }\r\n }", "public static void worldTimeStep() {\r\n \t\r\n \t//remake the hash map based on the x and y coordinates of the critters\r\n \tremakeMap(population);\r\n \t\r\n \t//Iterate through the grid positions in the population HashMap\r\n \tIterator<String> populationIter = population.keySet().iterator();\r\n \twhile (populationIter.hasNext()) { \r\n String pos = populationIter.next();\r\n ArrayList<Critter> critterList = population.get(pos);\r\n \r\n //Iterate through the critters ArrayList \r\n ListIterator<Critter> currCritter = critterList.listIterator();\r\n while(currCritter.hasNext()) {\r\n \tCritter thisCritter = currCritter.next();\r\n \tthisCritter.hasMoved = false;\r\n \tthisCritter.doTimeStep();\r\n \tif(thisCritter.hasMoved || thisCritter.getEnergy() <= 0) {\r\n \t\tcurrCritter.remove();\r\n \t} else {\r\n \t\tcurrCritter.set(thisCritter);\r\n \t}\r\n }\r\n population.replace(pos, critterList);\r\n }\r\n \t\r\n \tfixPopulation();\r\n \tmergePopulationMoved(populationMoved);\r\n \t\r\n \tdoEncounters();\r\n \t\r\n \tfixPopulation();\r\n \tmergePopulationMoved(populationMoved); //Stage 1 Complete\r\n \r\n \t//deduct resting energy cost from all critters in the hash map\r\n \t//could do a FOR EACH loop instead of iterator -- fixed\r\n \tpopulationIter = population.keySet().iterator();\r\n \twhile(populationIter.hasNext()) {\r\n \t\tString pos = populationIter.next();\r\n ArrayList<Critter> critterList = population.get(pos);\r\n \r\n //Iterate through the Critters attached to the keys in the Hash Map\r\n ListIterator<Critter> currCritter = critterList.listIterator();\r\n while(currCritter.hasNext()) {\r\n \tCritter thisCritter = currCritter.next();\r\n \t//deduct the rest energy cost from each critter\r\n \tthisCritter.energy = thisCritter.energy - Params.REST_ENERGY_COST;\r\n \t//remove all critters that have died after reducing the rest energy cost\r\n \tif(thisCritter.getEnergy() <= 0) {\r\n \t\tcurrCritter.remove();\r\n \t} else {\r\n \t\tcurrCritter.set(thisCritter);\r\n \t}\r\n }\r\n population.replace(pos, critterList);\r\n \t}\r\n \t\r\n \tmergePopulationMoved(babies);\r\n \t\r\n \t\r\n \t//add the clovers in each refresh of the world \r\n \ttry {\r\n \t\tfor(int j = 0; j < Params.REFRESH_CLOVER_COUNT; j++) {\r\n \t\t\tcreateCritter(\"Clover\");\r\n \t\t}\r\n \t} catch(InvalidCritterException p) {\r\n \t\tp.printStackTrace();\r\n \t}\r\n }", "public void run() {\n\t\tif (timeToStart > 0 && timeToStart <= 3) {\n\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\tonline.sendMessage(Main.prefix() + \"UHC is starting in §6\" + String.valueOf(timeToStart) + \"§7.\");\n\t\t\t\tonline.playSound(online.getLocation(), Sound.SUCCESSFUL_HIT, 1, 0);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (timeToStart == 1) {\n\t\t\tMain.stopCountdown();\n\t\t\tBukkit.getServer().getScheduler().scheduleSyncDelayedTask(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.SUCCESSFUL_HIT, 1, 1);\n\t\t\t\t\t\tif (ArrayUtil.spectating.contains(online.getName())) {\n\t\t\t\t\t\t\tSpectator.getManager().set(online, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.setAllowFlight(false);\n\t\t\t\t\t\tonline.setFlying(false);\n\t\t\t\t\t\tonline.setHealth(20.0);\n\t\t\t\t\t\tonline.setFireTicks(0);\n\t\t\t\t\t\tonline.setSaturation(20);\n\t\t\t\t\t\tonline.setLevel(0);\n\t\t\t\t\t\tonline.setExp(0);\n\t\t\t\t\t\tif (!ArrayUtil.spectating.contains(online.getName())) {\n\t\t\t\t\t\t\tonline.showPlayer(online);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.awardAchievement(Achievement.OPEN_INVENTORY);\n\t\t\t\t\t\tonline.setFoodLevel(20);\n\t\t\t\t\t\tonline.getInventory().clear();\n\t\t\t\t\t\tonline.getInventory().setArmorContents(null);\n\t\t\t\t\t\tonline.setItemOnCursor(new ItemStack (Material.AIR));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (online.getGameMode() != GameMode.SURVIVAL) {\n\t\t\t\t\t\t\tonline.setGameMode(GameMode.SURVIVAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (PotionEffect effect : online.getActivePotionEffects()) {\n\t\t\t\t\t\t\tonline.removePotionEffect(effect.getType());\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonline.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 250, 100));\n\t\t\t\t\t\tonline.addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, 6000, 100));\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"UHC has now started, Good luck!\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"PvP will be enabled in §6\" + Settings.getInstance().getData().getInt(\"game.pvp\") + \" §7mins in.\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"Meetup at §6\" + Settings.getInstance().getData().getInt(\"game.meetup\") + \" §7mins in.\");\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"Remember to read the match post: \" + Settings.getInstance().getData().getString(\"match.post\"));\n\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"/helpop questions.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tGameState.setState(GameState.INGAME);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§a§lPvE\", 1);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§a§lPvE\", 0);\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lMeetup\", Integer.parseInt(\"-\" + Settings.getInstance().getData().getInt(\"game.meetup\")));\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lPvP\", Integer.parseInt(\"-\" + Settings.getInstance().getData().getInt(\"game.pvp\")));\n\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lFinal heal\", -1);\n\t\t\t\t\t\n\t\t\t\t\tfor (World world : Bukkit.getWorlds()) {\n\t\t\t\t\t\tworld.setTime(0);\n\t\t\t\t\t\tworld.setDifficulty(Difficulty.HARD);\n\t\t\t\t\t\tworld.setPVP(false);\n\t\t\t\t\t\tfor (Entity mobs : world.getEntities()) {\n\t\t\t\t\t\t\tif (mobs.getType() == EntityType.BLAZE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.CAVE_SPIDER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.CREEPER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.ENDERMAN ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.ZOMBIE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.WITCH ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.WITHER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.DROPPED_ITEM ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.GHAST ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.GIANT ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.MAGMA_CUBE ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.DROPPED_ITEM ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SKELETON ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SPIDER ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SLIME ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SILVERFISH ||\n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.SKELETON || \n\t\t\t\t\t\t\t\t\tmobs.getType() == EntityType.EXPERIENCE_ORB) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tmobs.remove();\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}, 20);\n\t\t\t\n\t\t\tBukkit.getServer().getScheduler().scheduleSyncRepeatingTask(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lFinal heal\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lFinal heal\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"§6§lFinal heal!\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t\tonline.setHealth(20.0);\n\t\t\t\t\t\t\t\tonline.setFireTicks(0);\n\t\t\t\t\t\t\t\tonline.setFoodLevel(20);\n\t\t\t\t\t\t\t\tonline.setSaturation(20);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lFinal heal\", Scoreboards.getManager().getScore(\"§b§lFinal heal\") + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lPvP\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lPvP\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lPvP\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(Main.prefix() + \"PvP is now enabled, Good luck everyone.\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (World world : Bukkit.getWorlds()) {\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t\tworld.setPVP(true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lPvP\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lPvP\", Scoreboards.getManager().getScore(\"§b§lPvP\") + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (Scoreboards.getManager().getScore(\"§b§lPvP\") == -5) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"5 minutes to pvp, do §6/stalk §7if you think you're being stalked.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (Scoreboards.getManager().getScore(\"§b§lPvP\") == -1) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"1 minute to pvp, do §6/stalk §7if you think you're being stalked.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\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\n\t\t\t\t\tif (Scoreboards.getManager().getScoreType(\"§b§lMeetup\") != null) {\n\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1) == 0) {\n\t\t\t\t\t\t\tScoreboards.getManager().resetScore(\"§b§lMeetup\");\n\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.DARK_GRAY + \"==============================================\");\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.GREEN + \" Meetup has started, start headding to 0,0.\");\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.GREEN + \" Only stop for a fight, nothing else.\");\n\t\t\t\t\t\t\t\tonline.sendMessage(ChatColor.DARK_GRAY + \"==============================================\");\n\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.WITHER_DEATH, 1, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ((Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1) < 0) {\n\t\t\t\t\t\t\t\tScoreboards.getManager().setScore(\"§b§lMeetup\", Scoreboards.getManager().getScore(\"§b§lMeetup\") + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (Scoreboards.getManager().getScore(\"§b§lMeetup\") == -1) {\n\t\t\t\t\t\t\t\tBukkit.broadcastMessage(Main.prefix() + \"1 minute to meetup, Pack your stuff and get ready to head to 0,0.\");\n\t\t\t\t\t\t\t\tfor (Player online : PlayersUtil.getPlayers()) {\n\t\t\t\t\t\t\t\t\tonline.playSound(online.getLocation(), Sound.NOTE_PLING, 1, 0);\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}, 1200, 1200);\n\t\t\t\n\t\t\tBukkit.getServer().getScheduler().runTaskLater(Main.plugin, new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tBukkit.getPlayer(Settings.getInstance().getData().getString(\"game.host\")).chat(\"/gamerule doMobSpawning true\");\n\t\t\t\t\t} catch (Exception e) {}\n\t\t\t\t}\n\t\t\t}, 3600);\n\t\t}\n\t\ttimeToStart -=1;\n\t}", "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 act() \n {\n updateTimerDisplay();\n if(timeCounter < 3600){\n timeCounter++;\n \n }else{\n timeElapsed++;\n timeCounter = 0;\n }\n checkHighScore();\n checkRegScore();\n\n }", "private void startEmergency()\n {\n sendUserPresentLocationDetailsToEmergencyConatct();\n\n /*final ClientConfiguration clientConfiguration = getClientConfiguration();\n completedTime = completedTime + clientConfiguration.getTimeDelayEmergency();\n Timer timer = new Timer();\n timer.schedule(new TimerTask()\n {\n @Override\n public void run()\n {\n completedTime = completedTime + clientConfiguration.getTimeDelayEmergency();\n if (clientConfiguration.getMaxTimeEmergency() < completedTime)\n {\n completedTime = 0;\n cancel();\n notifyEmergencyCompleted();\n }\n else\n {\n sendUserPresentLocationDetailsToEmergencyConatct();\n }\n }\n }, clientConfiguration.getTimeDelayEmergency(), clientConfiguration.getTimeDelayEmergency());*/\n }", "@Override\n public void update() {\n if (!myNPC.isAlive()) {\n myNPC.setState(MovingState.DEATH);\n }\n\n if (isAttacking()) {\n if (attackCounter > 300) {\n myNPC.setState(MovingState.IDLE);\n attackCounter = 0;\n } else {\n attackCounter++;\n }\n return;\n }\n\n// randomMove();\n }", "public void startExecuting() {\n this.attackTime = 20;\n ShulkerEntity.this.updateArmorModifier(100);\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 breath() {\n\t\tif (alive) {\n\t\t\t_age++;\n\t\t\t// Respiration process\n\t\t\tboolean canBreath = useEnergy(Math.min((_mass - _lowmaintenance) / Utils.SEGMENT_COST_DIVISOR, _energy));\n\t\t\tif ((_age >> 8) > _geneticCode.getMaxAge() || !canBreath) {\n\t\t\t\t// It's dead, but still may have energy\n\t\t\t\tdie(null);\n\t\t\t} else {\n\t\t\t\tif (_energy <= Utils.tol) {\n\t\t\t\t\talive = false;\n\t\t\t\t\t_world.decreasePopulation();\n\t\t\t\t\t_world.organismHasDied(this, null);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// The corpse slowly decays\n\t\t\tuseEnergy(Math.min(_energy, Utils.DECAY_ENERGY));\n\t\t}\n\t}", "public void run() {\r\n\t\tcount = 270;\r\n\t\twhile(!gameOver()) {\r\n\t\t\tmoveGame();\r\n\t\t}\r\n\t\tif (laser != null)\r\n\t\t\tremove(laser);\r\n\t\tdisplayResults();\r\n\t}", "public void startFCombat() {\n\t\ttry { \n\t\t\tenemyName = Monster.getFBossName();\n\t\t\tSystem.out.println(\"\\t!#> \" + enemyName + \" has appeared! <#! \");\n\t\t\tenemyNewHealth = Monster.getFBossHealth();\n\n\t\t\t// While enemy is alive\n\t\t\tCOMBAT_START: while (enemyNewHealth > 0) {\n\t\t\t\tSystem.out.println(Player.getPlayerName() + \"\\n HP: \" + playerNewHealth + \" Stamina: \"\n\t\t\t\t\t\t+ Player.getPlayerStamina());\n\t\t\t\tSystem.out.println(\"----------------------------\");\n\t\t\t\tSystem.out.println(enemyName + \" HP: \" + enemyNewHealth);\n\n\t\t\t\tScanner in = new Scanner(System.in);\n\t\t\t\tSystem.out.println(\"\\n\\t # ACTIONS # \");\n\t\t\t\tSystem.out.println(\"\\t1.) Attack!\");\n\t\t\t\tSystem.out.println(\"\\t2.) Block!\");\n\t\t\t\tSystem.out.println(\"\\t3.) Run!\\n\");\n\t\t\t\tSystem.out.println(\"What are you going to do?\");\n\t\t\t\tint input = in.nextInt();\n\t\t\t\t// conditonal preventing other input\n\t\t\t\tif (input == 1 || input == 2 || input == 3) {\n\t\t\t\t\t// Attack\n\t\t\t\t\tif (input == 1) {\n\t\t\t\t\t\tenemySwing = rand.nextInt(Monster.getFBossAttack()+1);\n\t\t\t\t\t\thit = rand.nextInt(Player.Attack()+1);\n\t\t\t\t\t\tSystem.out.println(\"You lunge forward and strike the \" + enemyName + \"!!\");\n\t\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\t\t\t\t\t\tSystem.out.println(\"You dealt \" + hit + \" damage!\");\t\t\n\t\t\t\t\t\tSystem.out.println(enemyName + \" dealt \" + enemySwing + \" Damage!\");\n\t\t\t\t\t\tenemyNewHealth = enemyNewHealth - hit;\n\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\tif (playerNewHealth <= 0) {\n\t\t\t\t\t\t\tSystem.out.println(\"\\t!@#$%^ GAME OVER ^%$#@!\");\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (enemyNewHealth <= 0) {\n\t\t\t\t\t\t\tenemyNewHealth = 0;\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\"The \" + enemyName + \" has \" + enemyNewHealth + \" health left!\");\n\t\t\t\t\t\t\tcontinue COMBAT_START;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Block\n\t\t\t\t\tif (input == 2) {\n\t\t\t\t\t\tenemySwing = rand.nextInt(Monster.Attack());\n\t\t\t\t\t\tSystem.out.println(\"You attempt to cower behind your shield!\");\n\t\t\t\t\t\t// Block\n\t\t\t\t\t\tif (Player.Block() == true) {\n\t\t\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\n\t\t\t\t\t\t\tSystem.out.println(\"\\tBlock Successful!\");\n\t\t\t\t\t\t\tSystem.out.println(enemyName + \" trys to deal \" + enemySwing + \" damage!\");\n\t\t\t\t\t\t\t// how much is blocked\n\t\t\t\t\t\t\tenemySwing = enemySwing - rand.nextInt(Player.getPlayerMaxBlock());\n\t\t\t\t\t\t\t// if how much is blocked results neg make it 0\n\t\t\t\t\t\t\tif (enemySwing <= 0) {\n\t\t\t\t\t\t\t\tenemySwing = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// output results\n\t\t\t\t\t\t\tSystem.out.println(\"You took \" + enemySwing + \" damage\");\n\t\t\t\t\t\t\t// adjust health value\n\t\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(enemyName + \" dealt \" + enemySwing + \" damage!\");\n\t\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (playerNewHealth <= 0) {\n\t\t\t\t\t\t\tSystem.out.println(\"\\t!@#$%^ GAME OVER ^%$#@!\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue COMBAT_START;\n\n\t\t\t\t\t}\n\t\t\t\t\t// Run chance\n\t\t\t\t\tif (input == 3) {\n\t\t\t\t\t\tSystem.out.println(\"You attempt to flee!\");\n\t\t\t\t\t\t// roll to see if flee\n\t\t\t\t\t\tif (Player.Run() == true) {\n\t\t\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\t\t\t\t\t\t\tSystem.out.println(\"you've run away from the \" + enemyName + \"!\");\n\t\t\t\t\t\t\tbreak COMBAT_START;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tenemySwing = rand.nextInt(Monster.Attack());\n\t\t\t\t\t\t\tSystem.out.println(enemyName + \" dealt \" + enemySwing + \" Damage!\");\n\t\t\t\t\t\t\tplayerNewHealth = playerNewHealth - enemySwing;\n\t\t\t\t\t\t\tcontinue COMBAT_START;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"\\t!!!Invalid Input!!!\");\n\t\t\t\t\tSystem.out.println(\"\\tPlease try Again.\");\n\t\t\t\t}\n\n\t\t\t\t// When Enemy Dies.\n\t\t\t\t//TODO: add timeunit here\n\t\t\t\tif (enemyNewHealth <= 0) {\n\t\t\t\t\tSystem.out.println(\"You have defeated \" + enemyName + \"!!\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tYou have beaten my FIRST game ever.\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tThank you so fuckin' much for playing.\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tit means the W O R L D to me :)\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tIf you want to see more of my work,\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(1);\n\t\t\t\t\tSystem.out.println(\"\\tfollow me on Twitter @Simons_saysNull\");\n\t\t\t\t\tTimeUnit.SECONDS.sleep(2);\n\t\t\t\t\tSystem.out.println(\"\\tThanks again for playing my game. - Robb Simons\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue COMBAT_START;\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\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 }", "private void manageLoop() {\n if (!gameOver) {\n if (lastLoopTime != null) {\n timeBufer += lastLoopTime\n .until(LocalTime.now(), ChronoUnit.MILLIS);\n }\n lastLoopTime = LocalTime.now();\n\n if (timeBufer > fallingTime) {\n int nbFalling = (int) (timeBufer / fallingTime);\n timeBufer = timeBufer % fallingTime;\n for (int i = 0; i < nbFalling; i++) {\n if (currentPiece.canDown(grid)) {\n currentPiece.down();\n sincePieceDown = null;\n } else if (sincePieceDown == null) {\n sincePieceDown = LocalTime.now();\n sinceLastMove = LocalTime.now();\n }\n }\n }\n\n if (sincePieceDown != null && sinceLastMove != null) {\n long a = sinceLastMove\n .until(LocalTime.now(), ChronoUnit.MILLIS);\n long b = sincePieceDown\n .until(LocalTime.now(), ChronoUnit.MILLIS);\n if (a >= fallingTime || b >= fixTime) {\n effectsReader.play(\"drop.mp3\", 1);\n currentPiece.getPoints().stream().filter((p) -> (p.y >= 0))\n .forEachOrdered((p) -> {\n grid.get(p.y).updatePoint(\n p.x, currentPiece.getColorType()\n );\n });\n int nbRemove = 0;\n boolean newLevel = false;\n for (int j = Settings.getYCases() - 1; j >= 0; j--) {\n if (grid.get(j).isClear()) {\n grid.remove(j);\n nbRemove++;\n nbLines++;\n if (nbLines % 10 == 0) {\n newLevel = true;\n }\n }\n }\n if (nbRemove == 4) {\n effectsReader.play(\"tetris.mp3\", 1);\n } else if (nbRemove > 0) {\n effectsReader.play(\"line.mp3\", 1);\n }\n lineScore(nbRemove);\n if (newLevel) {\n effectsReader.play(\"level-up.mp3\", 1);\n level++;\n fallingTime = (int) (fallingTime * .8d);\n fixTime = fallingTime * 2;\n }\n for (int j = 0; j < nbRemove; j++) {\n grid.add(0, new Line());\n }\n initNextPiece();\n hasSwiched = false;\n }\n }\n }\n }", "public void enterRoom(Person p) {\n if (p.poisoned) {\n System.out.println(\"The poison eats away at you. You take 5 damage.\");\n p.hp -= 5;\n System.out.println(\"You now have \" + p.hp + \"health\");\n if (p.hp <= 0) {\n\n gameOff();\n }\n }\n occupant = p;\n p.setxLoc(this.xLoc);\n p.setyLoc(this.yLoc);\n Scanner n = new Scanner(System.in);\n\n if (!m.sleep) {\n if (m.alive) {\n System.out.println(\"There's a monster in the room!\");\n } else {\n System.out.println(\"The monster's remains lies before you.\");\n }\n m.aggro = true;\n while (m.alive && m.aggro) {\n if (m.hp <= 0) {\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n }\n int damage = m.counterAttack(p);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n if (p.hp <= 0) {\n System.out.println(\"You died. No one knows you died.\");\n Runner.gameOff();\n }\n System.out.println(\"You have \" + p.hp + \" health.\");\n System.out.println(\"What do you do now? (Fight, Run)\");\n String re = n.nextLine();\n if (re.equalsIgnoreCase(\"run\")) {\n damage = (int) (m.counterAttack(p) / p.dex);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n m.aggro = false;\n }\n if (re.equalsIgnoreCase(\"Fight\")) {\n double dam = (p.str + p.str * Math.random()) / (m.resist + 1);\n\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \"damage.\");\n if (m.hp <= 0) {\n m.alive = false;\n System.out.println(\"The monster howls as you deal a finishing blow.\");\n int g = m.dropGold();\n System.out.println(\"You gain \" + p.gold + \" Gold\");\n p.gold += g;\n m.threat = false;\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n }\n }\n }\n if (m.alive) {\n if (m.sleep) {\n System.out.println(\"You find a sleeping monster. Do you attack it? (Y/N)\");\n\n String q = n.nextLine();\n if (q.equalsIgnoreCase(\"yes\") || q.equalsIgnoreCase(\"y\")) {\n\n double dam = p.str * (1.5) + p.str * Math.random();\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \" damage.\");\n m.aggro = true;\n if (m.hp <= 0) {\n System.out.println(\"The monster dies on the spot. Who's the real monster here?\");\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \" Gold\");\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n while (m.alive && m.aggro) {\n if (m.hp <= 0) {\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \"Gold\");\n }\n int damage = m.counterAttack(p);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n if (p.hp <= 0) {\n System.out.println(\"You died. Serves you right for hitting a sleeping monster.\");\n Runner.gameOff();\n }\n System.out.println(\"You have \" + p.hp + \" health.\");\n System.out.println(\"What do you do now? (Fight, Run)\");\n q = n.nextLine();\n if (q.equalsIgnoreCase(\"run\")) {\n damage = (m.counterAttack(p) / p.dex);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n m.aggro = false;\n }\n if (q.equalsIgnoreCase(\"Fight\")) {\n dam = (p.str + p.str * Math.random()) / (m.resist + 1);\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \"damage.\");\n if (m.hp <= 0) {\n m.alive = false;\n System.out.println(\"The monster howls as you deal a finishing blow.\");\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \" Gold\");\n m.threat = false;\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n }\n\n }\n } else {\n System.out.println(\"You let the sleeping monster be.\");\n m.threat = false;\n n.close();\n }\n\n }\n }\n else\n {\n System.out.println(\"The monster's remains are still here.\");\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tif(role.getRoleCurHealth()==0||getRoleCurHealth()==0)\n\t\t\t\t{\n//\t\t\t\t\tUtils.SystemPrintln(\"fight!222\");\n\t\t\t\t\ttimer.cancel();\n\t\t\t\t\tifMoveEnd=false;\n\t\t\t\t}\n\t\t\t\tif(ifMoveEnd){\n//\t\t\t\t\tUtils.SystemPrintln(\"fight!333\");\n\t\t\t\t\trole.getHurt(getBaseDamage());\n\t\t\t\t\tSystem.out.println(\"getHurt!:\"+role.getRoleName()+\" 当前生命值:\"+role.getRoleCurHealth());\n\t\t\t\t}\n\t\t\t}", "private synchronized void teamVictory() {\n \t\tif (state == MatchState.ONVICTORY || state == MatchState.ONCOMPLETE || state == MatchState.ONCANCEL) \n \t\t\treturn;\n \t\tstate = MatchState.ONVICTORY;\n \t\t/// Call the rest after a 2 tick wait to ensure the calling transitionMethods complete before the\n \t\t/// victory conditions start rolling in\n \t\tBukkit.getScheduler().scheduleSyncDelayedTask(plugin, new MatchVictory(this),2L);\n \t}", "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}", "@Override\n\tpublic void doTimeStep() {\n\t\tif (getEnergy() > Params.MIN_REPRODUCE_ENERGY) {\n\t\t\tCritter1 child = new Critter1();\n\t\t\treproduce(child, Critter.getRandomInt(8));\n\t\t}\n\t\telse{\n\t\t\twalk(Critter.getRandomInt(8));\n\t\t}\n\t}", "static void boss_fight() {\n miss_choice = miss.nextInt(2);//random used to determie a miss or a hit\n playerhealth = 3500;\n nagahealth = 3500;\n bosshealth = 10000;//#enemyobject-the actual boss that has created the game play(antagonsit)\n System.out.println(\"You have recently leveled up and have increased your HP to 3500. Be careful...\");\n System.out.println(\"You can now cast 8 different types of spells...\");\n enter = next.nextLine();\n System.out.println(\"These spells include fire, ice, wind, lightening, throw rocks, sacred sword, \");\n System.out.println(\"cosmic rays, and teleport\");\n enter = next.nextLine();\n System.out.println(\"Naga has his own spells don't worry about him...\");\n enter = next.nextLine();\n System.out.println(\"'I can use 3 different types of dark magic and 2 different types of normal attacks'\");\n System.out.println(\"Don't worry, we got this \"+ username + \".\");\n enter = next.nextLine();\n System.out.println(\"ALL OR NOTHING!!! GHAAAA!!!\");\n enter = next.nextLine();\n monsterisalive = true;\n //#while \n /* while loop that will let players fight the boss */\n while(monsterisalive){\n System.out.println(\"It is your turn...which move will you use:\");\n System.out.println(\"fire, ice, wind, lightening, throw rocks, sacred sword, cosmic rays, teleport, or heal.\");\n attack = next.nextLine();\n if(attack.contains(\"fire\")) {\n System.out.println(\"Alright, I'm fired up...FOOOSH!!!\");\n bosshealth = bosshealth-30; //player deals damage\n System.out.println(\"WHOA! The witch lost 30 HP. The boss now has \" + bosshealth + \" HP.\" );\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"ice\")) {\n System.out.println(\"Alright, it's gonna be a little chilly...GHAAAA!!!\");\n bosshealth = bosshealth-20;\n System.out.println(\"BRRR... The evil witch lost 20 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"lightening\")) {\n System.out.println(\"Someone's gonna get fried today! ZAAAAP!!!\");\n bosshealth = bosshealth-40;\n System.out.println(\"OUCH!!! The evil witch lost 40 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP\");\n }else if (answer.contains(\"throw rocks\")) {\n System.out.println(\"Incoming Boulder...BOOOOOMM!!!\");\n bosshealth = bosshealth-30;\n System.out.println(\"The witch lost 30 HP. It now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"sacred swords\")) {\n System.out.println(username + \" summons the guardians of the 9 sacred swords, and \");\n System.out.println(\"the guardians released their swords to punish the wicked witch...\");\n enter = next.nextLine();\n System.out.println(\"The 9 swords punctures the wicked releasing powerful, positive energy.\");\n bosshealth = bosshealth-150;\n System.out.println(\"ZHHHHNGG!!! BOOOM!!! Ouch...the boss lost 150 HP. The boss now has \" + bosshealth);\n System.out.println(\"HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"cosmic rays\")) {\n System.out.println(username + \" casts a spell that absorbs all of the radiation from space...\");\n System.out.println(\"Then a large light bombards the witch and inflicts 130 HP.\");\n bosshealth = bosshealth-130;\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"teleport\")) {\n System.out.println(username + \" creates a blue portal and jumps inside the portal...\");\n enter = next.nextLine();\n System.out.println(username + \" then teleports behind the witch and strikes...Then jumps back in...\");\n enter = next.nextLine();\n System.out.println(\"Then appears in the rear side and strikes the boss again and quickly disappears...\");\n enter = next.nextLine();\n System.out.println(\"Finally...\" + username + \" strikes again on top of the witch.\");\n enter = next.nextLine();\n bosshealth = bosshealth-210;\n System.out.println(\"WOW!!!\" + username + \" inflicted 210 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if(answer.contains(\"wind\")) {\n System.out.println(\"Alright, let's finish this up...WHIRL!!!\");\n bosshealth = bosshealth-10;\n System.out.println(\"The evil witch lost 10 HP. The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"You now have \" + playerhealth + \" HP.\");\n }else if (answer.contains(\"heal\")){\n healing_challenge3();\n System.out.println(\"\\n\");\n System.out.println(username + \"'s HP increased 300 health points and now have \" + playerhealth + \".\");\n System.out.println(\"The boss still has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n }else{\n System.out.println(\"Please make sure you type everything correctly next time. You lost a turn...\");\n }\n \n if(bosshealth <= zero) { //check to see if boss is still alive\n System.out.println(\"You defeated the boss...Congratulations, you have won the war.\");\n enter = next.nextLine();\n System.out.println(\"The witch has disappeared, vanished forever in a black hole that consumed the boss.\");\n enter = next.nextLine();\n System.out.println(\"That is the last time you'll ever see that hideous thing ever again.\");\n monsterisalive = false;\n endgame();\n // It's Naga's turn\n }else if (bosshealth > zero) {\n System.out.println(\"It's Naga's turn...You can do this Naga!\");\n naga_attacks = naga.nextInt(6);\n if(naga_attacks == 0){\n System.out.println(\"Naga used shadow force...\");\n System.out.println(\"Naga disappears in a pitch black vortex...\");\n enter = next.nextLine();\n System.out.println(\"GHAAAAR!!!\");\n enter = next.nextLine();\n System.out.println(\"Naga flies out of his vortex and rams into the witch. YOUCH!\");\n System.out.println(\"The boss lost 180 HP.\");\n bosshealth = bosshealth-180;//Naga deals damage\n enter = next.nextLine();\n System.out.println(\"The evil witch now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 1) {\n System.out.println(\"Naga used firebreath...A large dark ember sparks from naga's mouth and \");\n System.out.println(\"begins to build up. The large black fire surrounds the witch and burns the witch\");\n enter = next.nextLine();\n System.out.println(\"'ARGHH! You will pay for that', the witch screamed.\");\n enter = next.nextLine();\n bosshealth = bosshealth-200;\n System.out.println(\"WHOA!!! The fiery breath inflicted 200 HP. The boss now has\" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 2) {\n System.out.println(\"Naga used his blades of terror to torture the witch...\");\n System.out.println(\"Naga creates a strong whirlwind with his wings and released thousands of sharp\");\n System.out.println(\"scales that severely wounded the witch. SHINGG!!!\");\n enter = next.nextLine();\n bosshealth = bosshealth-150;\n System.out.println(\"OWWW!!! The boss lost 150 HP and now has \" + bosshealth + \"HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\"); \n }else if (naga_attacks == 3) {\n System.out.println(\"Naga used wings of Justice. \");\n enter = next.nextLine();\n System.out.println(\"Naga flies up high and plunges down toward the witch...\");\n System.out.println(\"Naga uppercuts the witch with his large wings and knocks the witch off her feet.\");\n enter = next.nextLine();\n bosshealth = bosshealth-210;\n System.out.println(\"YIKES!!! Naga inflicted 210 HP. The boss has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 4) {\n System.out.println(\"Naga used tail whip...\");\n System.out.println(\"SWWWSSS!!! BRMMM!!!\");\n System.out.println(\"Naga sets himself apart and lunges forward with his tail and thrusts the witch\");\n System.out.println(\"off the arena...\");\n enter = next.nextLine();\n System.out.println(\"The witch teleports herself back into the arena, but loses 60 HP because of this.\");\n bosshealth = bosshealth-60;\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"Now Naga has \" + nagahealth + \" HP.\");\n }else if (naga_attacks == 5) {\n healing_naga_challenge3();\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n System.out.println(\"\\n\");\n System.out.println(\"The boss still has \" + bosshealth + \" HP.\");\n }\n }\n \n if(bosshealth <= zero) { //check to see if boss is still alive\n //#win\n /* This is the conditions to win. The boss's health must equal to or less than zero. If you win the \n boolean monsterisalive is equal to false and the player will come to the endgame method to \n displayt he credits...\n */\n System.out.println(\"You defeated the boss...Congratulations, you have won the war.\");\n enter = next.nextLine();\n System.out.println(\"The witch has disappeared, vanished forever in a black hole that consumed the boss.\");\n enter = next.nextLine();\n System.out.println(\"That is the last time you'll ever see that hideous thing ever again.\");\n monsterisalive = false;\n endgame();\n //it's the boss's turn\n }else if (bosshealth > zero) { //if it is still greater than zero...\n System.out.println(\"It's the monster's turn...brace yourselves\");\n System.out.println(\"'The witch has 8 different spells that she can use...she's very strong...\");\n System.out.println(\"BE CAREFUL,' stated Naga.\");\n enter = next.nextLine();\n System.out.println(\"Are you ready to feel what pain really is? Prepare yourself...\");\n System.out.println(\"ARGGHHH!!! BRRRM!!!\");\n enter = next.nextLine();\n System.out.println(\"Naga and \"+ username + \" are on their guard ready to defend against the witches attacks\");\n enter = next.nextLine();\n System.out.println(\"Here I go...\");\n enter = next.nextLine();\n which = pick.nextInt(2);//decide which one will get hit: player or Naga\n boss_attacks = boss.nextInt(9);//decides which\n if (boss_attacks == 0) {\n System.out.println(\"'Night Shadow!'\");\n //this will determine which player gets hit; you or Naga\n if(which == 0) { //player gets hit\n enter = next.nextLine();\n System.out.println(\"The witch summons a dark cloud from above with her staff...\");\n enter = next.nextLine();\n /* #enemyobject\n The witch affects the protagonist/player by harming the player's health through savage attacks that \n inflicts large amounts of damage to the player. \n */\n System.out.println(\"The dark cloud duplicates and strikes \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"Ouch \" + username + \" loses 200 HP.\");\n playerhealth = playerhealth-200;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n enter = next.nextLine();\n System.out.println(\"The witch summons a dark cloud from above with her staff...\");\n enter = next.nextLine();\n System.out.println(\"The dark cloud duplicates and strikes Naga. Naga collapses\");\n enter = next.nextLine();\n System.out.println(\"Ouch Naga loses 200 HP.\");\n nagahealth = nagahealth-200;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 1) {\n System.out.println(\"'Shadow Blade!'\");\n //this will determine who will get hit\n if (which == 0) { // player gets hit\n System.out.println(\"The witch's staff transforms into a deadly blade.\");\n System.out.println(\"The blade has \" + username + \"'s face on the back...\");\n enter = next.nextLine();\n System.out.println(\"Watch out \" + username + \". She's on to you...\");\n enter = next.nextLine();\n System.out.println(\"The witch charges up and strikes \" + username + \".\");\n System.out.println(\"SLASH...SHING!!!\");\n enter = next.nextLine();\n System.out.println(\"OUCH!!! \" + username + \" loses 150 HP.\");\n playerhealth = playerhealth-150;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n System.out.println(\"The witch's staff transforms into a deadly blade.\");\n System.out.println(\"The blade has a black dragon symbol on the edge...\");\n enter = next.nextLine();\n System.out.println(\"'Naga she's on to you. WATCH OUT!' \" + username + \" screams.\");\n System.out.println(\"SLASH...SHING!!!\");\n enter = next.nextLine();\n System.out.println(\"OUCH!!! naga loses 150 HP.\");\n nagahealth = nagahealth-150;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 2) {\n System.out.println(\"Dragon spiral!\");\n if(which == 0) { //player gets hit\n System.out.println(\"The witch summons a red and purple dragon underground...\");\n System.out.println(\"The red and purple dragon shoots out red and purple flames that fuse\");\n System.out.println(\"together to form a gigantic half red and purple flame.\");\n enter = next.nextLine();\n System.out.println(\"Look out \" + username + \".\");\n System.out.println(\"FOOOSH!!! The burning lava like embers engulf \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"ARRHHH!!! \" + username + \" loses 300 HP.\");\n playerhealth = playerhealth-300;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) { //naga gets hit\n System.out.println(\"The witch summons a red and purple dragon underground...\");\n System.out.println(\"The red and purple dragon shoots out red and purple flames that fuse\");\n System.out.println(\"together to form a gigantic half red and purple flame.\");\n enter = next.nextLine();\n System.out.println(\"'Look out Naga,' \" + username + \" stated.\");\n System.out.println(\"FOOOSH!!! The burning lava like embers engulf Naga.\");\n enter = next.nextLine();\n System.out.println(\"ARRHHH!!! Naga loses 300 HP.\");\n nagahealth = nagahealth-300;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 3) {\n System.out.println(\"Take over\");\n enter = next.nextLine();\n System.out.println(\"The witch summons the demons and releases them from a black portal she created\");\n System.out.println(\"Gouls, bats, and other hideous creatures emerged from the darkness\");\n if(which == 0) {// player gets hit\n System.out.println(\"The creatures targets \" + username + \".\");\n enter = next.nextLine();\n System.out.println(\"Watch out \" + username + \".\");\n System.out.println(\"GARRRL!!! SCRAA!!! FOOSHING!!!\");\n enter = next.nextLine();\n System.out.println(\"AHHH!!! \" + username + \" gets bitten, beaten, and scratched ...\");\n playerhealth = playerhealth-50;\n System.out.println(username + \" loses 50 HP. You now have \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (which == 1) {\n System.out.println(\"The creatures targets Naga.\");\n enter = next.nextLine();\n System.out.println(\"'Watch out Naga,' \" + username + \" stated.\");\n System.out.println(\"GARRRRL!!! SCRAAA!!! FOOOSHHING!!!\");\n enter = next.nextLine();\n nagahealth = nagahealth-50;\n System.out.println(\"ARRGGG!!! Naga loses 50 HP. Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 4) {\n System.out.println(\"dark cosmic swords!!!\");\n System.out.println(\"GHAAA!!!\");\n enter = next.nextLine();\n System.out.println(\"There are 5 darks lands in her reign, which means 5 different swords in her possession.\");\n System.out.println(\"Sword 1 released fire...\");\n System.out.println(\"FOOSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 2 released water...\");\n System.out.println(\"GURLG!!! FSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 3 released ice...\");\n System.out.println(\"SHING!!! BRRRRR!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 4 released wind...\");\n System.out.println(\"WHIRL!!! WHIRL!!! GUSHHH!!!\");\n enter = next.nextLine();\n System.out.println(\"Sword 5 released lightening...\");\n System.out.println(\"ZHNGGG!!! BAM!!!! BRVRMM!!!\");\n System.out.println(\"The ground ruptures and collides on \" + username + \" and Naga.\");\n enter = next.nextLine();\n System.out.println(\"These swords have just released the dark elements of the earth!\");\n System.out.println(\"YOUCH!!! Both Naga and \" + username + \" lost 220 HP.\");\n enter = next.nextLine();\n playerhealth = playerhealth-220;\n nagahealth = nagahealth-220;\n System.out.println(username + \" now has \" + playerhealth + \" HP and Naga has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (boss_attacks == 5) {\n System.out.println(\"Knock down!\");\n if(miss_choice == 0) {//boss miss\n System.out.println(\"The witch summons a dark spell from her staff.\");\n enter = next.nextLine();\n System.out.println(\"An evil figure lurks in the shadows...'Can you see it Naga?' \");\n System.out.println(username + \" said.\");\n enter = next.nextLine();\n System.out.println(\"'No...I can't see a thing.\");\n enter = next.nextLine();\n System.out.println(\"Suddenly, you see a big shadow coming at Naga.\");\n enter = next.nextLine();\n System.out.println(username + \" sends a fireball flying at the shadowy figure and it disappears.\");\n System.out.println(\"Naga then sees the figure coming towards \" + username + \" and sends a flame\");\n System.out.println(\"at the shadow...The figure plunges back into the witches staff. \");\n enter = next.nextLine();\n System.out.println(\"'I guess you saw that coming, won't happen ever again!' the witch exclaimed.\");\n enter = next.nextLine();\n System.out.println(\"You dodged the witches attack!\");\n enter = next.nextLine();\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" still has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga still has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (miss_choice == 1) { //boss hits\n System.out.println(\"The witch summons a dark spell from her staff.\");\n enter = next.nextLine();\n System.out.println(\"An evil figure lurks in the shadows...'Can you see it Naga?' \");\n System.out.println(username + \" said.\");\n enter = next.nextLine();\n System.out.println(\"'No...I can't see a thing.\");\n enter = next.nextLine();\n System.out.println(\"Suddenly, you see a big shadow coming at Naga.\");\n enter = next.nextLine();\n System.out.println(username + \" sends a fireball flying at the shadowy figure, but you missed!\");\n System.out.println(\"The shadowy figure steals 50 HP of Naga's health.\");\n nagahealth = nagahealth-50;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The shadowy figure then turns towards \" + username + \".\");\n System.out.println(\"Naga spits out a large fire, but misses the figure...\");\n System.out.println(\"The shadowy figure steals 50 HP of \" + username + \".\");\n playerhealth = playerhealth-50;\n System.out.println(username + \" still has \" + playerhealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }else if (boss_attacks == 6) {\n System.out.println(\"Volcanic Eruption!\");\n if(miss_choice == 0) {//the boss misses\n System.out.println(\"The witch casts a spell that creates a series of volcanoes around you.\");\n System.out.println(\"The witch then forces the volcanoes to spit lava out...\");\n System.out.println(\"However, you saw that coming already. You and Naga jumped out of the way\");\n enter = next.nextLine();\n System.out.println(\"You dodged the attack!\");\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" has \" + playerhealth + \" HP, and Naga has \" + nagahealth + \" HP.\");\n enter = next.nextLine();\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }else if (miss_choice == 1) {//the boss is able to hit you\n System.out.println(\"The witch summons the evil lava guardian...\");\n System.out.println(\"She then points her staff directly at...\");\n if(which == 0){//player gets hit\n System.out.println(username);\n enter = next.nextLine();\n System.out.println(\"Watch out!!!\");\n System.out.println(\"GURGLLE!!! FSH!!!\");\n System.out.println(\"The lava erupts like a fountain lake and basks \" + username + \".\");\n System.out.println(username + \" loses 100 HP.\");\n enter = next.nextLine();\n playerhealth = playerhealth-100;\n System.out.println(username + \" now has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (which == 1){ //naga gets hit\n System.out.println(\"Naga\");\n enter = next.nextLine();\n System.out.println(\"Watch out!\");\n System.out.println(\"GURGLRE!!! FSH!!!\");\n System.out.println(\"The lava shoots out at Naga's face, feet, and back...\");\n System.out.println(\"Removing all of his scales in the process\");\n System.out.println(\"Naga loses 100 HP.\");\n enter = next.nextLine();\n nagahealth = nagahealth-100;\n System.out.println(username + \" has \" + playerhealth + \" HP.\");\n System.out.println(\"Naga has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \" + bosshealth + \" HP.\");\n }\n }\n }else if (boss_attacks == 7) {\n System.out.println(\"Satin's Spear\");\n System.out.println(\"The witch uses her staff to summon her friend Satin...\");\n enter = next.nextLine();\n System.out.println(\"EXTERMINATE THEM!!!\");\n if(miss_choice == 0){ //boss missed\n System.out.println(\"Yes ma'm...\");\n System.out.println(\"Statin launches his spear...\");\n enter = next.nextLine();\n System.out.println(\"BUT, Naga and \" + username + \" were able to dodge the attack!\");\n System.out.println(\"MISS!\");\n enter = next.nextLine();\n System.out.println(\"OOPS!\");\n playerhealth = playerhealth-0;\n nagahealth = nagahealth-0;\n System.out.println(username + \" has \" + playerhealth + \" and Naga has \" + nagahealth + \" HP.\");\n System.out.println(\"The boss has \"+ bosshealth + \" HP.\");\n }else if(miss_choice == 1){//boss gets a hit\n System.out.println(\"Yes ma'm...\");\n System.out.println(\"URGGGHAAA!!!\");\n enter = next.nextLine();\n System.out.println(\"Satin launches his spear, which duplicated...\");\n System.out.println(\"The spear is still launching up on the air...\");\n enter = next.nextLine();\n if(which == 0) { //player gets hit\n System.out.println(username + \" wants to protect his friend so he jumps forward to block\");\n System.out.println(\"the threatening spear from piercing his friend...\");\n enter = next.nextLine();\n System.out.println(\"However, in doing so the spear lands on \" + username + \".\");\n System.out.println(\"The spear erupts into pieces, shattering \" + username + \"'s legs.\");\n enter = next.nextLine();\n System.out.println(\"The wound heals but inflicts 300 damage to \" + username + \".\");\n playerhealth = playerhealth-300;\n System.out.println(username + \" has \" + playerhealth + \" HP.\");\n }else if(which == 1) { //Naga gets hit\n System.out.println(\"Naga tries to shield \" + username + \" and successfully does.\");\n System.out.println(\"BUT, in doing so the spear pierces Naga's well-armored belly.\");\n enter = next.nextLine();\n System.out.println(\"The spear automatically drills deeper until Naga can't fight anymore...\");\n System.out.println(\"The wound heals, but dealt 300 damage to Naga.\");\n nagahealth = nagahealth-300;\n System.out.println(\"Naga now has \" + nagahealth + \" HP.\");\n }\n }\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }else if (boss_attacks == 8) {\n System.out.println(\"Health Spell...\");\n System.out.println(\"The evil witch raised her staff and a blue vortex emerged.\");\n System.out.println(\"\\n\");\n System.out.println(\"However, the witch suddenly jumps into the vortex and after a while jumps out.\");\n System.out.println(\"OH NO!!! She tried to heal herself...\");\n bosshealth = bosshealth + 350;\n if(bosshealth == 10000) {\n System.out.println(\"She already had a maximum health of \" + bosshealth + \" HP. So it didn't work.\");\n System.out.println(\"\\n\");\n }else if(bosshealth > 10000) {\n bosshealth = 10000;\n System.out.println(\"The boss currently now \" + bosshealth + \" HP.\");\n }else{\n System.out.println(\"The boss now has \" + bosshealth + \" HP.\");\n }\n }\n }\n //#lose-player loses all of HP \n if(playerhealth <= zero) { //in case player loses all of his/her health\n System.out.println(\"OH NO!!!\" + username + \" lost was defeated!\");\n System.out.println(\"Naga currently has \" + nagahealth + \" HP.\");\n System.out.println(\"Better luck next time...\");\n monsterisalive = false;\n replaybossfight();\n }\n //#lose-naga's HP is equal to or less than zero\n if(nagahealth <= zero) { // in case Naga loses all of his/her health\n System.out.println(\"OH NO!!! Naga lost all of his health and was defeated!\");\n System.out.println(username + \" currently has \" + playerhealth + \" HP.\");\n System.out.println(\"Better luck next time...\");\n monsterisalive = false;\n replaybossfight();\n }\n \n }\n \n }", "private void harvest() {\n\t\t// if VERY far from flower, it must have died. start scouting\n\t\tif(grid.getDistance(grid.getLocation(targetFlower),grid.getLocation(this)) > 200) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// if crop storage is full, return to hive with information\n\t\telse if(food >= maxCrop) {\n\t\t\tif(targetFlower != null) {\n\t\t\t\tlastFlowerNectar = targetFlower.food;\n\t\t\t}\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if daylight is diminishing, return to hive\n\t\telse if(clock.time > (endForagingTime + 1.0)){\n\t\t\tlastFlowerNectar = 0;\n\t\t\tstate = \"RETURNING\";\n\t\t}\n\t\t// if flower loses all nectar, start scouting for new flower\n\t\telse if(targetFlower.food <= 0){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// semi-random decision to scout for new flower if current flower has low food\n\t\telse if(RandomHelper.nextIntFromTo(0,(int)(maxFlowerNectar/4)) > targetFlower.food &&\n\t\t\t\tRandomHelper.nextDoubleFromTo(0,1) < forageNoise){\n\t\t\tstate = \"AIMLESSSCOUTING\";\n\t\t\ttempTime = clock.time;\n\t\t}\n\t\t// otherwise continue harvesting current flower\n\t\telse{\n\t\t\thover(grid.getLocation(targetFlower));\n\t\t\ttargetFlower.food -= foragingRate;\n\t\t\tfood += foragingRate;\n\t\t\tfood -= lowMetabolicRate;\n\t\t}\n\t}", "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}", "@Override\r\n protected boolean pollMovement(Creature creature, long lastPolled) {\r\n if (creature.isFighting())\r\n return false;\r\n\r\n Horde horde;\r\n \r\n if ((horde = WanderingHorde.inHorde(creature)) == null) {\r\n WanderingHorde.logger.warning(String.format(\"Polling movement for satellite AI but it is not in a horde? %s\", creature));\r\n hold(creature);\r\n return false;\r\n }\r\n\r\n if (System.currentTimeMillis() - horde.lastMovement < Options.satelliteMovement) {\r\n // Stop creature from moving randomly.\r\n hold(creature, true);\r\n return false;\r\n }\r\n \r\n Member satellite;\r\n \r\n if ((satellite = horde.isSatellite(creature)) == null) {\r\n WanderingHorde.logger.warning(String.format(\"Satellite is not in horde? %s, %s.\", creature, horde));\r\n hold(creature);\r\n return false;\r\n }\r\n\r\n if (satellite.checkHordeCombat())\r\n WanderingHorde.logger.warning(\"SATELLITE INVOLVED IN COMBAT NOW!\");\r\n \r\n Path path;\r\n \r\n if ((path = satellite.getStatus().getPath()) != null && !path.isEmpty()) {\r\n if (WanderingHorde.logger.isLoggable(Level.FINER))\r\n WanderingHorde.logger.finer(String.format(\"Satellite still pathing, %s.\", satellite));\r\n \r\n return false;\r\n }\r\n \r\n HordePath hp = horde.waypoints.path();\r\n \r\nswitchbreak:\r\n switch (satellite.brain) {\r\n case Idle:\r\n hold(satellite, false);\r\n break;\r\n case WalkingToTarget:\r\n if (satellite.walkingTarget == null || satellite.walkingTarget.isDead()) {\r\n satellite.brain = MemberStatus.WalkingToWaypoint;\r\n satellite.walkingTarget = null;\r\n break;\r\n }\r\n \r\n if (satellite.isWithinDistanceTo(satellite.walkingTarget, 4f)) {\r\n hold(satellite, false);\r\n satellite.setTarget(satellite.walkingTarget.getWurmId(), true);\r\n satellite.attackTarget();\r\n }\r\n else {\r\n int targetDistX = satellite.walkingTarget.getTileX() - satellite.getTileX() - 1;\r\n int targetDistY = satellite.walkingTarget.getTileY() - satellite.getTileY() - 1;\r\n boolean surface = satellite.isOnSurface();\r\n int toX = satellite.getTileX() + targetDistX;\r\n int toY = satellite.getTileY() + targetDistY;\r\n int tile = (surface ? Server.surfaceMesh.getTile(toX, toY) : Server.caveMesh.getTile(toX, toY));\r\n satellite.startPathingToTile(new PathTile(toX, toY, tile, surface, satellite.getFloorLevel()));\r\n }\r\n break;\r\n case WalkingToWaypoint:\r\n if (hp.nearDestination(creature, Options.scatterDistance)) {\r\n satellite.brain = MemberStatus.Scattering;\r\n satellite.scatter(Options.scatterDistance);\r\n break;\r\n }\r\n \r\n if ((path = satellite.getStatus().getPath()) != null && !path.isEmpty())\r\n break;\r\n \r\n LinkedList<PathTile> tiles = hp.get().getPathTiles();\r\n \r\n // gets a tile from the list that's 1 tile behind the anchor if possible.\r\n int start = Math.min(tiles.size() - 1, Math.max(0, hp.index - 1));\r\n \r\n for (int i = start; i >= 0; i--) {\r\n PathTile desTile = tiles.get(i);\r\n TilePos dest = TilePos.fromXY(desTile.getTileX(), desTile.getTileY());\r\n \r\n if (satellite.isWithinTileDistanceTo(dest.x, dest.y, 0, Options.satelliteAdvance)) {\r\n if (!satellite.walkDeviated(desTile.getTileX(), desTile.getTileY(), desTile.getTile(), desTile.isOnSurface(), desTile.getFloorLevel()))\r\n hold(satellite, false);\r\n \r\n break switchbreak;\r\n }\r\n }\r\n \r\n if (satellite.isWithinTileDistanceTo(tiles.getFirst().getTileX(), tiles.getFirst().getTileY(), 0, 0)) {\r\n hold(satellite, false);\r\n break;\r\n }\r\n \r\n satellite.startPathingToTile(tiles.getFirst());\r\n break;\r\n case Scattering:\r\n if ((path = satellite.getStatus().getPath()) != null && !path.isEmpty())\r\n break;\r\n \r\n // Satellite at scatter point, hold movement.\r\n if (satellite.isWithinTileDistanceTo(satellite.scatterdest.getTileX(), satellite.scatterdest.getTileY(), 0, 0)) {\r\n satellite.brain = MemberStatus.Scattered;\r\n \r\n satellite.rotateRandom(satellite.getStatus().getRotation(), WanderingHorde.random.nextInt(300) + 1);\r\n \r\n float oldX = satellite.getPosX() * 10f;\r\n float oldY = satellite.getPosY() * 10f;\r\n float newPosX = (satellite.getTileX() << 2) + WanderingHorde.random.nextFloat() * 4f;\r\n float newPosY = (satellite.getTileY() << 2) + WanderingHorde.random.nextFloat() * 4f;\r\n \r\n satellite.getStatus().setPositionX(newPosX);\r\n satellite.getStatus().setPositionY(newPosY);\r\n satellite.moved((int)(newPosX * 10f - oldX), (int)(newPosY * 10f - oldY), 0, 0, 0);\r\n hold(satellite, false);\r\n break;\r\n }\r\n \r\n satellite.startPathingToTile(satellite.scatterdest);\r\n break;\r\n case Scattered:\r\n hold(satellite, false);\r\n break;\r\n case WaitingOneTurn:\r\n hold(satellite, false);\r\n break;\r\n }\r\n\r\n return false;\r\n }", "private void updateTamingProcess() {\n\n if (!mseEntity.isTameable())\n return;\n\n int tamingIncrease = mseEntity.updateHunger();\n if (tamingIncrease > 0) {\n mseEntity.eatAnimation();\n }\n\n int tamingProgress = tamingHandler.getTamingProgress();\n tamingProgress += tamingIncrease;\n tamingHandler.setTamingProgress(tamingProgress);\n if (tamingProgress < 0)\n tamingProgress = 0;\n if (tamingProgress >= mseEntity.getMaxTamingProgress())\n tamingHandler.setSuccessfullyTamed();\n\n }", "public void holdForWorkXX()\n {\n if (cFixedServiceTimed)\n {\n hold(mServerConfig.mServiceTime);\n out();\n return;\n }\n double tBase;\n double tDelta;\n switch (mHoldType)\n {\n case cHoldNormal:\n hold(cRandom.normal(mServerConfig.mServiceTime, mServerConfig.mServiceTime * 0.1)); //0.3\n break;\n\n case cHoldNegexp:\n tBase = mServerConfig.mServiceTime * 0.75;\n tDelta = 1.0 / (mServerConfig.mServiceTime * 0.50);\n hold( tBase + cRandom.negexp(tDelta));\n break;\n\n case cHoldPoisson:\n tBase = mServerConfig.mServiceTime * 0.75;\n tDelta = mServerConfig.mServiceTime * 0.50;\n hold( tBase + cRandom.poisson(tDelta));\n break;\n\n case cHoldUniform:\n hold(cRandom.uniform(mServerConfig.mServiceTime * 0.75, mServerConfig.mServiceTime * 1.5));\n break;\n }\n out();\n }", "public void bossReset(){\n bossTimer.start();\n this.getView().setTranslateX(x);\n this.getView().setTranslateY(y);\n this.getView().setRotate(0);\n bossTimer.start();\n setHitPoints(getDefaultHp());\n }", "@Override\r\n\tpublic void tick(){\n\t\tif(!alert){\r\n\t\t\tif(hostileToPlayer&&closeEnoughToAlert(World.player))\r\n\t\t\t\t{alert=true;target=World.player;}\r\n\t\t}\r\n\t\t\r\n\t\tif(alert&&null!=target){\r\n\t\t\t//For now, advance towards the player\r\n\t\t\tPathfinder.moveTowards(this, target);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//If within attacking range but not yet attacking, and not stunned, do so.\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}", "private void startGame() {\r\n setGrid();\r\n setSnake();\r\n newPowerUp();\r\n timer.start();\r\n }", "private static void runHQ() throws GameActionException {\n\t\tif (Clock.getRoundNum() < 3) {\t\t\t\n\t\t\tif (rc.isActive()) {\n\t\t\t\tDirection spawnDir = dir[rand.nextAnd(7)];\n\t\t\t\tif (rc.senseObjectAtLocation(curLoc.add(spawnDir)) == null) {\n\t\t\t\t\trc.spawn(spawnDir);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif (pastrLocations[0] == null) {\n\t\t\t\tpastrLocations[0] = getBestPastrLocNearMeBasedOnCowGrowthRate();\n\t\t\t\trc.broadcast(0, pastrLocations[0].x * 100 + pastrLocations[0].y);\n\t\t\t}\n\t\t}\n\t\tdouble d = rc.senseCowsAtLocation(new MapLocation(8,11));\n\t\tSystem.out.println(d);\n\t}", "static void AdultItinerary(int location)\n {\n\t\tboatLock.acquire(); \n\n\t\twhile (true){ //continuous loop\n\t\t\t//check location\n if (location == 0){ //Oahu\n //may need while loop instead of if loop here...\n while ( childrenOnOahu > 1 || countOnBoat > 0 || boatLocation != 0){\n onOahu.sleep();\n }\n\t\t\t /*if( childrenOnOahu > 1) {\n\t\t\t\t\tonOahu.sleep();\n\t\t\t\t}\n\t\t\t\t//check number of children on boat | adults on boat\n\t\t\t\tif( countOnBoat > 0){\n\t\t\t\t\tonOahu.sleep();\n\t\t\t\t}\n\t\t\t\t//make sure boat is on Oahu\n\t\t\t\tif(boatLocation != 0){\n\t\t\t\t\tonOahu.sleep();\n\t\t\t\t} */\n\t\t\t//-------------------------------------------------------\n bg.AdultRowToMolokai();\n \n //update count and location\n adultsOnOahu--;\n adultsOnMolokai++;\n boatLocation = 1;\n location = 1;\n \n //communicating number of people on Molokai\n coms.speak(childrenOnMolokai + adultsOnMolokai);\n \n //wake everyone up and sleep on Molokai\n onMolokai.wakeAll();\n onMolokai.sleep();\n\t\t\t \n\t\t//Make sure there is at least ONE child on Molokai\n\t\tLib.assertTrue(childrenOnMolokai > 0);\n }\n else if (location == 1){ //Molokai\n onMolokai.sleep();\n }\n else{\n System.out.println(\"ERROR: Location other than 0 or 1\");\n Lib.assertTrue(false);\n break; \n }\n }\n\n boatLock.release(); \n }", "private void specialPowersPhase() {\n \tSpecialCharacter tmpPiece = null;\n \tTerrain theHex = null;\n\n for (Player p : playerList) {\n pause();\n this.player = p;\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Game.getRackGui().setOwner(player);\n }\n });\n /*\n * Loops through all of the hexes that the player has pieces on.\n * If one of the pieces is either Master Thief or Assassin Primus, perform their\n * special ability.\n */\n for (Terrain hex : player.getHexesWithPiece()) {\n for (Piece pc : hex.getContents(player.getName()).getStack()) {\n if (pc.getName().equals(\"Master Thief\") || pc.getName().equals(\"Assassin Primus\")) { \n ((Performable)pc).specialAbility();\n if (MasterThief.isReturnPiece() || AssassinPrimus.isReturnPiece()) {\n \ttmpPiece = (SpecialCharacter)pc;\n \ttheHex = hex;\n \ttmpPiece.returnToBank(theHex);\n \tbreak;\n }\n }\n }\n }\n player.flipAllDown();\n }\n ClickObserver.getInstance().setPlayerFlag(\"\");\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n DiceGUI.getInstance().setFaceValue(0);\n DiceGUI.getInstance().cover();\n }\n });\n }", "public void startExecuting() {\n this.peekTime = 20 * (1 + ShulkerEntity.this.rand.nextInt(3));\n ShulkerEntity.this.updateArmorModifier(30);\n }", "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 }", "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 }", "private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}", "private void pollAllCreaturesOnThisTile(boolean lava, boolean areaEffect) {\n/* 1322 */ long lStart = System.nanoTime();\n/* */ \n/* 1324 */ Creature[] lTempCreatures = getCreatures();\n/* 1325 */ for (int x = 0; x < lTempCreatures.length; x++)\n/* */ {\n/* 1327 */ pollOneCreatureOnThisTile(lava, lTempCreatures[x], areaEffect);\n/* */ }\n/* */ \n/* 1330 */ if ((float)(System.nanoTime() - lStart) / 1000000.0F > 300.0F && !Servers.localServer.testServer) {\n/* */ \n/* 1332 */ int destroyed = 0;\n/* 1333 */ for (int y = 0; y < lTempCreatures.length; y++) {\n/* */ \n/* 1335 */ if (lTempCreatures[y].isDead())\n/* 1336 */ destroyed++; \n/* */ } \n/* 1338 */ logger.log(Level.INFO, \"Tile at \" + this.tilex + \", \" + this.tiley + \" polled \" + lTempCreatures.length + \" creatures. Of those were \" + destroyed + \" destroyed. It took \" + (\n/* */ \n/* 1340 */ (float)(System.nanoTime() - lStart) / 1000000.0F) + \" ms\");\n/* */ } \n/* */ }", "private static void startCleanUp() {\n\n if (!isEventTrackerRunning) {\n var ttrcker = new EventTrackInfoHandler();\n timer = new Timer(true);\n timer.scheduleAtFixedRate(ttrcker, timerDelayTime, checkInterval);\n debugLogger.info(\"EventTrackInfoHandler begins! : {}\", new Date());\n } else {\n debugLogger.info(\"Timer is still running : {}\", new Date());\n\n }\n }", "public static void periodic() {\n a2 = limelightTable.getEntry(\"ty\").getDouble(0); //Sets a2, the y position of the target\n d = Math.round((h2-h1) / Math.tan(Math.toRadians(a1+a2))); //Calculates distance using a tangent\n\n if(m_gamepad.getStartButtonReleased()) { //Reset errorSum to 0 when start is released\n errorSum = 0;\n }\n\n shooting(); //Determine when we should be shooting\n reportStatistics(); //Report telemetry to the Driver Station\n }", "@ScheduledMethod(start =1, interval = 1, priority = 5)\n\tpublic void diningIn() {\n\t\t//i = 0;\n\t\tif(CFG.chooseContext() &&isEating &&!isLocated){\n\t\t\t//if(CFG.isMeetUp()) System.out.println(\"Something wrent wrong\");\n\t\t\tif(RandomHelper.nextDoubleFromTo(0, 1) > diningOutRatio)\n\t\t\t\tgoTo(myHome);\n\t\t}\n\t}", "public void unloadItems() {\n if (dishwasherState == State.ON) {\n throw new InvalidStateException(\"The washing cycle hasn't been run yet\");\n } else if (dishwasherState == State.RUNNING) {\n throw new InvalidStateException(\"Please wait until washing cycle is finished\");\n }\n items = 0;\n dishwasherState = State.ON;\n System.out.println(\"The dishwasher is ready to go\");\n }", "public void caughtCheating(){\n\t\tinGoodStanding = false;\n\t}", "private void pollOneCreatureOnThisTile(boolean lava, Creature aCreature, boolean areaEffect) {\n/* */ try {\n/* 1373 */ boolean dead = false;\n/* 1374 */ if (aCreature.poll()) {\n/* 1375 */ deleteCreature(aCreature);\n/* 1376 */ } else if (lava) {\n/* */ \n/* 1378 */ if (!aCreature.isInvulnerable() && !aCreature.isGhost() && !aCreature.isUnique())\n/* */ {\n/* 1380 */ if (aCreature.getDeity() == null || !aCreature.getDeity().isMountainGod() || aCreature.getFaith() < 35.0F)\n/* */ {\n/* 1382 */ if (aCreature.getFarwalkerSeconds() <= 0) {\n/* */ \n/* 1384 */ Wound wound = null;\n/* */ \n/* */ \n/* */ try {\n/* 1388 */ byte pos = aCreature.getBody().getRandomWoundPos((byte)10);\n/* 1389 */ if (Server.rand.nextInt(10) <= 6)\n/* */ {\n/* 1391 */ if (aCreature.getBody().getWounds() != null) {\n/* */ \n/* 1393 */ wound = aCreature.getBody().getWounds().getWoundAtLocation(pos);\n/* 1394 */ if (wound != null) {\n/* */ \n/* 1396 */ dead = wound.modifySeverity(\n/* 1397 */ (int)(5000.0F + Server.rand.nextInt(5000) * (100.0F - aCreature.getSpellDamageProtectBonus()) / 100.0F));\n/* 1398 */ wound.setBandaged(false);\n/* 1399 */ aCreature.setWounded();\n/* */ } \n/* */ } \n/* */ }\n/* 1403 */ if (wound == null)\n/* */ {\n/* 1405 */ if (!aCreature.isGhost() && !aCreature.isUnique() && \n/* 1406 */ !aCreature.isKingdomGuard())\n/* */ {\n/* 1408 */ dead = aCreature.addWoundOfType(null, (byte)4, pos, false, 1.0F, true, (5000.0F + Server.rand\n/* 1409 */ .nextInt(5000) * (100.0F - aCreature.getSpellDamageProtectBonus()) / 100.0F), 0.0F, 0.0F, false, false);\n/* */ }\n/* */ }\n/* 1412 */ aCreature.getCommunicator().sendAlertServerMessage(\"You are burnt by lava!\");\n/* 1413 */ if (dead)\n/* */ {\n/* 1415 */ aCreature.achievement(142);\n/* 1416 */ deleteCreature(aCreature);\n/* */ }\n/* */ \n/* 1419 */ } catch (Exception ex) {\n/* */ \n/* 1421 */ logger.log(Level.WARNING, aCreature.getName() + \" \" + ex.getMessage(), ex);\n/* */ }\n/* */ \n/* */ } \n/* */ }\n/* */ }\n/* 1427 */ } else if (!dead && areaEffect) {\n/* */ \n/* 1429 */ if (!aCreature.isInvulnerable() && !aCreature.isGhost() && !aCreature.isUnique()) {\n/* */ \n/* 1431 */ AreaSpellEffect aes = getAreaEffect();\n/* 1432 */ if (aes != null && aes.getFloorLevel() == aCreature.getFloorLevel()) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 1437 */ byte type = aes.getType();\n/* 1438 */ Creature caster = null;\n/* */ \n/* */ try {\n/* 1441 */ caster = Server.getInstance().getCreature(aes.getCreator());\n/* */ }\n/* 1443 */ catch (NoSuchCreatureException noSuchCreatureException) {\n/* */ \n/* */ \n/* */ }\n/* 1447 */ catch (NoSuchPlayerException noSuchPlayerException) {}\n/* */ \n/* */ \n/* */ \n/* 1451 */ if (caster != null) {\n/* */ \n/* */ try {\n/* */ \n/* 1455 */ if (aCreature.getAttitude(caster) == 2 || (caster\n/* 1456 */ .getCitizenVillage() != null && caster.getCitizenVillage().isEnemy(aCreature)))\n/* */ {\n/* 1458 */ boolean ok = true;\n/* 1459 */ if (!caster.isOnPvPServer() || !aCreature.isOnPvPServer()) {\n/* */ \n/* 1461 */ Village v = aCreature.getCurrentVillage();\n/* 1462 */ if (v != null && !v.mayAttack(caster, aCreature))\n/* */ {\n/* 1464 */ ok = false;\n/* */ }\n/* */ } \n/* 1467 */ if (ok)\n/* */ {\n/* 1469 */ aCreature.addAttacker(caster);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ }\n/* 1532 */ catch (Exception exe) {\n/* */ \n/* 1534 */ logger.log(Level.WARNING, exe.getMessage(), exe);\n/* */ } \n/* */ }\n/* */ } \n/* */ } \n/* */ } \n/* 1540 */ } catch (Exception ex) {\n/* */ \n/* 1542 */ logger.log(Level.WARNING, \"Failed to poll creature \" + aCreature.getWurmId() + \" \" + ex.getMessage(), ex);\n/* */ \n/* */ try {\n/* 1545 */ Server.getInstance().getCreature(aCreature.getWurmId());\n/* */ }\n/* 1547 */ catch (Exception nsc) {\n/* */ \n/* 1549 */ logger.log(Level.INFO, \"Failed to locate creature. Removing from tile. Creature: \" + aCreature);\n/* 1550 */ if (this.creatures != null) {\n/* 1551 */ this.creatures.remove(aCreature);\n/* */ }\n/* */ } \n/* */ } \n/* */ }", "public void step()\n\t{\n\t\t// Reservoir sampling by generating ordered list of numbers\n\t\t// randomly pick a number within length and use that as index\n\t\tRandom rand = new Random();\n\t\tArrayList<Integer> numbers = new ArrayList<Integer>();\n\t\tfor(int i = 0; i < listOfCells.size(); i++) { numbers.add(i); }\n\t\t\n\t\t// Randomly sample from reservoir until empty\n\t\twhile(numbers.size() > 0)\n\t\t{\n\t\t\tint picked_index = rand.nextInt(numbers.size());\n\t\t\tint picked_val = numbers.get(picked_index);\n\t\t\t\n\t\t\t//TODO: Maybe call a function on cell of random action that might occur\n\t\t\t//\tConsider only returning object when necessary, (how it is now)\n\t\t\tPlantCell newObject = listOfCells.get(picked_val).doAction();\n\t\t\tif(newObject != null)\n\t\t\t{\n//\t\t\t\tSystem.out.println(\"New cell generated!\");\n\t\t\t\tlistOfCells.add(newObject);\n\t\t\t}\n\t\t\t\n\t\t\t//Kill spawning cell if its health drops <= 0\n\t\t\t//should die right away to make room for other cell\n\t\t\tif(listOfCells.get(picked_val).getHealth() <= 0)\n\t\t\t{\n\t\t\t\tenvironmentPointer.map[listOfCells.get(picked_val).getX()][listOfCells.get(picked_val).getY()] = null;\n\t\t\t\tlistOfCells.set(picked_val, null); //Set to null as to preserve list integrity for reservoir sampling, will be removed later\n\t\t\t}\n\t\t\t\n\t\t\tnumbers.remove(picked_index);\n\t\t}\n\t\t\n\t\t// All recently dead cells are now null in our cell list, so we are removing them from the list now\n\t\tfor(int i = 0; i < listOfCells.size(); i++)\n\t\t{\n\t\t\tif(listOfCells.get(i) == null)\n\t\t\t{\n\t\t\t\tlistOfCells.remove(i);\n\t\t\t\ti--; //Adjust for changing size\n\t\t\t}\n\t\t}\n\t}", "public void setupGame() {\n\t\t// Re-spawn the appropriate number of sheep\n\t\tint numSheep = 31;\n\t\t\n\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\tnumSheep = 1;\n\t\t}\n\t\t\n\t\t// It takes half the sheep to win.\n\t\t_scoreToWin = numSheep / 2;\n\t\tp(\"It takes \" + _scoreToWin + \" sheep to win.\");\n\t\t\n\t\t_hasBeenWon = false;\n\t\t\n\t\t// Non-infrastructural entities.\n\t\t//////////////////////////\n\t\t\n\t\t// Don't create this stuff if I'm replaying.\n\t\tint mod = 1;\n\t\tfor (int i = 0; i < numSheep; i++) {\n\t\t\t//int x = _generator.nextInt(40) - 20;\n\t\t\t//int z = _generator.nextInt(80) - 40;\n\t\t\tmod *= -1;\n\t\t\tint x = i/2 * mod;\n\t\t\tint z = 0;\n\n\t\t\tSheep s = new Sheep(\"sheep-\" + i + \"[\" + _sheepID + \"]\", x, 2, z);\n\t\t\t\n\t\t\tif (!SheepPhysicsState.PRODUCTION) {\n\t\t\t\ts.setBehaviorActive(false);\n\t\t\t}\n\t\t\t\n\t\t\t_sheepID++;\n\t\t}\n\t\t\n\t\t// Add a wubble for testing.\n\t\tif (!_isJimboSpawned && !SheepPhysicsState.PRODUCTION) {\n\t\t\tSystem.out.println(\"Adding Jimbo.\");\n\t\t\t_isJimboSpawned = true;\n\t\t\taddWubble(\"Jimbo\", (short)100, (Integer)1);\n\t\t\taddSidekick(\"Jimbo\");\n\t\t\t//addWubble(\"Bimbo\", (short)101, (Integer)0);\n\t\t}\n\t\t\n\t\t//////////////////////////\n\n\t\t// Add some wrenches in the appropriate spots.\n\t\tnew Wrench(\"blueWrench1\", -8, 5, -20);\n\t\tnew Wrench(\"blueWrench2\", 8, 5, -20);\n\t\tnew Wrench(\"redWrench1\", -8, 5, 20);\n\t\tnew Wrench(\"redWrench2\", 8, 5, 20);\n\t\t\n\t\t// Save the start of the me.\n\t\t_gameStart = System.currentTimeMillis();\n\t\tSystem.out.println(\"Started game at \" + _gameStart);\n\t\t\n\t\t// Make some predicates.\n\t\t//Predicate p = new Predicate(\"baseClassPred\");\n\t\t//GoPred g = new GoPred(\"derivedGoClass\", 1);\n\t\t\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.SPEEDY, new Vector3f(0, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpE\", -1, PowerUpInfo.PowerUpType.EATER, new Vector3f(2, 0.4f, 0));\n\t\t//new PowerUp(\"PowerUpS\", -1, PowerUpInfo.PowerUpType.STICKY, new Vector3f(2, 0.4f, 2));\n\t}", "@Override\n\tpublic void onSequence() {\n\t\tsuper.onSequence();\n\n\t\tif (phase == AbyssalSirePhase.AWAKE) {\n\t\t\theal(3);\n\t\t} else if (phase == AbyssalSirePhase.WALKING_SOUTH) {\n\t\t\tif (getX() == region.getPhaseTwoCenter().getX() - 2 && getY() == region.getPhaseTwoCenter().getY()) {\n\t\t\t\ttransformToMelee();\n\t\t\t} else {\n\t\t\t\tif (!walkTileInDirection(region.getPhaseTwoCenter().getX() - 2, region.getPhaseTwoCenter().getY())) {\n\t\t\t\t\tmove(region.getPhaseTwoCenter().translate(-2, 0));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (phase == AbyssalSirePhase.WALKING_TO_CENTER) {\n\t\t\tif (getX() == region.getCenter().getX() - 2 && getY() == region.getCenter().getY()) {\n\t\t\t\ttransformToMagic();\n\t\t\t} else {\n\t\t\t\tif (!walkTileInDirection(region.getCenter().getX() - 2, region.getCenter().getY())) {\n\t\t\t\t\tmove(region.getCenter().translate(-2, 0));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (phase == AbyssalSirePhase.MELEE_COMBAT) {\n\t\t\tif (target != null) {\n\t\t\t\tint distanceTo = distanceTo(target.getX(), target.getY());\n\n\t\t\t\tif (distanceTo > 5 && distanceTo < 16) {\n\t\t\t\t\ttarget.move(new Position(getX(), getY(), getHeight()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (phase != AbyssalSirePhase.WALKING_HOME && phase != AbyssalSirePhase.SLEEPING\n\t\t && System.currentTimeMillis() - lastDamageTaken > TimeUnit.MINUTES.toMillis(3)\n\t\t || target != null && (target.isDisconnected() || target.distanceToPoint(getX(), getY()) >= 64)) {\n\t\t\twalkHome();\n\t\t}\n\n\t\tif (phase == AbyssalSirePhase.WALKING_HOME) {\n\t\t\tif (getX() == region.getSire().getX() && getY() == region.getSire().getY()) {\n\t\t\t\tlastSleep();\n\t\t\t} else {\n\t\t\t\tif (!walkTileInDirection(region.getSire().getX(), region.getSire().getY())) {\n\t\t\t\t\tmove(region.getSire());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void countDown() {\n makeTimer();\n int delay = 100;\n int period = 30;\n timer.scheduleAtFixedRate(new TimerTask() {\n public void run() {\n tick();\n updatePlayerHealthUI();\n }\n }, delay, period);\n }", "private void dance() {\n\t\t// if they are done dancing, start sleeping\n\t\tif(danceDuration <= 0){\n\t\t\thive.dancingBees.remove(this);\n\t\t\tstate = \"SLEEPING\";\n\t\t}\n\t\telse{ // otherwise keep dancing and decrease duration of dance\n\t\t\tdanceDuration--;\n\t\t}\n\t}", "@Override\n\tpublic void tick() {\n\t\tif(fighting) {\n\t\t\t//Mostrar numero de ronda\n\t\t\tif(msjRonda) {\n\t\t\t\ttiempoRondaMsj--;\n\t\t\t\tif(tiempoRondaMsj==0) {\n\t\t\t\t\tmsjRonda=false;\n\t\t\t\t\ttiempoRondaMsj=100;\n\t\t\t\t\tmsjFight=true;\n\t\t\t\t\thandler.getGame().setSoundEffect(6,true);\n\t\t\t\t}\n\t\t\t\thandler.getGame().setTiempoQuieto(true);\n\t\t\t}\n\t\t\t//Mostrar mensaje FIGHT!\n\t\t\telse if(msjFight) {\n\t\t\t\ttiempoFightMsj--;\n\t\t\t\tif(tiempoFightMsj==0) {\n\t\t\t\t\tmsjFight=false;\n\t\t\t\t\ttiempoFightMsj=100;\n\t\t\t\t}\n\t\t\t\thandler.getGame().setTiempoQuieto(true);\n\t\t\t}\n\t\t\t//Mostrar el ganador de la ronda\n\t\t\telse if(msjGanador) {\n\t\t\t\thandler.getGame().setTiempoQuieto(true);\n\t\t\t\ttiempoGanador--;\n\t\t\t\tif(tiempoGanador==0) {\n\t\t\t\t\tmsjGanador=false;\n\t\t\t\t\ttiempoGanador=100;\n\t\t\t\t\t//Si gana la CPU no mostramos los puntos que ha hecho (nos saltamos el estado msjGanador)\n\t\t\t\t\tif((mode==1 && resultado==2) || mode==3) {\n\t\t\t\t\t\ttiempoTime=50;\n\t\t\t\t\t\ttiempoVital=100;\n\t\t\t\t\t\tmsjPuntos=false;\n\t\t\t\t\t\tbonus=0;\n\t\t\t\t\t\thandler.getGame().setFade(true);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Actualizar variables para gestionar el final de ronda\n\t\t\t\t\t\taccionFinRonda();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tmsjPuntos=true;\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}\n\t\t\t//Mostrar puntos ganados\n\t\t\telse if(msjPuntos) {\n\t\t\t\ttiempoTime--;\n\t\t\t\ttiempoVital--;\n\t\t\t\t//bonus se usa para controlar el tiempo a mostrar despues de llegar hasta el maximo valor del bonus\n\t\t\t\tif(bonus>=(puntosTime+puntosVital+10000)) {\n\t\t\t\t\ttiempoTime=50;\n\t\t\t\t\ttiempoVital=100;\n\t\t\t\t\tmsjPuntos=false;\n\t\t\t\t\thandler.getGame().setFade(true);\t\n\t\t\t\t\tbonus=0;\n\t\t\t\t\t\n\t\t\t\t\t//Actualizar variables para gestionar el final de ronda\n\t\t\t\t\taccionFinRonda();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Comenzamos a hacer tick de la pelea cuando se han mostrado los mensajes iniciales\n\t\t\telse {\n\t\t\t\tif(handler.getGame().getKeyManager().primeraVez && primeraVez2) {\n\t\t\t\t\tprimeraVez2=false;\n\t\t\t\t\t\n\t\t\t\t\tif(handler.getKeyManager().ESC){ // Salir juego\n\t\t\t\t\t\tpause=!pause;\n\t\t\t\t\t\thandler.getGame().setSoundEffect(25,false);\n\t\t\t\t\t\thandler.getGame().quererSalir=true;\n\t\t\t\t\t\thandler.getGame().posAvion=1;\n\t\t\t\t\t\thandler.getGame().xEsc=590;\n\t\t\t\t\t\thandler.getGame().yEsc=335;\n\t\t\t\t\t\thandler.getGame().widthEsc=100;\n\t\t\t\t\t\thandler.getGame().heightEsc=50;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(handler.getGame().quererSalir) {\n\t\t\t\t\t\tif(handler.getKeyManager().enter && handler.getGame().posAvion==2){ // yes\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(handler.getKeyManager().enter && handler.getGame().posAvion==1){ // no\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(25,false);\n\t\t\t\t\t\t\thandler.getGame().quererSalir=false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(handler.getKeyManager().D){ // dcha\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(26,false);\n\t\t\t\t\t\t\tif(handler.getGame().posAvion==2) {\n\t\t\t\t\t\t\t\thandler.getGame().posAvion=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\thandler.getGame().posAvion=2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(handler.getKeyManager().A){ // izq\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(26,false);\n\t\t\t\t\t\t\tif(handler.getGame().posAvion==1) {\n\t\t\t\t\t\t\t\thandler.getGame().posAvion=2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\thandler.getGame().posAvion=1;\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\telse {\n\t\t\t\t\t\tif(handler.getKeyManager().P && mode!=3){ // Pause !!!!\n\t\t\t\t\t\t\t//System.out.println(\"Hola\");\n\t\t\t\t\t\t\tpause=!pause;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(!handler.getGame().getKeyManager().primeraVez) {\n\t\t\t\t\tprimeraVez2=true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(pause) {\n\t\t\t\t\t//que se detenga el tiempo de la pelea\n\t\t\t\t\thandler.getGame().setTiempoQuieto(true);\n\t\t\t\t\thandler.getGame().pauseState=new PauseState(handler);\n\t\t\t\t\tpause=false;\n\t\t\t\t\tState.setState(handler.getGame().pauseState);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//que avance el tiempo de la pelea\n\t\t\t\t\thandler.getGame().setTiempoQuieto(false);\n\t\t\t\t\t\n\t\t\t\t\tworld.tick();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Si se ha acabado el tiempo\n\t\t\t\tif(handler.getGame().tiempoRestante==0) {\n\t\t\t\t\t//Y el player 2 tiene mas vida, gana player 2\n\t\t\t\t\tif(handler.getWorld().getEntityManager().getPlayer_1().getVida()<\n\t\t\t\t\t handler.getWorld().getEntityManager().getPlayer_2().getVida()) {\n\t\t\t\t\t\tmarcador2++;\n\t\t\t\t\t\tresultado=2;\n\t\t\t\t\t}\n\t\t\t\t\t//Y el player 1 tiene mas vida, gana el player 1\n\t\t\t\t\telse {\n\t\t\t\t\t\tresultado=1;\n\t\t\t\t\t\tmarcador1++;\n\t\t\t\t\t}\n\t\t\t\t\tfinRonda=true;\n\t\t\t\t}\n\t\t\t\t//Player 2 ha ganado\n\t\t\t\telse if(handler.getWorld().getEntityManager().getPlayer_1().getVida()<=0) {\n\t\t\t\t\t//Comienza la animacion de KO\n\t\t\t\t\tif (handler.getWorld().getEntityManager().getPlayer_1().getAnimacionActual() != 13) {\n\t\t\t\t\t\t//Sonido de grito\n\t\t\t\t\t\tif (handler.getWorld().getEntityManager().getPlayer_1().getFighter() == 1) {\n\t\t\t\t\t\t\t//Chun\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(30);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//Ryu y Blanka\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(29);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ko) {\n\t\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().KO = true;\n\t\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().KO = true;\n\t\t\t\t\t\t\tresultado=2;\n\t\t\t\t\t\t\tmarcador2++;\n\t\t\t\t\t\t\tko = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().setAnimacionActual(13);\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().getAnimaciones().get(13).setAnimacionEnCurso(true);\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().getAnimaciones().get(13).resetAnimtaion();\n\t\t\t\t\t}\n\t\t\t\t\t//Finaliza la animacion de KO\n\t\t\t\t\telse if(handler.getWorld().getEntityManager().getPlayer_1().getAnimacionActual() == 13\n\t\t\t\t\t\t\t&& handler.getWorld().getEntityManager().getPlayer_1().getAnimaciones().get(13).getIndex() == 4) {\n\t\t\t\t\t\tfinRonda=true;\n\t\t\t\t\t\tko = true;\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().KO = false;\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().KO = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Player 1 ha ganado\n\t\t\t\telse if(handler.getWorld().getEntityManager().getPlayer_2().getVida()<=0) {\n\t\t\t\t\t//Comienza la animacion de KO\n\t\t\t\t\tif (handler.getWorld().getEntityManager().getPlayer_2().getAnimacionActual() != 13) {\n\t\t\t\t\t\t//Sonido de grito\n\t\t\t\t\t\tif (handler.getWorld().getEntityManager().getPlayer_2().getFighter() == 1) {\n\t\t\t\t\t\t\t//Chun\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(30);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//Ryu y Blanka\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(29);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ko) {\n\t\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().KO = true;\n\t\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().KO = true;\n\t\t\t\t\t\t\tresultado=1;\n\t\t\t\t\t\t\tmarcador1++;\n\t\t\t\t\t\t\tko = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().setAnimacionActual(13);\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().getAnimaciones().get(13).setAnimacionEnCurso(true);\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().getAnimaciones().get(13).resetAnimtaion();\n\t\t\t\t\t}\n\t\t\t\t\t//Finaliza la animacion de KO\n\t\t\t\t\telse if(handler.getWorld().getEntityManager().getPlayer_2().getAnimacionActual() == 13\n\t\t\t\t\t\t\t&& handler.getWorld().getEntityManager().getPlayer_2().getAnimaciones().get(13).getIndex() == 4) {\n\t\t\t\t\t\tfinRonda=true;\n\t\t\t\t\t\tko = true;\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_1().KO = false;\n\t\t\t\t\t\thandler.getWorld().getEntityManager().getPlayer_2().KO = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//SUMAR LOS PUNTOS AL JUGADOR QUE CORRESPONDA SI HA TERMINADO LA RONDA\n\t\t\t\tif(finRonda) {\n\t\t\t\t\t//Si ha ganado la ronda el jugador 1, se le suman los puntos por tiempo y vida\n\t\t\t\t\tif(resultado==1) {\n\t\t\t\t\t\t//TIEMPO\n\t\t\t\t\t\tpuntosTime=handler.getGame().tiempoRestante*100;\n\t\t\t\t\t\t//VIDA\n\t\t\t\t\t\tpuntosVital=(int)handler.getWorld().getEntityManager().getPlayer_1().getVida()*10;\n\t\t\t\t\t\t//Bonus de dificutad:\n\t\t\t\t\t\tif (handler.getGame().mode == 1) {\n\t\t\t\t\t\t\tif (handler.getGame().getDificultad() == 1 || handler.getGame().getDificultad() == 3) {\n\t\t\t\t\t\t\t\t//Medio o incremental\n\t\t\t\t\t\t\t\tpuntosTime *= 1.2;\n\t\t\t\t\t\t\t\tpuntosVital*=1.2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (handler.getGame().getDificultad() == 2) {\n\t\t\t\t\t\t\t\t//Medio o incremental\n\t\t\t\t\t\t\t\tpuntosTime *= 1.4;\n\t\t\t\t\t\t\t\tpuntosVital*=1.4;\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\telse if(resultado==2) {\n\t\t\t\t\t\t//TIEMPO\n\t\t\t\t\t\tpuntosTime=handler.getGame().tiempoRestante*100;\n\t\t\t\t\t\t//VIDA\n\t\t\t\t\t\tpuntosVital=(int)handler.getWorld().getEntityManager().getPlayer_2().getVida()*10;\n\t\t\t\t\t}\n\t\t\t\t\tmsjGanador=true;\n\t\t\t\t\tif(mode==1) {\n\t\t\t\t\t\tif(resultado==1) {\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(19);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\thandler.getGame().setSoundEffect(20);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//Si ha terminado la pelea y se muestran las caras reventadas\n\t\telse {\n\t\t\ttiempoVS--;\n\t\t\tif(tiempoVS<=0) {\n\t\t\t\ttiempoVS=250;\n\t\t\t\tif(mode==2) {\n\t\t\t\t\thandler.getGame().setPuntos1(0);\n\t\t\t\t\thandler.getGame().setPuntos2(0);\n\t\t\t\t\thandler.getGame().setCurrentSong(3);\n\t\t\t\t\tState.setState(handler.getGame().selectFighterState2);\n\t\t\t\t}\n\t\t\t\telse if(mode==1) {\n\t\t\t\t\t//Si ha ganado la CPU se guarda el score\n\t\t\t\t\tif(mostrarScoreLose) {\n\t\t\t\t\t\tState ScoreState = new ScoreState(handler,fighter1,false);\n\t\t\t\t\t\thandler.getGame().setCurrentSong(0);\n\t\t\t\t\t\tState.setState(ScoreState);\n\t\t\t\t\t}\n\t\t\t\t\t//Si se termina el modo historia se guarda el score\n\t\t\t\t\telse if(mostrarScoreWin) {\n\t\t\t\t\t\tState EndGameState = new EndGameState(handler,fighter1,false);\n\t\t\t\t\t\tif(fighter1==0) {\n\t\t\t\t\t\t\thandler.getGame().setCurrentSong(7);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(fighter1==1) {\n\t\t\t\t\t\t\thandler.getGame().setCurrentSong(8);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\thandler.getGame().setCurrentSong(9);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tAssets.initAssets_EndGameState();\n\t\t\t\t\t\tState.setState(EndGameState);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tState selectFighterState1=new SelectFighterState1(handler,fighterToSelectFighter);\n\t\t\t\t\t\thandler.getGame().setCurrentSong(3);\n\t\t\t\t\t\tState.setState(selectFighterState1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if(mode==3) {\n\t\t\t\t\thandler.getGame().finPeleaDemo=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void tickPeople() {\n\t\tplayer.tick();\n\t\tfor (Councilman councilman: councilmen) {\n\t\t\tcouncilman.tick();\n\t\t}\n\t}", "public void resetHp();", "public void tick()\n {\n \n move();\n if(redShellOn)\n moveShell();\n timer += .1;\n \n //adjusts the time based on the difficulty level\n if(!pause)\n {\n if(difficult.equals(\"EASY\"))\n {\n if(lastpowerUp.equals(\"RAINBOW\") && powerupTimer > 0) \n {\n timer2 += .045;\n powerupTimer -=.045;\n }\n else\n {\n timer2 += .067;\n if(powerupTimer > 0)\n {\n powerupTimer -= .067;\n }\n }\n }\n else if(modeT)\n {\n if(snakeOnDot() || wideSnakeOnDot())\n {\n tempScore = timer2;\n }\n if(!((lastpowerUp.equals(\"RAINBOW\")||lastpowerUp.equals(\"CRYSTAL\")) && powerupTimer>0))\n timer2 -= .025;\n //add here\n \n //System.out.println(\"Temp score: \" + tempScore + \"\\nTimer2: \" + timer2 + \"\\n\");\n if(tempScore -10 +3 < timer2)\n timer3 +=.025;\n if(lastpowerUp.equals(\"DOUBLE\") && powerupTimer > 0)\n {\n if(tempScore -20 + 6 < timer2)\n timer3 += .025;\n }\n if(powerupTimer > 0)\n {\n powerupTimer -= .025;\n }\n }\n else if(difficult.equals(\"MEDIUM\")||difficult.equals(\"GHOST\")|| difficult.equals(\"TROLL\"))\n {\n timer2 += .045;\n if(powerupTimer > 0)\n {\n powerupTimer -= .045;\n }\n }\n else if(difficult.equals(\"HARD\"))\n {\n timer2 += .03;\n if(powerupTimer > 0)\n {\n powerupTimer -= .03;\n }\n }\n else if(difficult.equals(\"YOU WILL NOT SURVIVE\"))\n {\n timer2 += .01;\n if(powerupTimer > 0)\n {\n powerupTimer -= .01;\n }\n }\n \n \n } \n }", "private boolean processMovingObject()\n {\n MovingObject[] ap_objects = p_gsb.ap_MovingObjects;\n for (int li = 0;li < ap_objects.length;li++)\n {\n MovingObject p_obj = ap_objects[li];\n\n if (!p_obj.lg_Active) continue;\n\n if (p_obj.process())\n {\n if (p_obj.i_State == MovingObject.STATE_EXPLODE)\n {\n p_obj.lg_Active = false;\n continue;\n }\n }\n\n if (p_obj.i_State == MovingObject.STATE_EXPLODE) continue;\n\n switch (p_obj.i_Type)\n {\n case MovingObject.TYPE_ARROW:\n {\n p_obj.i_scry -= ARROWSPEED;\n if (p_obj.i_scry <= (0 - p_obj.i_height))\n {\n p_obj.lg_Active = false;\n continue;\n }\n }\n ;\n break;\n case MovingObject.TYPE_ASSAULTER:\n {\n if (getRandomInt(1000) <= p_gsb.i_shotfreq)\n {\n MovingObject p_arrow = p_gsb.getInactiveMovingObject();\n if (p_arrow != null)\n {\n p_arrow.activate(MovingObject.TYPE_ARROW,MovingObject.STATE_UP);\n p_arrow.i_scrx = p_obj.i_scrx;\n p_arrow.i_scry = p_obj.i_scry - p_arrow.i_height;\n }\n }\n\n if (p_obj.i_State != MovingObject.STATE_DOWN) generateLadderAndDamForAssaulter(p_obj);\n\n switch (p_obj.i_State)\n {\n case MovingObject.STATE_LEFT:\n {\n if (p_obj.i_scrx - ASSAULTER_HORZSPEED < 0)\n {\n p_obj.setState(MovingObject.STATE_RIGHT,false);\n }\n else\n {\n p_obj.i_scrx -= ASSAULTER_HORZSPEED;\n }\n }\n ;\n break;\n case MovingObject.STATE_RIGHT:\n {\n if (p_obj.i_scrx + p_obj.i_width + ASSAULTER_HORZSPEED >= i_screenWidth)\n {\n p_obj.setState(MovingObject.STATE_LEFT,false);\n }\n else\n {\n p_obj.i_scrx += ASSAULTER_HORZSPEED;\n }\n }\n ;\n break;\n case MovingObject.STATE_UP:\n {\n p_obj.i_scry -= ASSAULTER_VERTSPEED;\n if ((p_obj.i_scry + (p_obj.i_height >> 1)) / VIRTUALCELL_HEIGHT == 0/*p_gsb.i_playeralt*/) return true;\n }\n ;\n break;\n case MovingObject.STATE_DOWN:\n {\n p_obj.i_scry += ASSAULTER_VERTSPEED;\n int i_cellx = p_obj.i_scrx / VIRTUALCELL_WIDTH;\n int i_celly = (p_obj.i_scry + p_obj.i_height - 1) / VIRTUALCELL_HEIGHT;\n boolean lg_stop = false;\n if (i_celly < FIELD_HEIGHT-p_gsb.i_playeralt)\n {\n if (Assault_GSB.getElement(i_cellx,i_celly) != Assault_GSB.CELL_NONE) lg_stop = true;\n }\n else\n {\n lg_stop = true;\n i_celly--;\n }\n\n if (lg_stop)\n {\n p_obj.i_scry = i_celly * VIRTUALCELL_HEIGHT;\n if (getRandomInt(40) >= 20)\n {\n p_obj.setState(MovingObject.STATE_LEFT,false);\n }\n else\n {\n p_obj.setState(MovingObject.STATE_RIGHT,false);\n }\n }\n }\n ;\n break;\n }\n }\n ;\n break;\n case MovingObject.TYPE_STONE:\n {\n if (p_obj.i_State == MovingObject.STATE_DOWN)\n {\n p_obj.i_scry += STONESPEED;\n if ((p_obj.i_scry + p_obj.i_height) >= FIELD_HEIGHT * VIRTUALCELL_HEIGHT)\n {\n p_obj.i_scry = (FIELD_HEIGHT * VIRTUALCELL_HEIGHT) - p_obj.i_height - 1;\n p_obj.setState(MovingObject.STATE_EXPLODE,false);\n }\n }\n }\n ;\n break;\n }\n }\n return false;\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 heat() throws InterruptedException {\n\t\tInteger delta = new Double((rest.getTemperature() - temperatureSensor.getTemperature()) * 10).intValue();\n\t\tfor (Integer rTemp : temperatureAdjust.keySet()) {\n\t\t\tif (delta > rTemp) {\n\t\t\t\tInteger percent = new Double(new Double(temperatureAdjust.get(rTemp)) / 100 * timeIntervalInMS).intValue();\n\t\t\t\theater.off();\n\t\t\t\tThread.sleep(timeIntervalInMS - percent);\n\t\t\t\theater.on();\n\t\t\t\tThread.sleep(percent);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// we are above all limits, switch heater off and wait!\n\t\theater.off();\n\t\tThread.sleep(timeIntervalInMS);\n\t}", "public void wash() {\n synchronized (this) {\n LOGGER.info(\"{}:Actual machine state:{}\", Thread.currentThread().getName(),\n getWashingMachineState());\n if (WashingMachineState.WASHING.equals(washingMachineState)) {\n LOGGER.error(\"ERROR:Cannot wash if the machine has already been washing\");\n return;\n }\n washingMachineState = WashingMachineState.WASHING;\n }\n LOGGER.info(\"{}:Doing the washing\", Thread.currentThread().getName());\n try {\n Thread.sleep(50);\n } catch (Exception e) {\n e.printStackTrace();\n }\n endWashing();\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile(true)\n\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\tswitch(this.direct)\n\t\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\t//说明坦克正在向上移动,坦克在一个方向上走30\n\t\t\t\t\t//再换方向\n\t\t\t\t\tfor(int i=0;i<30;i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(y>0&&!this.isTouchOtherEnemy())\n\t\t\t\t\t\t{\n\t\t\t\t\t y-=speed;\n\t\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(50);\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\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 1:\n\t\t\t\t\tfor(int i=0;i<30;i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(x<360&&!this.isTouchOtherEnemy())\n\t\t\t\t\t\t{\n\t\t\t\t x+=speed;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(50);\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\t\t}\n\t\t\t\t break;\n\t\t\t\tcase 2:\n\t\t\t\t\tfor(int i=0;i<30;i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(y<235&&!this.isTouchOtherEnemy())\n\t\t\t\t\t\t{\n\t\t\t\t\t y+=speed;\n\t\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(50);\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\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tfor(int i=0;i<30;i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(x>0&&!this.isTouchOtherEnemy())\n\t\t\t\t\t\t{\n\t\t\t\t\t x-=speed;\n\t\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(50);\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\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//让敌人的额坦克可以连续打子弹\n\t\t\t\tthis.times++;\n\t\t\t\tif(times%2==0)\n\t\t\t\t{\n\t\t\t\t\tif(isLive)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(hcShoot.size()<5)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t Shoot s=null;\n\t\t\t\t\t\t //没有子弹,添加\n\t\t\t\t\t\t\t\t\t\tswitch(direct)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\t\t\ts=new Shoot(x+10,y,0);\n\t\t\t\t\t\t\t\t\t\t\thcShoot.add(s);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t\ts=new Shoot(x+30,y+10,1);\n\t\t\t\t\t\t\t\t\t\t\thcShoot.add(s);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t\t\ts=new Shoot(x+10,y+30,2);\n\t\t\t\t\t\t\t\t\t\t\thcShoot.add(s);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t\t\ts=new Shoot(x,y+10,3);\n\t\t\t\t\t\t\t\t\t\t\thcShoot.add(s);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\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\tThread t=new Thread(s);\n\t\t\t\t\t\t\t\t\t\tt.start();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t//让坦克随机产生一个新的方向\n\t\t\t\tthis.direct=(int)(Math.random()*4);\n\t\t\t\t//判断敌人的坦克是否死亡\n\t\t\t\tif(this.isLive==false)\n\t\t\t\t{ \n\t\t\t\t\t//敌人的坦克死亡后退出线程\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t}", "public void sleep() {\n hunger += 1;\n fatigue = 0;\n\n if (isHungry()) {\n mood -= 1;\n } else {\n mood += 1;\n }\n\n if (!muted) {\n System.out.println(\"sleep\\t|\\tzzzZZZ *sheep*\");\n }\n }", "public void printSimulationState(){\n\n boolean flagActive = false;\n\n //boolean unloadPassengersNow = false;\n \n boolean timeHasArrived = false;\n \n //sleeps for 20 to allow threads to run\n try{\n Thread.sleep(20);\n }catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n \n //configures flags\n for(int i = 0; i< a; i++){ \n if(flagActive != true)\n flagActive = (elevatorArray[i].getScanCompleteFlag() || elevatorArray[i].getScannedBuildingFloorFlag());\n\n \n //System.out.println(\"====\" + SimClock.getTime());\n //System.out.println(\"====\" + elevatorArray[i].getMoveQueue().get(0).getExpectedArrival());\n \n if(timeHasArrived != true){\n if ((SimClock.getTime() >= nextArrivalTime) && (nextArrivalTime != -2)){\n timeHasArrived = true;\n }\n \n if (elevatorArray[i].getMoveQueue().size() > 0){\n nextArrivalTime = elevatorArray[i].getMoveQueue().get(0).getExpectedArrival();\n }else{\n nextArrivalTime = -2;\n }\n }\n \n if (flagActive && timeHasArrived){\n break;\n }\n }\n\n \n if(flagActive || timeHasArrived){\n System.out.println(\"********************** @\" + (SimClock.getTime()) + \" Simulated Seconds **********************\"); \n \n System.out.println(\"Building Floors:\");\n for(int i = 0; i < aBuildingManager.getFloors().length; i++){\n int[] passengerRequestArray = aBuildingManager.getFloors()[i].getPassengerRequests();\n System.out.println(\" \" + \"Floor \" + (i+1) + \": \" + Arrays.toString(passengerRequestArray));\n }\n System.out.println();\n \n for (int i = 0; i< a; i++){\n System.out.println();\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \"\\n\" + \"# of Passengers: \" + Arrays.toString(elevatorArray[i].getPassengerDestinations()) + \"\\n\" + \"Current Floor: \" + (elevatorArray[i].getCurrentFloor()+1) + \n \"\\nTotal Unloaded Passengers: \" + elevatorArray[i].getTotalUnloadedPassengers() + \"\\n\" + \"Total Loaded Passengers: \" + elevatorArray[i].getTotalLoadedPassengers() );\n System.out.println(\"=============================================================\");\n } \n \n\n \n for (int i = 0; i < a; i++){\n //checking to see if there exists passengersToUnload and prints corresponding output\n\n if(elevatorArray[i].getPassengersToUnload() != 0){ \n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" has arrived at Floor \" + (elevatorArray[i].getCurrentFloor()+1) + \" to unload passengers.\\n - \" + \n elevatorArray[i].getPassengersToUnload() + \" passengers are exiting the elevator.\");\n System.out.println(\"=============================================================\");\n elevatorArray[i].resetPassengersToUnload();\n }\n \n if(elevatorArray[i].getScanCompleteFlag()){\n \n //prevFloorArray[i] = -1;\n //floorChanged = false;\n \n System.out.println();\n System.out.println(\"=============================================================\");\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" has arrived at Floor \" + (elevatorArray[i].getCurrentFloor()+1) + \" and picked up \" + elevatorArray[i].getNumPassengers() + \" passenger(s).\");\n \n // iterating through each PassengerDestination in the Elevator to specify each floor's destination and amount\n // of passengers wanting to go to said floor\n for (int k = 0; k < elevatorArray[i].getPassengerDestinations().length; k++){\n if (elevatorArray[i].getPassengerDestinations()[k] != 0)\n System.out.println(\" - \" + elevatorArray[i].getPassengerDestinations()[k] + \" passenger(s) will go to Floor \" + (k+1));\n \n }\n System.out.println(\"=============================================================\");\n elevatorArray[i].resetScanCompleteFlag();\n continue;\n \n // checking if ScanBuildingFloorFlag() triggered\n }else if(elevatorArray[i].getScannedBuildingFloorFlag()){\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" will go to Floor \" + (elevatorArray[i].getMoveQueue().get(0).getDestination()+1) + \" to load passengers.\");\n \n //prevFloorArray[i] = -2;\n elevatorArray[i].resetScannedBuildingFloorFlag();\n continue;\n }\n }\n \n flagActive = false;\n timeHasArrived = false; \n System.out.println();\n }\n \n\n}", "private static void loop() throws GameActionException {\n RobotCount.reset();\n MinerEffectiveness.reset();\n\n //Update enemy HQ ranges in mob level\n if(Clock.getRoundNum()%10 == 0) {\n enemyTowers = rc.senseEnemyTowerLocations();\n numberOfTowers = enemyTowers.length;\n if(numberOfTowers < 5 && !Map.isEnemyHQSplashRegionTurnedOff()) {\n Map.turnOffEnemyHQSplashRegion();\n }\n if(numberOfTowers < 2 && !Map.isEnemyHQBuffedRangeTurnedOff()) {\n Map.turnOffEnemyHQBuffedRange();\n }\n }\n \n // Code that runs in every robot (including buildings, excepting missiles)\n sharedLoopCode();\n \n updateEnemyInRange(52);//52 includes splashable region\n checkForEnemies();\n \n int rn = Clock.getRoundNum();\n \n // Launcher strategy\n if(rn == 80) {\n BuildOrder.add(RobotType.HELIPAD); \n } else if(rn == 220) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 280) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 350) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 410) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n } else if (rn == 500) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n } \n if (rn > 500 && rn%200==0) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n //rc.setIndicatorString(1, \"Distance squared between HQs is \" + distanceBetweenHQs);\n \n \n \n if(rn > 1000 && rn%100 == 0 && rc.getTeamOre() > 700) {\n int index = BuildOrder.size()-1;\n if(BuildOrder.isUnclaimedOrExpired(index)) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n }\n \n \n \n /**\n //Building strategy ---------------------------------------------------\n if(Clock.getRoundNum() == 140) {\n BuildOrder.add(RobotType.TECHNOLOGYINSTITUTE);\n BuildOrder.add(RobotType.TRAININGFIELD);\n }\n if(Clock.getRoundNum() == 225) {\n BuildOrder.add(RobotType.BARRACKS);\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n if(Clock.getRoundNum() == 550) {\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n }\n if(Clock.getRoundNum() == 800) {\n BuildOrder.add(RobotType.HELIPAD);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n //BuildOrder.printBuildOrder();\n }\n //---------------------------------------------------------------------\n **/\n \n //Spawn beavers\n if (hasFewBeavers()) { \n trySpawn(HQLocation.directionTo(enemyHQLocation), RobotType.BEAVER);\n }\n \n //Dispense supply\n Supply.dispense(suppliabilityMultiplier);\n \n //Debug\n //if(Clock.getRoundNum() == 700) Map.printRadio();\n //if(Clock.getRoundNum() == 1500) BuildOrder.print();\n\n }" ]
[ "0.620196", "0.5923339", "0.584562", "0.58155143", "0.573788", "0.56981206", "0.5661526", "0.56198424", "0.56187016", "0.55956876", "0.55714995", "0.5567657", "0.55484384", "0.5533682", "0.545823", "0.5427777", "0.5427481", "0.54041886", "0.53936034", "0.53793645", "0.5378477", "0.53578216", "0.5354908", "0.5353027", "0.5350919", "0.53506273", "0.53208965", "0.5313503", "0.53031117", "0.5299741", "0.5295931", "0.5294261", "0.529132", "0.52910084", "0.52893484", "0.52839255", "0.5269075", "0.5267803", "0.52611446", "0.5253074", "0.525299", "0.5240466", "0.5233406", "0.5224282", "0.5209848", "0.5209276", "0.5208495", "0.52067137", "0.5202812", "0.5197655", "0.5194575", "0.51933324", "0.5187304", "0.51864153", "0.5185348", "0.51829517", "0.51791775", "0.5168767", "0.516522", "0.5162974", "0.5162525", "0.51514965", "0.5150834", "0.51400894", "0.51395035", "0.51378596", "0.5137431", "0.5133345", "0.5131723", "0.5131562", "0.512052", "0.51198435", "0.5119113", "0.5118666", "0.5116722", "0.51153135", "0.5112334", "0.5109964", "0.5107405", "0.51064783", "0.5099327", "0.5094562", "0.5091903", "0.50866765", "0.5086516", "0.50797105", "0.50765115", "0.5074995", "0.50707823", "0.50692123", "0.5064448", "0.50597256", "0.5059333", "0.5058799", "0.5053064", "0.5049145", "0.50462186", "0.50454694", "0.50420004", "0.5039753" ]
0.738636
0
Gets current state reference of individual
public State getCurrentState() { return currentState; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public S getCurrentState();", "public State getMyCurrentState () {\n return myCurrentState;\n }", "public com.commercetools.api.models.state.StateReference getState() {\n return this.state;\n }", "protected S state() {\n return state;\n }", "String getCurrentState() {\n return context.getString(allStates[currentIdx]);\n }", "public State getState() {\n return state.get();\n }", "public int getCurrentState() {\n return myState;\n }", "public T getState() {\r\n\t\treturn state;\r\n\t}", "public State GetState()\n {\n return this.state;\n }", "public S getState() {\r\n\t\treturn state;\r\n\t}", "public State state() {\n return state;\n }", "public State getState(){return this.state;}", "Object getState();", "public State getCurrentState() {\n \t\treturn currentState;\n \t}", "public StateID GetTarget()\n {\n return targetID;\n }", "public State state() {\n return _state;\n }", "public String getCurrentState() {\n\t\treturn currentState;\n\t}", "public TurtleState getCurrentState() {\n\t\treturn states.peek();\n\t}", "public int getState()\r\n\t{\r\n\t\treturn currentstate;\r\n\t}", "public static AGG_State getReference( int i )\n {\n return( (AGG_State)( intHash.get( new Integer( i ) ) ) );\n }", "public StateName getCurrentState() {\n for (Map.Entry<StateName, StateI> entry : availableStates.entrySet()) {\n if (entry.getValue().equals(curState)) {\n return entry.getKey();\n }\n }\n return null;\n }", "public State getState () {\n synchronized (this) {\n return state;\n }\n }", "public int getState() {return state;}", "public int getState() {return state;}", "private State getState()\n {\n return state;\n }", "public STATE getState() {\n return this.lastState;\n }", "State getState();", "State getState();", "State getState();", "State getState();", "public State getState()\r\n\t{\r\n\t\treturn this.state;\r\n\t}", "@Override\t\n\tpublic InventoryObjectState getObjectsCurrentState();", "public STATE getState() {\n\t\n\t\treturn state;\n\t}", "public State getState();", "public State getState();", "public IState getState();", "public State getCurrentState() {\n return currentState;\n }", "public String state() {\n return this.state;\n }", "public String state() {\n return this.state;\n }", "State getTarget();", "public State getState() {\n\t\treturn state;\n\t}", "public State getState() {\n\t\treturn state;\n\t}", "public Object getCurrentObject()\r\n\t{\r\n\t\tif (newState != null)\r\n\t\t{\r\n\t\t\t// Not applied yet\r\n\t\t\treturn newState.unmodifiedObject;\r\n\t\t}\r\n\r\n\t\treturn propertyBrowser.getObject();\r\n\t}", "public CoreState currentStatus() {\r\n return currentStatus;\r\n }", "public int getState(){\n return state;\n }", "public State getState() {\n return state;\n }", "public State getState() {\n return state;\n }", "public State getState() {\n return state;\n }", "public State getState() {\n return state;\n }", "public State getState() {\n return state;\n }", "private StateHolder getStateHolder() {\n return stateHolder;\n }", "public Long getState() {\n return state;\n }", "public state getStatus(){\n return this.st;\n }", "public S getState() {\n return currentState;\n }", "public AbstractResource resource()\r\n {\r\n\t return this.resource_state;\r\n }", "public int getState();", "public int getState();", "public int getState();", "public int getState();", "public TState getState() {\n return state;\n }", "public int getState() {\n return m_state;\n }", "public LightState getState() { return state; }", "public static States getState() {\r\n\t\treturn currentState;\r\n\t}", "public AtomicReference<LocatableInquiry> getReferenceGroundItemInquiry();", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "public String getCurrent()\n {\n return current.toString();\n }", "public Integer getState() {\r\n return state;\r\n }", "public Integer getState() {\r\n return state;\r\n }", "public GameObjectState getState() {\r\n\t\treturn state;\r\n\t}", "public String getState()\r\n\t{\r\n\t\treturn state.getModelObjectAsString();\r\n\t}", "public Reference individual() {\n return getObject(Reference.class, FhirPropertyNames.PROPERTY_INDIVIDUAL);\n }", "public String getState() { return state; }", "public GameState GetState(){\n\t\treturn this.state;\n\t}", "public int getState(){\n\t\treturn state;\n\t}", "public synchronized EventState state() {\n return this.currentState;\n }", "public int getState() {\n return state_;\n }", "public int getState() {\n return state_;\n }", "public int getState() {\n return state_;\n }", "public int getState() {\n return state_;\n }", "public int getState() {\n return state_;\n }", "public E getCurrentState() {\n return present;\n }", "public State getState() { return model.getState(); }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public synchronized Status getStatus(){\n return state;\n }", "public int getState() {\n return state;\n }", "public int getState() {\n return state;\n }", "public int getState() {\n return state;\n }", "public MesiStates getMyState()\n\t{\n\t\treturn myMesiState;\n\t}", "@Override\n\tpublic long getStateId() {\n\t\treturn _state.getStateId();\n\t}" ]
[ "0.7248866", "0.7042768", "0.6907899", "0.67855173", "0.6784747", "0.6756054", "0.6739173", "0.6732434", "0.67026436", "0.66894627", "0.6677965", "0.6656877", "0.6648968", "0.6645237", "0.6643603", "0.66053534", "0.6591014", "0.6589014", "0.6553646", "0.6545427", "0.6544144", "0.6526624", "0.6513241", "0.6513241", "0.64908415", "0.6487258", "0.6483695", "0.6483695", "0.6483695", "0.6483695", "0.64820147", "0.64794385", "0.647853", "0.6478361", "0.6478361", "0.6472182", "0.64695704", "0.646742", "0.646742", "0.6456188", "0.64529437", "0.64529437", "0.6451823", "0.64368063", "0.6424877", "0.6398541", "0.6398541", "0.6398541", "0.6398541", "0.6398541", "0.6391721", "0.6381921", "0.6378299", "0.635643", "0.63488406", "0.6345719", "0.6345719", "0.6345719", "0.6345719", "0.6344872", "0.6335835", "0.6327966", "0.63195556", "0.63191926", "0.6318139", "0.6318139", "0.6318139", "0.6318139", "0.6318139", "0.6318139", "0.6317658", "0.6308194", "0.6308194", "0.6296118", "0.6286039", "0.6281218", "0.6271288", "0.6266821", "0.62644756", "0.62606883", "0.6249253", "0.6249253", "0.6249253", "0.6249253", "0.6249253", "0.6245189", "0.62433636", "0.6241763", "0.6241763", "0.6241763", "0.6241763", "0.6241763", "0.6241763", "0.6232743", "0.6222012", "0.6222012", "0.62200016", "0.62178034", "0.62072265" ]
0.6530912
22
Sets current state reference of individual.
public void setCurrentState(State currentState) { this.currentState = currentState; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setState(final StateReference state);", "public void setState(States s) {\n\t\tthis.state = s;\n\t}", "public void setMyState(MesiStates theMesiState)\n\t{\n\t\tmyMesiState = theMesiState;\n\t}", "void setState(Object state);", "public synchronized void set() {\n this.currentState = EventState.UP;\n notify();\n }", "private void SetState(VehicleState state) {\n this.state = state;\n }", "void setState(int state);", "protected final void setState(State s) {\n state = s;\n }", "public void SetState(int s) {\n this.state=LS[s];\n }", "public static void setState(States state) {\r\n\t\tcurrentState = state;\r\n\t}", "public void setReference(Reference ref)\n {\n this.ref = ref;\n }", "public void setState(State state) { model.setState(state); }", "public void setEAIndividual(AbstractEAIndividual indy) {\n this.m_Indy = indy;\n }", "public void setState(State newState) {this.state = newState;}", "public void setState(int state);", "public void setState(int state);", "public void set(final Object ref) {\n synchronized (lock) {\n if (set) { throw new IllegalStateException(\"Reference has already been set\"); }\n\n if ((!allowsNull()) && (ref == null)) { throw new IllegalArgumentException(\n \"This instance cannot hold a null reference value\"); }\n\n set = true;\n this.ref = ref;\n }\n }", "public void setStatesReference(TableProcessor states) {\n opensimMocoJNI.MocoTrack_setStatesReference(swigCPtr, this, TableProcessor.getCPtr(states), states);\n }", "public void set(GameState state){\n states.pop();\n states.push(state);\n }", "private void setMechanicState(MechanicState state) {\r\n if (this.state == state) {\r\n return;\r\n }\r\n this.state = state;\r\n }", "public void setState(State state) {\n this.state = state;\n }", "public void setState(State state) {\n this.state = state;\n }", "public IBusinessObject setStateObject(IRState state)\n throws OculusException;", "public void setStateToActive() {\n state = VALID_STATES[0];\n }", "public void setState(State state) {\n\t\tthis.state = state;\n\t}", "public void setState(Integer state) {\r\n this.state = state;\r\n }", "public void setState(Integer state) {\r\n this.state = state;\r\n }", "void setState(State state);", "public void setState(State state) {\n synchronized (stateLock){\n this.state = state;\n }\n }", "public static void SetState (int state) {\n\t\t source = state;\n\t\t}", "public void setState(GameState s) {\n this.state = s;\n }", "public void xsetState(org.landxml.schema.landXML11.StateType state)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.StateType target = null;\r\n target = (org.landxml.schema.landXML11.StateType)get_store().find_attribute_user(STATE$14);\r\n if (target == null)\r\n {\r\n target = (org.landxml.schema.landXML11.StateType)get_store().add_attribute_user(STATE$14);\r\n }\r\n target.set(state);\r\n }\r\n }", "public void setState (State state) {\n synchronized (this) {\n this.state = state;\n }\n }", "public void setState(int i) {\n this.mState = i;\n }", "public void setOn(){\n state = true;\n //System.out.println(\"Se detecto un requerimiento!\");\n\n }", "public void set()\n\t{\n\t\tbitHolder.setValue(1);\n\t}", "public void setCurrentState(State state) {\n currentState = state;\n }", "public void setState(Integer state) {\n this.state = state;\n }", "public void setState(Integer state) {\n this.state = state;\n }", "public void setState(Integer state) {\n this.state = state;\n }", "public void setState(Integer state) {\n this.state = state;\n }", "public void setState(Integer state) {\n this.state = state;\n }", "public void setState(Integer state) {\n this.state = state;\n }", "public void setReference (SoftReference ref)\r\n {\r\n _reference = ref;\r\n }", "void setState(SimulationState state) {\n\t\tthis.state = state;\n\t}", "public void setState(Integer state) {\n\t\tthis.state = state;\n\t}", "private void setState( int state )\n {\n m_state.setState( state );\n }", "public void setState(org.landxml.schema.landXML11.StateType.Enum state)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STATE$14);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STATE$14);\r\n }\r\n target.setEnumValue(state);\r\n }\r\n }", "public SetOnceRef(Object ref) {\n this(ref, false, true);\n }", "public void setState(@NotNull State state) {\n this.state = state;\n }", "public void setState(DiagramModel state) {\r\n for (Element e : state) {\r\n savedState_.add(0, e.makeCopy());\r\n }\r\n }", "public void setState(final State state);", "public void changeState() {\n if (!isDead) {\n Bitmap temp = getBitmap();\n setBitmap(stateBitmap);\n stateBitmap = temp;\n }\n }", "protected void setStateNum(int stateNum) {\r\n\t\tthis.stateNum = stateNum;\r\n\t}", "public void setReference(int pointer, Object object)\n {\n references.put(object, pointer);\n }", "public void setState(String s) {\r\n\t\tstate = s;\t\t\r\n\t}", "public void setState(int state) {\n m_state = state;\n }", "public void xsetState(com.microsoft.schemas.xrm._2014.contracts.OrganizationState state)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.microsoft.schemas.xrm._2014.contracts.OrganizationState target = null;\r\n target = (com.microsoft.schemas.xrm._2014.contracts.OrganizationState)get_store().find_element_user(STATE$8, 0);\r\n if (target == null)\r\n {\r\n target = (com.microsoft.schemas.xrm._2014.contracts.OrganizationState)get_store().add_element_user(STATE$8);\r\n }\r\n target.set(state);\r\n }\r\n }", "private void setReference(String ref) {\n Set<String> allRefs = getAllReferenceNames();\n if (!allRefs.contains(ref) && allRefs.contains(\"chr\" + ref)) {\n ref = \"chr\" + ref;\n }\n currentReference = ref;\n Genome loadedGenome = GenomeController.getInstance().getGenome();\n setMaxRange(new Range(1, loadedGenome.getLength()));\n setRange(1, Math.min(1000, loadedGenome.getLength()));\n }", "void setState(boolean state);", "public void setReference(javax.xml.namespace.QName reference)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(REFERENCE$0, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(REFERENCE$0);\n }\n target.setQNameValue(reference);\n }\n }", "public void setState(int state) {\n \t\tthis.state = state;\n \t}", "public void applyNewState() {\n this.setAlive(this.newState);\n }", "protected void SwitchState(StateID state)\n {\n targetID = state;\n\n //This sets this ID to the restart state if you try and switch to this state, meaning that if you try and switch to this state, the state will reload.\n if(targetID == state)\n {\n this.ID = StateID.RESTART_STATE;\n }\n }", "void __setState(int i)\n {\n m_state = i;\n }", "public void setState(NodeState state) {\n this.state = state;\n }", "@Override\n public void set(boolean state) {\n if (isInverted) {\n super.set(!state);\n } else {\n super.set(state);\n }\n }", "public void setState(State stateParam) {\n this.state = stateParam;\n }", "@Override\n\tpublic void setStateId(long stateId) {\n\t\t_state.setStateId(stateId);\n\t}", "public static void setEnemyOne(boolean state)\r\n\t{\r\n\t\tenemyOne = state;\r\n\t}", "void setReference(String reference);", "public void setCameFrom(State n)\r\n\t{\r\n\t\tthis.previousState = new State(n);\r\n\t}", "void setState(forestOrDebrisState state)\n {\n this.state = state;\n }", "private OffState() {\n instance = this;\n }", "public void setState(ComplexEObject parent, State state)\n {\n AbstractListEO leo = (AbstractListEO) get(parent);\n \n for (java.util.Iterator itr = leo.iterator(); itr.hasNext(); )\n {\n ComplexEObject ceo = (ComplexEObject) itr.next();\n// ceo.setState(state, true /* shallow */);\n if (ceo instanceof NullComplexEObject) continue;\n if (ceo.isNullState())\n ceo.restoreState();\n }\n }", "public void setCargoIntakeState() {\n blueLED.set(false);\n greenLED.set(false);\n if (!redLED.get() && timer.get() >= pulseTime) {\n redLED.startPulse();\n timer.stop();\n timer.reset();\n }\n else if (redLED.get() && timer.get() > pulseTime) {\n redLED.set(false);\n }\n else {\n timer.start();\n }\n }", "public void setReference(String reference);", "@Override\n public void setState(String s)\n {\n state = s;\n nbChanges++;\n }", "private void setState(Element element, State state)\n\t{\n\t\tif (element != null) {\n\t\t\tif (state == State.FULL || state == null)\n\t\t\t\telement.removeAttribute(STATE_ATTR_NAME);\n\t\t\telse\n\t\t\t\telement.setAttribute(STATE_ATTR_NAME, state.toString());\n\t\t}\n\t}", "public void changeState(GameObjectState s) {\r\n\t\tstate.undoAction();\r\n\t\tstate = s;\r\n\t\tstate.doAction();\r\n\t}", "@Override\n public void setState(int state) {\n synchronized(LOCK_STATE) {\n this.state = state;\n }\n }", "@Override\n\tpublic void setState(State state) \n\t\t{ current = new PuzzleState(state.getString(state.getState()),\n\t\t\t\t\t\t\t\t\tstate.getString(state.getGoalState())); \n\t\t}", "public void setState(File state) {\r\n\t\tthis.state = state;\r\n\t}", "public void xsetReference(org.apache.xmlbeans.XmlQName reference)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlQName target = null;\n target = (org.apache.xmlbeans.XmlQName)get_store().find_element_user(REFERENCE$0, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlQName)get_store().add_element_user(REFERENCE$0);\n }\n target.set(reference);\n }\n }", "@Override\n\tpublic void setLastState(STATE state) {\n\n\t}", "@Override\n protected void set(org.tair.db.locusdetail.ILocusDetail dto) {\n locusLocus = dto;\n }", "public void setaState(Integer aState) {\n this.aState = aState;\n }", "public void setState(int state) {\n\t\t\tmState = state;\n\t\t}", "final protected void setEntityState(int newState)\n {\n state = newState;\n }", "@Override\n public void setOperationalState(MatchOperationalState state) {\n MatchOperationalState oldState = this.operationalState;\n this.operationalState = state;\n if (oldState != state) {\n this.notifyObservers(new MatchOperationalStateUpdate(this.operationalState));\n }\n }", "public void setReference(boolean isReference) {\n ModelEvent<?> event = new ModelEventBuilder( ModelEventType.REFERENCE_FLAG_MODIFIED, this )\n .setOldValue( this.isReference ).setNewValue( isReference ).buildEvent();\n\n this.isReference = isReference;\n publishEvent( event );\n }", "public void setCurrentPersonId(int personId) {\n currentPersonId = personId;\n }", "@Override\n void setupState(TYPE firstItem) {\n currentItem = 0;\n }", "public SetOnceRef() {\n this(null, false, false);\n }", "@Override\n\tpublic void setRef(int parameterIndex, Ref x) throws SQLException {\n\t\t\n\t}", "@Override\n public void setState(BookStatus bookStatus) {\n this.state = bookStatus;\n }", "@Override\n\tpublic void setState(STATE state) {\n\n\t}", "public void setSelf(Tag self) {\n if (this.self != null) {\n throw new IllegalStateException(\"Self can only be set once!\");\n }\n this.self = self;\n }", "public void setState(Long state) {\n this.state = state;\n }", "public void setState(int synstate){\n\tsynState = synstate;\n }", "public void setState(State state) {\n\t\tenvironmentStatus = state.name();\n\t\tsetupResult = state.name();\n\t}" ]
[ "0.6687555", "0.61251175", "0.6033773", "0.60186404", "0.59976023", "0.5996908", "0.5955009", "0.59484553", "0.5946919", "0.5911214", "0.5890197", "0.58702177", "0.5841882", "0.5840959", "0.58225733", "0.58225733", "0.5818711", "0.5818241", "0.58093727", "0.5794156", "0.5777458", "0.5777458", "0.57715833", "0.5763687", "0.57631135", "0.5762851", "0.5762851", "0.57470053", "0.57390624", "0.57215756", "0.57121307", "0.5708708", "0.5694582", "0.5690296", "0.56889385", "0.56856716", "0.5680087", "0.5668128", "0.5668128", "0.5668128", "0.5668128", "0.5668128", "0.5668128", "0.5646233", "0.56366247", "0.56298107", "0.56276786", "0.5624067", "0.56131667", "0.558865", "0.5587733", "0.558355", "0.5565697", "0.556361", "0.5555604", "0.55473834", "0.5541346", "0.5540907", "0.5538004", "0.55326295", "0.55145234", "0.5509967", "0.55086833", "0.549755", "0.54962826", "0.5494527", "0.548691", "0.5478719", "0.54752886", "0.54707164", "0.54635644", "0.54620266", "0.54489434", "0.5447645", "0.5440254", "0.5436817", "0.54328626", "0.542947", "0.54255176", "0.54209566", "0.54197156", "0.5416767", "0.5416608", "0.5416427", "0.5411412", "0.54068446", "0.5401319", "0.5399561", "0.5396624", "0.5393889", "0.53897035", "0.5374534", "0.5372138", "0.5371391", "0.5369497", "0.53691435", "0.5367582", "0.53635204", "0.53630817", "0.53612524", "0.5359322" ]
0.0
-1
Gets moving state reference of individual
public State getMoving() { return moving; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object GetMove (Object game_state);", "public int getStateOfMovement(){ return stateOfMovement; }", "public static MovingShape getInstance() {\n return state;\n }", "State getTarget();", "public IPlacementState getState();", "public Boolean getMovingState()\r\n\t{\r\n\t\tObject[] result = pParent.status.requestOne(TuxAPIConst.ST_NAME_FLIPPERS_MOTOR_ON);\r\n\t\tif (result[0] == null)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (result[0].equals(\"False\"))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public StateID GetTarget()\n {\n return targetID;\n }", "public void setStateOfMovement(int movementState){stateOfMovement = movementState; }", "public void getMove(){\n\t\t\n\t}", "public boolean GetMove();", "public Move lastCommittedMove() {return lastCommittedMove; }", "public S getCurrentState();", "Object getState();", "public S getState() {\n return currentState;\n }", "PieceColor whoseMove() {\n return _whoseMove;\n }", "protected int getMove() \t\t\t\t{\treturn move;\t\t}", "public State getState(){return this.state;}", "public GameObjectState getState() {\r\n\t\treturn state;\r\n\t}", "State getState();", "State getState();", "State getState();", "State getState();", "public abstract State getSourceState ();", "@Override\t\n\tpublic InventoryObjectState getObjectsCurrentState();", "public S getState() {\r\n\t\treturn state;\r\n\t}", "protected int getMove(){\r\n\t\treturn this.move;\r\n\t}", "protected S state() {\n return state;\n }", "public int getState() {return state;}", "public int getState() {return state;}", "public int getMove(){\n return this.move;\n }", "public static States getState() {\r\n\t\treturn currentState;\r\n\t}", "public interface Moves {\n\n /**\n * Applies the move onto a shape when it is on the correct tick.\n *\n * @return the shape with the move applied onto it\n */\n ShapeState apply(int tick);\n\n\n /**\n * Gets the initial tick of which the move is applicable on.\n *\n * @return the initial tick.\n */\n ShapeState getInitialState();\n\n /**\n * Gets the final tick of which the move is applicable on.\n *\n * @return the final tick.\n */\n ShapeState getFinalState();\n\n /**\n * Checks whether the move is finished at a certain time.\n *\n * @param tick the time to be checked.\n * @return whether the move is finished at that time.\n *\n */\n boolean isMoveFinished(int tick);\n\n\n\n}", "public Coordinate getMoveTo();", "public abstract State getDestinationState ();", "public SinglePieceMove getMove() {\n return move;\n }", "public T getState() {\r\n\t\treturn state;\r\n\t}", "public STATE getState() {\n return this.lastState;\n }", "public State getMyCurrentState () {\n return myCurrentState;\n }", "public State GetState()\n {\n return this.state;\n }", "public GameState GetState(){\n\t\treturn this.state;\n\t}", "public int getStateSwitchPosition();", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "public long getMoveId() {\n return moveId_;\n }", "public int getState()\r\n\t{\r\n\t\treturn currentstate;\r\n\t}", "public State getState();", "public State getState();", "public TurtleState getCurrentState() {\n\t\treturn states.peek();\n\t}", "public State getState() {\n return state.get();\n }", "public synchronized EventState state() {\n return this.currentState;\n }", "public State getCurrentState() {\n \t\treturn currentState;\n \t}", "private StateHolder getStateHolder() {\n return stateHolder;\n }", "public long getMoveId() {\n return moveId_;\n }", "@Override\n\tpublic MoveState transitionTowards() {\n\t\treturn new MoveTowardsState();\n\t}", "public Player getState() {\n\t\treturn state;\n\t}", "protected abstract LauncherState getTargetState(LauncherState fromState,\n boolean isDragTowardPositive);", "ShapeState getFinalState();", "public Gamestate myTurn() {\n\t\treturn this.iGoWhen;\n\t}", "public LightState getState() { return state; }", "public State getPreviousState()\r\n\t{\r\n\t\treturn previousState;\r\n\t}", "public IState getState();", "public State state() {\n return state;\n }", "protected Motor getMotorState() { return motorState; }", "public int getState();", "public int getState();", "public int getState();", "public int getState();", "public boolean getState( ) { return state; }", "@VisibleForTesting\n int getInternalState() {\n return currentState;\n }", "public static AGG_State getReference( int i )\n {\n return( (AGG_State)( intHash.get( new Integer( i ) ) ) );\n }", "public static AGG_State getReference( String s )\n {\n return( (AGG_State)( nameHash.get( s ) ) );\n }", "public Animation getMovingAnimation(){\r\n\t\treturn moving;\r\n\t}", "public int getState() {\n return m_state;\n }", "@Override\n public int getState() {\n return myState;\n }", "public MovingBehaviour getMovingBehaviour() {\n\t\treturn this.movingBehaviour;\n\t}", "public State state() {\n return _state;\n }", "ControllerState getNewObjectState();", "public boolean getPassed(){\n return passedLastMove;\n }", "StateT getState();", "public int getState(){\n return state;\n }", "public MashControlStateE GetState() {\n\n\t\tif (state == stateE.MASHING)\n\t\t{\n\t\t\treturn msc.GetState();\n\t\t}\n\n\t\tif (state == stateE.BOILING)\n\t\t{\n\t\t\treturn bc.GetState();\n\t\t}\n\t\telse\n\t\t\treturn MashControlStateE.DONE;\n\n\t}", "public DockableState getPreviousState() {\n\t\treturn previousState;\n\t}", "private State getState()\n {\n return state;\n }", "public Move getLastMove() {\n return lastMove;\n }", "public State getCurrentState() {\n\t\treturn currentState;\n\t}", "public State getCurrentState() {\n\t\treturn currentState;\n\t}", "public interface GameState {\n\n\t/**\n * Method used by a player in order to perform transfer of stones \n * @param pitId the identifier of the pit by which the player will start (the associated pit must belong to him) This is the only method that can change the state \n * @return map {@link Map Map.class} with (pitId,#stones) as entries\n */\n\tpublic Map<Integer, Integer> move(final int pitId);\n\t\n\t/**\n\t * @return the {@link GameStateEnum GameStateEnum.class} that corresponds to {@link GameState GameState.class} concretions\n\t */\n\tpublic GameStateEnum getStateEnum();\n}", "public STATE getState() {\n\t\n\t\treturn state;\n\t}", "public GameState getState(){\n\t\tGameState State=new GameState(this.points, this.currentBoard.getState());\n\t\t\n\t\treturn State;\n\t}", "public GameState getState() {\n\t\treturn state;\n\t}", "void playerMove(State state);", "public boolean makeMove(GameState gameState);", "public String toString() {\n\t\treturn \"PushObstacleState\";\n\t}", "@Override\n public Move getMove() {\n\n return Move.ROCK;\n }", "public boolean isMoving() {\n return moving;\n }", "public AeBpelState getState();" ]
[ "0.7015389", "0.69814986", "0.6540957", "0.65024483", "0.6281976", "0.60958475", "0.6069328", "0.6056186", "0.60482335", "0.60452557", "0.5992575", "0.5955563", "0.5941617", "0.59336144", "0.58808786", "0.58698756", "0.58493626", "0.582298", "0.57998174", "0.57998174", "0.57998174", "0.57998174", "0.5795744", "0.5787008", "0.5754926", "0.57540196", "0.5742598", "0.5742306", "0.5742306", "0.57362455", "0.57320666", "0.5715197", "0.56975436", "0.5691622", "0.56911933", "0.56872463", "0.56804216", "0.5679993", "0.5676124", "0.56705683", "0.56596404", "0.56594074", "0.56594074", "0.56594074", "0.56594074", "0.56594074", "0.56594074", "0.5654455", "0.5651426", "0.56410116", "0.56410116", "0.5635499", "0.56223726", "0.5610905", "0.5607902", "0.560673", "0.5592723", "0.5590886", "0.55860096", "0.5585952", "0.55782473", "0.557698", "0.5572778", "0.5568166", "0.55665696", "0.55613023", "0.55529773", "0.5550444", "0.5550444", "0.5550444", "0.5550444", "0.5546195", "0.55444986", "0.5542701", "0.55374646", "0.5537081", "0.55121535", "0.5507355", "0.55048436", "0.54977643", "0.5494967", "0.5494381", "0.54941064", "0.5492366", "0.54918545", "0.54867095", "0.5485972", "0.54759294", "0.5469959", "0.5469959", "0.5469609", "0.54630333", "0.5457969", "0.5456299", "0.54551363", "0.5454302", "0.5453801", "0.54529583", "0.544231", "0.54395753" ]
0.72874683
0
Gets in conversation state reference of individual
public State getInConversation() { return inConversation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getStateId(Conversation conversation);", "ConnectionState getContactState();", "public StateID GetTarget()\n {\n return targetID;\n }", "public State getState()\n\t\t{\n\t\t\treturn ConferenceInfoDocument.this.getState(userElement);\n\t\t}", "public AtomicReference<LocatableInquiry> getReferenceGroundItemInquiry();", "public S getCurrentState();", "Object getState();", "public FSMState getIncomingState()\n\t{\n\t\t/*\n\t\t * Two ports linked to this transition.\n\t\t * Check which one is the outgoing port in order\n\t\t * to get the incoming state (its container) \n\t\t */\n\t\ttry\n\t\t{\n\t\t\t//just two ports\n\t\t\tfor(Port p : this.linkedPortList())\n\t\t\t\tif (p.getName().equals(outgoingPortString))\n\t\t\t\t\treturn (FSMState) p.getContainer();\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public State getMyCurrentState () {\n return myCurrentState;\n }", "public State getState()\n\t\t{\n\t\t\treturn ConferenceInfoDocument.this.getState(endpointElement);\n\t\t}", "String getCurrentState() {\n return context.getString(allStates[currentIdx]);\n }", "public int getState() {return state;}", "public int getState() {return state;}", "public State getState()\n\t{\n\t\treturn getState(conferenceInfo);\n\t}", "public State getState(){return this.state;}", "State getTarget();", "public int getState(){\n return state;\n }", "public com.commercetools.api.models.state.StateReference getState() {\n return this.state;\n }", "public Long getState() {\n return state;\n }", "public T getState() {\r\n\t\treturn state;\r\n\t}", "public S getState() {\r\n\t\treturn state;\r\n\t}", "public String getState() { return state; }", "public state getStatus(){\n return this.st;\n }", "public boolean getState( ) { return state; }", "public State GetState()\n {\n return this.state;\n }", "public String state() {\n return this.state;\n }", "public String state() {\n return this.state;\n }", "public LightState getState() { return state; }", "public static AGG_State getReference( int i )\n {\n return( (AGG_State)( intHash.get( new Integer( i ) ) ) );\n }", "public Reference individual() {\n return getObject(Reference.class, FhirPropertyNames.PROPERTY_INDIVIDUAL);\n }", "public IState getState();", "public int getCurrentState() {\n return myState;\n }", "public GameState GetState(){\n\t\treturn this.state;\n\t}", "State getState();", "State getState();", "State getState();", "State getState();", "public Integer getState() {\r\n return state;\r\n }", "public Integer getState() {\r\n return state;\r\n }", "public synchronized Status getStatus(){\n return state;\n }", "public int getState() {\n return m_state;\n }", "public State who()\r\n\t{\r\n\t\tState temp = State.DEER;\r\n\t\r\n\t\treturn temp; \r\n\t}", "public STATE getState() {\n\t\n\t\treturn state;\n\t}", "public String getLocalState()\n {\n return localState;\n }", "protected S state() {\n return state;\n }", "public String getState(){\n return state;\n }", "public State getState() {\n return state.get();\n }", "public int getState();", "public int getState();", "public int getState();", "public int getState();", "public String getPartyStateRetrieveActionTaskReference() {\n return partyStateRetrieveActionTaskReference;\n }", "public Being getBeing();", "public Player getState() {\n\t\treturn state;\n\t}", "java.lang.String getState();", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public Integer getState() {\n return state;\n }", "public String getState()\r\n\t{\r\n\t\treturn state.getModelObjectAsString();\r\n\t}", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "@Override\n\tpublic long getStateId() {\n\t\treturn _state.getStateId();\n\t}", "public IMAP.IMAPState getState()\n {\n return __state;\n }", "public AeBpelState getState();", "public int getState(){\n\t\treturn state;\n\t}", "public String getState() {\n\t\treturn this.state_rep;\n\t}", "String getState();", "String getState();", "String getState();", "public java.lang.String getState() {\n java.lang.Object ref = state_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n state_ = s;\n }\n return s;\n }\n }", "public String getState() {\n return this.state;\n }", "public String getState() {\n return this.state;\n }", "public int getState() {\n return state;\n }", "public String getState() {\n\t\treturn state.toString();\n\t}", "public String getState()\n {\n \treturn state;\n }", "StateT getState();", "public String getState() {\n return state;\n }", "public String getStateDescription() {\n return myID;\n }", "public MesiStates getMyState()\n\t{\n\t\treturn myMesiState;\n\t}", "public State state() {\n return state;\n }", "public String getState() {\n return this.state;\n }", "public String getState() {\n return this.state;\n }", "public String getState() {\n return this.state;\n }", "public String getState() {\n return this.state;\n }", "public Byte getUserState() {\r\n return userState;\r\n }", "public int getState() {\n return state_;\n }", "public int getState() {\n return state_;\n }", "public int getState() {\n return state_;\n }", "public int getState() {\n return state_;\n }", "public int getState() {\n return state_;\n }", "@Override\n public String getState() {\n\n if(this.state == null){\n\n this.state = TestDatabase.getInstance().getClientField(token, id, \"state\");\n }\n\n return state;\n }", "public static AGG_State getReference( String s )\n {\n return( (AGG_State)( nameHash.get( s ) ) );\n }", "public E getCurrentState() {\n return present;\n }" ]
[ "0.6797476", "0.62337786", "0.599451", "0.5956028", "0.58489096", "0.5837287", "0.5723923", "0.56855047", "0.5677839", "0.56698173", "0.5664533", "0.56434715", "0.56434715", "0.563379", "0.56206954", "0.5620246", "0.5589381", "0.5588587", "0.5581946", "0.5581369", "0.5557513", "0.5541046", "0.55380267", "0.5537821", "0.55335814", "0.5523383", "0.5523383", "0.5509302", "0.5505832", "0.54874235", "0.5484828", "0.5482409", "0.54808134", "0.5480458", "0.5480458", "0.5480458", "0.5480458", "0.5476518", "0.5476518", "0.54732025", "0.5472717", "0.54720587", "0.54704946", "0.54627776", "0.5450424", "0.5447462", "0.5446353", "0.5443427", "0.5443427", "0.5443427", "0.5443427", "0.54431", "0.5436649", "0.5434629", "0.5428857", "0.5425305", "0.5425305", "0.5425305", "0.5425305", "0.5425305", "0.5425305", "0.542011", "0.5419907", "0.5419907", "0.5419907", "0.5419907", "0.5419907", "0.5419907", "0.54177845", "0.5412897", "0.5402178", "0.5401566", "0.5400327", "0.53997016", "0.53997016", "0.53997016", "0.53994375", "0.5397646", "0.5397646", "0.53836924", "0.53821266", "0.5382125", "0.53799677", "0.5371423", "0.5370754", "0.5370457", "0.5363765", "0.5357712", "0.5357712", "0.5357712", "0.5357712", "0.5354239", "0.5351902", "0.5351902", "0.5351902", "0.5351902", "0.5351902", "0.5346316", "0.53443694", "0.53436595" ]
0.7017717
0
Gets in hospital state reference of individual
public State getInHospital() { return inHospital; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Reference individual() {\n return getObject(Reference.class, FhirPropertyNames.PROPERTY_INDIVIDUAL);\n }", "AdministrativeState adminsatratveState();", "AdministrativeState adminsatratveState();", "public AtomicReference<LocatableInquiry> getReferenceGroundItemInquiry();", "public String getHospital() {\r\n return hospital;\r\n }", "public static AGG_State getReference( String s )\n {\n return( (AGG_State)( nameHash.get( s ) ) );\n }", "public StateID GetTarget()\n {\n return targetID;\n }", "public String getHospitalAddress() {\n return hospitalAddress;\n }", "public State who()\r\n\t{\r\n\t\tState temp = State.DEER;\r\n\t\r\n\t\treturn temp; \r\n\t}", "public int getHospitalNumber() {\n return this.hospitalNumber;\n }", "public String getHospitalId() {\n return hospitalId;\n }", "public String getHospitalName() {\n return hospitalName;\n }", "public com.commercetools.api.models.state.StateReference getState() {\n return this.state;\n }", "public static AGG_State getReference( int i )\n {\n return( (AGG_State)( intHash.get( new Integer( i ) ) ) );\n }", "public String getStateDescription() {\n return myID;\n }", "public State who()\n\t{\n\t\t// TODO \n\t\treturn State.EMPTY; \n\t}", "public interface State {\n\n\t/**\n\t * The internal ID of the state. Is not dictated by any external/official\n\t * nomenclature, although it may match one for the sake of readability.\n\t * \n\t * Example: The ID of Massachusetts, USA might be \"ma\".\n\t * \n\t * @return The internal ID. Should never be null or empty.\n\t */\n\tString getId();\n\n\t/**\n\t * The common name of the state.\n\t * \n\t * Example: The name of Massachusetts, USA would be \"Massachusetts\", not the\n\t * official \"The Commonwealth of Massachusetts\".\n\t * \n\t * @return The common name of the state. Should never be null or empty.\n\t */\n\tString getName();\n\n\t/**\n\t * The public abbreviation of the state. Should match the official\n\t * nomenclature, typically defined by postal services.\n\t * \n\t * Example: The abbreviation of Massachusetts, USA would be \"MA\".\n\t * \n\t * @return The public abbreviation of the state. Should never be null or\n\t * empty.\n\t */\n\tString getAbbr();\n\n\t/**\n\t * The country of which this state is a part.\n\t * \n\t * Example: The country of Massachusetts, USA would be ISOCountry.USA\n\t * \n\t * @return The Country object for this state's nation. Should never be null\n\t * or empty.\n\t */\n\tCountry getCountry();\n\n}", "Reference getPatient();", "public Employee getHRhead();", "@Override\n public int getEmployeeRef() throws RemoteException {\n return employeeRef;\n }", "public jkt.hms.masters.business.MasHospital getHospital () {\n\t\treturn hospital;\n\t}", "public jkt.hms.masters.business.MasHospital getHospital () {\n\t\treturn hospital;\n\t}", "public jkt.hms.masters.business.MasHospital getHospital () {\n\t\treturn hospital;\n\t}", "@Valid\n @JsonProperty(\"state\")\n public StateReference getState();", "public State GetState()\n {\n return this.state;\n }", "public State getState(){return this.state;}", "@Override\n\tpublic HousePerson getOccupant() {\n\t\treturn houseperson;\n\t}", "State getState(Long stateId);", "public String getShortState(String state) {\n\t\t\t\t\n\t\t\t\tStatement statement=null;\n\t\t\t\tResultSet rs=null;\n\t\t\t\tString shortState=\"\";\n\t\t\t\ttry {\n\t\t\t\t\tstatement = connection.createStatement();\n\t\t\t\t\tString sql=\"select LINK2 from config_master where NAME='EXE_STATE' and VALUE='\"+state+\"'\";\n\t\t\t\t\trs = statement.executeQuery(sql);\n\t\t\t\t\t\n\t\t\t\t\twhile (rs.next()) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tshortState=rs.getString(\"LINK2\");\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\treturn shortState;\n\t}", "public int getState() {return state;}", "public int getState() {return state;}", "State findByPrimaryKey( int nIdState );", "DNSState getState()\n {\n return state;\n }", "Object getState();", "public String getState() { return state; }", "public AbstractResource resource()\r\n {\r\n\t return this.resource_state;\r\n }", "public java.lang.String getIntersectingRoadwayRef()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(INTERSECTINGROADWAYREF$20);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public String getState(){\n return state;\n }", "public void goHospital()\n\t{\n\t\tsynchronized (this) {\n\t\tworld.hospitalizedIndividual();\n\t\tcurrentState.goHospital();\n\t\t}\n\t}", "@Override\n\tpublic int getID() {\n\t\treturn this.stateID;\n\t}", "@Override\n\tpublic int getID() {\n\t\treturn stateID;\n\t}", "public State getState()\n\t\t{\n\t\t\treturn ConferenceInfoDocument.this.getState(userElement);\n\t\t}", "public String getcompanyUSState() {\n return companyUSState;\n }", "String getState();", "String getState();", "String getState();", "public State getState(){\n\t\treturn State.TUT_ISLAND;\n\t}", "public StateEbo getOffCampusState() {\n if ( StringUtils.isBlank(KFSConstants.COUNTRY_CODE_UNITED_STATES ) || StringUtils.isBlank(offCampusStateCode) ) {\n offCampusState = null;\n } else {\n if ( offCampusState == null || !StringUtils.equals( offCampusState.getCountryCode(), KFSConstants.COUNTRY_CODE_UNITED_STATES)|| !StringUtils.equals( offCampusState.getCode(), offCampusStateCode)) {\n ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(StateEbo.class);\n if ( moduleService != null ) {\n Map<String,Object> keys = new HashMap<String, Object>(2);\n keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, offCampusCountryCode);\n keys.put(LocationConstants.PrimaryKeyConstants.CODE, offCampusStateCode);\n offCampusState = moduleService.getExternalizableBusinessObject(StateEbo.class, keys);\n } else {\n throw new RuntimeException( \"CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed.\" );\n }\n }\n }\n \n return offCampusState;\n }", "public Suit getReferencedSuit() {\n return this.referencedSuit;\n }", "public S getCurrentState();", "public NamedIndividual getNamedIndividual() {\n \treturn namedIndividual;\n }", "public State getExternalArcState()\n {\n return iconPartStates[0];\n }", "public String getStateId() {\n return stateId;\n }", "@Override\n\tpublic State who() {\n\t\treturn State.CASUAL;\n\t}", "public state getStatus(){\n return this.st;\n }", "public String getHospitalCountry() {\n return hospitalCountry;\n }", "public EncounterHospitalization hospitalization() {\n return getObject(EncounterHospitalization.class, FhirPropertyNames.PROPERTY_HOSPITALIZATION);\n }", "@Override\n\tpublic long getStateId() {\n\t\treturn _state.getStateId();\n\t}", "public String getHospitalProvince() {\n return hospitalProvince;\n }", "int getStateValue2();", "public State who()\n\t{\n\t\treturn State.DEER; \n\t}", "protected S state() {\n return state;\n }", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "public com.microsoft.schemas.xrm._2014.contracts.OrganizationState xgetState()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.microsoft.schemas.xrm._2014.contracts.OrganizationState target = null;\r\n target = (com.microsoft.schemas.xrm._2014.contracts.OrganizationState)get_store().find_element_user(STATE$8, 0);\r\n return target;\r\n }\r\n }", "ConnectionState getContactState();", "int getStateValue1();", "public int getState(){\n return state;\n }", "public Integer getHousestatusid() {\r\n\t\treturn housestatusid;\r\n\t}", "public IState getState();", "public S getState() {\r\n\t\treturn state;\r\n\t}", "public State getState()\n\t{\n\t\treturn getState(conferenceInfo);\n\t}", "public String getIssuedDeviceStateInstanceReference() {\n return issuedDeviceStateInstanceReference;\n }", "public int getState();", "public int getState();", "public int getState();", "public int getState();", "public String getReferringPhysician()\n {\n return referringPhysician;\n }", "public String getState()\n {\n \treturn state;\n }", "public UpnpState getUpnpState();", "@Override\n\tpublic int getStateId() {\n\t\treturn _locMstLocation.getStateId();\n\t}", "public String getReference();", "public String getReference();", "public Village getVillage() {\n/* 501 */ return this.village;\n/* */ }", "String getReference();", "String getReference();", "public String getSelectedState()\n {\n return rentalModel.getSelectedRental().getStateName();\n }", "String getSelectedStateName();", "public MesiStates getMyState()\n\t{\n\t\treturn myMesiState;\n\t}", "public String getHomeState()\n {\n return homeState;\n}", "public Integer getaState() {\n return aState;\n }", "public String getHospitalPhone() {\n return hospitalPhone;\n }", "public Integer getPhysicalstate() {\r\n return physicalstate;\r\n }", "public String getAtmState();", "public ActH01 getActH01();", "public STATE getState() {\n\t\n\t\treturn state;\n\t}" ]
[ "0.6197126", "0.58904344", "0.58904344", "0.58295584", "0.581103", "0.5711587", "0.5710527", "0.56926394", "0.56778955", "0.56668603", "0.56595254", "0.56373525", "0.5620847", "0.55941945", "0.5578323", "0.5567744", "0.55299366", "0.5518182", "0.5493417", "0.5471566", "0.547051", "0.547051", "0.547051", "0.54554605", "0.5443584", "0.54377323", "0.5414075", "0.54105866", "0.53767663", "0.53754306", "0.53754306", "0.5367916", "0.536602", "0.53651565", "0.53628355", "0.5349697", "0.532618", "0.5325221", "0.5324771", "0.53190213", "0.53178304", "0.53153706", "0.53096396", "0.53073126", "0.53073126", "0.53073126", "0.53048235", "0.5295666", "0.5293871", "0.5293718", "0.5292648", "0.5283711", "0.52830637", "0.5280325", "0.52773374", "0.52762586", "0.5274331", "0.52652776", "0.52615833", "0.5257933", "0.5257824", "0.52574044", "0.5256924", "0.5256924", "0.5256924", "0.5256924", "0.5256924", "0.5256924", "0.5256917", "0.5249908", "0.5232999", "0.52319396", "0.5226472", "0.5220023", "0.52174073", "0.521725", "0.5213297", "0.52042", "0.52042", "0.52042", "0.52042", "0.51986694", "0.51881474", "0.518426", "0.5175962", "0.5175618", "0.5175618", "0.516922", "0.51669055", "0.51669055", "0.5166496", "0.5164117", "0.5161122", "0.515114", "0.5150164", "0.5148459", "0.51446784", "0.5142531", "0.51413035", "0.51342976" ]
0.74303955
0
Gets dead state reference of individual
public State getDead() { return dead; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean getDead();", "void dead() { this.alive = false; }", "default public boolean dead() {\n return life().dead();\n }", "public State who()\r\n\t{\r\n\t\tState temp = State.DEER;\r\n\t\r\n\t\treturn temp; \r\n\t}", "public boolean isDead() {\n return this.isDead;\n }", "public boolean isDead() {\r\n \t\treturn this.isDead;\r\n \t}", "public static AGG_State getReference( int i )\n {\n return( (AGG_State)( intHash.get( new Integer( i ) ) ) );\n }", "public AtomicReference<LocatableInquiry> getReferenceGroundItemInquiry();", "public boolean isDead();", "public boolean isDead() {\r\n return this.dead;\r\n }", "public State who()\n\t{\n\t\treturn State.DEER; \n\t}", "public Entity getLeashHolder ( ) throws IllegalStateException {\n\t\treturn extract ( handle -> handle.getLeashHolder ( ) );\n\t}", "private void bringToLife(){\n this.dead = false;\n }", "public boolean isDead() {\n return isDead;\n }", "public boolean isDead() {\n return isDead;\n }", "@Override\n\tpublic boolean isDead() {\n\t\treturn dead;\n\t}", "public boolean isDead() {\n\t\treturn dead;\n\t}", "private StateHolder getStateHolder() {\n return stateHolder;\n }", "Boolean isDead();", "private Object getState() {\n\treturn null;\r\n}", "@Override\r\n\tpublic Ref getRef() {\n\t\treturn ref;\r\n\t}", "public boolean isDead() {\r\n\t\treturn this.lives == 0;\r\n\t}", "@Override\n\tpublic DateTime getDeadLine() {\n\t\treturn this.details.getDeadLine();\n\t}", "boolean getRefuse();", "public LifeState lifeState() {\r\n return lifeStates().head();\r\n }", "public boolean isDead ( ) {\n\t\treturn extract ( handle -> handle.isDead ( ) );\n\t}", "public Object get() {\n synchronized (lock) {\n if (!set) { throw new IllegalStateException(\"Reference has not been set\"); }\n\n return ref;\n }\n }", "public boolean getRefuse() {\n return instance.getRefuse();\n }", "public StateID GetTarget()\n {\n return targetID;\n }", "public void softReference()\n {\n \t //====NOTE=====>>> RSN how SoftReference is created\n SoftReference<ReferenceExample> ex = new SoftReference<ReferenceExample>(new ReferenceExample(\"SoftRef\"));\n //====NOTE=====>>> RSN SUPER IMP : Note how to get hold of real object, by get() method\n System.out.println(\"Soft refrence :: \" + ex.get().getOrigin());\n \n int counter=0;\n while(counter<5)\n {\n counter++;\n System.gc();\n }\n \n System.out.println(\"SoftReference still Valid after 5 GC:\" + ex.get().getStatus() + \"Orig=\" + ex.get().getOrigin());\n }", "public Reference getReference() throws NamingException\n {\n return ref;\n }", "public SoftReference getReference ()\r\n {\r\n return _reference;\r\n }", "public org.landxml.schema.landXML11.StateType xgetState()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.StateType target = null;\r\n target = (org.landxml.schema.landXML11.StateType)get_store().find_attribute_user(STATE$14);\r\n return target;\r\n }\r\n }", "public int getUniqueReference ()\n\t{\n\t\treturn uniqueReference;\n\t}", "boolean hasRef();", "public String getIssuedDeviceStateInstanceReference() {\n return issuedDeviceStateInstanceReference;\n }", "public boolean isDead()\n {\n // TODO: replace this line with your code\n }", "Object getState();", "protected S state() {\n return state;\n }", "public GHFrom getRef() {\n return ref;\n }", "default State<Problem> getGoalState() {\n throw new UnsupportedOperationException(\"getGoalState is not supported in: \" + this.getClass());\n }", "public State getState() {\n return state.get();\n }", "public State who()\n\t{\n\t\t// TODO \n\t\treturn State.EMPTY; \n\t}", "public State getOldState() {\n\t\treturn oldState;\n\t}", "@java.lang.Override\n public com.google.cloud.datafusion.v1beta1.Instance.State getState() {\n com.google.cloud.datafusion.v1beta1.Instance.State result =\n com.google.cloud.datafusion.v1beta1.Instance.State.forNumber(state_);\n return result == null\n ? com.google.cloud.datafusion.v1beta1.Instance.State.UNRECOGNIZED\n : result;\n }", "public static AGG_State getReference( String s )\n {\n return( (AGG_State)( nameHash.get( s ) ) );\n }", "public State getState(){return this.state;}", "public org.apache.xmlbeans.XmlQName xgetReference()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlQName target = null;\n target = (org.apache.xmlbeans.XmlQName)get_store().find_element_user(REFERENCE$0, 0);\n return target;\n }\n }", "public org.landxml.schema.landXML11.RoadwayNameRef xgetRoadwayRef()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.landxml.schema.landXML11.RoadwayNameRef target = null;\r\n target = (org.landxml.schema.landXML11.RoadwayNameRef)get_store().find_attribute_user(ROADWAYREF$16);\r\n return target;\r\n }\r\n }", "public com.commercetools.api.models.state.StateReference getState() {\n return this.state;\n }", "@java.lang.Override\n public com.google.cloud.datafusion.v1beta1.Instance.State getState() {\n com.google.cloud.datafusion.v1beta1.Instance.State result =\n com.google.cloud.datafusion.v1beta1.Instance.State.forNumber(state_);\n return result == null\n ? com.google.cloud.datafusion.v1beta1.Instance.State.UNRECOGNIZED\n : result;\n }", "public Object getLocalReference()\n {\n return m_localInstance;\n }", "public State GetState()\n {\n return this.state;\n }", "public Rule_in_State get_unprocessed_rule();", "@Override\n\tpublic boolean isDead() {\n\t\treturn mRemainedCounters == 0;\n\t}", "public boolean removeDeadTransitions() throws Exception{\n \tArrayList<Integer> st=new ArrayList<Integer>(getStates());//st fixes some arbitrary order of states\n \tboolean [][] canReach=buildConnectionMatrix(st);\n\n \t//collect reachable states\n \tStack<Integer> worklist=new Stack<Integer>();\n \tHashSet<Integer> reachableStates=new HashSet<Integer> ();\n \tfor(String var:pointers.keySet())\n \t\tworklist.push(st.indexOf(pointers.get(var)));\n \twhile(!worklist.empty()){\n \t\tint cur=worklist.pop();\n \t\treachableStates.add(st.get(cur));\n \t\tfor(int i=0;i<st.size();i++)\n \t\t\tif(canReach[cur][i]&&!worklist.contains(i)&&!reachableStates.contains(st.get(i)))\n \t\t\t\tworklist.push(i);\n \t}\n \t//remove unreachable states\n \tboolean hasUnreachableNonReferenceStates=false;//might still be a useless state\n \tfor(TreeAutomaton ta:lt){\n \tHashSet<Integer> toRemove=new HashSet<Integer>();\n \t\tfor(int s:ta.getStates())\n \t\t\tif(!reachableStates.contains(s)){\n \t\t\t\ttoRemove.add(s);\n \t\t\t}\n \tfor(int s:toRemove){\n\t\t\t\tif(!ta.isReferenceTo(s, NULL)&&!ta.isReferenceTo(s, UNDEF)&&ta.referenceTo(s)==-1)\n\t\t\t\t\thasUnreachableNonReferenceStates=true;\n \t\t\tta.removeState(s);\n \t}\n \t}\n \treturn hasUnreachableNonReferenceStates;\n }", "State getTarget();", "public void setDead(){\n\t\t//queue this blood for cleanup\n\t\tvisible = false;\n\t\tDEAD = true;\n\t\tcleanUp();\n\t}", "public com.microsoft.schemas.xrm._2014.contracts.OrganizationState xgetState()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n com.microsoft.schemas.xrm._2014.contracts.OrganizationState target = null;\r\n target = (com.microsoft.schemas.xrm._2014.contracts.OrganizationState)get_store().find_element_user(STATE$8, 0);\r\n return target;\r\n }\r\n }", "public STATE getState() {\n return this.lastState;\n }", "public boolean canBeReferencedByIDREF() {\n/* 171 */ return false;\n/* */ }", "Object visitReference(ReferenceNode node, Object state);", "public ActivityState\n getActivityState() \n {\n return ActivityState.Unassigned;\n }", "public static boolean isDead(Entity e) {\r\n return e.getAttribute(\"state:death\", false);\r\n }", "DNSState getState()\n {\n return state;\n }", "public boolean isDead() {\r\n\t\treturn !isAlive();\r\n\t}", "@VisibleForTesting\n public ConnectivityState getState() {\n ConnectivityState state2;\n try {\n synchronized (this.lock) {\n state2 = this.state.getState();\n }\n this.syncContext.drain();\n return state2;\n } catch (Throwable th) {\n this.syncContext.drain();\n throw th;\n }\n }", "@FameProperty(name = \"isDead\", derived = true)\n public Boolean getIsDead() {\n throw new UnsupportedOperationException(\"Not yet implemented!\"); \n }", "public T getState() {\r\n\t\treturn state;\r\n\t}", "public LocalHolding\t\tgetHolding();", "State getState();", "State getState();", "State getState();", "State getState();", "@Override\n protected ExchangeUse getExchangeUse() {return ExchangeUse.DEAD;}", "public String getRef() {\n return ref;\n }", "@Nullable\n default StateHolder getAlternateStateHolder() {\n return null;\n }", "public Suit getReferencedSuit() {\n return this.referencedSuit;\n }", "public GameObjectState getState() {\r\n\t\treturn state;\r\n\t}", "boolean isWeakRelationship();", "@Valid\n @JsonProperty(\"state\")\n public StateReference getState();", "boolean getFenced();", "public IPlacementState getState();", "private State getState()\n {\n return state;\n }", "public StateDependencyElements getStateDependencyAccess() {\r\n\t\treturn pStateDependency;\r\n\t}", "boolean hasReference();", "protected void setDead()\n {\n alive = false;\n if(location != null) {\n field.clear(location);\n location = null;\n field = null;\n }\n }", "protected void setDead()\n {\n alive = false;\n if(location != null) {\n field.clear(location);\n location = null;\n field = null;\n }\n }", "public State getState () {\n synchronized (this) {\n return state;\n }\n }", "public org.apache.xmlbeans.XmlString xgetRefID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(REFID$4, 0);\n return target;\n }\n }", "public DukeState getDukeState() {\n return dukeState;\n }", "public PreservedState getPreservedState() {\n return preservedState;\n }", "public boolean borrowed()\r\n\t{\n\t\treturn !(currentlyBorrowed == null);\r\n\t}", "public Optional<String> getRefAllele() {\n return this.placement.getAlleles().stream()\n .map(p -> p.getAllele().getSpdi().getDeletedSequence())\n .findFirst();\n }", "private OffState() {\n instance = this;\n }", "public boolean getState( ) { return state; }", "public boolean getAlive() {\n return instance.getAlive();\n }", "public State getState();", "public State getState();", "public boolean refCountDown() {\n\t\treferenceCounter--;\n\t\treturn (referenceCounter > 0) ? true : false;\n\t}" ]
[ "0.6616717", "0.6133997", "0.5829411", "0.5782331", "0.5760682", "0.5741245", "0.5733422", "0.57133466", "0.57090497", "0.56970435", "0.56673324", "0.56564385", "0.56384486", "0.56083417", "0.56083417", "0.5586958", "0.5520177", "0.55177253", "0.5513183", "0.5491715", "0.5490228", "0.54827285", "0.54665303", "0.54617405", "0.5453954", "0.5432141", "0.54183054", "0.540065", "0.53978604", "0.53593135", "0.5355424", "0.53443915", "0.53263426", "0.53247607", "0.5324023", "0.53072566", "0.5261913", "0.5210082", "0.52100563", "0.5207637", "0.52071476", "0.5199789", "0.51912093", "0.5190236", "0.5186369", "0.5185646", "0.5171223", "0.51692283", "0.51673657", "0.51649886", "0.516128", "0.5157349", "0.51498777", "0.51494676", "0.5147551", "0.51326025", "0.51263446", "0.5124916", "0.5124852", "0.5116359", "0.51060426", "0.5103594", "0.51002634", "0.50956553", "0.50936216", "0.50917023", "0.50891924", "0.50851345", "0.50842446", "0.5081888", "0.5080589", "0.5080589", "0.5080589", "0.5080589", "0.50792825", "0.5077086", "0.50724506", "0.5067276", "0.5066018", "0.5058024", "0.5049015", "0.5046466", "0.5042648", "0.50375473", "0.50367296", "0.50306606", "0.5029067", "0.5029067", "0.5027514", "0.5025946", "0.5025731", "0.5025413", "0.5023387", "0.5022171", "0.5018123", "0.5017081", "0.50164896", "0.5015396", "0.5015396", "0.5010318" ]
0.7278497
0
This process used change current state to in conversation state
public void startConversation(int conversationTime) { synchronized (this) { currentState.startConversation(conversationTime); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateConversationState() {\n Conversation.State state = this.anonymousConversation.getState();\n conversationStateTextView.setText(state.toString());\n switch (state) {\n case ESTABLISHED:\n this.meetingJoined = true;\n break;\n case IDLE:\n conversationStateTextView.setText(\"\");\n this.meetingJoined = false;\n if (this.anonymousConversation != null) {\n this.anonymousConversation.removeOnPropertyChangedCallback(this.conversationPropertyChangeListener);\n this.anonymousConversation = null;\n }\n break;\n default:\n }\n\n // Refresh the UI\n this.updateUiState();\n\n if (meetingJoined) {\n this.navigateToConversationsActivity();\n }\n }", "private void sendCurrentState() {\n\ttry {\n\t channel.sendObject(getState());\n\t} catch (IOException e) {\n\t Log.e(\"423-client\", e.toString());\n\t}\n }", "public void changeState()\r\n\t{\r\n\t\tfailedNumber=0;\r\n\t\tif(state.equalsIgnoreCase(\"IN PREPARATION\"))\r\n\t\t\tsetState(\"IN TRANSIT\");\r\n\t\telse if(state.equalsIgnoreCase(\"IN TRANSIT\"))\r\n\t\t{\r\n\t\t\tfailedNumber=Math.random();\r\n\t\t\tif(failedNumber<=0.2) setState(\"FAILED\");\r\n\t\t\telse setState(\"RECEIVED\");\r\n\t\t}\r\n\t}", "@Override\n public void apply() {\n owner.setState(Mob.State.stunned);\n }", "synchronized void advanceState()\n {\n state = state.advance();\n notifyAll();\n }", "@Override\n public void handleMessage(Message msg) {\n switch (msg.what) {\n case Constants.MESSAGE_STATE_CHANGE:\n\n break;\n\n }\n }", "public void resetConversationFlow(){\n conversationDao.init();\n }", "private void updateSharedState()\r\n {\r\n // TODO update the shared state\r\n // e.g.: sharedState.setTurnHolder(gameModel.getTurnHolder());\r\n }", "public void applyNewState() {\n this.setAlive(this.newState);\n }", "@Override\n public void onPropertyChanged(Observable sender, int propertyId) {\n if (propertyId == Conversation.STATE_PROPERTY_ID) {\n updateConversationState();\n }\n }", "void stateUpdate(String msg);", "public void onRestorePendingState() {\n }", "synchronized void revertState()\n {\n state = state.revert();\n notifyAll();\n }", "private void setState(Intent intent, String calledFrom) {\r\n // We are creating new state?\r\n boolean isNew = false;\r\n String message = \"\";\r\n \r\n if (state == null) {\r\n state = new StateClass();\r\n message += (state.restored ? \"Old state restored; \" : \"No previous state; \");\r\n } else {\r\n message += \"State existed and \" + (state.restored ? \"restored earlier; \" : \"was not restored earlier; \");\r\n }\r\n isNew = state.actionCompleted;\r\n \r\n StateClass stateNew = new StateClass(intent.getAction());\r\n\r\n Bundle extras = intent.getExtras();\r\n if (extras != null) {\r\n // For a usage example see also com.android.email.activity.setup.AccountSettings.onCreate(Bundle)\r\n\r\n // Unparcel Extras!\r\n stateNew.response = extras.getParcelable(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE);\r\n if (stateNew.response != null) {\r\n // In order to force initializing state\r\n isNew = true;\r\n }\r\n android.accounts.Account ac = null;\r\n if (android.os.Build.VERSION.SDK_INT < 16 ) { // before Jelly Bean\r\n // Starting with Jelly Bean (16) there is only one link for the the setting of all AndStatus accounts\r\n // So we must select account in our code\r\n ac = (android.accounts.Account) intent\r\n .getParcelableExtra(EXTRA_ACCOUNT_MANAGER_ACCOUNT);\r\n }\r\n if (ac != null) {\r\n // We have persistent account in the intent\r\n stateNew.builder = new MyAccount.Builder(ac);\r\n isNew = true;\r\n } else {\r\n // Maybe we received MyAccount name as as parameter?!\r\n String accountGuid = extras.getString(EXTRA_MYACCOUNT_GUID);\r\n if (!TextUtils.isEmpty(accountGuid)) {\r\n stateNew.builder = MyAccount.Builder.valueOf(accountGuid);\r\n isNew = stateNew.getMyAccount().isPersistent();\r\n }\r\n }\r\n }\r\n\r\n if (isNew) {\r\n message += \"State initialized; \";\r\n state = stateNew;\r\n if (state.builder == null && !state.getAccountAction().equals(Intent.ACTION_INSERT)) {\r\n if (state.getAccountAction().equals(ACTION_ACCOUNT_MANAGER_ENTRY) && android.os.Build.VERSION.SDK_INT < 16) {\r\n // This case occurs if we're changing account settings from Settings -> Accounts\r\n state.setAccountAction(Intent.ACTION_INSERT);\r\n } else {\r\n message += \"Select Account; \";\r\n Intent i = new Intent(this, AccountSelector.class);\r\n startActivityForResult(i, REQUEST_SELECT_ACCOUNT);\r\n }\r\n }\r\n \r\n if (state.builder == null) {\r\n if (state.getAccountAction().equals(Intent.ACTION_INSERT)) {\r\n state.builder = MyAccount.Builder.valueOf(\"\");\r\n } else {\r\n state.builder = MyAccount.Builder.valueOf(MyAccount.getCurrentMyAccountGuid());\r\n }\r\n if (!state.builder.getMyAccount().isPersistent()) {\r\n state.setAccountAction(Intent.ACTION_INSERT);\r\n // Check if there are changes to avoid \"ripples\"\r\n // ...\r\n // TODO check this: state.actionCompleted = false;\r\n } else {\r\n state.setAccountAction(Intent.ACTION_VIEW);\r\n }\r\n } else {\r\n if (state.getMyAccount().isPersistent()) {\r\n state.setAccountAction(Intent.ACTION_EDIT);\r\n } else {\r\n state.setAccountAction(Intent.ACTION_INSERT);\r\n }\r\n }\r\n\r\n message += \"action=\" + state.getAccountAction() + \"; \";\r\n\r\n showUserPreferences();\r\n }\r\n \r\n if (state.response != null) {\r\n message += \"response; \";\r\n }\r\n MyLog.v(TAG, \"setState from \" + calledFrom +\"; \" + message + \"intent=\" + intent.toUri(0));\r\n }", "public void setStateToActive() {\n state = VALID_STATES[0];\n }", "void changeState(Spreadable spreadable, State from, State to, int count);", "private void stateChanged(TallyDeviceService.State pNewState, Message pMsg) {\n\n state = pNewState;\n\n if (state == TallyDeviceService.State.CONNECTED) {\n tallyDeviceName = (String)pMsg.obj;\n handleConnectedState();\n } else if (state == TallyDeviceService.State.CONNECTING) {\n tallyDeviceName = (String)pMsg.obj;\n handleConnectingState();\n } else if (state == TallyDeviceService.State.DISCONNECTED) {\n handleDisconnectedState();\n }\n\n }", "protected void setState(IMAP.IMAPState state)\n {\n __state = state;\n }", "private void restoreState(Intent intent, String calledFrom) {\r\n String message = \"\";\r\n if (state == null) {\r\n state = StateOfAccountChangeProcess.fromStoredState();\r\n message += (state.restored ? \"Old state restored; \" : \"No previous state; \");\r\n } else {\r\n message += \"State existed and \" + (state.restored ? \"was restored earlier; \" : \"was not restored earlier; \");\r\n }\r\n StateOfAccountChangeProcess newState = StateOfAccountChangeProcess.fromIntent(intent);\r\n if (state.actionCompleted || newState.useThisState) {\r\n message += \"New state; \";\r\n state = newState;\r\n if (state.accountShouldBeSelected) {\r\n Intent i = new Intent(this, AccountSelector.class);\r\n startActivityForResult(i, ActivityRequestCode.SELECT_ACCOUNT.id);\r\n message += \"Select account; \";\r\n }\r\n message += \"action=\" + state.getAccountAction() + \"; \";\r\n \r\n showUserPreferences();\r\n }\r\n if (state.authenticatiorResponse != null) {\r\n message += \"authenticatiorResponse; \";\r\n }\r\n MyLog.v(TAG, \"setState from \" + calledFrom +\"; \" + message + \"intent=\" + intent.toUri(0));\r\n }", "public State getInConversation() {\n\t\treturn inConversation;\n\t}", "@Override\n public void handleMessage(Message m) {\n int gameState = Integer.valueOf(m.getText());\n System.out.println(\"Got authoritative game state \" + gameState + \" from server. Updating local state now...\");\n this.gameState = gameState;\n }", "void currentStateChanged();", "private void setState(State newState) {\n state = newState;\n switch (newState) {\n case IDLE:\n toggleReco.setText(\"Tap to speak.\");\n break;\n case LISTENING:\n toggleReco.setText(getResources().getString(R.string.listening));\n break;\n case PROCESSING:\n toggleReco.setText(getResources().getString(R.string.processing));\n break;\n }\n }", "@Override\r\n\tpublic void nextState() {\n\t\t\r\n\t}", "public void changeState() {\n if (!isDead) {\n Bitmap temp = getBitmap();\n setBitmap(stateBitmap);\n stateBitmap = temp;\n }\n }", "private void updateState() {\n switch (game.getGameState()) {\n case GAME:\n gamePlay();\n break;\n case ONE:\n lostTurnByOne();\n break;\n case READY:\n readyToPlay();\n break;\n case START:\n startGame();\n break;\n case TURN:\n startTurn();\n break;\n case FINISH:\n finishGame();\n break;\n }\n }", "void conversationResuming(Conversation conversation, HttpServletRequest request);", "@Override\n\tpublic void setState(State state) \n\t\t{ current = new PuzzleState(state.getString(state.getState()),\n\t\t\t\t\t\t\t\t\tstate.getString(state.getGoalState())); \n\t\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate void sendState(int currentPlayerState, int opponentPlayerState) {\n for(Integer playerID: getPlayerList()) {\n \tif(playerID == currentPlayer) {\n \t//\tplayerStates.put(player, currentPlayerState);\n \t\t// Don't send anything but a clone! It will mysteriously vanish once it hits the ClientWindow\n\t\t\t\tsendToOne(playerID, new GameState((Player)players.get(playerID), (ArrayList<Card>)discardHand.clone(), currentPlayerState));\n \t} else {\n \t//\tplayerStates.put(player, opponentState);\n\t\t\t\tsendToOne(playerID, new GameState((Player)players.get(playerID), (ArrayList<Card>)discardHand.clone(), opponentPlayerState));\n \t}\n }\n// for(int i = 0; i < playerCount; i++) {\n// \tsendToOne(i+1, new GameState(hands.get(i),playerStates.get(key)));\n// }\n\t}", "@Override\n protected void incrementStates() {\n\n }", "public void setCameFrom(State n)\r\n\t{\r\n\t\tthis.previousState = new State(n);\r\n\t}", "@Override protected void setState(State s) {\n session.setState(s);\n super.setState(s);\n }", "protected abstract int newState();", "private void updateStatePost() {\n\t\tif(!link.hasNextLine()) {\n\t\t\tcontroller.printError(\"Errore di Comunicazione\", \"La postazione \" + ip.getHostAddress() + \" non ha inviato il proprio stato.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tString state = link.read();\n\t\t((Controller) controller).setStatePost(state, ip);\n\t}", "private static void updateCdmaCallStateOnNewOutgoingCall(PhoneGlobals app,\n Connection connection) {\n if (app.cdmaPhoneCallState.getCurrentCallState() ==\n CdmaPhoneCallState.PhoneCallState.IDLE) {\n // This is the first outgoing call. Set the Phone Call State to ACTIVE\n app.cdmaPhoneCallState.setCurrentCallState(\n CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE);\n } else {\n // This is the second outgoing call. Set the Phone Call State to 3WAY\n app.cdmaPhoneCallState.setCurrentCallState(\n CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE);\n\n // TODO: Remove this code.\n //app.getCallModeler().setCdmaOutgoing3WayCall(connection);\n }\n }", "public void draftEvent(){\n gameState = GameState.DRAFT;\n currentMessage = \"\" + currentPlayer.getNumTroops();\n currentTerritoriesOfInterest = currentPlayer.getTerritoriesList();\n notifyObservers();\n }", "@Override\r\n\tpublic void activate() {\n\t\tif(CID==true) {\r\n\t\t\tinter.setState(inter.getResults());\r\n\t\t}\r\n\t}", "private void mRelayStateSet(cKonst.eSerial newState) {\n nRelayState=newState;\n oBTServer.mStateSet( newState);\n }", "void state_REQState(){\r\n eccState = INDEX_REQState;\r\n alg_REQAlg();\r\n CNF.serviceEvent(this);\r\n state_START();\r\n}", "@Override\n\tpublic void setState(STATE state) {\n\n\t}", "@Override\n\tpublic void globalState(LinphoneCore lc, GlobalState state, String message) {\n\t\t\n\t}", "protected void changeStatus(String state)\n { call_state=state;\n printLog(\"state: \"+call_state,Log.LEVEL_MEDIUM); \n }", "public void changeState() {\r\n if(state == KioskState.CLOSED) {\r\n state = KioskState.OPEN;\r\n } else {\r\n state = KioskState.CLOSED;\r\n }\r\n }", "void reinstate() {\n\t\tisSuspended = false;\n\t\tSystem.out.println(\"Reinstate account successfully.\");\n\t}", "public void previousChannel() {\n String json = new Gson().toJson(new TelevisionModel(TelevisionModel.Action.PREVIOUS_CHANNEL));\n String a = sendMessage(json);\n TelevisionModel teleM = new Gson().fromJson(a, TelevisionModel.class);\n System.out.println(\"Client Received \" + json);\n\n if (teleM.getAction() == TelevisionModel.Action.PREVIOUS_CHANNEL) {\n isSwitchingPrevious = teleM.getValue();\n ui.updateArea(teleM.getMessage());\n };\n }", "@Override\n public void handleMessage(Message pMsg) {\n\n TallyDeviceConnectionStatusActivity tempActivity = activity.get();\n if (tempActivity != null) {\n\n switch (pMsg.what) {\n\n case TallyDeviceService.MSG_CONNECTION_STATE:\n tempActivity.stateChanged(TallyDeviceService.State.values()[pMsg.arg1], pMsg);\n break;\n\n }\n\n }\n\n super.handleMessage(pMsg);\n\n }", "private void\n processMsg(Msg input) throws IOException {\n assert Tracer.printConsoleLog(\"INFO Received \" + input + \" in state \" + currentState);\n\n Transition trans = transition[currentState.ordinal()][input.ordinal()];\n if (trans != null) {\n currentState = trans.execute(input);\n }\n assert Tracer.printConsoleLog(\"INFO New State: \" + currentState);\n }", "@Override\n public void onRestate() {\n }", "public void broadcastState() {\n StringBuilder sb = new StringBuilder();\n sb.append(MSG_STATE);\n\n if(mService.isTransmitterMode()) {\n sb.append(\" t \");\n }\n else {\n sb.append(\" r \");\n }\n\n sb.append(mService.getVADThreshold());\n sb.append(\" \");\n\n sb.append(mService.getNoiseTracker().getLastNoiseHeard() / 1000);\n\n try {\n sendChannelMessage(sb.toString());\n }\n catch(RemoteException e) {\n e.printStackTrace();\n }\n }", "public void switchStatus() {\n if (ioStatus.get() == EdgeStatus.INPUT) {\n ioStatus.set(EdgeStatus.OUTPUT);\n } else {\n ioStatus.set(EdgeStatus.INPUT);\n }\n }", "private void setState(STATE state) {\n if (this.state != state) {\n sendStatusChange(MEDIA_STATE, null, (float)state.ordinal());\n }\n this.state = state;\n }", "@Override\n\tpublic void stateChanged() {\n\t\t\n\t}", "public void transitionStates () {\n myCurrentState = myNextState;\n myNextState = null;\n }", "@Override\n\t\tpublic boolean OnStatusChange(String msgId, int state) {\n\t\t\treturn false;\n\t\t}", "public void setChatState(final ChatState state)\n\t{\n\t\tSwingUtilities.invokeLater(new Runnable()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tif(stateToMessageMap.containsKey(state.getUserStatus()))\n\t\t\t\t{\n\t\t\t\t\tprint(\"\\n\" + stateToMessageMap.get(state.getUserStatus()) + \"\\n\");\n\t\t\t\t}\n\t\t\t\tsetConnected(state.isLoggedIn());\n\t\t\t\tclearUserNames();\n\t\t\t\tif(state.isLoggedIn())\n\t\t\t\t{\n\t\t\t\t\taddUserNames(state.getLoggedInUserNames());\n\t\t\t\t\tfinal List<ChatMessage> messages = state.getChatMessages();\n\t\t\t\t\tCollections.sort(messages);\n\t\t\t\t\tfor (final ChatMessage message : messages)\n\t\t\t\t\t{\n\t\t\t\t\t\taddMessage(message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmainFrame.revalidate();\n\t\t \t\tmainFrame.repaint();\n\t\t\t}\n\t\t});\n\t\t\n\t}", "private SyncState() {}", "@Override\n\tpublic void adjust() {\n\t\tstate = !state;\n\t}", "public void activate(){\n active = true;\n state = State.cleaving;\n }", "private synchronized void processWithStateMachine(Message m) {\n dispatchMessageLocked(m);\n\n // Perform transitions\n if (next != null) {\n while (current != next) {\n performTransitionLocked();\n }\n next = null;\n\n // Put deferred messages at the front of queue to ensure they will be replayed before the others.\n while (deferredMessages.size() > 0) {\n sendMessageAtFrontOfQueue(deferredMessages.pop());\n }\n }\n }", "@Override\r\n\tpublic void updateState() {\r\n\t\tState<A> result = null;\r\n\t\tif(events.size() > 0){\r\n\t\t\tfor(Event<A> a : events){\r\n\t\t\t\tstate = (result = state.perform(this,a)) == null ? state : result;\r\n\t\t\t}\r\n\t\t\tevents.removeAllElements();\r\n\t\t}\r\n\t\tstate = (result = state.perform(this, null)) == null ? state : result;\r\n\t\trequestInput();\r\n\t\t\r\n\t}", "private void setStatus() {\n\t\t// adjust the status of the rest\n\t\tif (rest.getState().equals(RestState.INACTIVE)) {\n\t\t\t// set status to heating\n\t\t\trest.setState(RestState.HEATING);\n\t\t\tlog.info(rest.getName() + \" is now in state \" + rest.getState());\n\t\t} else if (rest.getState().equals(RestState.HEATING) && temperatureSensor.getTemperature() >= (rest.getTemperature() - tolerance)) {\n\t\t\t// set status to active\n\t\t\trest.setState(RestState.ACTIVE);\n\t\t\tlog.info(rest.getName() + \" is now in state \" + rest.getState());\n\t\t} else if (rest.getState().equals(RestState.ACTIVE)\n\t\t\t\t&& (new GregorianCalendar().getTimeInMillis() - rest.getActive().getTimeInMillis()) / 1000 / 60 > rest.getDuration()) {\n\t\t\t// time is up :)\n\t\t\tif (rest.isContinueAutomatically()) {\n\t\t\t\trest.setState(RestState.COMPLETED);\n\t\t\t} else {\n\t\t\t\trest.setState(RestState.WAITING_COMPLETE);\n\t\t\t}\n\t\t\tlog.info(rest.getName() + \" is now in state \" + rest.getState());\n\t\t}\n\t}", "public void changeStatus()\n {\n if(this.isActivate == false)\n {\n this.isActivate = true;\n switchSound.play();\n //this.dungeon.updateSwitches(true); \n }\n else{\n this.isActivate = false;\n switchSound.play(1.75, 0, 1.5, 0, 1);\n //this.dungeon.updateSwitches(false); \n }\n notifyObservers();\n\n }", "Conversation(String user) {\n\t\t\tuser = this.user;\n\t\t\tstate = \"main\";\n\t\t}", "@Override\r\n\tpublic void resume() {\n\t\tcurrentState.resume();\r\n\t}", "private void storeViewState()\n\t{\n\t\tCommand lastCmd = project.getLastCommand();\n\t\tif (lastCmd != null)\n\t\t{\n\t\t\tlastCmd.setOptionalState(view.toJSONString(lastCmd.getProjectState()));\n\t\t}\n\t}", "@Override\n public void onChatMessageFragmentInteraction(MessageEnum message, Object result) {\n ((MyMessage)result).setSenderId(this.user.getUserId());\n ((MyMessage)result).setReceiverId(this.receiverId);\n ((MyMessage)result).setBookId(this.selectedBook.getBookId());\n //send message to message list\n databaseHandler.sendMessageToDatabase((MyMessage)result);\n //message should come back with reference change?\n }", "private void stateChange(int state) {\n Log.d(TAG, String.format(\"stateChange: %d ++++\", state));\n\n if (mCurrentSyncRequest != null) {\n if (state <= SyncListener.SYNC_STATE_SUCCESS) {\n switch (state) {\n case SyncListener.SYNC_STATE_SUCCESS:\n mCurrentSyncRequest\n .notifyState(SyncRequest.SyncNotify.SYNC_STATE_SUCCESS);\n /*\n * we'll not update the version on\n * SyncRequest.CHECK_RESTORE_RESULT to avoid saving an\n * unbackuped version.\n */\n if (mCurrentSyncRequest.mSyncType != SyncRequest.CHECK_RESTORE_RESULT) {\n SyncService.ContactsChecker.getInstance(mService)\n .updateVersion();\n }\n break;\n case SyncListener.SYNC_STATE_ERROR:\n mCurrentSyncRequest\n .notifyState(SyncRequest.SyncNotify.SYNC_STATE_ERROR);\n break;\n case SyncListener.SYNC_STATE_SUCCESS_DONOTHING:\n mCurrentSyncRequest\n .notifyState(SyncRequest.SyncNotify.SYNC_STATE_SUCCESS_DONOTHING);\n break;\n default:\n break;\n }\n mIsSyncing = false;\n mSyncRequestQueue.completeRequest(mCurrentSyncRequest);\n mCurrentSyncRequest = null;\n /*sync next*/\n syncNext();\n }\n } else {\n Log.e(TAG, \"receive state change while the current request is null\");\n }\n Log.d(TAG, \"stateChange -----\");\n }", "public void updateACMsg(OL_Message msg) {\n FSM_Extension e = ((FSM_Extension) msg.getFirstExtensionByType(Extension.FSM));\n switch(myState) {\n case NoPayload_Recover:\n {\n switch(e.getType()) {\n case DONT_HAVE_IT:\n {\n myState = NoPayload_NoRecover;\n messageStore.setTimer(this, REC_TIMER_INDEX, timeout_REC);\n }\n break;\n case HAVE_IT:\n {\n neighboraddress = msg.getSourceAddress();\n sendToNode(NACK_SYNC, msg.getSourceAddress());\n myState = WaitforPayload;\n messageStore.setTimer(this, NACK_TIMER_INDEX, timeout_NACK);\n messageStore.setTimer(this, MAXNACK_TIMER_INDEX, max_NACK);\n }\n break;\n case NACK_SYNC:\n case QUERY_MSG_SYNC:\n {\n sendToNode(DONT_HAVE_IT, msg.getSourceAddress());\n myState = NoPayload_NoRecover;\n messageStore.setTimer(this, REC_TIMER_INDEX, timeout_REC);\n }\n break;\n }\n }\n break;\n case NoPayload_NoRecover:\n {\n switch(e.getType()) {\n case HAVE_IT:\n {\n neighboraddress = msg.getSourceAddress();\n sendToNode(NACK_SYNC, msg.getSourceAddress());\n myState = WaitforPayload;\n messageStore.setTimer(this, NACK_TIMER_INDEX, timeout_NACK);\n messageStore.setTimer(this, MAXNACK_TIMER_INDEX, max_NACK);\n }\n break;\n case NACK_SYNC:\n case QUERY_MSG_SYNC:\n {\n sendToNode(DONT_HAVE_IT, msg.getSourceAddress());\n }\n break;\n }\n }\n break;\n case WaitforPayload:\n {\n switch(e.getType()) {\n case DONT_HAVE_IT:\n {\n if (neighboraddress != msg.getSourceAddress() && neighboraddress != null) {\n sendToNode(NACK_SYNC, neighboraddress);\n } else {\n myState = NoPayload_NoRecover;\n messageStore.setTimer(this, REC_TIMER_INDEX, timeout_REC);\n }\n }\n break;\n case HAVE_IT:\n {\n neighboraddress = msg.getSourceAddress();\n }\n break;\n case NACK_SYNC:\n case QUERY_MSG_SYNC:\n {\n sendToNode(DONT_HAVE_IT, msg.getSourceAddress());\n }\n break;\n }\n }\n break;\n case HavePayload:\n {\n if (e.getType() == NACK_SYNC) {\n OL_Message payload = (OL_Message) socket.createMessage(data);\n ;\n msg.setHopLimit((short) 1);\n FSM_Extension ee = new FSM_Extension(MessageStore.FSM_SYNCHRONIZATION, PAYLOAD, messageid);\n payload.addExtension(ee);\n payload.setDeliveryMode(OL_Message.DELIVERY_MODE_UNICAST);\n payload.setDestinationAddress(msg.getSourceAddress());\n socket.forwardToParent(payload);\n } else if (e.getType() == QUERY_MSG_SYNC) {\n sendToNode(HAVE_IT, msg.getSourceAddress());\n }\n }\n break;\n }\n }", "public void processMsg(Msg input) {\r\n\t\tSystem.out.println(\"INFO Received \"+input+\" in state \"+currentState);\r\n\t\tTransition trans = transition[currentState.ordinal()][input.ordinal()];\r\n\t\tif(trans != null){\r\n\t\t\tcurrentState = trans.execute(input);\r\n\t\t}\r\n\t\tSystem.out.println(\"INFO State: \"+ currentState);\r\n\t}", "private void changeContext(){\n MainWorkflow.observeContexts(generateRandom(24,0));\n }", "public void setState(PlayerState newPlayerState) {\n\n this.playerState = newPlayerState;\n\n closeWindows();\n\n\n switch (newPlayerState) {\n\n case CHOOSE_BONUS_TILE:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(false);\n\n setSkipAction(false);\n\n setEndTurn(false);\n\n setUseLeader(false);\n\n\n break;\n\n\n case THROWDICES:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(true);\n\n setSkipAction(false);\n\n setEndTurn(false);\n\n setUseLeader(false);\n\n try {\n throwDices();\n } catch (InterruptedException e) {\n LOGGER.log(Level.WARNING, \"Interrupted!\", e);\n // clean up state...\n Thread.currentThread().interrupt();\n }\n\n break;\n\n\n\n case DOACTION:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(true);\n\n setThrowDices(false);\n\n setSkipAction(true);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n try {\n yourTurn();\n } catch (InterruptedException e) {\n LOGGER.log(Level.WARNING, \"Interrupted!\", e);\n // clean up state...\n Thread.currentThread().interrupt();\n }\n\n\n break;\n\n case BONUSACTION:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(false);\n\n setSkipAction(true);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n\n try {\n bonusAction();\n } catch (InterruptedException e) {\n LOGGER.log(Level.WARNING, \"Interrupted!\", e);\n // clean up state...\n Thread.currentThread().interrupt();\n }\n\n break;\n\n\n case CHOOSEACTION:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(true);\n\n setThrowDices(false);\n\n setSkipAction(true);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n\n break;\n\n\n case CHOOSEWORKERS:\n case ACTIVATE_PAY_TO_OBTAIN_CARDS:\n case CHOOSE_EFFECT:\n case CHOOSECOST:\n case CHOOSE_COUNCIL_PRIVILEGE:\n case PRAY:\n case WAITING:\n\n noButtonsAble();\n\n setLeaderButtons(false);\n\n setUseLeader(false);\n\n break;\n\n case ENDTURN:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(false);\n\n setSkipAction(false);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n\n break;\n\n case LEADER:\n\n noButtonsAble();\n\n setUseLeader(true);\n break;\n\n\n case SUSPENDED:\n\n noButtonsAble();\n\n setLeaderButtons(false);\n\n setUseLeader(false);\n\n suspendedPane.setVisible(true);\n\n break;\n\n\n }\n\n }", "@Override\r\n\tpublic void converse() {\n\t\t\r\n\t}", "@Override\n protected void sendUpdatedStateTo(GamePlayer p) {\n PigGameState copy = new PigGameState(pgs);\n p.sendInfo(copy);\n }", "public void setState(GameState state, CharSequence message) {\n\t\tsynchronized (mSurfaceHolder) {\n\t\t\tmState = state;\n\n\t\t\tResources res = mContext.getResources();\n\t\t\tCharSequence str = \"\";\n\t\t\tint visibility = View.VISIBLE;\n\t\t\tswitch (mState) {\n\t\t\t\tcase READY :\n\t\t\t\t\tstr = res.getText(R.string.mode_ready);\n\t\t\t\t\tbreak;\n\t\t\t\tcase PAUSE :\n\t\t\t\t\tstr = res.getText(R.string.mode_pause);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LOSE :\n\t\t\t\t\tstr = res.getText(R.string.mode_lose);\n\t\t\t\t\tbreak;\n\t\t\t\tcase WIN :\n\t\t\t\t\tstr = \"You win\";\n\t\t\t\t\tthis.mLvlNum++;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstr = \"\";\n\t\t\t\t\tvisibility = View.INVISIBLE;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (message != null) {\n\t\t\t\tstr = message + \"\\n\" + str;\n\t\t\t}\n\n\t\t\tMessage msg = mHandler.obtainMessage();\n\t\t\tBundle b = new Bundle();\n\t\t\tb.putString(\"message\", str.toString());\n\t\t\tb.putInt(\"visible\", visibility);\n\t\t\tmsg.setData(b);\n\t\t\tmHandler.sendMessage(msg);\n\t\t}\n\t}", "@Override\n public void executeImplicitBehaviour() {\n controller.game.getCurrentRound().getDraftPool().reRoll();\n controller.setControllerState(controller.stateManager.getNextState(this));\n }", "private void setState(WFDState s) {\n Log.d(TAG, \"Moving from \" + sState + \" --> \" + s);\n sState = s;\n }", "private void updateFaceListeningState() {\n if (!this.mHandler.hasMessages(336)) {\n this.mHandler.removeCallbacks(this.mRetryFaceAuthentication);\n if (isUnlockWithFacePossible(getCurrentUser())) {\n boolean shouldListenForFace = shouldListenForFace();\n if (this.mFaceRunningState == 1 && !shouldListenForFace) {\n stopListeningForFace();\n } else if (this.mFaceRunningState != 1 && shouldListenForFace) {\n startListeningForFace();\n }\n }\n }\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 }", "public void setState(State state)\n\t{\n\t\tsetState(conferenceInfo, state);\n\t}", "private void setCurrentState( final STATE newState ) {\n\t\tif ( newState != mCurrentState ) {\n\t\t\tfinal STATE previousState = mCurrentState;\n\t\t\tmCurrentState = newState;\n\n\t\t\tswitch ( newState ) {\n\t\t\t\tcase OPENING:\n\t\t\t\t\tmCurrentEffect.setOnPreviewListener( this );\n\t\t\t\t\tmCurrentEffect.setOnApplyResultListener( this );\n\t\t\t\t\tmCurrentEffect.setOnErrorListener( this );\n\t\t\t\t\tmCurrentEffect.setOnProgressListener( this );\n\n\t\t\t\t\tif ( mCurrentEffect instanceof ContentPanel ) ( (ContentPanel) mCurrentEffect ).setOnReadyListener( this );\n\n\t\t\t\t\tmHandler.sendEmptyMessage( FilterManager.STATE_OPENING );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase OPENED:\n\t\t\t\t\tmCurrentEffect.onActivate();\n\t\t\t\t\tmHandler.sendEmptyMessage( FilterManager.STATE_OPENED );\n\n\t\t\t\t\tif ( !( mCurrentEffect instanceof ContentPanel ) ) {\n\t\t\t\t\t\tmHandler.sendEmptyMessage( STATE_READY );\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CLOSING:\n\t\t\t\t\tmHandler.sendEmptyMessage( FilterManager.STATE_CLOSING );\n\n\t\t\t\t\tmCurrentEffect.onDeactivate();\n\t\t\t\t\tif ( mCurrentEffect instanceof ContentPanel ) {\n\t\t\t\t\t\t( (ContentPanel) mCurrentEffect ).setOnReadyListener( null );\n\t\t\t\t\t}\n\n\t\t\t\t\tmHandler.postDelayed( new Runnable() {\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tif ( null != mBitmapChangeListener ) mBitmapChangeListener.onClearColorFilter();\n\t\t\t\t\t\t\tmContext.getDrawingImageContainer().removeAllViews();\n\t\t\t\t\t\t\tmContext.deactivatePopupContainer();\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 100 );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CLOSED_CANCEL:\n\t\t\t\tcase CLOSED_CONFIRMED:\n\n\t\t\t\t\tmContext.getOptionsPanelContainer().removeAllViews();\n\n\t\t\t\t\tif ( previousState != STATE.DISABLED ) {\n\t\t\t\t\t\tmCurrentEffect.onDestroy();\n\t\t\t\t\t\tmCurrentEffect.setOnPreviewListener( null );\n\t\t\t\t\t\tmCurrentEffect.setOnApplyResultListener( null );\n\t\t\t\t\t\tmCurrentEffect.setOnErrorListener( null );\n\t\t\t\t\t\tmCurrentEffect.setOnProgressListener( null );\n\t\t\t\t\t\tmCurrentEffect = null;\n\t\t\t\t\t\tmCurrentEntry = null;\n\t\t\t\t\t}\n\n\t\t\t\t\tmHandler.sendEmptyMessage( FilterManager.STATE_CLOSED );\n\n\t\t\t\t\tif ( ( newState == STATE.CLOSED_CONFIRMED ) && ( previousState != STATE.DISABLED ) ) if ( mToolListener != null ) mToolListener.onToolCompleted();\n\t\t\t\t\tSystem.gc();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase DISABLED:\n\t\t\t\t\tmHandler.sendEmptyMessage( FilterManager.STATE_DISABLED );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void setLastState(STATE state) {\n\n\t}", "public abstract ExplicitMachineState convertToExplicitMachineState(MachineState state);", "@Override\n\t\tprotected void doCurrentState() {\n\t\t\tswitch(currentState) {\n\t\t\t\n\t\t\t// follow operator commands, but respect limit switches\n\t\t\tcase manual:\n\t\t\t\tcd.gearLeftOpen.set(rd.gearManualLeftOpen && !rd.leftOpenSwitch, rd.gearManualLeftClose && !rd.leftCloseSwitch );\n\t\t\t\tcd.gearRightOpen.set(rd.gearManualRightOpen && !rd.rightOpenSwitch, rd.gearManualRightClose && !rd.rightCloseSwitch);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t// close each motor until fully closed, if one motor is closed stop that motor\n\t\t\tcase autoClose:\n\t\t\t\tcd.gearLeftOpen.set(false, !rd.leftCloseSwitch );\n\t\t\t\tcd.gearRightOpen.set(false, !rd.rightCloseSwitch);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// open each motor until fully open, if one motor is open stop that motor\t\n\t\t\tcase autoOpen:\n\t\t\t\tcd.gearLeftOpen.set(!rd.leftOpenSwitch, false);\n\t\t\t\tcd.gearRightOpen.set(!rd.rightOpenSwitch, false);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "@Override\n public void updateState(Perception p) {\n \n //TODO: Complete Method\n }", "private synchronized void setState(int state) {\n Log.d(TAG, \"setState() \" + mState + \" -> \" + state);\n mState = state;\n\n if(mState == STATE_CONNECTED) {\n cancelRetryConnect();\n }\n\n // Give the new state to the Handler so the UI Activity can update\n mHandler.obtainMessage(MESSAGE_STATE_CHANGE, state, -1).sendToTarget();\n //블루투스상태메세지와,블루투스상태와, -1 을 비티 서비스에 보내는거져 비티서비스핸들러에서 찾아봅시다.//근데이건 그냥 액티비티 유아이 변환을 위한 애들이었다...\n }", "private ScanState switchState(ScanState desired,EnumSet<ScanState> allowed) {\n final ScanState old;\n final long timestamp;\n final long sequence;\n synchronized(this) {\n old = state;\n if (!allowed.contains(state))\n throw new IllegalStateException(state.toString());\n state = desired;\n timestamp = System.currentTimeMillis();\n sequence = getNextSeqNumber();\n }\n LOG.fine(\"switched state: \"+old+\" -> \"+desired);\n if (old != desired)\n queueStateChangedNotification(sequence,timestamp,old,desired);\n return old;\n }", "@Override\r\n\tpublic void config() {\n\t\tinter.setState(inter.getConfig());\r\n\t}", "public void update(){\r\n\r\n // update curState based on inputs\r\n // Perform state-transition actions \r\n switch(curState) {\r\n${nextstatecases}\r\n default:\r\n reset();\r\n break;\r\n }", "public void recordState() {\n this.event = null;\n flowContextInfo.setWaitingNode(currentNode);\n }", "public void setStateComplete() {state = STATUS_COMPLETE;}", "@Override\n\t\t\t\tpublic void isComposingReceived(LinphoneCore lc, LinphoneChatRoom cr) {\n\t\t\t\t\t\n\t\t\t\t}", "public void enterNormalState() {\n\n\t}", "@Override\r\n public boolean updateState(Status currentState, Event event,\r\n Status nextState, UserVmTcDetail vo, Object data) {\n return false;\r\n }", "public void getState();", "void conversationPausing(Conversation conversation);", "public void updateState();", "public static int activityStateToProcessState( int newState )\r\n {\r\n // The states actually have the same ordinals.\r\n return newState;\r\n }", "public void transferStateToConfig() {\r\n \t\t\r\n \t\t\tSeamCorePlugin.getDefault().getPluginPreferences().setValue(\r\n \t\t\t\t\tSeamProjectPreferences.SEAM_DEFAULT_RUNTIME_NAME,\r\n \t\t\t\t\tjBossSeamHomeEditor.getValueAsString());\r\n \r\n \t\t\tSeamCorePlugin.getDefault().getPluginPreferences().setValue(\r\n \t\t\t\t\tSeamProjectPreferences.SEAM_DEFAULT_CONNECTION_PROFILE,\r\n \t\t\t\t\tconnProfileSelEditor.getValueAsString());\r\n \t\t\t\r\n \t\t\tSeamCorePlugin.getDefault().getPluginPreferences().setValue(\r\n \t\t\t\t\tSeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS,\r\n \t\t\t\t\tthis.jBossAsDeployAsEditor.getValueAsString());\r\n \t\t\t\r\n \t\t\tSeamCorePlugin.getDefault().getPluginPreferences().setValue(\r\n \t\t\t\t\tSeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE,\r\n \t\t\t\t\tthis.jBossHibernateDbTypeEditor.getValueAsString());\r\n \t\t\t\r\n \t}", "@Override\n protected void sendUpdatedStateTo(GamePlayer p) {\n //makes sure player exists\n if(p == null){\n return;\n }\n // if there is no state to send, ignore\n if(state == null){\n return;\n }\n //creates a copy of the official state and sends it to the desired player\n StrategoGameState stateForPlayer = new StrategoGameState(state);\n p.sendInfo((stateForPlayer));\n }", "private void updateState() {\n\t while(!isGoodState()) {\n\t\t updateStateOnce();\n\t }\n }", "public void setOn(){\n state = true;\n //System.out.println(\"Se detecto un requerimiento!\");\n\n }" ]
[ "0.69980097", "0.652291", "0.6502802", "0.6212999", "0.6140483", "0.6130991", "0.6126959", "0.6102246", "0.60845613", "0.6049614", "0.60118455", "0.59040093", "0.58927566", "0.588431", "0.5879537", "0.5872784", "0.587265", "0.5871172", "0.5848075", "0.58479196", "0.5844988", "0.5842803", "0.5840414", "0.5815476", "0.58133036", "0.57940114", "0.5785517", "0.57556134", "0.57513255", "0.57217884", "0.57188916", "0.57174975", "0.5691704", "0.56787795", "0.56468225", "0.5644768", "0.5638793", "0.56351763", "0.5628293", "0.5627659", "0.5624499", "0.55985117", "0.5587909", "0.55750203", "0.55619097", "0.5561829", "0.5559612", "0.5556243", "0.55496025", "0.5541399", "0.5539877", "0.5538472", "0.55347246", "0.55266607", "0.55192286", "0.55162543", "0.5496069", "0.54932624", "0.548629", "0.54835826", "0.54756534", "0.5472829", "0.5465456", "0.5463028", "0.54606897", "0.5444285", "0.54420966", "0.54341567", "0.5430771", "0.5427593", "0.54265", "0.5419005", "0.5417322", "0.54152554", "0.5403997", "0.54008824", "0.5398862", "0.53891027", "0.538715", "0.53817487", "0.53814936", "0.53697187", "0.5366502", "0.53659976", "0.53655225", "0.5361996", "0.5360176", "0.5357672", "0.5357462", "0.5355349", "0.5353394", "0.5341831", "0.5341183", "0.53375745", "0.5337248", "0.53341943", "0.53297436", "0.53253454", "0.5324698", "0.53105617", "0.52997875" ]
0.0
-1
If individual successfully change its state to conversation, it starts conversation timer. This timer's duration determined by both communicating individual. After time is up, individual tries to change state to again moving by calling moveInPopulation() function. Timer also added to timer list to get updates.
public void startConversationTimer(int conversationTime) { conversationTimer = new PlayPauseTimer(conversationTime, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { moveInPopulation(); timerList.remove(conversationTimer); } }, world.getRefreshTime()); timerList.add(conversationTimer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void pickUpTimer()\r\n\t{\t\t\r\n\t\tSystem.out.println(timer.get());\r\n\t\tif(timer.get() < Config.Auto.timeIntakeOpen)\r\n\t\t{\r\n\t\t\t//claw.openClaw();\r\n\t\t\tSystem.out.println(\"in second if\");\r\n\t\t}\r\n\t\t\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeElevatorStack)\r\n\t\t{\r\n\t\t\t//elevator.setLevel(elevatorLevel);\r\n\t\t\t//elevatorLevel++;\r\n\t\t}\r\n\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeIntakeClose)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"in first if\");\r\n\t\t\t//claw.closeClaw();\r\n\t\t}\r\n\t\t\r\n\t\telse\r\n\t\t\tendRoutine();\r\n\t}", "public void inTurn() {\n\t\tthis.timer = new Timer();\n\t\ttimer.schedule(new TimerTask() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinishTurn();\n\t\t\t}\n\t\t}, turnMaxSeconds * 1000);\n\n\t}", "public void action()\n {\n if(timeout > 0 && timeout < 2)\n {\n timeout = 0;\n agent.removeBehaviour(introNegotiation);\n introNegotiation = null;\n counter = 0;\n\n\n }\n //If this is the very first time getting to this state or if the timeout reset the counter to 0\n if(counter < 1)\n {\n //Clean the list of receivers in case there is something\n if(!receivers.isEmpty())\n receivers.removeAllElements();\n //Calculate the duration of the intro\n calculateDurationIntro();\n //Find a receiver\n findAllReceivers();\n constructACLMessage();\n introNegotiation = new IntroNegotiation(agent,msg);\n introNegotiation.setDataStore(getDataStore());\n agent.addBehaviour(introNegotiation);\n }\n\n\n //Handle where I'm heading to from here.\n switch (steps)\n {\n case 0:\n transition = 29;\n break;\n case 1:\n agent.removeBehaviour(introNegotiation);\n introNegotiation = null;\n transition = 17;\n\n }\n\n\n\n }", "public void newTurnCountdown() {\n newTurn = true;\n newTurnTimer = 77;\n }", "public void startConversation(int conversationTime)\n\t{\n\t\tsynchronized (this) {\n\t\tcurrentState.startConversation(conversationTime);\n\t\t}\n\t}", "void turn2Start() throws InterruptedException {\r\n\t\t \r\n\t\t secondTurn = true;\r\n\t\t \r\n\t\t displayMessage.setText(\"TIME'S UP!\");\r\n\t\t timeSeconds2 = 1; //duration\r\n\t\t \r\n\t\t Timer clock2 = new Timer();\r\n\t\t clock2.scheduleAtFixedRate(new TimerTask() {\r\n\t\t public void run() {\r\n\t\t if(timeSeconds2 >= 0)\r\n\t\t {\r\n\t\t timeSeconds2--; \r\n\t\t }\r\n\t\t else {\r\n\t\t clock2.cancel();\r\n\t\t \r\n\t\t try {\r\n\t\t\t\t\t\t\t\tgetReadyMessage2();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t} \r\n\t\t \r\n\t\t ////////////////////////////////reset everything///////////////////\r\n\t\t wordCount.setVisible(false);\r\n\t\t wordMax.setVisible(false);\r\n\t\t slash.setVisible(false);\r\n\t\t counterBox.setVisible(false);\r\n\t\t countDownTimer.setVisible(false);\r\n\t\t countDownTimer.setText(\"20\");\r\n\t\t outOf=0;\r\n\t\t wordCount.setText(Integer.toString(outOf));\r\n\t\t \r\n\t\t String sequenceText = \"\" ;\r\n\t\t \t\t\t\tfor (int i = 0; i < DupMeClient.myPattern.size(); i++) {\r\n\t\t \t\t\t\t\tsequenceText = sequenceText + Integer.toString(DupMeClient.myPattern.get(i));\r\n\t\t \t\t\t\t}\r\n\t\t \t\t\t\tlastPattern.setText(sequenceText);\r\n\t\t \t\t\t\t\r\n\t\t DupMeClient.opponentPattern = DupMeClient.myPattern;\r\n\t\t DupMeClient.myPattern = new ArrayList<Integer>();\r\n\t\t \r\n\t\t \r\n\t\t }\r\n\t\t }\r\n\t\t }, 1000,1000);\r\n }", "public void startTimer() {\n // TODO = handle more aspects of the behaviour required by the specification\n System.out.println(\"starting timer\");\n initialHeroCastle();\n isPaused = false;\n // trigger adding code to process main game logic to queue. JavaFX will target\n // framerate of 0.3 seconds\n timeline = new Timeline(new KeyFrame(Duration.seconds(0.1), event -> {\n if (world.getMode() == -1){\n modeSelectionSwitchToMainMenu();\n }\n world.runTickMoves();\n world.runBattles();\n world.updateGoal();\n if (world.goalAchieved()) {\n world.gameOver();\n deadSwitchToMainMenu(true);\n return;\n }\n List<Soldier> soldiers = world.possiblySpawnSoldiers();\n for (Soldier s : soldiers) {\n loadSoldier(s);\n }\n List<BasicEnemy> deadEnemies = world.cleanEnemies();\n for (BasicEnemy e : deadEnemies) {\n reactToEnemyDefeat(e);\n }\n List<BasicEnemy> newEnemies = world.possiblySpawnEnemies();\n for (BasicEnemy newEnemy : newEnemies) {\n loadEnemies(newEnemy);\n }\n printThreadingNotes(\"HANDLED TIMER\");\n loopNumber.setText(\"Loop: \" + (int) world.getCurrentLoop().get());\n if (world.isCharacterDead()) {\n if (!world.useOneRing())\n deadSwitchToMainMenu(false);\n return;\n }\n if (world.isAtHeroCastle() && world.shouldShopAppear()) {\n System.out.println(\"At Hero Castle. Shopping!\");\n shopSwitchToMainMenu();\n }\n }));\n timeline.setCycleCount(Animation.INDEFINITE);\n timeline.play();\n }", "private void timerstart() {\n timer = new Timer(timer1, new ActionListener(){ \n \tpublic void actionPerformed(ActionEvent ae){\n \t\tcheckMatch();\n \t}});\n timer.start();\n timer.setRepeats(false);\n }", "private void startNewTimer(){\n timer.cancel();\n timer = null;\n timesUp();\n timer = new MainGameTimer(this);\n timer.startNewRoundCountDown();\n }", "private void startTimer()\n {\n if (timer == null)\n {\n timer = new CountDownTimer(TIMER_MILLI_SEC, 1000)\n {\n @Override\n public void onTick(long l)\n {\n timerText.setText(\"\" + l / 1000);\n }\n\n @Override\n public void onFinish()\n {\n // Let P2 play\n if (secondPlayer instanceof IAPlayer)\n {\n ((IAPlayer) secondPlayer).playRandom();\n }\n // Animations and full results\n announceRoundResult();\n\n // Hide timer\n timerText.setVisibility(View.GONE);\n gameControlButton.setVisibility(View.VISIBLE);\n }\n };\n }\n\n // Clean UI state\n gameControlButton.setVisibility(View.INVISIBLE);\n timerText.setVisibility(View.VISIBLE);\n\n drawIcon.setVisibility(View.INVISIBLE);\n firstCup.setVisibility(View.INVISIBLE);\n secondCup.setVisibility(View.INVISIBLE);\n\n // Reset users actions\n resetActionButtonsState();\n firstPlayer.resetLastAction();\n secondPlayer.resetLastAction();\n\n // First player plays first\n if (firstPlayer instanceof IAPlayer)\n {\n ((IAPlayer) firstPlayer).playRandom();\n }\n\n // Start count down\n timer.start();\n }", "private void doLastTurn()\n\t{\n\t\tInteger time = turn;\n\n\t\tstartEnterScore(time);\n\t\tdisposeFrameMap();\n\n\t\ttimer.cancel();\n\t}", "public void startOpponent() {\n\t\tthis.opponent.start();\n\t\tthis.timer.start();\n\t}", "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\r\n public void setupMove(double localTime) {\n if (mEntityMap.containsKey(mLocalCharId)) {\r\n Character localChar = (Character)mEntityMap.get(mLocalCharId);\r\n localChar.setController(Game.mCamera);\r\n ((Client)mEndPoint).sendUDP(localChar.getControl());\r\n\r\n ChatMessage chat = localChar.getChat();\r\n if (chat != null && chat.s != null) {\r\n System.err.println(\"Sending chat to server:\" + chat.s);\r\n ((Client)mEndPoint).sendTCP(chat);\r\n chat.s = null;\r\n }\r\n }\r\n\r\n // receive world state from server\r\n TransmitPair pair;\r\n for (;;) {\r\n pair = pollHard(localTime, 0);\r\n if (pair == null)\r\n break;\r\n\r\n if (pair.object instanceof StateMessage) {\r\n // Server updates client with state of all entities\r\n StateMessage state = (StateMessage) pair.object;\r\n applyEntityChanges(state.timestamp, state.data);\r\n\r\n // update clock correction based on packet timestamp, arrival time\r\n if (mClockCorrection == Double.MAX_VALUE) {\r\n mClockCorrection = state.timestamp - localTime;\r\n } else {\r\n mClockCorrection = Config.CORRECTION_WEIGHT * (state.timestamp - localTime)\r\n + (1 - Config.CORRECTION_WEIGHT) * mClockCorrection;\r\n }\r\n } else if (pair.object instanceof StartMessage) {\r\n // Server tells client which character the player controls\r\n mLocalCharId = ((StartMessage) pair.object).characterEntity;\r\n System.err.println(\"Client sees localid, \" + mLocalCharId);\r\n } else if (pair.object instanceof ChatMessage) {\r\n ChatMessage chat = (ChatMessage) pair.object;\r\n mChatDisplay.addChat(localTime, chat.s, Color.white);\r\n } else if (pair.object instanceof ChunkMessage) {\r\n ChunkMessage chunkMessage = (ChunkMessage) pair.object;\r\n ChunkModifier.client_putModified(chunkMessage);\r\n }\r\n }\r\n\r\n // move local char\r\n if (mEntityMap.containsKey(mLocalCharId)) {\r\n Character localChar = (Character)mEntityMap.get(mLocalCharId);\r\n localChar.setupMove(localTime);\r\n }\r\n }", "public void opponentResponseCountdown() {\n responseTimer = 101;\n opponentResponseSwitch = true;\n }", "public void newTurnPauseCountdown()\n {\n pauseNewTurn = true;\n pauseNewTurnTimer = 169;\n }", "public void updateConversationState() {\n Conversation.State state = this.anonymousConversation.getState();\n conversationStateTextView.setText(state.toString());\n switch (state) {\n case ESTABLISHED:\n this.meetingJoined = true;\n break;\n case IDLE:\n conversationStateTextView.setText(\"\");\n this.meetingJoined = false;\n if (this.anonymousConversation != null) {\n this.anonymousConversation.removeOnPropertyChangedCallback(this.conversationPropertyChangeListener);\n this.anonymousConversation = null;\n }\n break;\n default:\n }\n\n // Refresh the UI\n this.updateUiState();\n\n if (meetingJoined) {\n this.navigateToConversationsActivity();\n }\n }", "public void startTeleopTimer() {\n t.reset();\n t.start();\n }", "private void reactMain_region_digitalwatch_Time_counting_Counting() {\n\t\tif (timeEvents[0]) {\n\t\t\tnextStateIndex = 0;\n\t\t\tstateVector[0] = State.$NullState$;\n\n\t\t\ttimer.unsetTimer(this, 0);\n\n\t\t\ttimer.setTimer(this, 0, 1 * 1000, false);\n\n\t\t\tsCILogicUnit.operationCallback.increaseTimeByOne();\n\n\t\t\tnextStateIndex = 0;\n\t\t\tstateVector[0] = State.main_region_digitalwatch_Time_counting_Counting;\n\t\t}\n\t}", "@Override\n public long processTimer (long interval)\n {\n state.incVersion ();\n\n Map <String, JiniPeer> peers = agent.getPeers ();\n if (peers.size () > 0)\n {\n GossipMsg.Ping msg = new GossipMsg.Ping ();\n msg.appendDigest (state.getMessage ());\n\n for (JiniPeer peer : peers.values ()) {\n State peerState = (State) peer.getAttached ();\n if (peerState != null)\n msg.appendDigest (peerState.getMessage ());\n }\n\n // Gossip to some random live member\n boolean seed = sendGossip (msg, liveEndpoints);\n\n // Gossip to some unreachable member with some probability to check if he is back up\n sendGossipDead (msg);\n\n if (!seed || liveEndpoints.size() < seeds.size())\n sendGossip (msg, seeds);\n\n checkState ();\n }\n \n return interval;\n }", "private void suarez() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -10;\n\t\tint yInit = 8;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit*selfPerception.getSide().value());\n\t\twhile (commander.isActive()) {\n\t\t\t\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\t//state = State.FOLLOW;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}", "private void onPingingTimerTick()\r\n {\r\n EneterTrace aTrace = EneterTrace.entering();\r\n try\r\n {\r\n try\r\n {\r\n myConnectionManipulatorLock.lock();\r\n try\r\n {\r\n // Send the ping message.\r\n myUnderlyingOutputChannel.sendMessage(myPreserializedPingMessage);\r\n\r\n // Schedule the next ping.\r\n myPingingTimer.change(myPingFrequency);\r\n }\r\n finally\r\n {\r\n myConnectionManipulatorLock.unlock();\r\n }\r\n }\r\n catch (Exception err)\r\n {\r\n // The sending of the ping message failed - the connection is broken.\r\n cleanAfterConnection(true, true);\r\n }\r\n }\r\n finally\r\n {\r\n EneterTrace.leaving(aTrace);\r\n }\r\n }", "TimerStatus onTimer();", "@Override\n\t\tpublic void run() {\n\t\t\tLOGGER.log(Level.INFO, \"Timer started\");\n\t\t\ttry {\n\t\t\t\tThread.sleep(TIMEOUT);\n\t\t\t\tif (gameCanStart()) {\n\t\t\t\t\tstartNewGame(players);\n\t\t\t\t} else {\n\t\t\t\t\tLOGGER.log(Level.INFO, \"No players available right now...\");\n\t\t\t\t}\n\t\t\t\tLOGGER.log(Level.INFO, \"Timer stopped\");\n\t\t\t\tactiveConnections = 0;\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// Non fa nulla, può essere interrotto\n\t\t\t\tLOGGER.log(Level.INFO, \"Timer interrupted\", e);\n\t\t\t}\n\t\t}", "private void performTransition() {\r\n\t\t// Do something only if the time has been reached\r\n\t\tif (transitionTime <= System.currentTimeMillis()) {\r\n\t\t\t// Clear the transition time\r\n\t\t\ttransitionTime = Long.MAX_VALUE;\r\n\r\n\t\t\t// If there are no lives left, the game is over. Show the final\r\n\t\t\t// screen.\r\n\t\t\tif (lives <= 0) {\r\n\t\t\t\t// Updates the highScore\r\n\t\t\t\tif (numScore > highScore) {\r\n\t\t\t\t\thighScore = numScore;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Updates the HighScore label in enhanced mode\r\n\t\t\t\tif (enhanced == true) {\r\n\t\t\t\t\tdisplay.setHighScore(highScore);\r\n\t\t\t\t}\r\n\t\t\t\t// Brings up the final screen\r\n\t\t\t\tfinalScreen();\r\n\t\t\t\t// JOptionPane.showMessageDialog(null, numLiveUpdated);\r\n\t\t\t}\r\n\r\n\t\t\t// If the ship was destroyed, place a new one and continue\r\n\t\t\telse if (ship == null) {\r\n\t\t\t\tplaceShip();\r\n\t\t\t}\r\n\t\t\tif (pstate.countAsteroids() == 0) {\r\n\r\n\t\t\t\t// increase the level and speed markers\r\n\t\t\t\tnumLevel += 1;\r\n\t\t\t\tspeed += 0.5;\r\n\r\n\t\t\t\t// Update the level display\r\n\t\t\t\tdisplay.setLevel(numLevel);\r\n\t\t\t\tParticipant.expire(alien);\r\n\t\t\t\tplaceAsteroids();\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Place a new alien when one has been destroyed\r\n\t\t\tif (pstate.countAliens() == 0 && ship != null) {\r\n\t\t\t\tif (numLevel == 2) {\r\n\t\t\t\t\tplaceAlien(1);\r\n\r\n\t\t\t\t} else if (numLevel >= 3) {\r\n\t\t\t\t\tplaceAlien(0);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclipAlienDestroyed.stop();\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "@Override\n public void update() {\n if (!myNPC.isAlive()) {\n myNPC.setState(MovingState.DEATH);\n }\n\n if (isAttacking()) {\n if (attackCounter > 300) {\n myNPC.setState(MovingState.IDLE);\n attackCounter = 0;\n } else {\n attackCounter++;\n }\n return;\n }\n\n// randomMove();\n }", "void startGameTimer()\n {\n Timer.destroyTimer(\"starting_game_timer\");\n Timer timer = Timer.createTimer(\"starting_game_timer\", startTimerSeconds);\n timer.addTimerListener(this);\n timer.start();\n }", "@Override\n public void start(Stage stage) throws Exception {\n StackPane pane = new StackPane();\n Button sendMove = new Button(\"Send Move\");\n Button receiveMove = new Button(\"Wait(Received_Move)\");\n Button stopAll = new Button(\"Stop All\");\n Label label2 = new Label();\n Label label1 = new Label();\n Label label3 = new Label();\n Label label4 = new Label();\n VBox hbox = new VBox(label4, label1, label2, label3);\n hbox.setSpacing(15);\n VBox box = new VBox(sendMove, receiveMove, stopAll, hbox);\n box.setSpacing(15);\n\n pane.getChildren().addAll(box);\n Scene scene = new Scene(pane, 500, 500);\n\n long veryInitialTime = System.currentTimeMillis();\n// clickedTime = veryInitialTime;\n backgroundStopWatch.schedule(new TimerTask() {\n public void run() {\n Platform.runLater(new Runnable() {\n public void run() {\n// timer2.cancel();\n label4.setText(String.valueOf(System.currentTimeMillis() - veryInitialTime));//+ (System.currentTimeMillis() - initialTimer));\n\n }\n });\n }\n }, 0, 500);\n\n receiveMove.setOnAction((event) -> {\n// delChange += delTimer;\n// delChange = 5000;\n\n clickedTime = System.currentTimeMillis();\n\n waitingForMyMoveStopWatch.cancel();\n waitingForReceiverMoveStopWatch = new Timer();\n// clickedTime = System.currentTimeMillis();\n\n waitingForReceiverMoveStopWatch.schedule(new TimerTask() {\n public void run() {\n Platform.runLater(new Runnable() {\n public void run() {\n// timer2.cancel();\n label3.setText(\"(Do after receiving Move)My Move timer ... (my Move) ...\" + String.valueOf(System.currentTimeMillis() - clickedTime));//+ (System.currentTimeMillis() - initialTimer));\n\n }\n });\n }\n }, 0, 500);\n// clickedTime = System.currentTimeMillis();\n// System.out.println(\"Button1 .. delTimer .. \" + delTimer + \" .. delChange .. \" + delChange);\n toDoTaskTimer.cancel();\n toDoTaskTimer = new Timer();\n toDoTaskTimer.schedule(new TimerTask() {\n public void run() {\n Platform.runLater(new Runnable() {\n public void run() {\n waitingForReceiverMoveStopWatch.cancel();\n// backgroundStopWatch.cancel();\n label3.setText(\"I didn't make move ... YOU LOSE AFTER (time) (to do)10s \");//+ (System.currentTimeMillis() - initialTimer));\n\n// label3.setText(\"(Move not received in due time) (time) (to do)10s \");//+ (System.currentTimeMillis() - initialTimer));\n }\n });\n }\n }, delChange);\n });\n\n sendMove.setOnAction((event) -> {\n// delChange = 5000;\n clickedTime = System.currentTimeMillis();\n waitingForReceiverMoveStopWatch.cancel();\n waitingForMyMoveStopWatch = new Timer();\n waitingForMyMoveStopWatch.schedule(new TimerTask() {\n public void run() {\n Platform.runLater(new Runnable() {\n public void run() {\n// timer2.cancel();\n label2.setText(\"(Do After Send MyMove) (waiting for opponentMove) ...\" + String.valueOf(System.currentTimeMillis() - clickedTime));//+ (System.currentTimeMillis() - initialTimer));\n\n }\n });\n }\n }, 0, 500);\n// System.out.println(\"Button2 .. delTimer .. \" + delTimer + \" .. delChange .. \" + delChange);\n toDoTaskTimer.cancel();\n toDoTaskTimer = new Timer();\n toDoTaskTimer.schedule(new TimerTask() {\n public void run() {\n Platform.runLater(new Runnable() {\n public void run() {\n waitingForMyMoveStopWatch.cancel();\n// backgroundStopWatch.cancel();\n// label3.setText(\"I didn't make move ... YOU LOSE AFTER (time) (to do)10s \");//+ (System.currentTimeMillis() - initialTimer));\n label2.setText(\"(Move not received in due time) (time) (to do)10s \");//+ (System.currentTimeMillis() - initialTimer));\n\n }\n });\n }\n }, delChange);\n });\n\n stopAll.setOnAction((event) -> {\n// toDoTaskTimer.cancel();\n// backgroundStopWatch.cancel();\n// waitingForReceiverMoveStopWatch.cancel();\n// sendMove.fi\n });\n stage.setScene(scene);\n stage.show();\n\n }", "@Override\n public void run() {\n cs = new CommStack(this, this.csParams);\n /** time variables to control the <Actor>s lifetime */\n long time_ini; \n /** lifecicle duration in ns */\n long deltaTime; \n /** lifecicle duration in ms */\n long deltaTime_ms;\n setInitialParameters();\n /** start the comunication Thread CommStack */\n cs.start();\n \n /** while the actor is alive, keep updating it every time_pace milliseconds */\n try {\n while (alive && !SimStatus.globalActors.get(id).actorDyingQ()) {\n /** decreases lifetime as the cycles pass */\n lifetime = lifetime - time_pace; \n if (lifetime > 0) {\n /** saves current time in nanoseconds */\n time_ini = System.nanoTime();\n label = moveActor();\n SimStatus.setActorStatus(id, x, y, vx, vy, label);\n /** saves lifecycle duration */\n deltaTime = System.nanoTime() - time_ini;\n deltaTime_ms = TimeUnit.NANOSECONDS.toMillis(deltaTime);\n /** if lifecycle duration is less than the time pace, sleeps for the time remaining */\n if (deltaTime_ms <= time_pace) {\n Thread.sleep(time_pace - deltaTime_ms);\n }\n /** if lifecycle is more than 20% bigger than time pace, launches warning */\n if(deltaTime_ms > 0.2*time_pace) { \n System.err.println(\"WARNING - actor \"+id+\" lifecicle time >20% of time_pace\");\n }\n } else {\n \n /** Starts de dying process */\n System.out.println(\"Actor \" + id + \" lifetime is over...\");\n dying = true;\n /** sets actor status to 'dying' */\n SimStatus.setActorStatus(id, x, y, vx, vy, label, dying);\n /** sleep for some time, waiting for the news to spread */\n Thread.sleep(500);\n }\n }\n /** completes the dying process */\n alive = false;\n cs.join();\n SimStatus.removeActor(id);\n } catch (InterruptedException ex) {\n Logger.getLogger(Actor.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void resolveTurnCountdown() {\n resolveTurn = true;\n resolveTurnTimer = 130;\n }", "void put_and_set_timer(SftpDatagram d){\r\n\t\tsendings.put(new Integer(covered_datagrams), d);\r\n\t\tnot_ack_yet++;\t//must assure not over SEND_WINDOW\r\n\t\td.set_timer();\r\n\t}", "private void startActiveHeartbeatTimer() {\n\t\tTimerTask timerTask = new TimerTask() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (currentActive == null) {\n\t\t\t\t\t// No active was present - elevate own state.\n\t\t\t\t\tComponentLogger.getInstance().log(LogMessageType.LOAD_BALANCER_NO_ACTIVE_DETECTED);\n\t\t\t\t\tSystem.out.println(\"Detected absence of an active node.\");\n\t\t\t\t\tterminateThread.set(true);\n\t\t\t\t\tnew Thread(LoadBalancer.getNewActiveLoadBalancer()).start();\n\t\t\t\t\tfor (RemoteLoadBalancer remoteLoadBalancer : remoteLoadBalancers) {\n\t\t\t\t\t\tremoteLoadBalancer.resetState();\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Suspected failure - attempt to contact active\n\t\t\t\tComponentLogger.getInstance().log(LogMessageType.LOAD_BALANCER_ACTIVE_FAILURE_DETECTED);\n\t\t\t\tSystem.out.println(\"Active load balancer failure detected.\");\n\t\t\t\tThread.currentThread().setPriority(Thread.MAX_PRIORITY);\n\n\t\t\t\tif (!currentActive.connect(activeTimeoutMillis / 100)) {\n\t\t\t\t\t// activeFailureDetected = true;\n\t\t\t\t\thandleActiveFailure();\n\t\t\t\t} else {\n\t\t\t\t\tByteBuffer buffer = ByteBuffer.allocate(1);\n\t\t\t\t\tbuffer.put((byte) MessageType.ALIVE_REQUEST.getValue());\n\t\t\t\t\tbuffer.flip();\n\t\t\t\t\ttry {\n\t\t\t\t\t\twhile (buffer.hasRemaining()) {\n\t\t\t\t\t\t\tcurrentActive.getSocketChannel().write(buffer);\n\t\t\t\t\t\t}\n\t\t\t\t\t\texpectingAliveConfirmation = true;\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t// e.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tnew Timer().schedule(new TimerTask() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tif (!receivedAliveConfirmation) {\n\t\t\t\t\t\t\t\thandleActiveFailure();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresetActiveHeartbeatTimer();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\texpectingAliveConfirmation = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}, activeTimeoutMillis);\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\t\tactiveHeartbeatTimer = new Timer();\n\t\tactiveHeartbeatTimer.schedule(timerTask, activeTimeoutMillis);\n\t}", "public void setAttackState(String state, \n int loadingTime, \n int activeTime, \n int recoveryTime) {\n this.setSpecialState(state, loadingTime+activeTime+recoveryTime);\n this.resetXMovement();\n TimedEventQueue.addTask(new TimedTask(this, \"activeAttackState\", loadingTime));\n TimedEventQueue.addTask(new TimedTask(this, \"activeAttackStateOver\", \n loadingTime+activeTime));\n \n }", "public void startTimer() {\n\n if(mTimer == null) {\n mTimer = new Timer();\n }\n\n mElapsedTime = 0;\n mTimer.scheduleAtFixedRate(new TimerTask() {\n\n public void run() {\n mElapsedTime += 1; //increase every sec\n mTimerHandler.obtainMessage(TimerHandler.INCREASE_TIMER).sendToTarget();\n if (mLiveVideoBroadcaster == null || !mLiveVideoBroadcaster.isConnected()) {\n mTimerHandler.obtainMessage(TimerHandler.CONNECTION_LOST).sendToTarget();\n }\n }\n }, 0, 1000);\n }", "public boolean thoughtBubbleTimer(boolean debug) {\r\n if (debug) {\r\n if (seconds - lastBubble >= 5) {\r\n lastBubble = seconds;\r\n return true;\r\n } else if (seconds < lastBubble) {\r\n lastBubble = 0;\r\n }\r\n } else {\r\n if (minutes - lastBubble >= 1) {\r\n lastBubble = minutes;\r\n return true;\r\n } else if (minutes < lastBubble) {\r\n lastBubble = 0;\r\n }\r\n }\r\n return false;\r\n }", "private synchronized void reStartTimer(){\n handler.removeCallbacks(null);\n handler.postDelayed(new Runnable(){\n @Override\n public void run(){\n if (running) reStartTimer();\n update();\n }\n }, TURN_DELAY_MILLIS);\n }", "public boolean transition() {\n current = new State(ts++, hopper); \n if (terminus.isTerminus(current)) {\n return false;\n } else {\n hopper.sendBall(oneMinute);\n return true;\n }\n }", "public abstract void userTurnStarts(long ms);", "@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 }", "private void busquets() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -25;\n\t\tint yInit = -10;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit *selfPerception.getSide().value());\n\t\t\n\t\twhile (commander.isActive()) {\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\tstate = State.ATTACKING;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\t//if(closer)\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private String proposeTime(Conversation conv, boolean correction)\n throws IOException {\n // propose a time block\n Calendar appt = scheduleManager.getApptSlot();\n conv.setAppointmentTime(appt);\n // transition to a the message proposed state\n conv.setState(Conversation.STATE_APPT_PROPOSED);\n\n // generate the message\n if (correction) {\n return WordLattice.fromFile(\"correction.lat\")\n .generate(conv.getAppointmentTime(), conv.getName());\n } else {\n return WordLattice.fromFile(\"propose.lat\")\n .generate(conv.getAppointmentTime(), conv.getName());\n }\n }", "public void createTimer() {\n timer = new AnimationTimer() {\n @Override\n public void handle(long now) {\n if (animal.changeScore()) {\n setNumber(animal.getPoints());\n }\n if (animal.getStop()) {\n System.out.println(\"Game Ended\");\n background.stopMusic();\n stop();\n background.stop();\n\n ArrayList list = null;\n try {\n list = scoreFile.sortFile(animal.getPoints());\n } catch (IOException e) {\n e.printStackTrace();\n }\n popUp(list);\n }\n }\n };\n }", "@Override\n\tpublic void run() {\n\t\tBot.inst.dbg.writeln(this, \"Running scheduled task id \" + this.timerID + \" for channel \" + this.channel);\n\t\t\n\t\tMessageInfo info = new MessageInfo(channel, \"\", message, \"\", \"\", 0);\n\t\tBot.inst.dbg.writeln(this, \"Flags: \" + this.flags);\n\n\t\tif (this.flagsVals.REQUIRES_MSG_COUNT && Integer.parseInt(this.flagsVals.REQUIRES_MSG_COUNT_AMT) > this.flagsVals.MSGES_SINCE_LAST_TRIGGER) {\n\t\t\tthis.flagsVals.MSGES_SINCE_LAST_TRIGGER = 0; // Reset msges count, even if the timer didnt get to run\n\t\t\tBot.inst.dbg.writeln(this, \"Timer failed. Not enough messages. Channel: \" + this.channel + \", id: \" + this.timerID);\n\t\t\treturn; // Not enough messages have been sent for this to trigger again\n\t\t}\n\t\t\n\t\tif (this.flagsVals.REQUIRES_LIVE) {\n\t\t\tif(!kdk.api.twitch.APIv5.isStreamerLive(Bot.inst.getClientID(), Bot.inst.getChannel(channel).getUserID())) {\n\t\t\t\tBot.inst.dbg.writeln(this, \"Timer failed. Streamer isn't live. Channel: \" + this.channel + \", id: \" + this.timerID);\n\t\t\t\treturn; // Streamer isn't live, we arnt going to send message\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (this.flagsVals.REQUIRES_GAME) {\n\t\t\tChannel chan = Bot.inst.getChannel(this.channel);\n\t\t\tString retrievedGame = kdk.api.twitch.APIv5.getChannelGame(DBFetcher.getTwitchOAuth(kdk.Bot.dbm), chan.getUserID()).replaceAll(\"\\\"\", \"\");\n\t\t\tif(!this.flagsVals.REQUIRES_GAME_NAME.equalsIgnoreCase(retrievedGame)) {\n\t\t\t\tBot.inst.dbg.writeln(this, \"Timer failed. Game did not match. Match: \" + retrievedGame + \", To: \" + this.flagsVals.REQUIRES_GAME_NAME + \", Channel: \" + this.channel + \", id: \" + this.timerID);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tBot.inst.dbg.writeln(this, \"Triggered timer \" + this.timerID + \", all conditions met\");\n\t\tthis.flagsVals.MSGES_SINCE_LAST_TRIGGER = 0; // Reset msges count, even if we're not using it\n\t\tBot.inst.sendMessage(channel, MessageParser.parseMessage(message, info));\n\t\t\n\t\tif(flagsVals.RANDOM_MODIFIER) {\n\t\t\tRandom rng = new Random();\n\t\t\tSystem.out.println(\"ID: \" + timerID + \", RNG_MAX: \" + flagsVals.RANDOM_MODIFIER_MAX);\n\t\t\tint rni = rng.nextInt(Integer.parseInt(flagsVals.RANDOM_MODIFIER_MAX));\n\t\t\t\n\t\t\ttimer.schedule(this, (delay + rni) * 1000, delay * 1000);\n\t\t}\n\t}", "public void circleOpp(int time){\n int[][] ordinance = {{0,1},{-1,0},{0,-1},{1,0}}; \n \n tMovement = new Timer(time,new ActionListener(){\n private int ordinanceInd = 0;\n private int distance = 1;\n private int[][] moveOrdinance = ordinance; \n\n @Override \n public void actionPerformed(ActionEvent e){\n //update velocity values\n xVel = distance*moveOrdinance[ordinanceInd][0];\n yVel = distance*moveOrdinance[ordinanceInd][1]; \n\n //update image display fields\n if (ordinanceInd == 0){\n direction = Player.SOUTH;\n } else if (ordinanceInd == 3){\n direction = Player.WEST; \n } else if (ordinanceInd == 1){\n direction = Player.EAST; \n } else{\n direction = Player.NORTH; \n }\n displayVal = direction;\n\n //change direction\n ordinanceInd = (ordinanceInd+1)%4;\n }\n\n });\n \n tMovement.setInitialDelay(1);\n tMovement.start();\n tState.start();\n }", "public void updateTimer(){\n\t\tif(timer.isRunning()){ \n\t\t\ttimer.stop();\n\t\t\tmakeTimer();\n\t\t\ttimer.start();\n\t\t}else{\n\t\t\tmakeTimer();\n\t\t}\n\t}", "public void startHealing()\n\t{\n\t\ttimerList.clear();\n\t\tinHospitalTimer = new PlayPauseTimer(10, new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tworld.heal();\n\t\t\t\tx = random.nextInt(world.getSIMULATION_WIDTH() - individualSize);\n\t\t\t\ty = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize); \n\t\t\t\tmoveInPopulation();\n\t\t\t\texitHospital();\n\t\t\t\thealthStatus = HealthStatus.HEALTHY;\n\t\t\t\ttimerList.remove(inHospitalTimer);\n\t\t\t}\n\t\t\t\n\t\t}, world.getRefreshTime());\n\t\ttimerList.add(inHospitalTimer);\n\t}", "@Override\r\n public void run() {\n d2++;\r\n if (d2 == 1) {\r\n onReceive(new byte[]{Message.TIMER_MESSAGE, Message.TFP2_EXPIRE});\r\n }\r\n }", "@Test\n void testBallStuckAfterTimeOut() {\n assertFalse(goalie.IsBallStuck(ball.getPosition(), 0));\n // test the timer after 5 seconds should be true\n // timer resets\n assertTrue(goalie.IsBallStuck(ball.getPosition(), 5));\n\n // Next call should be false since ball was reset after the first.\n assertFalse(goalie.IsBallStuck(ball.getPosition(),6));\n }", "public static void startTimer() {\n elapsedTime = 0;\r\n timerIsWorking = true;\r\n startTime = System.nanoTime() / 1000000; // ms\r\n }", "public void timePassed() {\n this.moveOneStep();\n }", "private void trackerTimer() {\n\n Thread timer;\n timer = new Thread() {\n\n @Override\n public void run() {\n while (true) {\n\n if (Var.timerStart) {\n try {\n Var.sec++;\n if (Var.sec == 59) {\n Var.sec = 0;\n Var.minutes++;\n }\n if (Var.minutes == 59) {\n Var.minutes = 0;\n Var.hours++;\n }\n Thread.sleep(1000);\n } catch (Exception cool) {\n System.out.println(cool.getMessage());\n }\n\n }\n timerText.setText(Var.hours + \":\" + Var.minutes + \":\" + Var.sec);\n }\n\n }\n };\n\n timer.start();\n }", "public void nextTurn() {\r\n\r\n\t\t// System.out.println(\"nextTurn================================================================================================\" + this.DiceNumber);\r\n\t\tif (gameState == GameState.Playing) {\r\n\t\t\tif (!isPlayerCall && currentTurnPlayer != null && !currentTurnPlayer.getPlayerDetail().getIsRobot()) {\r\n\t\t\t\tif (currentTurnPlayer.PlayerTimeOutCall()) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcurrentTurnPlayer.addNoOperateTime();\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// current turn count add one.\r\n\t\t\tturnIndex++;\r\n\t\t\tisPlayerCall = false;\r\n\t\t\tcurrentTurnPlayer = findNextLiving();\r\n\t\t\tsendGameNextTurn(currentTurnPlayer, this);\r\n\r\n\t\t\t// if current player is robot,add robot logical action.\r\n\t\t\tif (currentTurnPlayer.getPlayerDetail().getIsRobot()\r\n\t\t\t\t\t|| currentTurnPlayer.getPlayerDetail().getIsRobotState()) {\r\n\t\t\t\tThreadSafeRandom random = new ThreadSafeRandom();\r\n\t\t\t\tAddAction(new RobotProcessAction(random.next(1, 6) * 1000, currentTurnPlayer));// 机器人随机一个叫的时间\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// if the player has trusteed the game,add trustee action to deal\r\n\t\t\t// with the condition.\r\n\t\t\t// if (currentTurnPlayer.getPlayerState() == PlayerState.Trustee)\r\n\t\t\t// {\r\n\t\t\t// AddAction(new TrusteePlayerAction(random.next(3, 6) * 1000,\r\n\t\t\t// currentTurnPlayer));\r\n\t\t\t// return;\r\n\t\t\t// }\r\n\r\n\t\t\t// this turn wait for 20 seconds.\r\n\t\t\tWaitTime(1000 * 20);// csf0423 以前是12 + 8\r\n\t\t\tonBeginNewTurn();\r\n\t\t}\r\n\t}", "@Override\n public void clock(@NonNull Mailbox incoming1, @NonNull Mailbox outgoing1) {\n this.incoming = incoming1;\n this.outgoing = outgoing1;\n // Extract expected messages\n this.levelMessage = extractOnlyMatch(MessageKind.LEVEL_v, incoming1);\n this.steamMessage = extractOnlyMatch(MessageKind.STEAM_v, incoming1);\n this.pumpStateMessages = extractAllMatches(MessageKind.PUMP_STATE_n_b, incoming1);\n this.pumpControlStateMessages = extractAllMatches(MessageKind.PUMP_CONTROL_STATE_n_b,\n incoming1);\n if (transmissionFailure(this.pumpStateMessages, this.pumpControlStateMessages)) {\n // Level and steam messages required, so emergency stop.\n this.mode = State.EMERGENCY_STOP;\n }\n\n if (this.mode == State.WAITING) {\n outgoing1.send(new Message(MessageKind.MODE_m, Mailbox.Mode.INITIALISATION));\n if (incoming1.contains(new Message(MessageKind.STEAM_BOILER_WAITING))) {\n if (this.steamMessage.getDoubleParameter() != 0) { // steam measuring device is defective\n this.mode = State.EMERGENCY_STOP;\n this.outgoing.send(new Message(MessageKind.MODE_m, Mailbox.Mode.EMERGENCY_STOP));\n return;\n }\n if (waterLevelFailure()) {\n this.outgoing.send(new Message(MessageKind.LEVEL_FAILURE_DETECTION));\n this.outgoing.send(new Message(MessageKind.MODE_m, Mailbox.Mode.EMERGENCY_STOP));\n this.mode = State.EMERGENCY_STOP;\n return;\n }\n this.mode = State.READY;\n this.waterLevel = this.levelMessage.getDoubleParameter();\n double level = this.levelMessage.getDoubleParameter();\n if (level > this.configuration.getMinimalNormalLevel()\n && level < this.configuration.getMaximalNormalLevel()) {\n this.outgoing.send(new Message(MessageKind.PROGRAM_READY));\n }\n }\n } else if (this.mode == State.READY) {\n if (this.incoming.contains(new Message(MessageKind.PHYSICAL_UNITS_READY))) {\n this.mode = State.NORMAL;\n this.outgoing.send(new Message(MessageKind.MODE_m, Mailbox.Mode.NORMAL));\n } else {\n initializationMode();\n }\n } else if (this.mode == State.NORMAL) {\n normalMode();\n } else if (this.mode == State.DEGRADED) {\n degradedMode();\n } else if (this.mode == State.RESCUE) {\n rescueMode();\n } else if (this.mode == State.EMERGENCY_STOP) {\n emergencyStopMode();\n }\n\n }", "public void startTimer(){\n timerStarted = System.currentTimeMillis();\n }", "public void startClock(){\n\n final Timer gTimer = new Timer();\n gTimer.schedule(new TimerTask() {\n @Override\n public void run() {\n //Log.e(\"GLOBAL TIMER\",\"RUNNING...\");\n if(!((MainActivity)context).isPaused) {\n //if they are dead, remove them from list\n Iterator<EnemyCharacter> iter0 = enemyFactory.enemies.iterator();\n while (iter0.hasNext()) {\n EnemyCharacter enemyCharacter = iter0.next();\n\n if (enemyCharacter.isDead) {\n iter0.remove();\n }\n }\n\n gTime++;\n //Reset the power ups on set intervals.\n if (gTime % 2000 == 0) {\n canGrowl = true;\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n bottomFragment.growl.setBackgroundResource(R.drawable.growl_btn);\n }\n });\n\n }\n if (gTime % 7000 == 0) {\n canTebow = true;\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n bottomFragment.tebow.setBackgroundResource(R.drawable.tebow_btn);\n }\n });\n }\n if (gTime % 5000 == 0) {\n canAlberta = true;\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n bottomFragment.alberta.setBackgroundResource(R.drawable.alberta_btn);\n }\n });\n }\n\n //INCREASE DIFFICULTY OVER TIME\n if (gTime < 1000) {\n difficulty = 1;\n } else if (gTime < 3000) {\n difficulty = 2;\n } else if (gTime < 7000) {\n difficulty = 3;\n } else if (gTime < 12000) {\n difficulty = 4;\n } else {\n difficulty = 5;\n }\n\n //USE DIFFICULTY TO CREATE ENEMIES\n if (difficulty == 1) {\n if (gTime % 400 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else if (difficulty == 2) {\n if (gTime % 300 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else if (difficulty == 3) {\n if (gTime % 300 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else if (difficulty == 4) {\n if (gTime % 200 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n } else {\n //Log.e(\"MAX\", \"Difficulty\");\n if (gTime % 100 == 0) {\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n enemyFactory.newEnemy(maxHeight, maxWidth, difficulty);\n }\n }\n\n //DO THE ANIMATIONS\n Iterator<EnemyCharacter> iter3 = enemyFactory.enemies.iterator();\n while (iter3.hasNext()) {\n EnemyCharacter enemyCharacter = iter3.next();\n\n //Do the animation and moving every ten times this timer runs\n if (gTime % 10 == 0) {\n enemyCharacter.animate();\n enemyCharacter.move();\n }\n }\n\n //TEBOW TO THE RESCUE WITH THE POWER OF JEEESUUUSS!\n if (drawTebow) {\n Iterator<EnemyCharacter> iter = enemyFactory.enemies.iterator();\n while (iter.hasNext()) {\n EnemyCharacter enemyCharacter = iter.next();\n if (enemyCharacter.x < maxWidth / 2) {\n tebow.setX(enemyCharacter.x - 100);\n tebow.setY(enemyCharacter.y);\n iter.remove();\n drawTebowCounter++;\n }\n if (drawTebowCounter >= 10) {\n drawTebow = false;\n drawTebowCounter = 0;\n }\n }\n }\n\n //REDRAW EVERYTHING CONSTANTLY\n ((MainActivity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n canvasView.invalidate();\n }\n });\n\n //CHECK TO SEE IF THE PLAYER LOST THE GAME OR IF ENEMY GETS AUTO-MAGICALLY CHOMPED\n Iterator<EnemyCharacter> iter1 = enemyFactory.enemies.iterator();\n while (iter1.hasNext()) {\n EnemyCharacter enemyCharacter = iter1.next();\n\n //Check if the player lost\n if (enemyCharacter.x < -50) {\n gameOver = true;\n }\n if (enemyCharacter.x < 50) {\n if ((enemyCharacter.y + enemyCharacter.bitmap.getHeight() / 2) > canvasView.albert.y) {\n if ((enemyCharacter.y + enemyCharacter.bitmap.getHeight() / 2) < canvasView.albert.y + canvasView.albert.bitmap.getHeight()) {\n //Enemy in range. Chomp him.\n enemyCharacter.isDead = true;\n score++;\n canvasView.albert.chomp(canvasView);\n bottomFragment = (BottomFragment) ((MainActivity) context).getSupportFragmentManager().findFragmentById(R.id.bottom_fragment);\n bottomFragment.updateScores();\n }\n }\n }\n }\n\n if (gameOver) {\n gTimer.purge();\n gTimer.cancel();\n restart();\n\n //launch play fragment dialog\n DialogFragment gameOverDialog = new PlayFragment.GameOverDialog();\n gameOverDialog.show(((MainActivity) context).getFragmentManager(), \"Game Over\");\n }\n }\n }//END OF GLOBAL TIMER RUN METHOD\n },0,10);\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile(gameTimer > 0 && !Timer.this.gameScene.popUp){\n\t\t\t\t\tcountDown();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tThread.sleep(10);\n\t\t\t\t\t}catch(InterruptedException e){\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\toutOfTime = true;\n\t\t\t}", "public void startWait() {\n\t\tTimer timer = new Timer();\n\t\ttimer.schedule(new TimerTask() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (server.getNumberOfPlayers() > 0 && !server.gameStartFlag) {\n\t\t\t\t\tserver.runGame();\n\t\t\t\t}\n\t\t\t}\n\t\t}, 120000);\n\t\t// 2min(2*60*1000)\n\t\tsendMessage(\"The game will start 2 minute late\");\n\t}", "public abstract void interactionStarts(long ms);", "public void timeToChallenger() {\n\n\n String c = null;\n for(PlayerInterface p : onlinePlayers){\n if(p.getNickname().equals(getCurrentTurn().getCurrentPlayer().getNickname())){\n c = p.getWorkerRef().get(0).getColor();\n break;\n }\n }\n notifyCards(getCurrentTurn().getCurrentPlayer().getNickname(), c);\n notifyChoose(cardsChosen, this.getAllGods(), this.getCurrentTurn().getCurrentPlayer().getNickname());\n }", "private void startTimer() {\n\n //call renewWord function once the timer is on\n renewWord();\n countDownTimer = new MyCountDown(totalTimeCountInMilliseconds, 50);\n countDownTimer.start();\n }", "private void startPingTimer() {\n\n Timer timer = new Timer();\n TimerTask task = new TimerTask() {\n @Override\n public void run() {\n\n if (pong) {\n send(\"<ping/>\");\n pong = false;\n } else {\n System.out.println(\"[CLIENT] No pong received. Client will now be disconnected.\");\n clientController.onMissingPong();\n closeConnection();\n timer.cancel();\n }\n\n }\n };\n timer.scheduleAtFixedRate(task, 0, 20000);\n\n }", "public void run() {\n\n switch( operation )\n {\n case \"Timer\":\n System.out.println( \"INFO : Timer started\" );\n try {\n // wait 7 seconds\n Thread.sleep( 7000 );\n if( !receivedOk )\n {\n // OK not received. Set self as leader\n LeaderState.getInstance().setLeaderID( ServerState.getInstance().getSelfID() );\n electionInProgress = false; // allow another election request to come in\n leaderFlag = true;\n System.out.println( \"INFO : Server s\" + LeaderState.getInstance().getLeaderID()\n + \" is selected as leader! \" );\n\n LeaderState.getInstance().resetLeader(); // reset leader lists when newly elected\n\n Runnable sender = new BullyAlgorithm( \"Sender\", \"coordinator\" );\n new Thread( sender ).start();\n }\n\n if( receivedOk && !leaderFlag )\n {\n System.out.println( \"INFO : Received OK but coordinator message was not received\" );\n\n electionInProgress = false;\n receivedOk = false;\n\n Runnable sender = new BullyAlgorithm( \"Sender\", \"election\" );\n new Thread( sender ).start();\n }\n }\n catch( Exception e ) {\n System.out.println( \"INFO : Exception in timer thread\" );\n }\n break;\n\n case \"Heartbeat\":\n while( true ) {\n try {\n Thread.sleep(10);\n if( leaderFlag && ServerState.getInstance().getSelfID() != LeaderState.getInstance().getLeaderID() ) {\n Thread.sleep( 1500 );\n Server destServer = ServerState.getInstance().getServers()\n .get( LeaderState.getInstance().getLeaderID() );\n\n MessageTransfer.sendServer(\n ServerMessage.getHeartbeat( String.valueOf(ServerState.getInstance().getSelfID()) ),\n destServer\n );\n //System.out.println( \"INFO : Sent heartbeat to leader s\" + destServer.getServerID() );\n }\n }\n\n catch( Exception e ) {\n leaderFlag = false;\n leaderUpdateComplete = false;\n System.out.println( \"WARN : Leader has failed!\" );\n // send election request\n Runnable sender = new BullyAlgorithm( \"Sender\", \"election\" );\n new Thread( sender ).start();\n }\n }\n\n case \"Sender\":\n switch( reqType ) {\n case \"election\":\n try {\n sendElectionRequest();\n } catch( Exception e ) {\n System.out.println( \"WARN : Server has failed, election request cannot be processed\" );\n }\n break;\n\n case \"ok\":\n try {\n sendOK();\n } catch( Exception e ) {\n e.printStackTrace();\n }\n break;\n\n case \"coordinator\":\n try {\n sendCoordinatorMsg();\n } catch( Exception e ) {\n e.printStackTrace();\n }\n break;\n }\n break;\n }\n }", "public void updateTimer() {\n this.machineCounter.setTimerValue(Config.MACHINE_TIMER);\n }", "@Override\n public void run() {\n if (timerValidFlag)\n gSeconds++;\n Message message = new Message();\n message.what = 1;\n handler.sendMessage(message);\n }", "protected void advanceTimer(long amount, TimeUnit timeUnit) {\r\n\t\tPseudoClockScheduler sessionClock = kieSession.getSessionClock();\r\n\t\tsessionClock.advanceTime(amount, timeUnit);\r\n\t}", "@Override\r\n public void run() {\n d1++;\r\n if (d1 == 1) {\r\n onReceive(new byte[]{Message.TIMER_MESSAGE, Message.TFP1_EXPIRE});\r\n }\r\n if (d1 == 10) {\r\n onReceive(new byte[]{Message.TIMER_MESSAGE, Message.TFP1_EXPIRE_N});\r\n }\r\n }", "@Override\n\tpublic void run() {\n\n\t\tint loop = 0;\n\n\t\tdo {\n\t\t\tthis.onCallTeam.setCountTimer(loop);\n\t\t\tloop++;\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException ex) {\n\t\t\t\tSystem.out.println(\"Interrupted\");\n\t\t\t}\n\t\t} while (loop != 900);// 15 minutes\n\n\t}", "public void updateGameTime() {\n\t\tGameTime = Timer.getMatchTime();\n\t}", "public void startTimer() {\n mStatusChecker.run();\n }", "public void startTurn() {\r\n\t\tbought.clear();\r\n\t\tdeck.gained.clear();\r\n\t\tfor(int i = deck.duration.size() - 1; i >= 0; i--) {\r\n\t\t\tdeck.duration.get(i).durationAction();\r\n\t\t}\r\n\t\tnotifyObservers();\r\n\t\taccess.log(getPlayerName() + \"'s turn started\");\r\n\t\tif(ai != null) ai.takeTurn();\r\n\t}", "public void passTime(){\n growPop();\n growGdp();\n growSocial();\n growLiving();\n }", "public void act() \n {\n updateTimerDisplay();\n if(timeCounter < 3600){\n timeCounter++;\n \n }else{\n timeElapsed++;\n timeCounter = 0;\n }\n checkHighScore();\n checkRegScore();\n\n }", "public void startOppTurn(GameState state) {\n }", "@Test\n void testBallStuckAfterMoving() {\n assertFalse(goalie.IsBallStuck(ball.getPosition(), 0));\n // ball moves\n ball.setPosition(1f,1f);\n // timer shuold be reset from first call\n assertFalse(goalie.IsBallStuck(ball.getPosition(), 1));\n // This is five seconds since move should reprot stuck\n assertTrue(goalie.IsBallStuck(ball.getPosition(), 5));\n }", "private void SecondStateFiringChecks()\n {\n List<Player> AffectedPlayers = game.GetAffectedPlayers(geoTarget, game.GetConfig().GetBlastRadius(missileType));\n\n if(AffectedPlayers.size() == 1)\n {\n final Player affectedPlayer = AffectedPlayers.get(0);\n\n if(lLastWarnedID != affectedPlayer.GetID() && affectedPlayer.GetRespawnProtected())\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_respawn_protected, affectedPlayer.GetName(), TextUtilities.GetTimeAmount(affectedPlayer.GetStateTimeRemaining())));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else if(lLastWarnedID != affectedPlayer.GetID() && game.GetNetWorthMultiplier(game.GetOurPlayer(), affectedPlayer) < Defs.NOOB_WARNING)\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_noob, affectedPlayer.GetName()));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else if(lLastWarnedID != affectedPlayer.GetID() && game.GetNetWorthMultiplier(game.GetOurPlayer(), affectedPlayer) > Defs.ELITE_WARNING)\n {\n final LaunchDialog launchDialog = new LaunchDialog();\n launchDialog.SetHeaderLaunch();\n launchDialog.SetMessage(context.getString(R.string.attacking_elite, affectedPlayer.GetName()));\n launchDialog.SetOnClickYes(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n lLastWarnedID = affectedPlayer.GetID();\n Launch();\n }\n });\n launchDialog.SetOnClickNo(new View.OnClickListener()\n {\n @Override\n public void onClick(View view)\n {\n launchDialog.dismiss();\n }\n });\n launchDialog.show(activity.getFragmentManager(), \"\");\n }\n else\n {\n Launch();\n }\n }\n else\n {\n Launch();\n }\n }", "@Override\n public void timePassed() {\n moveOneStep();\n }", "@Override\n public void run() {\n if (time == 0) {\n // wait has ended time to teleport\n if (!Utils.homeExists(homeOwner, homeName)) {\n // the has since been deleted whilst waiting\n p.sendMessage(\"There was an error teleporting you.\");\n cancel();\n return;\n }\n Utils.teleportPlayer((Player) sender, homeOwner, homeName);\n sender.sendMessage(Utils.chat(plugin.getConfig().getString(\"teleport-color\") + plugin.getConfig().getString(\"teleport-message\")));\n cancel();\n return;\n }\n Location currentLocation = ((Player) sender).getLocation();\n if (initialLocation.getX() != currentLocation.getX() ||\n initialLocation.getY() != currentLocation.getY() ||\n initialLocation.getZ() != currentLocation.getZ()) {\n // they've moved and the config says to cancel on move\n sender.sendMessage(Utils.chat(plugin.getConfig().getString(\"move-cancel-message\")));\n cancel();\n }\n else {\n sender.sendMessage(Utils.chat(plugin.getConfig().getString(\"countdown-message\").replace(\"<time>\", Integer.toString(time))));\n time--;\n }\n }", "public void updateState() {\n\n // After each frame, the unit has a slight morale recovery, but only up to the full base morale.\n morale = Math.min(morale + GameplayConstants.MORALE_RECOVERY, GameplayConstants.BASE_MORALE);\n\n if (morale < GameplayConstants.PANIC_MORALE) {\n state = UnitState.ROUTING;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.ROUTING);\n }\n } else if (state == UnitState.ROUTING && morale > GameplayConstants.RECOVER_MORALE) {\n this.repositionTo(averageX, averageY, goalAngle);\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.MOVING);\n }\n }\n\n // Update the state of each single and the average position\n double sumX = 0;\n double sumY = 0;\n double sumZ = 0;\n int count = 0;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.updateState();\n sumX += single.getX();\n sumY += single.getY();\n sumZ += single.getZ();\n count += 1;\n }\n averageX = sumX / count;\n averageY = sumY / count;\n averageZ = sumZ / count;\n\n // Updating soundSink\n soundSink.setX(averageX);\n soundSink.setY(averageY);\n soundSink.setZ(averageZ);\n\n // Update the bounding box.\n updateBoundingBox();\n\n // Update stamina\n updateStamina();\n }", "public static void initTimer(){\r\n\t\ttimer = new Timer();\r\n\t timer.scheduleAtFixedRate(new TimerTask() {\r\n\t public void run() {\r\n\t \t//se o player coletar todas os lixos, o tempo para\r\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 }\r\n\t\t}, 1000, 1000);\r\n\t}", "private void setNewTimer() {\n if (!isSetNewTimerThreadEnabled) {\n return;\n }\n\n timer = new Timer();\n timer.scheduleAtFixedRate(new TimerTask() {\n\n @Override\n public void run() {\n // Send the message to the handler to update the UI of the GameView\n GameActivity.this.handler.sendEmptyMessage(UPDATE);\n\n // For garbage collection\n System.gc();\n }\n\n }, 0, 17);\n }", "public void walking(final Player p){\n timerListener = new ActionListener()\n {\n public void actionPerformed(ActionEvent e)\n {\n //test to see if the player is currently jumping\n if(jumpState != 2){\n //if the player is not jumping this if else statement will\n //change the character from leg out to leg in position\n if(jumpState == 1){\n //sets the image to have the leg in\n jumpState = 0;\n }\n else{\n //sets the image to have the leg out\n jumpState = 1;\n }\n\n }\n\n }\n };\n //creates the timer for continous animation of walkListener\n walker = new Timer(getWalkSpeed(), timerListener);\n //starts timer for walk animation\n walker.start();\n ActionListener walkIncListener = new ActionListener()\n {\n public void actionPerformed(ActionEvent e)\n {\n if (getWalkSpeed() > WALK_SPEED_MIN)\n {\n System.out.println(\"1\");\n walker.stop();\n incWalkSpeed(getWalkSpeedInc());\n walker = new Timer(getWalkSpeed(), timerListener);\n walker.start();\n }\n else\n {\n walkInc.stop();\n System.out.println(\"2\");\n }\n\n }\n };\n walkInc = new Timer(WALK_SPEED, walkIncListener);\n //starts timer for walk animation\n walker.start();\n ActionListener dead = new ActionListener()\n {\n public void actionPerformed(ActionEvent e)\n {\n if(p.isAlive() == false){\n walker.stop();\n }\n }\n };\n Timer kill = new Timer(100, dead);\n kill.start();\n\n }", "private void setTimer() {\r\n timer = new Timer(TIMER_DELAY, new ActionListener() {\r\n public void actionPerformed(ActionEvent ae) {\r\n action();\r\n }\r\n });\r\n }", "protected void processTimer(){\n if(timer != null){\n timer.cancel();\n timer = null;\n }\n // Verificamos si el partido esta en progreso\n if(match.status == Match.STATUS_PENDING || match.status == Match.STATUS_ENDED){\n return;\n }\n // Creamos temporizador 90 * 60 * 1000 = 5.400.000\n timer = new CountDownTimer(5400000, 1000) {\n @Override\n public void onTick(long l) {\n // Calcular los segundos que pasaron\n long seconds = (new Date().getTime() - matchDayLong) / 1000;\n // Calcular los minutos del partido\n long minutes = seconds / 60;\n //long minutes = TimeUnit.MILLISECONDS.toMinutes(uptime);\n if(minutes < 0){\n minutes = 0;\n seconds = 0;\n statusMedium.setText(\"PT\");\n }if(minutes > 45 && minutes < 60){\n minutes = 45;\n seconds = 60;\n }else if(minutes > 90){\n minutes = 90;\n seconds = 60;\n statusMedium.setText(\"ST\");\n }else if(minutes >= 60){\n minutes -= 15;\n statusMedium.setText(\"ST\");\n }else{\n statusMedium.setText(\"PT\");\n }\n\n statusTime.setText(String.format(\"%02d:%02d\", minutes, (seconds%60)));\n }\n\n @Override\n public void onFinish() {\n\n }\n }.start();\n }", "private void getOneToteTimer()\r\n\t{\r\n\t\tswitch(autoStep)\r\n\t\t{\r\n\t\t\tcase 0:\r\n\t\t\t{\r\n\t\t\t\tpickUpTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcase 1:\r\n\t\t\t{\r\n\t\t\t\tdriveForwardTimer();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "public abstract void isCorrectionTurn(long ms);", "protected void timeout(Object data_) \n\t{\n\t\tif ( data_ instanceof DiffTimer )\n\t\t{\n\t\t\tDiffTimer d = (DiffTimer)data_ ;\n\t\t\tint type = d.EVT_Type ;\n\t\t\tif(pendingInterest!=null && type!=DiffTimer.TIMEOUT_DELAY_BROADCAST){\n\t\t\t\tsendPacket(pendingInterest, 0.0) ;\n\t\t\t}\n\t\t\tswitch ( type )\n\t\t\t{\n\t\t\t\tcase DiffTimer.TIMEOUT_SEND_REINFORCEMENT :\n\t\t\t\t\tsendReinforcements() ;\n\n\t\t\t\t\t/*// if the size of the dataCache has become 0, there is no need for the timer. The timer will be set next time dataCache_insert is called. \n\t\t\t\t\tif ( (dataCache.size() == 0) && (reinforcementTimer.handle != null) )\n\t\t\t\t\t{\n\t\t\t\t\t\tcancelTimeout(reinforcementTimer.handle) ;\n\t\t\t\t\t\treinforcementTimer.setObject(null) ;\n\t\t\t\t\t\treinforcementTimer.handle = null ; \n\t\t\t\t\t\treinforcementTimer = null ;\n\t\t\t\t\t}\n\t\t\t\t\telse{*/\n\t\t\t\t\t//\t reset the timer. \n\t\t\t\t\t\treinforcementTimer.handle = setTimeout(reinforcementTimer, REINFORCE_WINDOW) ;\n\t\t\t\t\t//}\n\t\t\t\t\tbreak ;\n\t\t\t\tcase DiffTimer.TIMEOUT_INTEREST_CACHE_PURGE :\n\t\t\t\t\tinterestCachePurge() ;\n\n\t\t\t\t\t/* if the size of the interestCache has become 0, there is no need for the timer. The timer will be set next time interestCache_insert is called. */\n\t\t\t\t\tif ( (interestCache.size() == 0) && (interestCache_purgeTimer.handle != null) )\n\t\t\t\t\t{\n\t\t\t\t\t\tcancelTimeout(interestCache_purgeTimer.handle) ;\n\t\t\t\t\t\tinterestCache_purgeTimer.setObject(null) ;\n\t\t\t\t\t\tinterestCache_purgeTimer.handle = null ; \n\t\t\t\t\t\tinterestCache_purgeTimer = null ;\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/* reset the timer. */\n\t\t\t\t\t\tinterestCache_purgeTimer.handle = setTimeout(interestCache_purgeTimer, INTEREST_CACHE_PURGE_INTERVAL) ;\n\t\t\t\t\t}\n\t\t\t\t\tbreak ;\n\t\t\t\tcase DiffTimer.TIMEOUT_DELAY_BROADCAST :\n\t\t\t\t\t\n\t\t\t\t\tif ( d.getObject() instanceof InterestPacket )\n\t\t\t\t\t{\n\t\t\t\t\t\tsendPacket((InterestPacket)(d.getObject()), 0.0) ;\n\t\t\t\t\t}\n\t\t\t\t\telse if ( d.getObject() instanceof DataPacket )\n\t\t\t\t\t{\n\t\t\t\t\t\tDataPacket dataPkt = (DataPacket)(d.getObject()) ;\n\t\t\t\t\t\tsendPacket(dataPkt, 0.0) ;\n\t\t\t\t\t}\n\t\t\t\t\telse if ( d.getObject() instanceof ReinforcementPacket )\n\t\t\t\t\t{\n\t\t\t\t\t\tReinforcementPacket pstvReinforcementPkt = (ReinforcementPacket)(d.getObject()) ;\n\t\t\t\t\t\tsendPacket(pstvReinforcementPkt, 0.0) ;\n\t\t\t\t\t}\n\t\t\t\t\tbreak ;\n\t\t\t\tcase DiffTimer.TIMEOUT_REFRESH_INTEREST :\n\t\t\t\t\t\n\t\t\t\t\tInteger I = (Integer)(d.getObject()) ;\n\t\t\t\t\tint taskId = I.intValue() ;\n\t\t\t\t\tTaskEntry taskEntry = activeTasksList.get(taskId) ;\n\t\t\t\t\tInterestPacket interest= taskEntry.getInterest();\n\t\t\t\t\t//if ( (getTime() - taskEntry.getStartTime()) <= interest.getDuration()) /* depends on getTime() - interest start time */\n\t\t\t\t\t//{\n\t\t\t\t\t\tif ( isDebugEnabled() )\n\t\t\t\t\t\t\tSystem.out.println(\"DiffApp \" + nid + \": Sending INTEREST packet at time \" + getTime()) ;\n\t\t\t\t\t\tinterest.setTimestamp(getTime());\n\t\t\t\t\t\tsendPacket(interest, 0.0 ) ;\n\t\t\t\t\t\tDiffTimer refresh_EVT = new DiffTimer(DiffTimer.TIMEOUT_REFRESH_INTEREST, new Integer(taskId)); \n\t\t\t\t\t\trefresh_EVT.handle = setTimeout(refresh_EVT, taskEntry.getRefreshPeriod()) ;\n\t\t\t\t\t/*}\n\t\t\t\t\telse if ( d.handle != null )\n\t\t\t\t\t{\n\t\t\t\t\t\t// The task state has to be purged from the node after the time indicated by the duration attribute. \n\t\t\t\t\t\tactiveTasksList.remove(taskId) ;\n\t\t\t\t\t}*/\n\t\t\t\t\tcancelTimeout(d.handle) ;\n\t\t\t\t\td.setObject(null) ;\n\t\t\t\t\td.handle = null ;\n\t\t\t\t\tbreak ;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmicroLearner.timeout(data_) ;\n\t\t} \n\t}", "private void initTimer(){\r\n\t\ttimer = new Timer() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tdisplayNext();\r\n\t\t\t}\r\n\t\t};\r\n\t}", "public void checkGameStatus() {\n everyTenthGoalCongrats();\n randomPopUpBecauseICan();\n }", "public void start() {timer.start();}", "public void printSimulationState(){\n\n boolean flagActive = false;\n\n //boolean unloadPassengersNow = false;\n \n boolean timeHasArrived = false;\n \n //sleeps for 20 to allow threads to run\n try{\n Thread.sleep(20);\n }catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n \n //configures flags\n for(int i = 0; i< a; i++){ \n if(flagActive != true)\n flagActive = (elevatorArray[i].getScanCompleteFlag() || elevatorArray[i].getScannedBuildingFloorFlag());\n\n \n //System.out.println(\"====\" + SimClock.getTime());\n //System.out.println(\"====\" + elevatorArray[i].getMoveQueue().get(0).getExpectedArrival());\n \n if(timeHasArrived != true){\n if ((SimClock.getTime() >= nextArrivalTime) && (nextArrivalTime != -2)){\n timeHasArrived = true;\n }\n \n if (elevatorArray[i].getMoveQueue().size() > 0){\n nextArrivalTime = elevatorArray[i].getMoveQueue().get(0).getExpectedArrival();\n }else{\n nextArrivalTime = -2;\n }\n }\n \n if (flagActive && timeHasArrived){\n break;\n }\n }\n\n \n if(flagActive || timeHasArrived){\n System.out.println(\"********************** @\" + (SimClock.getTime()) + \" Simulated Seconds **********************\"); \n \n System.out.println(\"Building Floors:\");\n for(int i = 0; i < aBuildingManager.getFloors().length; i++){\n int[] passengerRequestArray = aBuildingManager.getFloors()[i].getPassengerRequests();\n System.out.println(\" \" + \"Floor \" + (i+1) + \": \" + Arrays.toString(passengerRequestArray));\n }\n System.out.println();\n \n for (int i = 0; i< a; i++){\n System.out.println();\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \"\\n\" + \"# of Passengers: \" + Arrays.toString(elevatorArray[i].getPassengerDestinations()) + \"\\n\" + \"Current Floor: \" + (elevatorArray[i].getCurrentFloor()+1) + \n \"\\nTotal Unloaded Passengers: \" + elevatorArray[i].getTotalUnloadedPassengers() + \"\\n\" + \"Total Loaded Passengers: \" + elevatorArray[i].getTotalLoadedPassengers() );\n System.out.println(\"=============================================================\");\n } \n \n\n \n for (int i = 0; i < a; i++){\n //checking to see if there exists passengersToUnload and prints corresponding output\n\n if(elevatorArray[i].getPassengersToUnload() != 0){ \n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" has arrived at Floor \" + (elevatorArray[i].getCurrentFloor()+1) + \" to unload passengers.\\n - \" + \n elevatorArray[i].getPassengersToUnload() + \" passengers are exiting the elevator.\");\n System.out.println(\"=============================================================\");\n elevatorArray[i].resetPassengersToUnload();\n }\n \n if(elevatorArray[i].getScanCompleteFlag()){\n \n //prevFloorArray[i] = -1;\n //floorChanged = false;\n \n System.out.println();\n System.out.println(\"=============================================================\");\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" has arrived at Floor \" + (elevatorArray[i].getCurrentFloor()+1) + \" and picked up \" + elevatorArray[i].getNumPassengers() + \" passenger(s).\");\n \n // iterating through each PassengerDestination in the Elevator to specify each floor's destination and amount\n // of passengers wanting to go to said floor\n for (int k = 0; k < elevatorArray[i].getPassengerDestinations().length; k++){\n if (elevatorArray[i].getPassengerDestinations()[k] != 0)\n System.out.println(\" - \" + elevatorArray[i].getPassengerDestinations()[k] + \" passenger(s) will go to Floor \" + (k+1));\n \n }\n System.out.println(\"=============================================================\");\n elevatorArray[i].resetScanCompleteFlag();\n continue;\n \n // checking if ScanBuildingFloorFlag() triggered\n }else if(elevatorArray[i].getScannedBuildingFloorFlag()){\n System.out.println(\"Elevator \" + elevatorArray[i].getElevatorID() + \" will go to Floor \" + (elevatorArray[i].getMoveQueue().get(0).getDestination()+1) + \" to load passengers.\");\n \n //prevFloorArray[i] = -2;\n elevatorArray[i].resetScannedBuildingFloorFlag();\n continue;\n }\n }\n \n flagActive = false;\n timeHasArrived = false; \n System.out.println();\n }\n \n\n}", "private synchronized void teamVictory() {\n \t\tif (state == MatchState.ONVICTORY || state == MatchState.ONCOMPLETE || state == MatchState.ONCANCEL) \n \t\t\treturn;\n \t\tstate = MatchState.ONVICTORY;\n \t\t/// Call the rest after a 2 tick wait to ensure the calling transitionMethods complete before the\n \t\t/// victory conditions start rolling in\n \t\tBukkit.getScheduler().scheduleSyncDelayedTask(plugin, new MatchVictory(this),2L);\n \t}", "@Override\n public void actionPerformed(ActionEvent e) {\n timer.start();\n if (!gameOver) {\n checkApple();\n checkCollision();\n move();\n }\n repaint();\n\n }", "private void startReadyTimer(boolean newPlayerReady) {\r\n\t\t// Make sure that the server is not full\r\n\t\t// Otherwise, start the game right away\r\n\t\tthis.currentTimerNo++;\r\n\t\tif (this.currentTimerNo > Integer.MAX_VALUE / 2)\r\n\t\t\tthis.currentTimerNo = 0;\r\n\r\n\t\t// Only create a timer to start the game if a timer currently isn't\r\n\t\t// running or if a new player became ready, preventing multiple games\r\n\t\t// from starting\r\n\t\tif (newPlayerReady || !this.lobbyTimerActive) {\r\n\t\t\tif (this.players.size() < 6) {\r\n\t\t\t\tthis.lobbyTimerActive = true;\r\n\t\t\t\tlong startTime = System.nanoTime();\r\n\r\n\t\t\t\t// Create new thread to prevent interference with other\r\n\t\t\t\t// activities\r\n\t\t\t\tnew Thread(new Updatable(this.currentTimerNo) {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t// Keep checking if the entire lobby is ready until the\r\n\t\t\t\t\t\t// number of seconds specified by the\r\n\t\t\t\t\t\t// 'Server#START_DELAY' constant is reached\r\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}\r\n\t\t\t\t}).start();\r\n\t\t\t}\r\n\t\t\t// Skip the timer if the lobby is full and all the players are ready\r\n\t\t\t// because it's not possible for more players to join.\r\n\t\t\telse if (this.players.size() == this.playersReady) {\r\n\t\t\t\tthis.startGame();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void startClock() {\r\n\t\tTimer timer = new Timer(500, new ActionListener() {\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent theEvent) {\r\n\t\t\t\tadvanceTime();\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n timer.setRepeats(true);\r\n timer.setCoalesce(true);\r\n timer.setInitialDelay(0);\r\n timer.start();\r\n\t}", "private void setupAnimationTimer() {\n new AnimationTimer() {\n @Override\n public void handle(long l) {\n view.movePlayer();\n view.updateView();\n }\n }.start();\n\n // Timeline for UI stuff\n uiTimeline = new Timeline();\n\n KeyFrame keyStart = new KeyFrame(\n Duration.seconds(0),\n e -> view.updateUI((1160 / distance) * 0.005)\n );\n KeyFrame keyEnd = new KeyFrame(Duration.millis(5));\n\n uiTimeline.getKeyFrames().addAll(keyStart, keyEnd);\n uiTimeline.setCycleCount(Timeline.INDEFINITE);\n uiTimeline.setAutoReverse(false);\n\n countdownTimer = new Timeline(\n new KeyFrame(\n Duration.seconds(distance - (1160 / distance) * 0.005),\n e -> journeyComplete()\n )\n );\n\n // Timeline for asteroids\n Timeline asteroidTimer = new Timeline(\n new KeyFrame(Duration.millis(2000), e -> model.AsteroidPool.spawn())\n );\n asteroidTimer.setCycleCount(Timeline.INDEFINITE);\n asteroidTimer.play();\n }", "private void timerAction(){\n \n timerEnd();\n \n if (timerCounter == TEST_TARGET_APPERANCE + testTargetDelay){\n manageTestTarget();\n }\n \n if (timerCounter == TEST_TARGET_DISAPPERANCE + testTargetDelay){\n labelArray[TEST_TARGET_LOCATION].setIcon(iconSet.getGrayIcon());\n //System.out.println(\"Test End\");\n }\n //creates clickable red target in random, non occupied location\n //and handles removal of unclicked, expired targets\n int randRedTarget = generator.nextInt(100);\n while(labelArray[randRedTarget].getIcon()!=iconSet.getGrayIcon()){\n //System.out.println(\"Already a target in place\");\n randRedTarget = generator.nextInt(100);\n }\n labelArray[randRedTarget].setIcon(iconSet.getRedTargetIcon());\n \n if (timerCounter<ACTIVE_RED_TARGET_TOTAL){\n activeRedTarget[timerCounter] = randRedTarget;\n }\n \n if (timerCounter>=ACTIVE_RED_TARGET_TOTAL){\n if(labelArray[activeRedTarget[0]].getIcon()!=iconSet.getGrayIcon()){\n labelArray[activeRedTarget[0]].setIcon(iconSet.getGrayIcon());\n }\n for(int i = 0; i < activeRedTarget.length-1; i++){\n activeRedTarget[i] = activeRedTarget[i+1];\n }\n activeRedTarget[ACTIVE_RED_TARGET_TOTAL-1] = randRedTarget;\n }\n\n if (timerCounter%4==0){\n manageBlueTargets();\n }\n \n timerCounter++;\n \n if (timerCounter%4==0){\n manageGreenTargets();\n }\n \n System.out.println(\"Timer: \" + timerCounter); \n }", "public void startTurn(){\n if (hasWinner()){\n announceWinner();\n return;\n }\n\n gameDraft();\n gameAttack();\n if (hasWinner()) return; //Skipping fortify if the game is won\n gameFortify();\n displayMessage(\"End of \" + currentPlayer.getName() + \"'s turn!\");\n }", "public void showTimeLeft(int time, String state);", "public void nextTurn() {\n visionChanged = true;\n SoundPlayer.playEndTurn();\n // Check if any protection objectives have failed\n gameState.updateAllHeroProtectionGoals(getHeroManager());\n // hook the next turn\n if (!multiplayerGameManager.hookNextTurn()) {\n\n if (map.enemyPerformingMove()) {\n return;\n }\n // Enemy action was made\n if (playerTurn && map.hasEnemy()) {\n try {\n map.enemyTurn(this);\n } catch (InterruptedException e) {\n logger.error(\"ayylmao at the GameManager.nextTurn(..) Method\");\n Platform.exit();\n Thread.currentThread().interrupt();\n }\n } else {\n map.playerTurn(this);\n updateBuffIcons();\n updateTempVisiblePoints();\n map.turnTick();\n for(CurrentHeroChangeListener listener:heroChangeListeners){\n \tlistener.onHeroChange(getHeroManager().getCurrentHero());\n }\n }\n\n } else {\n moveViewTo(getHeroManager().getCurrentHero().getX(), getHeroManager().getCurrentHero().getY());\n updateBuffIcons();\n updateTempVisiblePoints();\n }\n\n map.updateVisibilityArray();\n dayNightClock.tick();\n turnTickLiveTiles();\n abilitySelected = AbilitySelected.MOVE;\n abilitySelectedChanged = true;\n backgroundChanged = true;\n gameChanged = true;\n minimapChanged = true;\n saveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n // update(this.tracker,null);\n }", "public void nextTurn() {\n\t\tLog.d(TAG, \"nextTurn()\");\t\t\n\t\ttickPeople();\n\t\t//doEvents();\n\t\tupdateBar();\n\t}" ]
[ "0.584548", "0.5604632", "0.5580702", "0.55683094", "0.5418984", "0.535996", "0.5357539", "0.5352888", "0.5313491", "0.5311396", "0.525725", "0.52314645", "0.51944804", "0.5190477", "0.51805687", "0.51787573", "0.51775753", "0.5157829", "0.5132049", "0.5122746", "0.5105628", "0.50653905", "0.506377", "0.5062708", "0.5057119", "0.5018712", "0.5018652", "0.49987563", "0.49755806", "0.497431", "0.49594915", "0.49384803", "0.4935814", "0.49281037", "0.4924866", "0.49215987", "0.49092734", "0.48889327", "0.48887062", "0.4878539", "0.48744375", "0.4863771", "0.4844827", "0.48440313", "0.4839125", "0.48306873", "0.48254818", "0.48239595", "0.48157698", "0.48112616", "0.4808478", "0.4807551", "0.4805154", "0.47818163", "0.47731864", "0.47697523", "0.47689867", "0.4758348", "0.4757876", "0.47503096", "0.47483557", "0.4748244", "0.4745682", "0.47397786", "0.47336632", "0.47303498", "0.47299236", "0.47296605", "0.47257382", "0.47255364", "0.4723026", "0.47186247", "0.47141808", "0.47069836", "0.46997398", "0.46971402", "0.46931642", "0.46885264", "0.46880135", "0.4687438", "0.46873134", "0.46865076", "0.46760437", "0.4670261", "0.46701926", "0.4668107", "0.46631765", "0.4657345", "0.46514362", "0.46426997", "0.4635496", "0.4631836", "0.46300942", "0.46292531", "0.46244356", "0.46241832", "0.46223533", "0.46222794", "0.4622043", "0.46216947" ]
0.65114266
0
This function tries to change current state to moving state. If change is valid, individual starts moving on simulation map.
public void moveInPopulation() { synchronized (this) { currentState.moveInPopulation(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean changeMove();", "@Override\r\n\tpublic void move() {\n\t\tPoint target = strategy.search(this.getLocation(), new Point(0,0));\r\n\r\n\t\tint tries = 0;\r\n\t\t\r\n\t\twhile(!state.equals(\"Inactive\") && !game.movement(this, target.x, target.y)){\r\n\t\t\ttarget = strategy.search(new Point(x,y),playerLocation);\r\n\t\t\ttries++;\r\n\t\t\tif(tries > 4) return; // the search strategy has 4 tries to pick a valid location to move to\r\n\t\t}\r\n\t\t\r\n\t\tx = target.x;\r\n\t\ty = target.y;\r\n\r\n\t\tmoveSprite();\r\n\t}", "public void setStateOfMovement(int movementState){stateOfMovement = movementState; }", "public void paradiseMove(){\n if (!getCurrentMainCellCoordinates().equals(new DiscreteCoordinates(11, 9))) {\n move(30);\n }\n }", "private void changeState() {\n if (jobs.contains(this.currentFloor)){\n throw new AssertionError(\"Changing state of elevator no \" + ElevatorID + \" on destination floor\");\n }\n\n // empty job set -> going to IDLE state\n if (jobs.size() == 0) {\n this.currentState = IDLE;\n return;\n }\n\n Integer closestFloorDownwards = jobs.floor(this.currentFloor);\n Integer closestFloorUpwards = jobs.ceiling(this.currentFloor);\n\n switch (this.currentState) {\n // if elevator is in idle state then we need to go to the closest job possible\n case IDLE -> {\n Integer closestFloor =\n findClosestFloor(this.currentFloor, closestFloorUpwards, closestFloorDownwards);\n\n if (closestFloor < this.currentFloor) {\n this.currentState = DOWN;\n } else {\n this.currentState = UP;\n }\n }\n case DOWN -> {\n if (closestFloorDownwards != null) { // if there exists a predecessor in `jobs`\n this.currentState = DOWN; // let's continue going down\n } else {\n this.currentState = UP; // otherwise we need to go up\n }\n }\n case UP -> {\n if (closestFloorUpwards != null) { // if there exists a successor in `jobs`\n this.currentState = UP; // let's continue going up\n } else {\n this.currentState = DOWN; // otherwise we need to go down\n }\n }\n }\n }", "public void move() {\n\t\tif(right) {\n\t\t\tgoRight();\n\t\t\tstate++;\n\t\t\tif(state > 5) {\n\t\t\t\tstate = 3;\n\t\t\t}\n\t\t}\n\t\telse if(left) {\n\t\t\tgoLeft();\n\t\t\tstate++;\n\t\t\tif(state > 2) {\n\t\t\t\tstate = 0;\n\t\t\t}\n\t\t}\n\t}", "protected void move()\n {\n // Find a location to move to.\n Debug.print(\"Fish \" + toString() + \" attempting to move. \");\n Location nextLoc = nextLocation();\n\n // If the next location is different, move there.\n if ( ! nextLoc.equals(location()) )\n {\n // Move to new location.\n Location oldLoc = location();\n changeLocation(nextLoc);\n\n // Update direction in case fish had to turn to move.\n Direction newDir = environment().getDirection(oldLoc, nextLoc);\n changeDirection(newDir);\n Debug.println(\" Moves to \" + location() + direction());\n }\n else\n Debug.println(\" Does not move.\");\n }", "public void updateState() {\n\n // After each frame, the unit has a slight morale recovery, but only up to the full base morale.\n morale = Math.min(morale + GameplayConstants.MORALE_RECOVERY, GameplayConstants.BASE_MORALE);\n\n if (morale < GameplayConstants.PANIC_MORALE) {\n state = UnitState.ROUTING;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.ROUTING);\n }\n } else if (state == UnitState.ROUTING && morale > GameplayConstants.RECOVER_MORALE) {\n this.repositionTo(averageX, averageY, goalAngle);\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.switchState(SingleState.MOVING);\n }\n }\n\n // Update the state of each single and the average position\n double sumX = 0;\n double sumY = 0;\n double sumZ = 0;\n int count = 0;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n single.updateState();\n sumX += single.getX();\n sumY += single.getY();\n sumZ += single.getZ();\n count += 1;\n }\n averageX = sumX / count;\n averageY = sumY / count;\n averageZ = sumZ / count;\n\n // Updating soundSink\n soundSink.setX(averageX);\n soundSink.setY(averageY);\n soundSink.setZ(averageZ);\n\n // Update the bounding box.\n updateBoundingBox();\n\n // Update stamina\n updateStamina();\n }", "public void move() {\n\n if (_currentFloor == Floor.FIRST) {\n _directionOfTravel = DirectionOfTravel.UP;\n }\n if (_currentFloor == Floor.SEVENTH) {\n _directionOfTravel = DirectionOfTravel.DOWN;\n }\n\n\n if (_directionOfTravel == DirectionOfTravel.UP) {\n _currentFloor = _currentFloor.nextFloorUp();\n } else if (_directionOfTravel == DirectionOfTravel.DOWN) {\n _currentFloor = _currentFloor.nextFloorDown();\n }\n\n if(_currentFloor.hasDestinationRequests()){\n stop();\n } \n\n }", "public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tif (gr.isValid(next)) {\n\t\t\tsetDirection(getLocation().getDirectionToward(next));\n\t\t\tmoveTo(next);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t\tFlower flower = new Flower(getColor());\n\t\tflower.putSelfInGrid(gr, loc);\n\t}", "void simulateMove(CheckersData cur_board, CheckersMove move, int player) {\n\n cur_board.makeMove(move);\n\n /* If the move was a jump, it's possible that the player has another\n jump. Check for legal jumps starting from the square that the player\n just moved to. If there are any, the player must jump. The same\n player continues moving. That means their could be another choice to make.\n */\n if (move.isJump()) {\n CheckersMove[] newMoves;\n newMoves = cur_board.getLegalJumpsFrom(player, move.toRow, move.toCol);\n if (newMoves != null) {\n simulateMove(cur_board, newMoves[0], player);\n }\n \t // we have to keep jumping until we can't! If there is more than one jump\n // we are just going to have to pick the first one. More logic could go here\n }\n return;\n }", "public void resetMove() {\n\t\tthis.moveMade = false;\n\t}", "public abstract boolean attemptMove(Player currentPlayerObj, Coordinate move);", "void update() {\n if (gameState.states > 1)\n move();\n }", "public boolean makeMove(GameState gameState);", "public void move() {\n if (!canMove) {\n return;\n }\n int moveX = currDirection == EAST ? PACE : currDirection == WEST ? -PACE : 0;\n int moveY = currDirection == NORTH ? PACE : currDirection == SOUTH ? -PACE : 0;\n if (grid == null || grid.isOutside(currX + moveX, currY + moveY)) {\n return;\n }\n currX += moveX;\n currY += moveY;\n }", "public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\t\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (gr.isValid(next2)) {\n\t\t\tmoveTo(next2);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t}", "public void makeMove() {\n\t\tif (CheckForVictory(this)) {\n\t\t\t// System.out.println(\"VICTORY\");\n\t\t\tInterface.goalReached = true;\n\t\t\tfor (int i = 0; i < tmpStrings.length; i++) {\n\t\t\t\tif (moveOrder[i] == 0)\n\t\t\t\t\ttmpStrings[i] = \"turn left\";\n\t\t\t\telse if (moveOrder[i] == 1)\n\t\t\t\t\ttmpStrings[i] = \"turn right\";\n\t\t\t\telse\n\t\t\t\t\ttmpStrings[i] = \"go forward\";\n\n\t\t\t\tInterface.info.setText(\"Generation: \" + Parallel.generationNo + 1 + \" and closest distance to goal: \" + 0);\n\t\t\t}\n\t\t} else {\n\t\t\tmoveOrder[this.movesMade] = moves.remove();\n\t\t\tswitch (moveOrder[this.movesMade]) {\n\t\t\tcase (0):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0)\n\t\t\t\t\tface = 3;\n\t\t\t\telse\n\t\t\t\t\tface--;\n\t\t\t\tbreak;\n\t\t\tcase (1):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 3)\n\t\t\t\t\tface = 0;\n\t\t\t\telse\n\t\t\t\t\tface++;\n\t\t\t\tbreak;\n\t\t\tcase (2):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0 && Y - 1 >= 0)\n\t\t\t\t\tY--;\n\t\t\t\telse if (face == 1 && X + 1 <= map[0].length - 1)\n\t\t\t\t\tX++;\n\t\t\t\telse if (face == 2 && Y + 1 <= map.length - 1)\n\t\t\t\t\tY++;\n\t\t\t\telse if (face == 3 && X - 1 >= 0)\n\t\t\t\t\tX--;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Error making move :(\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void move() {\n\n\tGrid<Actor> gr = getGrid();\n\tif (gr == null) {\n\n\t return;\n\t}\n\n\tLocation loc = getLocation();\n\tif (gr.isValid(next)) {\n\n\t setDirection(loc.getDirectionToward(next));\n\t moveTo(next);\n\n\t int counter = dirCounter.get(getDirection());\n\t dirCounter.put(getDirection(), ++counter);\n\n\t if (!crossLocation.isEmpty()) {\n\t\t\n\t\t//reset the node of previously occupied location\n\t\tArrayList<Location> lastNode = crossLocation.pop();\n\t\tlastNode.add(next);\n\t\tcrossLocation.push(lastNode);\t\n\t\t\n\t\t//push the node of current location\n\t\tArrayList<Location> currentNode = new ArrayList<Location>();\n\t\tcurrentNode.add(getLocation());\n\t\tcurrentNode.add(loc);\n\n\t\tcrossLocation.push(currentNode);\t\n\t }\n\n\t} else {\n\t removeSelfFromGrid();\n\t}\n\n\tFlower flower = new Flower(getColor());\n\tflower.putSelfInGrid(gr, loc);\n\t\n\tlast = loc;\n\t\t\n }", "public void move() {\n Grid<Actor> gr = getGrid();\n if (gr == null) {\n return;\n }\n Location loc = getLocation();\n if (gr.isValid(next)) {\n setDirection(getLocation().getDirectionToward(next));\n moveTo(next);\n } else {\n removeSelfFromGrid();\n }\n Flower flower = new Flower(getColor());\n flower.putSelfInGrid(gr, loc);\n }", "private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }", "public void toMoving() {\n notifyStartMoving(this.getCurrentTurn().getCurrentPlayer().getNickname());\n if (getCurrentTurn().getCurrentPlayer().isHasSpecialMove()) {\n notifyAskForEffect(currentTurn.getCurrentPlayer().getNickname());\n } else {\n notifyChooseWorker(this.getCurrentTurn().getCurrentPlayer().getNickname(), board);\n }\n }", "public void tryMove() {\n if(!currentPlayer.getHasPlayed()){\n if (!currentPlayer.isEmployed()) {\n String destStr = chooseNeighbor();\n\n currentPlayer.moveTo(destStr, getBoardSet(destStr));\n if(currentPlayer.getLocation().getFlipStage() == 0){\n currentPlayer.getLocation().flipSet();\n }\n refreshPlayerPanel();\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"Since you are employed in a role, you cannot move but you can act or rehearse if you have not already\");\n }\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end turn your turn.\");\n }\n view.updateSidePanel(playerArray);\n }", "private ScanState switchState(ScanState desired,EnumSet<ScanState> allowed) {\n final ScanState old;\n final long timestamp;\n final long sequence;\n synchronized(this) {\n old = state;\n if (!allowed.contains(state))\n throw new IllegalStateException(state.toString());\n state = desired;\n timestamp = System.currentTimeMillis();\n sequence = getNextSeqNumber();\n }\n LOG.fine(\"switched state: \"+old+\" -> \"+desired);\n if (old != desired)\n queueStateChangedNotification(sequence,timestamp,old,desired);\n return old;\n }", "public void move() {\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t\tthis.swim();\r\n\t}", "public void move(){\n\t\tswitch(state){\r\n\t\t\tcase ATField.SPRITE_STAND:\r\n\t\t\t\tspriteX = 0;\r\n\t\t\t\tcoords = standbySprite.get(spriteX);\r\n\t\t\t\tspriteImg = new Rect(coords.left,coords.top,coords.right,coords.bottom);\r\n\t\t\t\tactualImg = new Rect(x, y, x + width, y + height);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\r\n\t\t\tcase ATField.SPRITE_WALK:\r\n\t\t\t\tif(spriteX >walkSprite.size() - 1){\r\n\t\t\t\t\tspriteX = 0;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcoords = walkSprite.get(spriteX);\r\n\t\t\t\tspriteImg = new Rect(coords.left,coords.top,coords.right,coords.bottom);\r\n\t\t\t\tactualImg = new Rect(x, y, x + width, y + height);\r\n\t\t\t\tspriteX++;\r\n\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase ATField.SPRITE_RUN:\r\n\t\t\t\t\r\n\t\t\t\tif(spriteX >runSprite.size() - 1){\r\n\t\t\t\t\tspriteX = 0;\r\n\t\t\t\t\tsetState(STAND);\r\n\t\t\t\t}\r\n\t\t\t\tcoords = runSprite.get(spriteX);\r\n\t\t\t\tspriteImg = new Rect(coords.left,coords.top,coords.right,coords.bottom);\r\n\t\t\t\tactualImg = new Rect(x, y, x + width, y + height);\r\n\t\t\t\tspriteX++;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase ATField.SPRITE_JUMP:\r\n\t\t\t\tif(spriteX >5){\r\n\t\t\t\t\tsetState(STAND);\r\n\t\t\t\t}\r\n\t\t\t\tcoords = jumpSprite.get(0);\r\n\t\t\t\tspriteImg = new Rect(coords.left,coords.top,coords.right,coords.bottom);\r\n\t\t\t\tactualImg = new Rect(x, y, x + width, y + height);\r\n\t\t\t\tspriteX++;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public boolean transition() {\n current = new State(ts++, hopper); \n if (terminus.isTerminus(current)) {\n return false;\n } else {\n hopper.sendBall(oneMinute);\n return true;\n }\n }", "public void runStateMachine() {\n switch(m_currentState) {\n case PoweringUpState:\n if (this.doPowerUpStuff()) {\n this.setRobotState(RobotState.InitializingDataState);\n }\n break;\n case InitializingDataState:\n\n if (this.initializeData()) {\n // Load some commands for our robot.\n // We could definitely load these from a different file.\n System.out.println(\"-------- Populating Command Queue --------\");\n m_robotQueue.addCommand(new MoveToLocationXY(1.0, 2.0, 2.0));\n m_robotQueue.addCommand(new MoveToLocationXY(-1.0, -2.0, 1.0));\n m_robotQueue.addCommand(new RotateDegrees(180.0, 22.5));\n\n System.out.println(\"\\n-------- Entering Main Robot State --------\");\n this.setRobotState(RobotState.IdleWaitingForCommandState);\n }\n break;\n case IdleWaitingForCommandState:\n if (m_robotQueue.isCommandPending()) {\n\n m_currentCommand = m_robotQueue.getNextCommand();\n\n // m_currentCommand is a generic Object. Let's see what it actually is...\n String commandName = m_currentCommand.getClass().toString();\n System.out.println(\"* Got new command. Processing: \" + commandName);\n\n // Change robot state depending on the type of command we found.\n switch (commandName) {\n // NOTE: This \"class xyz\" text compare is kind of weird,\n // We could probably find a better way.\n case \"class commands.MoveToLocationXY\":\n this.setRobotState(RobotState.MovingToLocationState);\n break;\n case \"class commands.RotateDegrees\":\n this.setRobotState(RobotState.RotatingState);\n break;\n default:\n System.out.println(\"Unrecognized command \" + commandName);\n }\n System.out.println();\n\n } else if (m_currentCommand != null) {\n m_currentCommand = null; // Doing nothing. Clear current command.\n }\n break;\n case MovingToLocationState:\n MoveToLocationXY moveCmd = (MoveToLocationXY) m_currentCommand;\n try {\n if (moveCmd.runUntilComplete()) {\n // Done moving, process next item in command queue\n this.setRobotState(RobotState.IdleWaitingForCommandState);\n }\n } catch (InterruptedException e) { // for Thread.sleep - demo only\n e.printStackTrace();\n }\n break;\n case RotatingState:\n RotateDegrees rotateCmd = (RotateDegrees) m_currentCommand; // Cast to correct type.\n try {\n if (rotateCmd.runUntilComplete()) {\n // Done moving, process next item in command queue\n this.setRobotState(RobotState.IdleWaitingForCommandState);\n }\n } catch (InterruptedException e) { // for Thread.sleep - demo only\n e.printStackTrace();\n }\n break;\n case SearchingForTargetsState:\n // TODO - implement SearchTarget demo behavior\n break;\n }\n }", "public boolean attemptMove(MapPanel caller) {\n\t\tGameState status = caller.getGameStatus();\n\t\tif(activePath == null || activePath.size() == 0) {\n\t\t\tlog.log(\"Move not attempted.\");\n\t\t\treturn false;\n\t\t}\n\t\telse if(status == GameState.PLAYER_CONFIRMING_ATTACK) {\n\t\t\treturn attemptAttack(caller, s.getSelected());\n\t\t}\n\t\telse if(status == GameState.PLAYER_CONFIRMING_MOVE) {\n\t\t\tmakeMove(caller);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void move() {\n spriteBase.move();\n\n Double newX = spriteBase.getXCoordinate() + spriteBase.getDxCoordinate();\n Double newY = spriteBase.getYCoordinate() + spriteBase.getDyCoordinate();\n\n if (!newX.equals(spriteBase.getXCoordinate())\n || !newY.equals(spriteBase.getYCoordinate())) {\n Logger.log(String.format(\"Monster moved from (%f, %f) to (%f, %f)\",\n spriteBase.getXCoordinate(), spriteBase.getYCoordinate(), newX, newY));\n }\n }", "@Override\r\n public void move() {\r\n Grid<Actor> gr = getGrid();\r\n if (gr == null) {\r\n return;\r\n }\r\n Location loc = getLocation();\r\n if (gr.isValid(next)) {\r\n setDirection(getLocation().getDirectionToward(next));\r\n moveTo(next);\r\n } else {\r\n removeSelfFromGrid();\r\n }\r\n Flower flower = new Flower(getColor());\r\n flower.putSelfInGrid(gr, loc);\r\n }", "public void AIMakeMove() {\n\t\t\n\t\tRandom randomizer = new Random();\n\t\tint index = randomizer.nextInt(AIPossibleMoves.size());\n\t\tMove move = AIPossibleMoves.get(index);\n\t\tChecker checker = model.findChecker(move.getxOrigin(), move.getyOrigin());\n\t\tint xChange = (move.getxOrigin() - move.getxMove());\n\t\tint yChange = (move.getyOrigin() - move.getyMove());\n\t\t\n\t\tint xMoveNew = 0;\n\t\tint yMoveNew = 0;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tif(board.getBoard()[move.getyMove()][move.getxMove()] == 0) {\n\t\t\t//do nothing\n\t\t} else {\n\t\t\t//moving down\n\t\t\tif(yChange < 0) {\n\t\t\t\t//moving right\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t//moving left\n\t\t\t\t\t\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() + 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//moving up\n\t\t\t\tif(xChange < 0) {\n\t\t\t\t\t//moving right\n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() + 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t} else {\n\t\t\t\t\t//moving left \n\t\t\t\t\tremoveTakenPiece(move.getxMove(), move.getyMove());\n\t\t\t\t\txMoveNew = move.getxMove() - 1;\n\t\t\t\t\tyMoveNew = move.getyMove() - 1;\n\t\t\t\t\tmove.setxMove(xMoveNew);\n\t\t\t\t\tmove.setyMove(yMoveNew);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(\"New Move is: \" + xMoveNew + \",\" + yMoveNew);\n\t\tif(canBeKing(checker, move)) {\n\t\t\tchecker = convertToKing(checker, move);\n\t\t\tmodel.updateChecker(move, checker, 2);\n\t\t\t\n\t\t\tprintBoard();\n\t\t\tmodel.moves.add(move);\n\t\t\treturn;\n\t\t}\n\t\tmodel.updateChecker(move, checker, 2);\n\t//\tSystem.out.println(\"AI - DEBUGGING\");\n\t//\tSystem.out.println(\"Origin Piece: \" + move.getxOrigin() + \",\" + move.getyOrigin());\n\t//\tSystem.out.println(\"Move Position: \" + move.getxMove() + \",\" + move.getyMove());\n\t\tupdateBoard(move);\n\t\tmodel.moves.add(move);\n\t\tprintBoard();\n\t\t\n\t}", "public boolean moveOn() {\n\t\t\n\t}", "protected void setMove(int _move)\t\t{\tmove = _move;\t\t}", "public boolean move() {\n\t\tint nextDirection;\n\t\tint pacmanX = parent.getPacManX();\n\t\tint pacmanY = parent.getPacManY();\n\t\t\n\t\tint[] directionPriority = new int[4];\n\t\t/** The direction is added to the priority in order to achieve it once the move is chosen */\n\t\tdirectionPriority[0]=(pacmanX-pixelLocationX)*(10)*state+GameCharacter.RIGHT;\n\t\tdirectionPriority[1]=((pacmanX-pixelLocationX)*(-10)*state+GameCharacter.LEFT);\n\t\tdirectionPriority[2]=(pacmanY-pixelLocationY)*(10)*state+GameCharacter.DOWN;\n\t\tdirectionPriority[3]=((pacmanY-pixelLocationY)*(-10)*state+GameCharacter.UP);\n\t\tArrays.sort(directionPriority);\n\t\t\n\t\tint i=3;\n\t\t\n\t\tdo {\n\t\t\tnextDirection = directionPriority[i]%10;\n\t\t\tif (nextDirection < 0) {\n\t\t\t\tnextDirection += 10;\n\t\t\t}\n\t\t\tif(isLegalMove(nextDirection) && (Math.abs(nextDirection-currentDirection) != 2) || i==0) {\n\t\t\t\tsetDirection(nextDirection);\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ti--;\n\t\t}\n\t\twhile (i>=0);\n\t\treturn super.move();\n\t}", "private void moveTo(int xpos, int ypos) {\n repeat = true;\n int x1 = ypos / CELL_SIZE;\n int y1 = xpos / CELL_SIZE;\n int d;\n boolean valid = true;\n int st, bc = 0;\n if (x1 == x && y1 != y) {\n if (y1 > y) {\n for (int i = y; i <= y1; i++) {\n st = state[x][i];\n if (st == WALL_ST || st == NULL_ST) {\n valid = false;\n break;\n } else if (st == BOX_ST || st == FIT_ST) {\n bc++;\n if (bc > 1) {\n valid = false;\n break;\n }\n }\n }\n } else {\n for (int i = y1; i <= y; i++) {\n st = state[x][i];\n if (st == WALL_ST || st == NULL_ST) {\n valid = false;\n break;\n } else if (st == BOX_ST || st == FIT_ST) {\n bc++;\n if (bc > 1) {\n valid = false;\n break;\n }\n }\n }\n }\n } else if (x1 != x && y1 == y) {\n if (x1 > x) {\n for (int i = x; i <= x1; i++) {\n st = state[i][y];\n if (st == WALL_ST || st == NULL_ST) {\n valid = false;\n break;\n } else if (st == BOX_ST || st == FIT_ST) {\n bc++;\n if (bc > 1) {\n valid = false;\n break;\n }\n }\n }\n } else {\n for (int i = x1; i <= x; i++) {\n st = state[i][y];\n if (st == WALL_ST || st == NULL_ST) {\n valid = false;\n break;\n } else if (st == BOX_ST || st == FIT_ST) {\n bc++;\n if (bc > 1) {\n valid = false;\n break;\n }\n }\n }\n }\n } else {\n valid = false;\n }\n\n if (valid) {\n if (x1 == x && y1 != y) {\n if (y1 > y) {\n d = y1 - y;\n for (int i = 0; i < d && repeat; i++) {\n changeState(RIGHT_MOVE);\n try {\n Thread.sleep(SLEEP);\n } catch (InterruptedException e1) {\n //empty\n }\n }\n } else {\n d = y - y1;\n for (int i = 0; i < d && repeat; i++) {\n changeState(LEFT_MOVE);\n try {\n Thread.sleep(SLEEP);\n } catch (InterruptedException e1) {\n //empty\n }\n }\n }\n } else if (x1 != x && y1 == y) {\n if (x1 > x) {\n d = x1 - x;\n for (int i = 0; i < d && repeat; i++) {\n changeState(DOWN_MOVE);\n try {\n Thread.sleep(SLEEP);\n } catch (InterruptedException e1) {\n //empty\n }\n }\n } else {\n d = x - x1;\n for (int i = 0; i < d && repeat; i++) {\n changeState(UP_MOVE);\n try {\n Thread.sleep(SLEEP);\n } catch (InterruptedException e1) {\n //empty\n }\n }\n }\n }\n } else {\n List<Point> path = findPath(new Point(y, x), new Point(y1, x1));\n\n if (path.size() > 1) {\n Point cpnt, opnt;\n opnt = (Point) path.get(0);\n int psize = path.size();\n for (int i = 1; i < psize && repeat; i++) {\n cpnt = (Point) path.get(i);\n moveOne(cpnt.y, cpnt.x, opnt.y, opnt.x);\n opnt = cpnt;\n try {\n Thread.sleep(SLEEP);\n } catch (InterruptedException e1) {\n //empty\n }\n }\n }\n }\n }", "public void updatemove() {\n\t\tmove = new Movement(getX(), getY(),dungeon,this);\n\t\t//System.out.println(\"Updated\");\n\t\tnotifys();\n\t\tif(this.getInvincible()) {\n\t\t\tsteptracer++;\n\t\t}\n\t\tdungeon.checkGoal();\n\t}", "void playerMove(State state);", "void doMakeMove(CheckersMove move) {\n\n boardData.makeMove(move, false);\n\n /* If the move was a jump, it's possible that the player has another\n jump. Check for legal jumps starting from the square that the player\n just moved to. If there are any, the player must jump. The same\n player continues moving. */\n \n if (move.isJump()) {\n legalMoves = boardData.getLegalJumpsFrom(currentPlayer, move.toRow, move.toCol);\n if (legalMoves != null) {\n if (currentPlayer == CheckersData.RED) {\n console(\"RED: You must continue jumping.\");\n } else {\n console(\"BLACK: You must continue jumping.\");\n }\n selectedRow = move.toRow; // Since only one piece can be moved, select it.\n selectedCol = move.toCol;\n refreshBoard();\n return;\n }\n }\n\n /* The current player's turn is ended, so change to the other player.\n Get that player's legal moves. If the player has no legal moves,\n then the game ends. */\n if (currentPlayer == CheckersData.RED) {\n currentPlayer = CheckersData.BLACK;\n legalMoves = boardData.getLegalMoves(currentPlayer);\n if (legalMoves == null) {\n gameOver(\"BLACK has no moves. RED wins.\");\n } else if (legalMoves[0].isJump()) {\n console(\"BLACK: Make your move. You must jump.\");\n } else {\n console(\"BLACK: Make your move.\");\n }\n } else {\n currentPlayer = CheckersData.RED;\n legalMoves = boardData.getLegalMoves(currentPlayer);\n if (legalMoves == null) {\n gameOver(\"RED has no moves. BLACK wins.\");\n } else if (legalMoves[0].isJump()) {\n console(\"RED: Make your move. You must jump.\");\n } else {\n console(\"RED: Make your move.\");\n }\n }\n\n /* Set selectedRow = -1 to record that the player has not yet selected\n a piece to move. */\n selectedRow = -1;\n\n /* As a courtesy to the user, if all legal moves use the same piece, then\n select that piece automatically so the user won't have to click on it\n to select it. */\n if (legalMoves != null) {\n boolean sameStartSquare = true;\n for (int i = 1; i < legalMoves.length; i++) {\n if (legalMoves[i].fromRow != legalMoves[0].fromRow\n || legalMoves[i].fromCol != legalMoves[0].fromCol) {\n sameStartSquare = false;\n break;\n }\n }\n if (sameStartSquare) {\n selectedRow = legalMoves[0].fromRow;\n selectedCol = legalMoves[0].fromCol;\n }\n }\n\n /* Make sure the board is redrawn in its new state. */\n refreshBoard();\n\n }", "public void move() {\n\t\tif (type.equals(\"Fast\")) {\n\t\t\tspeed = 2;\n\t\t}else if (type.equals(\"Slow\")){\n\t\t\tspeed = 4;\n\t\t}\n\t\t\n\t\tif (rand.nextInt(speed) == 1){\n\t\t\tif (currentLocation.x - ChristopherColumbusLocation.x < 0) {\n\t\t\t\tif (currentLocation.x + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.x != 0) {\t\t\t\t\n\t\t\t\t\tcurrentLocation.x--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (currentLocation.y - ChristopherColumbusLocation.y < 0) {\n\t\t\t\tif (currentLocation.y + 1 < oceanMap.getDimensions()) {\n\t\t\t\t\tcurrentLocation.y++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (currentLocation.y != 0) {\n\t\t\t\t\tcurrentLocation.y--;\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t}", "public void move() {\n\t\tthis.position.stepForwad();\n\t\tthis.position.spin();\n\t}", "private void processStatesAnimation() {\n if(getState() == JUMPING_STATE || getState() == FALLING_STATE) {\n if(getDirection() == DIRECTION_RIGHT)\n setAnim(jumpingRight);\n else if(getDirection() == DIRECTION_LEFT)\n setAnim(jumpingLeft);\n }\n\n if(getState() == NORMAL_STATE) {\n if(getDirection() == DIRECTION_STOPPED_RIGHT)\n setAnim(standingRight);\n else if(getDirection() == DIRECTION_STOPPED_LEFT)\n setAnim(standingLeft);\n else if(getDirection() == DIRECTION_RIGHT)\n setAnim(walkingRight);\n else if(getDirection() == DIRECTION_LEFT)\n setAnim(walkingLeft);\n }\n\n if(getState() == DYING_STATE) \n setAnim(dying);\n }", "boolean prepareToMove();", "public void moveToNewState(int leg) {\n if (leg == 4) {\n gsm.set(new WinState(gsm));\n }else if (leg == 3) {\n boatsInOrder = boatsInOrder.subList(0,3);\n boolean gameOver = true;\n for (Boat boat: boatsInOrder) {\n if (boat == player) {\n gameOver = false;\n break;\n }\n }\n if (gameOver) {\n gsm.set(new GameOverSpeed(gsm));\n } else {\n // resets the boat attributes\n for (Boat boat:boatsInOrder) {\n boat.setPosY(0);\n boat.setHealth(100);\n boat.setFatigue(600);\n //TEAM19-START resets player speed and time penalty\n boat.setTimePenalty(0);\n boat.setTotalLegTime(0);\n boat.resetSpeed();\n //TEAM19-END\n }\n boatsInOrder.remove(player);\n gsm.set(new PlayState(gsm,boatsInOrder,player,leg + 1, DIFFICULTY));\n }\n } else {\n // resets the boat attributes\n for (Boat boat:boatsInOrder) {\n boat.setPosY(0);\n boat.setHealth(100);\n boat.setFatigue(600);\n //TEAM19-START resets player speed and time penalty\n boat.setTimePenalty(0);\n boat.setTotalLegTime(0);\n boat.resetSpeed();\n //TEAM19-END\n }\n boatsInOrder.remove(player);\n gsm.set(new PlayState(gsm,boatsInOrder,player,leg + 1, DIFFICULTY));\n }\n }", "boolean makeMove();", "void setMoving(boolean isMoving);", "public abstract void makeMove(GameStatus gameStatus);", "public void startMoving ()\n {\n if (canMove()) {\n ((Mobile)_actor).setDirection(_actor.getRotation());\n _actor.set(Mobile.MOVING);\n }\n }", "public void act() \r\n {\r\n if (startTime > 0) {\r\n startTime--;\r\n }\r\n else {\r\n if (isScared()) {\r\n doScareMode();\r\n }\r\n else {\r\n if (counter == 0 || !canMove(currDirectionStr)) {\r\n counter = CELL_SIZE * 4;\r\n prevDirection = currDirection;\r\n do {\r\n currDirection = (int)(Math.random() * 10);\r\n if (currDirection == 0) {\r\n currDirectionStr = \"up\";\r\n }\r\n else if (currDirection == 1) {\r\n currDirectionStr = \"left\";\r\n }\r\n else if (currDirection == 2) {\r\n currDirectionStr = \"down\";\r\n }\r\n else if (currDirection == 3) {\r\n currDirectionStr = \"right\";\r\n }\r\n } while (!canMove(currDirectionStr));\r\n }\r\n \r\n if (canMove(currDirectionStr)) {\r\n move(currDirectionStr);\r\n }\r\n counter--;\r\n } \r\n }\r\n }", "private void resetValidMove()\n {\n validMoves = null;\n setToValidMoveColor = false;\n validMoveFlag = false;\n }", "private void move() {\n resetUpdate();\n\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.resetGameMessage();\n gameMessage.notify(gameMessage);\n\n\n if( liteGame.isWinner() ) endOfTheGame = true;\n }", "@Override\r\n\tpublic boolean guardMovement() {\r\n\r\n\t\tif(stop == 0) {\r\n\t\t\tstate = 'G';\r\n\t\t\t\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tint tmp = rand.nextInt(10) + 1;\r\n\t\t\t\r\n\t\t\tif(tmp > 8) { \r\n\t\t\t\tstate = 'g';\r\n\t\t\t\tstop = rand.nextInt(3) + 1;\r\n\t\t\t\tdirection = rand.nextBoolean();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn checkAndMove();\r\n\t\t}\r\n\t\telse \r\n\t\t\tstop--;\r\n\r\n\t\treturn false;\r\n\t}", "private void handleMovement() {\n if (movements.isEmpty()) return;\n try {\n switch (movements.peek()) {\n case MOVE_UP:\n game.movePlayer(Direction.N);\n break;\n case MOVE_LEFT:\n game.movePlayer(Direction.W);\n break;\n case MOVE_DOWN:\n game.movePlayer(Direction.S);\n break;\n case MOVE_RIGHT:\n game.movePlayer(Direction.E);\n break;\n }\n } catch (Exception ignored) { }\n }", "public void move() {\n\t\tthis.hero.setPF(1);\n\t\tthis.hero.setState(this.hero.getMoved());\n\t}", "static void moving() throws GameActionException {\n\n\t\tcheckLumberjack();\n\n\t\trc.setIndicatorLine(myLocation, myLocation.add(robotDirection), 0, 0, 0);\n\n\t\tif (rc.canBuildRobot(RobotType.SCOUT, robotDirection)\n\t\t\t\t&& rc.readBroadcast(Channels.COUNT_SCOUT) < Constants.MAX_COUNT_SCOUT) {\n\t\t\trc.buildRobot(RobotType.SCOUT, robotDirection);\n\t\t\tCommunication.countMe(RobotType.SCOUT);\n\t\t\treturn;\n\t\t}\n\t\t// } else if (rc.canBuildRobot(RobotType.SOLDIER, buildDirection) &&\n\t\t// rc.readBroadcast(Channels.COUNT_SOLDIER) <\n\t\t// Constants.MAX_COUNT_SOLDIER) {\n\t\t// rc.buildRobot(RobotType.SOLDIER, buildDirection);\n\t\t// Communication.countMe(RobotType.SOLDIER);\n\t\t// return;\n\t\t// }\n\n\t}", "private void think()\n\t{\n\t\tboolean bChange=false;\n\t\tif ((mMoveY+Height)<0)\n\t\t\tbChange=true;\n\t\tif ((mMoveX+Width)<0)\n\t\t\tbChange=true;\n\t\tif ((mMoveY+Height)>500)\n\t\t\tbChange=true;\n\t\tif ((mMoveX+Width)>500)\n\t\t\tbChange=true;\n\t\tif (bChange)\n\t\t{\n\t\t\t//Go in opposite direction\n\t\t\tDirection = Direction+4;\n\t\t\tif (Direction>7)\n\t\t\t\tDirection-=8;\n\t\t\tif (Direction<0)\n\t\t\t\tDirection=0;\n\t\t}\t\t\n\t}", "private void moveOrTurn() {\n\t\t// TEMP: look at center of canvas if out of bounds\n\t\tif (!isInCanvas()) {\n\t\t\tlookAt(sens.getXMax() / 2, sens.getYMax() / 2);\n\t\t}\n\n\t\t// if we're not looking at our desired direction, turn towards. Else, move forward\n\t\tif (needToTurn()) {\n\t\t\tturnToDesiredDirection();\n\t\t} else {\n\t\t\tmoveForward(2.0);\n\t\t}\n\n\t\t// move in a random direction every 50 roaming ticks\n\t\tif (tickCount % 100 == 0) {\n\t\t\tgoRandomDirection();\n\t\t}\n\t\ttickCount++;\n\t}", "public void move(int moveDirection) {\n //if same or opposite direction, check if movable\n if ((direction - moveDirection) % 6 == 0) {\n this.direction = moveDirection;\n if (moveable()) {\n if (direction == 12) {\n this.setLocation(new Point(this.getX(),\n this.getY() - speed));\n }\n //move right\n if (direction == 3) {\n this.setLocation(new Point(this.getX() + speed,\n this.getY()));\n\n }\n //move down\n if (direction == 6) {\n this.setLocation(new Point(this.getX(),\n this.getY() + speed));\n }\n //move left\n if (direction == 9) {\n this.setLocation(new Point(this.getX() - speed,\n this.getY()));\n }\n\n }\n } // if it is turning, check if can turn or not. If can turn then turn and move according to the direction before turn, otherwise, just leave the monster there\n else {\n Point snapToGridPoint = GameUtility.GameUtility.snapToGrid(\n this.getLocation());\n Point gridPoint = GameUtility.GameUtility.toGridCordinate(\n this.getLocation());\n Point nextPoint = new Point(gridPoint.x, gridPoint.y);\n //if the distance is acceptable\n if (GameUtility.GameUtility.distance(snapToGridPoint,\n this.getLocation()) < GameUtility.GameUtility.TILE_SIZE / 2.5) {\n\n if (moveDirection == 3) {\n int x = Math.max(0, gridPoint.x + 1);\n nextPoint = new Point(x, gridPoint.y);\n } else if (moveDirection == 6) {\n int y = Math.max(0, gridPoint.y + 1);\n nextPoint = new Point(gridPoint.x, y);\n } else if (moveDirection == 9) {\n int x = Math.min(19, gridPoint.x - 1);\n nextPoint = new Point(x, gridPoint.y);\n } else if (moveDirection == 12) {\n int y = Math.min(19, gridPoint.y - 1);\n nextPoint = new Point(gridPoint.x, y);\n }\n // if the turn is empty, then snap the monster to the grid location\n if (!(GameManager.getGameMap().getFromMap(nextPoint) instanceof Wall) && !(GameManager.getGameMap().getFromMap(\n nextPoint) instanceof Bomb)) {\n if (GameUtility.GameUtility.distance(snapToGridPoint,\n this.getLocation()) < GameUtility.GameUtility.TILE_SIZE / 10) {\n this.setLocation(snapToGridPoint);\n this.direction = moveDirection;\n } else {\n if (direction == 9 || direction == 3) {\n int directionOfMovement = (snapToGridPoint.x - getX());\n directionOfMovement = directionOfMovement / Math.abs(\n directionOfMovement);\n this.setLocation(new Point(\n this.getX() + directionOfMovement * speed,\n this.getY()));\n } else if (direction == 12 || direction == 6) {\n int directionOfMovement = (snapToGridPoint.y - getY());\n directionOfMovement = directionOfMovement / Math.abs(\n directionOfMovement);\n this.setLocation(new Point(\n this.getX(),\n this.getY() + directionOfMovement * speed));\n }\n }\n }\n }\n }\n }", "public void moveStart(\n )\n {\n index = StartIndex;\n if(state == null)\n {\n if(parentLevel == null)\n {state = new GraphicsState(this);}\n else\n {state = parentLevel.state.clone(this);}\n }\n else\n {\n if(parentLevel == null)\n {state.initialize();}\n else\n {parentLevel.state.copyTo(state);}\n }\n\n notifyStart();\n\n refresh();\n }", "public void move() {\n\n int move_position_x = 0;\n int move_postion_y = 0;\n Random random = new Random();\n do {\n\n move_position_x = 0;\n move_postion_y = 0;\n int direction = random.nextInt(6);\n switch (direction) {\n case 0:\n move_postion_y = -1;\n break;\n case 1:\n case 4:\n move_postion_y = 1;\n break;\n case 2:\n case 5:\n move_position_x = 1;\n break;\n case 3:\n move_position_x = -1;\n }\n } while ((this.positionX + move_position_x < 0) || (this.positionX + move_position_x >= size_of_map) || (\n this.positionY + move_postion_y < 0) || (this.positionY + move_postion_y >= size_of_map));\n this.positionX += move_position_x;\n this.positionY += move_postion_y;\n }", "private void move(){\n \n currentAnimation = idleDown;\n \n if(playerKeyInput.allKeys[VK_W]){\n int ty = (int) (objectCoordinateY - speed + bounds.y) / 16;\n \n if(!collisionDetection((int) (objectCoordinateX + bounds.x)/16, ty)){\n objectCoordinateY -= speed;\n currentAnimation = upWalk;\n }\n } \n \n if(playerKeyInput.allKeys[VK_S]){\n int ty = (int) (objectCoordinateY + speed + bounds.y + bounds.height) / 16;\n if(!collisionDetection((int) (objectCoordinateX + bounds.x)/16, ty)){\n objectCoordinateY += speed;\n currentAnimation = downWalk;\n }\n } \n \n if(playerKeyInput.allKeys[VK_A]){\n int tx = (int) (objectCoordinateX - speed + bounds.x) / 16;\n if(!collisionDetection(tx, (int) (objectCoordinateY + bounds.y)/16)){\n objectCoordinateX -= speed;\n currentAnimation = sideWalkLeft;\n }\n } \n \n if(playerKeyInput.allKeys[VK_D]){\n int tx = (int) (objectCoordinateX + speed + bounds.x + bounds.width) / 16;\n if(!collisionDetection(tx, (int) (objectCoordinateY + bounds.y)/16)){\n objectCoordinateX += speed;\n currentAnimation = sideWalkRight;\n }\n } \n \n if(playerKeyInput.allKeys[VK_E]){\n currentAnimation = pickUp;\n } \n }", "private void setState(WFDState s) {\n Log.d(TAG, \"Moving from \" + sState + \" --> \" + s);\n sState = s;\n }", "public final void forceStartMoveLoop() {\r\n\t\txOff = 0;\r\n\t\tzOff = 0;\r\n\t\tmoveStart = System.currentTimeMillis();\r\n\t}", "public void move()\n {\n move(WALKING_SPEED);\n }", "public void makeMove(Location loc)\n {\n \tLocation curLoc = getLocation();\n \tint curDirection = getDirection();\n // get 2 left locations\n\t\tLocation leftNeighborLoc = curLoc.getAdjacentLocation(curDirection + Location.LEFT);\n Location leftNextNeighborLoc = leftNeighborLoc.getAdjacentLocation(curDirection + Location.LEFT);\n // get 2 right locations\n Location rightNeighborLoc = curLoc.getAdjacentLocation(curDirection + Location.RIGHT);\n Location rightNextNeighborLoc = rightNeighborLoc.getAdjacentLocation(curDirection + Location.RIGHT);\n // initial a null\n Actor leftNeighborActor = null;\n Actor leftNextNeighborActor = null;\n Actor rightNeighborActor = null;\n Actor rightNextNeighborActor = null;\n\n boolean isLeftValid = false;\n boolean isRightValid = false;\n\n Grid<Actor> grid = getGrid();\n // if left valid\n if (grid.isValid(leftNeighborLoc) && grid.isValid(leftNextNeighborLoc))\n {\n \tleftNeighborActor = grid.get(leftNeighborLoc);\n \tleftNextNeighborActor = grid.get(leftNextNeighborLoc);\n \t\n \tif (leftNeighborActor == null && leftNextNeighborActor == null) {\n \t\tisLeftValid = true;\n }\n }\n // if right valid\n if (grid.isValid(rightNeighborLoc) && grid.isValid(rightNextNeighborLoc))\n {\n \trightNeighborActor = grid.get(rightNeighborLoc);\n \trightNextNeighborActor = grid.get(rightNextNeighborLoc);\n\n \tif (rightNeighborActor == null && leftNextNeighborActor == null) {\n \t\tisRightValid = true;\n }\n }\n // if both valid\n if (isLeftValid && isRightValid)\n {\n\t // move ramdonly\n if (Math.random() < 0.5)\n\t {\n\t \tmoveTo(leftNextNeighborLoc);\n\t \n\t }\n\t else{\n\t \tmoveTo(rightNextNeighborLoc);\n\t }\n }\n // right valid only\n else if (isRightValid && !isLeftValid)\n {\n \tmoveTo(rightNextNeighborLoc);\n }\n // left valid only\n else if (!isRightValid && isLeftValid)\n {\n \tmoveTo(leftNextNeighborLoc);\n }\n else\n {\n \tsuper.makeMove(loc);\n }\n \n }", "protected void resetMotion(){\n \tisMoving = false;\n \tframesForCurrentMove = 0;\n \ttargetMainCellCoordinates = getCurrentMainCellCoordinates();\n }", "public void move() {\n\tupdateSwapTime();\n\tupdateAttackTime();\n\n\tif (enemyNear) {\n\t if (moved) {\n\t\tstopMove();\n\t\tmoved = false;\n\t }\n\t} else {\n\t if (!moved) {\n\t\tcontinueMove();\n\t\tmoved = true;\n\t }\n\n\t x += dx;\n\t y += dy;\n\n\t if (x < speed) {\n\t\tx = speed;\n\t\tdx = (-1) * dx;\n\t }\n\n\t if (y < speed) {\n\t\ty = speed;\n\t\tdy = (-1) * dy;\n\t }\n\n\t if (x > MapSize.getSIZE().getWidth() - 40) {\n\t\tx = MapSize.getSIZE().getWidth() - 40;\n\t\tdx = (-1) * dx;\n\t }\n\n\t if (y > MapSize.getSIZE().getHeight() - 40) {\n\t\ty = MapSize.getSIZE().getHeight() - 40;\n\t\tdy = (-1) * dy;\n\t }\n\t}\n }", "private static void move() {\r\n\t\ttry {\r\n\t\t\tThread.sleep(timer);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\trunTime += timer;\r\n\t\tif (runTime > stepUp) {\r\n\t\t\ttimer *= 0.9;\r\n\t\t\tstepUp += 5000;\r\n\t\t}\r\n\r\n\t\tupdateSnake(lastMove);\r\n\t\t// updateField();\r\n\r\n\t\tif (score >= 10 && (r.nextInt(40) == 0)) {\r\n\t\t\taddFood(MOUSE);\r\n\t\t}\r\n\t\tif (score >= 30 && (r.nextInt(50) == 0)) {\r\n\t\t\taddFood(POISON);\r\n\t\t}\r\n\t}", "public void move() {\n if(Objects.nonNull(this.position)) {\n Position position = this.getPosition();\n Function<Position, Position> move = moveRobotInDirectionMap.get(position.getDirection());\n this.position = move.apply(position);\n }\n }", "public void move() { \n\t\tSystem.out.println(\"MOVING\");\n\t\tswitch(direction) {\n\t\t\tcase NORTH: {\n\t\t\t\tyloc -= ySpeed;\n\t\t\t}\n\t\t\tcase SOUTH: {\n\t\t\t\tyloc+= xSpeed;\n\t\t\t}\n\t\t\tcase EAST: {\n\t\t\t\txloc+= xSpeed;\n\t\t\t}\n\t\t\tcase WEST: {\n\t\t\t\txloc-= xSpeed;\n\t\t\t}\n\t\t\tcase NORTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase NORTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc+=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc+= ySpeed;\n\t\t\t}\n\t\t}\n\t}", "public void move_to_gantry() {\n\t\tstop_moving();\n\t\ttry {\n\t\t\tThread.sleep(1000);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tmove(gpX, gpY, gpZ);\n\t}", "@Test\n public void testMoveMonsterToCell()\n {\n theEngine.start();\n assertTrue(theEngine.inPlayingState());\n \n assertFalse(getTheMonster().getLocation() == getEmptyCell());\n moveMonsterToCell(getEmptyCell());\n assertEquals(getTheMonster().getLocation(), getEmptyCell());\n }", "private void breakSpecialState() {\n this.inSpecialState = false;\n this.resetXMovement();\n }", "@Override\n public void calculateMove() {\n int xa = 0, ya = 0;\n if (steps <= 0) {\n direction = ep.calculateDirection();\n steps = MAX_STEPS;\n }\n if (direction == 0) {\n ya--;\n }\n if (direction == 2) {\n ya++;\n }\n if (direction == 3) {\n xa--;\n }\n if (direction == 1) {\n xa++;\n }\n if (canMove(xa, ya)) {\n steps -= 1 + rest;\n move(xa * speed, ya * speed);\n moving = true;\n } else {\n steps = 0;\n moving = false;\n }\n }", "private Board moveTo(int direction) {\n Board newBoard = new Board(this.state);\n int oZ = this.zero;\n int nZ = oZ;\n switch (direction) {\n case Board.LEFT: nZ = oZ - 1; break;\n case Board.RIGHT: nZ = oZ + 1; break;\n case Board.UP: nZ = oZ - Board.dim; break;\n case Board.DOWN: nZ = oZ + Board.dim; break;\n default: return null;\n }\n newBoard.state[oZ] = state[nZ];\n newBoard.state[nZ] = 0;\n newBoard.zero = nZ;\n\n // update heuristic iteratively except for MAN\n switch(Board.heuristic) {\n case HAM:\n if (state[nZ] == oZ) newBoard.dist = this.dist - 1;\n else if (state[nZ] == nZ) newBoard.dist = this.dist + 1;\n else newBoard.dist = this.dist;\n break;\n case INT: // iterative update the interference\n // this is the most logically complicated code I have\n // done in a while\n int moved = state[nZ];\n int oC;\n newBoard.inter = inter;\n switch (direction) {\n case Board.LEFT:\n case Board.RIGHT: // LEFT AND RIGHT\n if (Board.colOf[state[nZ]] == Board.colOf[nZ]) {\n // we've replaced a piece on its col with a zero\n // interference can only decrease since we know\n // the piece didn't belong to its old column\n //System.out.println(\"Took \" + state[nZ] + \" out of its col\");\n for (int i = Board.colOf[nZ]; i < nZ; i+=Board.dim)\n if (Board.colOf[state[i]] == Board.colOf[nZ] &&\n state[i] > state[nZ])\n newBoard.inter--;\n for (int i = nZ + Board.dim; i < state.length; i+=Board.dim)\n if (Board.colOf[state[i]] == Board.colOf[nZ] &&\n state[i] < state[nZ])\n newBoard.inter--;\n \n } else if (Board.colOf[state[nZ]] == Board.colOf[oZ]) {\n // we've put a piece on its col that was a zero\n // interference can only increase since we know\n // the piece didn't below to its old column\n //System.out.println(\"Put \" + state[nZ] + \" into its col\");\n for (int i = Board.colOf[oZ]; i < oZ; i+=Board.dim)\n if (Board.colOf[state[i]] == Board.colOf[oZ] &&\n state[i] > state[nZ])\n newBoard.inter++;\n for (int i = oZ + Board.dim; i < state.length; i+=Board.dim)\n if (Board.colOf[state[i]] == Board.colOf[oZ] &&\n state[i] < state[nZ])\n newBoard.inter++;\n }\n break;\n default: // UP AND DOWN\n if (Board.rowOf[state[nZ]] == Board.rowOf[nZ]) {\n // we've replaced a piece on its row with a zero\n // interference can only decrease since we know\n // the piece didn't belong to its old row\n //System.out.println(\"Took \" + state[nZ] + \" out of its row\");\n for (int i = Board.dim*Board.rowOf[nZ]; i < nZ; i++)\n if (Board.rowOf[state[i]] == Board.rowOf[nZ] &&\n state[i] > state[nZ])\n newBoard.inter--;\n for (int i = nZ+1; i < Board.dim*(Board.rowOf[nZ]+1); i++)\n if (Board.rowOf[state[i]] == Board.rowOf[nZ] &&\n state[i] < state[nZ])\n newBoard.inter--;\n } else if (Board.rowOf[state[nZ]] == Board.rowOf[oZ]) {\n // we've put a piece on its row that was a zero\n // interference can only increase since we know\n // the piece didn't belong to its old row\n //System.out.println(\"Put \" + state[nZ] + \" into its row\");\n for (int i = Board.dim*Board.rowOf[oZ]; i < oZ; i++)\n if (Board.rowOf[state[i]] == Board.rowOf[oZ] &&\n state[i] > state[nZ])\n newBoard.inter++;\n for (int i = oZ+1; i < Board.dim*(Board.rowOf[oZ]+1); i++)\n if (Board.rowOf[state[i]] == Board.rowOf[oZ] &&\n state[i] < state[nZ])\n newBoard.inter++;\n }\n } \n default: // update the manhattan distance\n newBoard.dist = this.dist - \n Board.manhattanTable[state[nZ]][nZ] +\n Board.manhattanTable[state[nZ]][oZ];\n }\n return newBoard;\n }", "private void setValidMoves() {\n\t\tl.getValidMoves();\n\n\t\tif(l.upValid) {\t// Update upward movement\n\t\t\ttmp=layout_Circle[l.y-1][l.x];\n\t\t\ttmp.setFill(Paint.valueOf(\"Green\"));\n\t\t}\n\n\t\tif(l.leftValid) {\t// Update leftward movement\n\t\t\ttmp=layout_Circle[l.y][l.x-1];\n\t\t\ttmp.setFill(Paint.valueOf(\"Green\"));\n\t\t}\n\n\t\tif(l.rightValid) {\t// Update rightward movement\n\t\t\ttmp=layout_Circle[l.y][l.x+1];\n\t\t\ttmp.setFill(Paint.valueOf(\"Green\"));\n\t\t}\n\t}", "boolean isValidMove(int move)\n\t{\n\t\treturn move >= 0 && move <= state.size() - 1 && state.get(move) == 0;\n\t}", "@Override\n public Status move(){\n\n if(onNode.getNextNode(this)==null){\n return Status.NOT_EMPTY_CAR;\n }\n List<Train> on = onNode.getNextNode(this).getTrains();\n if(!on.isEmpty()) return Status.CRASHED;\n\n Node next = onNode.getNextNode(this);\n prevNode.removeTrain(this);\n next.addTrain(this);\n x=next.getX();\n y=next.getY();\n try {\n ((Station)next).setGetOff();\n }\n catch (Exception e) {}\n \n return nextCar.move();\n }", "public void move() {\n char move;\n\n do {\n System.out.println(\"Move snake: (wasd)\");\n move = scan.nextLine().charAt(0);\n } while(move != 'a' && move != 'w' && move != 's' && move != 'd');\n \n\n switch (move) {\n case 'w':\n if(board[snakePartList.get(0).getSnakePartRowsOld()-1][snakePartList.get(0).getSnakePartCollsOld()] != '*' ) {\n if(board[snakePartList.get(0).getSnakePartRowsOld()-1][snakePartList.get(0).getSnakePartCollsOld()] == '@') {\n eatApple();\n }\n\n if(board[snakePartList.get(0).getSnakePartRowsOld()-1][snakePartList.get(0).getSnakePartCollsOld()] == 'S') {\n keepMoving = false;\n }\n\n for(int i = 0; i < snakePartList.size(); i++) {\n if(i != 0) {\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i-1).getSnakePartRowsOld());\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i-1).getSnakePartCollsOld());\n } else {\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i).getSnakePartRowsOld()-1);\n }\n }\n\n updateBoard();\n\n for(int i = 0; i < snakePartList.size(); i++) {\n snakePartList.get(i).updateOldPlace();\n }\n \n \n } else {\n keepMoving = false;\n }\n break;\n\n case 'a':\n if(board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()-1] != '*' ) {\n if( board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()-1] == '@') {\n eatApple();\n }\n if( board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()-1] == 'S') {\n keepMoving = false;\n }\n for(int i = 0; i < snakePartList.size(); i++) {\n if(i != 0) {\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i-1).getSnakePartCollsOld());\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i-1).getSnakePartRowsOld());\n } else {\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i).getSnakePartCollsOld()-1);\n }\n }\n updateBoard();\n\n for(int i = 0; i < snakePartList.size(); i++) {\n snakePartList.get(i).updateOldPlace();\n }\n\n \n } else {\n keepMoving = false;\n }\n break;\n\n case 's':\n if(board[snakePartList.get(0).getSnakePartRowsOld()+1][snakePartList.get(0).getSnakePartCollsOld()] != '*') {\n if( board[snakePartList.get(0).getSnakePartRowsOld()+1][snakePartList.get(0).getSnakePartCollsOld()] == '@') {\n eatApple();\n }\n if( board[snakePartList.get(0).getSnakePartRowsOld()+1][snakePartList.get(0).getSnakePartCollsOld()] == 'S') {\n keepMoving = false;\n }\n for(int i = 0; i < snakePartList.size(); i++) {\n if(i != 0) {\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i-1).getSnakePartRowsOld());\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i-1).getSnakePartCollsOld());\n } else {\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i).getSnakePartRowsOld()+1);\n }\n }\n updateBoard();\n\n for(int i = 0; i < snakePartList.size(); i++) {\n snakePartList.get(i).updateOldPlace();\n }\n\n \n } else {\n keepMoving = false;\n }\n break;\n\n case 'd':\n if(board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()+1] != '*') {\n if(board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()+1] == '@') {\n eatApple();\n }\n if(board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()+1] == 'S') {\n keepMoving = false;\n }\n for(int i = 0; i < snakePartList.size(); i++) {\n if(i != 0) {\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i-1).getSnakePartCollsOld());\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i-1).getSnakePartRowsOld());\n } else {\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i).getSnakePartCollsOld()+1);\n }\n }\n updateBoard();\n \n for(int i = 0; i < snakePartList.size(); i++) {\n snakePartList.get(i).updateOldPlace();\n }\n\n \n } else {\n keepMoving = false;\n }\n break;\n }\n }", "public State getMoving() {\n\t\treturn moving;\n\t}", "public void move(){\n \n currentFloor = currentFloor + ( 1 * this.direction);\n //if we're at the bottom or top after move, flip the bit\n if(Elevator.MIN_FLOOR == currentFloor \n || currentFloor == Elevator.MAX_FLOOR)\n this.direction *= -1;\n \n if(destinedPassengers[ currentFloor ] > 0)\n elevatorStop( currentFloor, true );\n \n if(building.floor(currentFloor).passengersWaiting() > 0)\n elevatorStop(currentFloor, false);\n \n }", "boolean doMove();", "public void updateCellState(Move move)\r\n\t{\r\n\t\tCellState color = this.grid[move.getMovedMarbleInitialPosition(0).getX()][move.getMovedMarbleInitialPosition(0).getY()];\r\n\t\t\r\n\t\tfor(int i = 0;i < move.getMovedMarblesCount();i++)\r\n\t\t{\r\n\t\t\tthis.grid[move.getMovedMarbleInitialPosition(i).getX()][move.getMovedMarbleInitialPosition(i).getY()] = CellState.EMPTY;\r\n\t\t}\r\n\t\tfor(int i = 0; i < move.getMovedMarblesFinalCount();i++)\r\n\t\t{\r\n\t\t\tif(isPositionValid(move.getMovedMarbleFinalPosition(i)))\r\n\t\t\t{\r\n\t\t\t\tthis.grid[move.getMovedMarbleFinalPosition(i).getX()][move.getMovedMarbleFinalPosition(i).getY()] = color;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(color == CellState.BLACK_MARBLE) this.blackMarblesCount --;\r\n\t\t\t\tif(color == CellState.WHITE_MARBLE) this.whiteMarblesCount --;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean move();", "public void move() {\n\t\t// tolerance of angle at which the Base starts moving\n\t\tint tolerance = 10;\n\t\tif(Math.abs(angle) < Math.abs(angleDesired)+tolerance && Math.abs(angleDesired)-tolerance < Math.abs(angle)) {\n\t\t\tdouble vX = Math.cos(Math.toRadians(this.angle + 90)) * v;\n\t\t\tdouble vY = Math.sin(Math.toRadians(this.angle + 90)) * v;\n\t\t\t\n\t\t\tthis.x += vX;\n\t\t\tthis.y += vY;\t\n\t\t\tthis.rectHitbox = new Rectangle((int)(x-rectHitbox.width/2),(int)(y-rectHitbox.height/2),rectHitbox.width,rectHitbox.height);\n\t\t}\n\t\t// curTargetPathBoardRectangle\n\t\tRectangle curTPBR = pathBoardRectangles.get(curTargetPathCellIndex).rect;\n\t\tRectangle rectSmallerBR = new Rectangle((int)curTPBR.getCenterX()-5,(int)curTPBR.getCenterY()-5,10,10);\n\t\t// updates the index when it crosses a pathCell so it counts down from pathCell to pathCell,\n\t\t// always having the next pathCell in the array as the target until the end is reached then it stops\n\t\tif(rectSmallerBR.contains(new Point((int)x,(int)y))) {\n\t\t\tif(curTargetPathCellIndex < pathBoardRectangles.size()-1) {\n\t\t\t\tcurTargetPathCellIndex++;\n\t\t\t\tparentGP.boardRect = pathBoardRectangles.get(curTargetPathCellIndex-1);\n\t\t\t\ttAutoDirectionCorrection.restart();\n\t\t\t}else {\n\t\t\t\tparentGP.isMoving = false;\n\t\t\t\tparentGP.boardRect = pathBoardRectangles.get(curTargetPathCellIndex);\n\t\t\t\tpathBoardRectangles.clear();\n\t\t\t\ttAutoDirectionCorrection.stop();\n\t\t\t\tStagePanel.tryCaptureGoldMine(parentGP);\n\t\t\t}\n\t\t}\n\t}", "private void doGameCycle() {\n if(currentState == Common.GAME_STATE.INGAME){\r\n gun.move();\r\n checkCollision();\r\n repaint();\r\n }\r\n }", "private void validPlayerMove(char moveType) {\n\n\t\t//Obtain X and Y of playerLocation\n\t\tint x = getPlayerLocation()[0];\n\t\tint y = getPlayerLocation()[1];\n\n\t\t//By default, set xOffset and yOffset to 0\n\t\tint xOffset = 0;\n\t\tint yOffset = 0;\n\n\t\t//Change xOffset and yOffset corresponding to each moveType\n\t\t//For example, RIGHT would set xOffset to +1\n\t\tswitch(moveType) {\n\t\tcase Legend.UP: \n\t\t\tyOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.UP_LEFT:\n\t\t\tyOffset = -1;\n\t\t\txOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.UP_RIGHT:\n\t\t\tyOffset = -1;\n\t\t\txOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.DOWN:\n\t\t\tyOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.DOWN_RIGHT:\n\t\t\tyOffset = 1;\n\t\t\txOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.DOWN_LEFT:\n\t\t\tyOffset = 1;\n\t\t\txOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.LEFT:\n\t\t\txOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.RIGHT:\n\t\t\txOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.JUMP:\n\n\t\t\t//Generate a random location of the jump\n\t\t\twhile (true) {\n\n\t\t\t\t//random x and y values (between 0-10)\n\t\t\t\tint randomX = 1+(int)(Math.random()*10);\n\t\t\t\tint randomY = 1+(int)(Math.random()*10);\n\n\t\t\t\t//If the new location is a BlankSpace, assign that as a Player, and assign a new move in moveList\n\t\t\t\tif(map[randomX][randomY] instanceof BlankSpace) {\n\t\t\t\t\tnewMap[randomX][randomY] = new Player(x, y, board);\n\t\t\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\t\t\tmoveList[x][y] = moveType;\n\t\t\t\t\tmap[x][y].setJumpLocation(randomX, randomY);\n\t\t\t\t\tsetNewPlayerLocation(new int[] {randomX, randomY});\n\t\t\t\t\tbreak;\n\t\t\t\t} \n\n\t\t\t\t//If the new location is a Mho, completely wipe the board of the player, and initiate a gameOver procedure\n\t\t\t\telse if(map[randomX][randomY] instanceof Mho) {\n\t\t\t\t\tnewMap[randomX][randomY] = new Mho(x, y, board);\n\t\t\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\t\t\tmoveList[x][y] = moveType;\n\t\t\t\t\tmap[x][y].setJumpLocation(randomX, randomY);\n\t\t\t\t\tsetNewPlayerLocation(new int[] {randomX, randomY});\n\t\t\t\t\tgameOver();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t//If the new location that the Player will move to will be a Player (in the case of Legend.SHRINK), or BlankSpace, change map and newMap, as well as moveList and the playerLocation \n\t\tif (map[x+xOffset][y+yOffset] instanceof BlankSpace || map[x+xOffset][y+yOffset] instanceof Player) {\n\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\tnewMap[x+xOffset][y+yOffset] = new Player(x+xOffset, y+yOffset, board);\n\t\t\tmoveList[x][y] = moveType;\n\t\t\tsetNewPlayerLocation(new int[] {x+xOffset, y+yOffset});\n\t\t\treturn;\n\t\t} \n\n\t\t//If the new location that the Player will move to will be a Fence, remove the player from the map and initiate the gameOver() process\n\t\telse {\n\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\tmoveList[x][y] = Legend.SHRINK;\n\t\t\tsetNewPlayerLocation(new int[] {x, y});\n\t\t\tgameOver();\n\t\t\treturn;\n\t\t}\n\n\t}", "@Override\r\n\tpublic void move(Map map) {\r\n\t\tRandom rand = new Random();\r\n\t\tdouble change = rand.nextDouble();\r\n\t\t\r\n\t\tif(change > 0.8) {\r\n\t\t\treverse = !reverse;\r\n\t\t}\r\n\r\n\t\tguardIndex = move_aux(guardIndex,coords,reverse,map);\r\n\t}", "public void makeMove(Location loc)\n {\n if (loc == null)\n removeSelfFromGrid();\n else\n {\n int newDirection = getLocation().getDirectionToward(loc);\n Location nextLocation = getLocation().getAdjacentLocation(newDirection);\n Actor otherActor = getGrid().get(nextLocation);\n if(otherActor != null)\n {\n if(otherActor instanceof AbstractPokemon)\n {\n AbstractPokemon otherPokemon = (AbstractPokemon) otherActor;\n battle(otherPokemon);\n }\n else\n {\n PokemonTrainer otherTrainer = (PokemonTrainer) otherActor;\n battleTrainer(otherTrainer);\n }\n }\n if(getGrid() != null)\n moveTo(loc);\n }\n }", "@Override\n public void makeMove(int player, Coordinate startCoordinate, Coordinate endCoordinate) throws InvalidMoveException {\n GamePiece curr = myGamePieces.get(startCoordinate.getRow()).get(startCoordinate.getCol());\n Coordinate oldPos = curr.getPosition();\n List<GamePiece> neighbors = getNeighbors(curr);\n if (curr.calculateAllPossibleMoves(neighbors,player).contains(endCoordinate)) {\n curr.makeMove(endCoordinate, neighbors, player);\n doesTurnChange = curr.changeTurnAfterMove();\n if(curr.getPosition() != oldPos){\n Coordinate currPosition = curr.getPosition();\n GamePiece switchedWith = myGamePieces.get(currPosition.getRow()).get(currPosition.getCol());\n myGamePieces.get(oldPos.getRow()).set(oldPos.getCol(), switchedWith);\n myGamePieces.get(currPosition.getRow()).set(currPosition.getCol(), curr);\n }\n } else {\n throw new InvalidMoveException(\"Your move to \" + endCoordinate.toString() + \" is invalid\");\n }\n }", "public MoveState(ArrayList<Box> possibleMovesby0,ArrayList<Box> possibleMovesby1, boolean pushWorker, boolean swapWorker, boolean heraIsActive, Model model,boolean firstAction)\n {\n\n //If possibleMoves is empty the player has lost\n stateID = StateEnum.Move;\n if(possibleMovesby0.isEmpty() && possibleMovesby1.isEmpty() && firstAction)\n {\n playerHasLost(model);\n }\n this.firstAction=firstAction;\n\n possibleMovesWorker0 = possibleMovesby0;\n possibleMovesWorker1 = possibleMovesby1;\n pushWorkerBack = pushWorker;\n swapWorkerPosition = swapWorker;\n hasFinished = false;\n this.heraIsActive = heraIsActive;\n\n startup(model);\n if(model.getTurn().getCurrentPlayer().getHasLost())\n {\n hasFinished=true;\n }\n }", "public void move(Cell[][] maze) {\n // check monster still alive or not\n if (!alive) {\n return;\n }\n //four directions: left, right, up, down\n int[][] dirs = {{0, -1}, {0, 1}, {-1, 0}, {1, 0}};\n // a list to store all valid directions to move\n List<int[]> validDir = new ArrayList<>();\n for (int[] dir : dirs) {\n int newRow = this.current_row + dir[0];\n int newCol = this.current_column + dir[1];\n // try finding a location where is not wall, not the previous location, not a place 3 sides surrounded by walls\n // and save it to valid directions list\n if (maze[newRow][newCol].getValue() != 1 && !(newRow == pre_row && newCol == pre_column)\n && validNextMove(newRow, newCol, maze)) {\n int[] newLocation = new int[]{newRow, newCol};\n validDir.add(newLocation);\n }\n }\n //If there is no valid move choice, the monster has to backtrack\n if (validDir.size() == 0) {\n this.current_row = this.pre_row;\n this.current_column = this.pre_column;\n this.pre_row = this.current_row;\n this.pre_column = this.current_column;\n } else {\n // randomly select a valid direction to move\n Random random = new Random();\n int ranNum = random.nextInt(validDir.size());\n int[] newLoc = validDir.get(ranNum);\n int newRow = newLoc[0];\n int newCol = newLoc[1];\n this.pre_row = this.current_row;\n this.pre_column = this.current_column;\n this.current_row = newRow;\n this.current_column = newCol;\n }\n }", "private void actionSwitchMove()\r\n\t{\r\n\t\tif (FormMainMouse.isSampleMovable)\r\n\t\t{\r\n\t\t\thelperSwitchMoveOff();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\thelperSwitchMoveOn();\r\n\r\n\t\t\t//---- Turn off sample selection mode\r\n\t\t\thelperSwitchSelectOff();\r\n\t\t}\r\n\t}", "private boolean makeMove(Move move) {\n\n // Moving piece from Cell\n Piece sourcePiece = move.getStart().getCurrentPiece();\n\n // Valid Move? Calling Piece actual implementation\n if (!sourcePiece.canMove(board, move.getStart(), move.getEnd())) {\n System.out.println(\"Invalid Move, sourcePiece is \" + sourcePiece);\n }\n\n // Killed other player Piece?\n Piece destPiece = move.getEnd().getCurrentPiece();\n if (destPiece != null) {\n destPiece.setKilled(true);\n move.setPieceKilled(destPiece);\n }\n\n // castling?\n if (sourcePiece instanceof King\n && sourcePiece.isCastlingMove()) {\n move.setCastlingMove(true);\n }\n\n // Store the Move\n movesPlayed.add(move);\n\n // If move is VALID, set piece=null at start cell and new piece at dest cell\n move.getEnd().setCurrentPiece(sourcePiece);\n move.getStart().setCurrentPiece(null);\n\n // Game Win or not\n if (destPiece instanceof King) {\n if (move.getPlayedBy().isWhiteSide()) {\n this.setStatus(GameStatus.WHITE_WIN);\n } else {\n this.setStatus(GameStatus.BLACK_WIN);\n }\n\n }\n\n return true;\n }", "@Override\r\n\tpublic void makeRandonMove() {\r\n\t\tif (randPlayer.getPlayerNumber() == game.getState().getTurn() && !game.getState().isFinished()) game.execute(randPlayer.requestAction(game.getState()));\r\n\t}", "public void move(){\n System.out.println(\"I can't move...\");\n }", "public TurnState step() {\n ReadOnlyHistory history = board.viewHistory();\n \n if (!isGameOver) {\n Player next = nextPlayer();\n Move move = null;\n \n try {\n final long startTime = System.currentTimeMillis();\n move = next.play(history);\n next.addTime(System.currentTimeMillis() - startTime);\n \n if (next.getTime() >= timeLimit || !board.isValid(move)){\n isGameOver = true;\n }\n else {\n board.set(move);\n }\n }\n catch (IllegalArgumentException ex) {\n System.err.println(\"Player \" + next.getName() + \": \" + ex.getMessage());\n isGameOver = true;\n }\n catch (ArrayIndexOutOfBoundsException ex) {\n System.err.println(\"Player \" + next.getName() + \": \" + ex.getMessage());\n isGameOver = true;\n }\n \n return new TurnState(next, move, isGameOver);\n }\n else {\n return new TurnState(null, null, true);\n }\n }", "boolean makeMove(Bouger m) {\n\tlong oldBits[] = { pieceBits[LIGHT], pieceBits[DARK] };\n\n\tint from, to;\n\t/*\n\t* test to see if a castle move is legal and move the rook (the king is\n\t* moved with the usual move code later)\n\t*/\n\tif ((m.bits & 2) != 0) {\n\n\tif (inCheck(side))\n\treturn false;\n\tswitch (m.getTo()) {\n\tcase 62:\n\tif (color[F1] != EMPTY || color[G1] != EMPTY\n\t|| attack(F1, xside) || attack(G1, xside))\n\treturn false;\n\tfrom = H1;\n\tto = F1;\n\tbreak;\n\tcase 58:\n\tif (color[B1] != EMPTY || color[C1] != EMPTY\n\t|| color[D1] != EMPTY || attack(C1, xside)\n\t|| attack(D1, xside))\n\treturn false;\n\tfrom = A1;\n\tto = D1;\n\tbreak;\n\tcase 6:\n\tif (color[F8] != EMPTY || color[G8] != EMPTY\n\t|| attack(F8, xside) || attack(G8, xside))\n\treturn false;\n\tfrom = H8;\n\tto = F8;\n\tbreak;\n\tcase 2:\n\tif (color[B8] != EMPTY || color[C8] != EMPTY\n\t|| color[D8] != EMPTY || attack(C8, xside)\n\t|| attack(D8, xside))\n\treturn false;\n\tfrom = A8;\n\tto = D8;\n\tbreak;\n\tdefault: /* shouldn't get here */\n\tfrom = -1;\n\tto = -1;\n\tbreak;\n\t}\n\tcolor[to] = color[from];\n\tpiece[to] = piece[from];\n\tcolor[from] = EMPTY;\n\tpiece[from] = EMPTY;\n\tpieceBits[side] ^= (1L << from) | (1L << to);\n\t}\n\t/* back up information so we can take the move back later. */\n\n\tHistoryData h = new HistoryData();\n\th.m = m;\n\tto = m.getTo();\n\tfrom = m.getFrom();\n\th.capture = piece[to];\n\th.castle = castle;\n\th.ep = ep;\n\th.fifty = fifty;\n\th.pawnBits = new long[] { pawnBits[LIGHT], pawnBits[DARK] };\n\th.pieceBits = oldBits;\n\thistDat[hply++] = h;\n\n\t/*\n\t* update the castle, en passant, and fifty-move-draw variables\n\t*/\n\tcastle &= castleMask[from] & castleMask[to];\n\tif ((m.bits & 8) != 0) {\n\tif (side == LIGHT)\n\tep = to + 8;\n\telse\n\tep = to - 8;\n\t} else\n\tep = -1;\n\tif ((m.bits & 17) != 0)\n\tfifty = 0;\n\telse\n\t++fifty;\n\n\t/* move the piece */\n\tint thePiece = piece[from];\n\tif (thePiece == KING)\n\tkingSquare[side] = to;\n\tcolor[to] = side;\n\tif ((m.bits & 32) != 0) {\n\tpiece[to] = m.promote;\n\tpieceMat[side] += pieceValue[m.promote];\n\t} else\n\tpiece[to] = thePiece;\n\tcolor[from] = EMPTY;\n\tpiece[from] = EMPTY;\n\tlong fromBits = 1L << from;\n\tlong toBits = 1L << to;\n\tpieceBits[side] ^= fromBits | toBits;\n\tif ((m.bits & 16) != 0) {\n\tpawnBits[side] ^= fromBits;\n\tif ((m.bits & 32) == 0)\n\tpawnBits[side] |= toBits;\n\t}\n\tint capture = h.capture;\n\tif (capture != EMPTY) {\n\tpieceBits[xside] ^= toBits;\n\tif (capture == PAWN)\n\tpawnBits[xside] ^= toBits;\n\telse\n\tpieceMat[xside] -= pieceValue[capture];\n\t}\n\n\t/* erase the pawn if this is an en passant move */\n\tif ((m.bits & 4) != 0) {\n\tif (side == LIGHT) {\n\tcolor[to + 8] = EMPTY;\n\tpiece[to + 8] = EMPTY;\n\tpieceBits[DARK] ^= (1L << (to + 8));\n\tpawnBits[DARK] ^= (1L << (to + 8));\n\t} else {\n\tcolor[to - 8] = EMPTY;\n\tpiece[to - 8] = EMPTY;\n\tpieceBits[LIGHT] ^= (1L << (to - 8));\n\tpawnBits[LIGHT] ^= (1L << (to - 8));\n\t}\n\t}\n\n\t/*\n\t* switch sides and test for legality (if we can capture the other guy's\n\t* king, it's an illegal position and we need to take the move back)\n\t*/\n\tside ^= 1;\n\txside ^= 1;\n\tif (inCheck(xside)) {\n\ttakeBack();\n\treturn false;\n\t}\n\treturn true;\n\t}", "private GameState doMove(Move move, Player player, GameState state) {\n\t\tGameState newState = state.deepClone();\n\t\tplayer = Main.getSWController().getPlayerController().getPlayer(player.getName(), newState);\n\t\tswitch (move.getAction()) {\n\t\tcase OLYMPIA:\n\t\tcase BUILD:\n\t\t\tplayer.getHand().remove(move.getCard());\n\t\t\tplayer.getBoard().addCard(move.getCard());\n\t\t\tplayer.setChooseCard(null);\n\t\t\tif (move.getCard().getEffects() != null)\n\t\t\t\tfor (Effect effect : move.getCard().getEffects())\n\t\t\t\t\tif (effect.getType() == EffectType.WHEN_PLAYED)\n\t\t\t\t\t\teffect.run(player, newState, newState.isTwoPlayers());\n\t\t\tif (move.getTradeOption() != null)\n\t\t\t\tMain.getSWController().getPlayerController().doTrade(newState, player, move.getTradeOption());\n\t\t\tbreak;\n\t\tcase PLACE_SLOT:\n\t\t\tplayer.getHand().remove(move.getCard());\n\t\t\tswitch (player.getBoard().nextSlot()) {\n\t\t\tcase 0:\n\t\t\t\tplayer.getBoard().slot1();\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tplayer.getBoard().slot2();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tplayer.getBoard().slot3();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tplayer.getBoard().fill(player.getBoard().nextSlot());\n\t\t\tplayer.setChooseCard(null);\n\t\t\tif (move.getTradeOption() != null)\n\t\t\t\tMain.getSWController().getPlayerController().doTrade(newState, player, move.getTradeOption());\n\t\t\tbreak;\n\t\tcase SELL:\n\t\t\tplayer.getHand().remove(move.getCard());\n\t\t\tplayer.addCoins(3);\n\t\t\tplayer.setChooseCard(null);\n\t\t}\n\n\t\treturn newState;\n\t}", "@Test\n public void testStateTransitions2()\n {\n theEngine.start();\n letPlayerWin();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Player won -> Halted\n theEngine.quit();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Player won -> Player died\n killPlayerByPlayerMove();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Undo from player won state\n theEngine.undoLastMove();\n //didn't throw assertion error, so this is fine\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inHaltedState());\n }" ]
[ "0.68265575", "0.67821", "0.6780207", "0.6679596", "0.66268444", "0.6555612", "0.6552218", "0.648701", "0.6419093", "0.63942784", "0.63768876", "0.6357664", "0.6357511", "0.63356423", "0.63347423", "0.63272786", "0.6307144", "0.62755036", "0.6254761", "0.62383664", "0.623573", "0.6223932", "0.62160337", "0.6211019", "0.62054455", "0.6192213", "0.618861", "0.61387163", "0.61312795", "0.612627", "0.611667", "0.61125404", "0.6105004", "0.6095236", "0.6088447", "0.60833496", "0.60803956", "0.60660756", "0.60624945", "0.60598576", "0.6050788", "0.6050742", "0.604675", "0.60414684", "0.6035173", "0.6025387", "0.6024163", "0.6022651", "0.60037285", "0.60010296", "0.5995873", "0.59828734", "0.5976643", "0.5973747", "0.59730965", "0.59715116", "0.5971268", "0.5969976", "0.5966286", "0.5961327", "0.59557134", "0.5955457", "0.5950492", "0.5944953", "0.59372914", "0.592465", "0.59222364", "0.5919406", "0.5918002", "0.59126174", "0.59118927", "0.5907454", "0.5900709", "0.59006", "0.5895585", "0.5893915", "0.5893822", "0.58924395", "0.588318", "0.58825684", "0.58722323", "0.5872174", "0.5864468", "0.58567476", "0.58508396", "0.5846144", "0.5842117", "0.58366096", "0.5829305", "0.5826835", "0.582669", "0.58240914", "0.5821503", "0.581502", "0.5808479", "0.58065563", "0.5804189", "0.58018965", "0.5801057", "0.5797645" ]
0.5837139
87
This function tries to change current state to dead state. If this change is valid, individual start dead process.
public void justDie() { synchronized (this) { currentState.justDie(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void dead() { this.alive = false; }", "private void bringToLife(){\n this.dead = false;\n }", "public void setDead(boolean dead) {\n isDead = dead;\n }", "@Override\n\t\tpublic void processStatusChanged(ProcessStatusEvent event) {\n\t\t\tif (event.getNewStatus().isDead() && event.getOldStatus() == AbstractProcess.Status.RUNNING) {\n\t\t\t\tfreeProcess(uid);\n\t\t\t}\n\t\t}", "public void kill() {\r\n \t\tthis.isDead = true;\r\n \t}", "public void setDead(boolean dead) {\n this.isDead = dead;\n }", "public void changeState() {\n if (!isDead) {\n Bitmap temp = getBitmap();\n setBitmap(stateBitmap);\n stateBitmap = temp;\n }\n }", "public void setIsDead(boolean isDead) {\n this.isDead = isDead;\n }", "public void setDead(boolean dead) {\r\n this.dead = dead;\r\n }", "@Override\n\tpublic boolean isDead() {\n\t\treturn dead;\n\t}", "public void setDead(boolean value);", "private void repaired() { //active\n activate();\n this.damageState = DamageState.DAMAGED;\n this.setCurrentLife(this.maxLife / REPAIR_LIFE_FACTOR);\n }", "public void setDead(boolean dead) {\n\t\tthis.dead = dead;\n\t}", "public void setDead(){\n\t\t//queue this blood for cleanup\n\t\tvisible = false;\n\t\tDEAD = true;\n\t\tcleanUp();\n\t}", "private void foundRunning() {\n\t\tif (state == BridgeState.RUNNING || state == BridgeState.CREATED) {\n\t\t\tstate = BridgeState.RUNNING;\n\t\t}\n\t}", "public void markDead() {\r\n\t\tsetNodeWasContacted(0);\r\n\t}", "public boolean isDead()\n {\n // TODO: replace this line with your code\n }", "public State getDead() {\n\t\treturn dead;\n\t}", "public boolean isDead();", "protected void setDead()\n {\n alive = false;\n if(location != null) {\n field.clear(location);\n location = null;\n field = null;\n }\n }", "protected void setDead()\n {\n alive = false;\n if(location != null) {\n field.clear(location);\n location = null;\n field = null;\n }\n }", "@Override\n\tpublic boolean isDead() {\n\t\treturn mProgress>mLife && mLife>=0;\n\t}", "private void breakSpecialState() {\n this.inSpecialState = false;\n this.resetXMovement();\n }", "private StateChange checkBeforeStart() {\n PayaraServerStatus status = PayaraState.getStatus(instance);\n String msgKey = null;\n switch (status.getStatus()) {\n case ONLINE:\n TaskState result;\n TaskEvent event;\n if (PayaraModule.PROFILE_MODE.equals(instance.getProperty(PayaraModule.JVM_MODE))) {\n result = TaskState.FAILED;\n event = TaskEvent.CMD_FAILED;\n } else {\n result = TaskState.COMPLETED;\n event = TaskEvent.CMD_COMPLETED;\n }\n return new StateChange(this, result, event,\n \"StartTask.startDAS.alreadyRunning\");\n case OFFLINE:\n if (ServerUtils.isAdminPortListening(\n instance, NetUtils.PORT_CHECK_TIMEOUT)) {\n msgKey = \"StartTask.startDAS.adminPortOccupied\";\n } else {\n final int httpPort = instance.getPort();\n if (httpPort >= 0 && httpPort <= 65535\n && NetUtils.isPortListeningLocal(\n instance.getHost(), httpPort)) {\n msgKey = \"StartTask.startDAS.httpPortOccupied\";\n }\n }\n break;\n case SHUTDOWN:\n msgKey = \"StartTask.startDAS.shutdown\";\n break;\n case STARTUP:\n msgKey = \"StartTask.startDAS.startup\";\n }\n return msgKey != null\n ? new StateChange(this, TaskState.FAILED,\n TaskEvent.CMD_FAILED, msgKey, this.instance.getDisplayName())\n : null;\n }", "default public boolean dead() {\n return life().dead();\n }", "public void updateStates() {\n if (isRunningProcess && currentRunningProcess.getState() == ProcessState.RUNNING\n && currentRunningProcess.remainingCPUBurstTime == 0) {\n //this is end of current cpu burst, check if any more cpu time to go.\n if (currentRunningProcess.remainingCPUTime <= 0) {\n currentRunningProcess.setFinished(currentTime);\n processCounter--;\n } else {\n //this process still has more CPU time to go.\n currentRunningProcess.setBlocked();\n isBlockedProcess++;\n }\n isRunningProcess = false;\n currentRunningProcess = null;\n }\n for (Process process : processes) {\n // For each process:\n // Check if this is the running process and if it needs to be preempted (RR algorithm only).\n if (process == currentRunningProcess && currentAlgorithm == Algorithm.RR) {\n if (isRunningProcess && remainingQuantum == 0) {\n //this process has finished its quantum, it will be preempted by the next\n //ready process.\n currentRunningProcess.setReady(readyProcesses);\n isRunningProcess = false;\n currentRunningProcess = null;\n }\n }\n // Check if this process has finished being blocked.\n if (process.getState() == ProcessState.BLOCKED\n && process.remainingBlockedBurstTime == 0) {\n \tif(currentAlgorithm == Algorithm.UP){\n \t\tprocess.setRunning(randomNumbers.remove(0));\n \t\tisRunningProcess = true;\n \t\tcurrentRunningProcess = process;\n \t}\n \telse{\n \t\tprocess.setReady(readyProcesses);\n \t}\n isBlockedProcess--;\n // If UP algorithm. Set running. Otherweise set ready\n }\n // Check if this process is ready to run:\n if (process.arrivalTime <= currentTime) {\n if (process.getState() == ProcessState.NONEXISTENT) {\n process.setReady(readyProcesses);\n }\n }\n }\n }", "public void setDead()\r\n/* 107: */ {\r\n/* 108:128 */ if (this.b) {\r\n/* 109:129 */ vs.a(this.world, this, this);\r\n/* 110: */ }\r\n/* 111:132 */ super.setDead();\r\n/* 112: */ }", "public void activate() {\r\n\t\tif (state != MachineState.DOWN)\r\n\t\t\tthrow new IllegalStateException(\r\n\t\t\t\t\t\"Only a machine in state DOWN can be activated.\");\r\n\t\tassert curJob == null;\r\n\r\n\t\tstate = MachineState.IDLE;\r\n\t\tprocFinished = -1.0d;\r\n\t\tprocStarted = -1.0d;\r\n\r\n\t\tworkStation.activated(this);\r\n\r\n\t\tdownReason = null;\r\n\t}", "@Override\n\tpublic boolean isDead() {\n\t\treturn mRemainedCounters == 0;\n\t}", "public abstract void turnToDead(int x, int y);", "public boolean isDead() {\r\n \t\treturn this.isDead;\r\n \t}", "public void setStateToExpired() {\n state = VALID_STATES[1];\n }", "public void applyNewState() {\n this.setAlive(this.newState);\n }", "private void handleActiveFailure() {\n\t\tif (isElectedBackup) {\n\t\t\tterminateThread.set(true);\n\t\t\tnew Thread(LoadBalancer.getNewActiveLoadBalancer()).start();\n\t\t\tfor (RemoteLoadBalancer remoteLoadBalancer : remoteLoadBalancers) {\n\t\t\t\tremoteLoadBalancer.resetState();\n\t\t\t}\n\t\t} else {\n\t\t\tcurrentActive.setState(LoadBalancerState.PASSIVE);\n\t\t\tcurrentActive.setIsElectedBackup(false);\n\t\t\ttry {\n\t\t\tcurrentActive = remoteLoadBalancers.stream().filter(x -> x.isElectedBackup()).findFirst().get();\n\t\t\t} catch (NoSuchElementException e) {\n\t\t\t\tcurrentActive = null;\n\t\t\t}\n\t\t\tresetActiveHeartbeatTimer();\n\t\t}\n\t}", "public void kill() { _isAlive = false; }", "public void setStateToActive() {\n state = VALID_STATES[0];\n }", "public boolean isDead() {\n\t\treturn dead;\n\t}", "public void step() {\n\t\t// calculate new values\n\t\tfor (int x = 0; x < gridX; x++) {\n\t\t\tfor (int y = 0; y < gridY; y++) {\n\t\t\t\tCell c = cells[x + (y * gridX)];\n\t\t\t\tCell newCell = newCells[x + (y * gridX)];\n\n\t\t\t\tint neighborCount = sameNeighborCount(x, y);\n\n\t\t\t\tif (c.isActive) {\n\t\t\t\t\tif (neighborCount < 2) {\n\t\t\t\t\t\t// all alone, die of loneliness\n\t\t\t\t\t\tnewCell.isActive = false;\n\t\t\t\t\t\tnewCell.cellColor = app.color(deadColor);\n\t\t\t\t\t}\n\t\t\t\t\telse if (neighborCount > 3) {\n\t\t\t\t\t\tnewCell.isActive = false;\n\t\t\t\t\t\tnewCell.cellColor = app.color(deadColor);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Dead cells can be reborn if surrounded by enough neighbors of the same\n\t\t\t\t\t// color. The cell will be reborn using the most prominent color.\n\t\t\t\t\tint populousColor = mostPopulousColor(x, y);\n\t\t\t\t\tif (populousColor > Integer.MIN_VALUE) {\n\t\t\t\t\t\tnewCell.isActive = true;\n\t\t\t\t\t\tnewCell.cellColor = populousColor;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// update to new state\n\t\tfor (int i = 0; i < cells.length; i++) {\n\t\t\tcells[i].isActive = newCells[i].isActive;\n\t\t\tcells[i].cellColor = newCells[i].cellColor;\n\t\t}\n\t}", "public boolean isDead() {\n return isDead;\n }", "public boolean isDead() {\n return isDead;\n }", "private void resetPIDBreach() {\n\t\t\n\t}", "@Override\n\tpublic void onLifeStateChanged(State prevState, State newState)\n\t{\n\t\tif (newState == State.DEAD)\n\t\t{\n\t\t\tplayer.onPlayerEntityDead();\n\t\t}\n\t}", "private void updateState() {\n\t while(!isGoodState()) {\n\t\t updateStateOnce();\n\t }\n }", "@Override\n\tpublic boolean isProcessInStateMachine() {\n\t\treturn false;\n\t}", "private void fullRepaired() { //full life\n this.active = true;\n this.damageState = DamageState.FULL;\n }", "private final void kill() {\n\t\tgrown=false;\t\t\n\t}", "private void handleKillStart() {\n if (curState != 1) {\n Slog.i(TAG, \"handle kill start, stop zswapd\");\n removeMessagesToKill();\n curState = 3;\n closeZswapd();\n Message msg = handler.obtainMessage();\n msg.what = 10;\n handler.sendMessageDelayed(msg, 10000);\n }\n }", "public synchronized void reset() {\n state = State.WAITING_TO_START;\n }", "public boolean isDead() {\r\n\t\treturn !isAlive();\r\n\t}", "public Deadline start()\n\t{\n\t\treturn new Deadline(this);\n\t}", "public void setAlive() {\n\t\tif (this.alive == true) {\n\t\t\tthis.alive = false;\n\t\t} else {\n\t\t\tthis.alive = true;\n\t\t}\n\t}", "Boolean isDead();", "public void kill() throws RuntimeException {\n if (isDead == true)\n throw new RuntimeException(\"This player is already dead!\");\n this.isDead = true;\n }", "public boolean isDead() {\r\n\t\treturn this.lives == 0;\r\n\t}", "public void setAlive() {\n\t\tif(alive)\n\t\t\talive = false;\n\t\telse\n\t\t\talive = true;\n\t}", "public boolean isDead() {\n return this.isDead;\n }", "public void arraiter() {\n \tthis.running = false;\n }", "synchronized void cullDeadProcesses() {\n\t\t// Removes processes that have completed and haven't been checked on\n\t\t// for maxLiveTime milliseconds.\n\t\t//long cullBefore = System.currentTimeMillis() - maxLiveTime;\n\t\t//int before = processes.size();\n\t\tIterator<Map.Entry<Long, ProcessEntry>> iter = processes.entrySet().iterator();\n\t\tint runningCount = 0;\n\t\twhile (iter.hasNext()) {\n\t\t\tMap.Entry<Long, ProcessEntry> entry = iter.next();\n\t\t\tProcessEntry pe = entry.getValue();\n\t\t\tAbstractProcess.Status status = pe.process.getStatus();\n\t\t\t// For now, we never remove \"dead\" processes to ensure the status\n\t\t\t// is maintained. So instead all this does is check to make sure\n\t\t\t// that the run count doesn't get messed up.\n\t\t\t/*if (pe.lastAccess < cullBefore && status.isDead()) {\n\t\t\t\tif (logger.isDebugEnabled()) {\n\t\t\t\t\tlogger.debug(\"Process {} last accessed {}, before cutoff of {}.\",\n\t\t\t\t\t\t\tnew Object[] { uidToString(entry.getKey()),\n\t\t\t\t\t\t\tdateFormat.format(new Date(entry.getValue().lastAccess)),\n\t\t\t\t\t\t\tdateFormat.format(new Date(cullBefore)) });\n\t\t\t\t}\n\t\t\t\tpe.process.destroy();\n\t\t\t\titer.remove();\n\t\t\t} else */\n\t\t\tif (status == AbstractProcess.Status.RUNNING) {\n\t\t\t\trunningCount++;\n\t\t\t}\n\t\t}\n\t\t//logger.info(\"Removed {} processes.\", before - processes.size());\n\t\tif (this.runningCount != runningCount) {\n\t\t\tlogger.error(\"Actual running count {} does not match stored running count of {}! This is a bug!\", runningCount, this.runningCount);\n\t\t\t// Fix this\n\t\t\tthis.runningCount = runningCount;\n\t\t\tcheckRunningProcesses();\n\t\t}\n\t}", "private void reportNewIdleState(boolean idle) {\n StatusDevice.IDLE_CONSTRAINT_SATISFIED.set(idle);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n if (HaloUtils.isServiceRunning(mContext, HaloSchedulerService.class)) {\n mContext.startService(HaloSchedulerService.deviceStatusChanged(mContext, Job.STATUS_IDLE_DEVICE_KEY, false));\n } else {\n mContext.startForegroundService(HaloSchedulerService.deviceStatusChanged(mContext, Job.STATUS_IDLE_DEVICE_KEY, true));\n }\n } else {\n mContext.startService(HaloSchedulerService.deviceStatusChanged(mContext, Job.STATUS_IDLE_DEVICE_KEY, false));\n }\n }", "@Override\n public boolean isDead() {\n return (this.getLife() <= 0);\n }", "protected boolean isDead(int x, int y){\n \tclearAllSigns();\n \treturn noLife(x, y);\n\t}", "@Override\n public void Die() {\n this.setAlive(false);\n }", "protected void die()\n\t{\n\t\tdead = true;\n\t\tcurrentCell.setOccupant(null);\n\t\tcurrentCell = null;\n\t}", "public boolean isAlive(){\r\n\t\tif(dead==true){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "protected void checkDeadLock()\r\n/* 134: */ {\r\n/* 135:165 */ if (channel().isRegistered()) {\r\n/* 136:166 */ super.checkDeadLock();\r\n/* 137: */ }\r\n/* 138: */ }", "private void killBullet() {\r\n this.dead = true;\r\n }", "public void forceChangeState(State toState) {\n changeState(state, toState);\n }", "public boolean getDead();", "private void checkDeadlock() {\r\n\t\tif (p0.holdsOnlyLeftStick() && p1.holdsOnlyLeftStick() && p2.holdsOnlyLeftStick()\r\n\t\t\t\t&& p3.holdsOnlyLeftStick() && p4.holdsOnlyLeftStick()) {\r\n\t\t\tisDeadlock = true;\r\n\t\t}\r\n\t}", "@Override\n\tpublic void force() {\n\t\t\n\t\ttry (Restore restore = ComponentBoundary.push(loggerName(), this)) {\t\t\n\t\t\tstateHandler.waitToWhen(new IsSoftResetable(), new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tlogger().info(\"Forcing complete.\");\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tchildStateReflector.stop();\n\t\t\t\t\t\n\t\t\t\t\tgetStateChanger().setState(ParentState.COMPLETE);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "@Override\n public void checkEffect()\n {\n age(1);\n\n if (!suspended)\n suspend();\n }", "public boolean isDead() {\r\n return this.dead;\r\n }", "@Override\n public boolean use(ActivePokemon p, Battle b) {\n if (!p.isActuallyDead()) {\n return false;\n }\n\n p.removeStatus();\n p.healHealthFraction(1);\n\n Messages.add(p.getName() + \" was fully revived!\");\n return true;\n }", "@Override\n public boolean use(ActivePokemon p, Battle b) {\n if (!p.isActuallyDead()) {\n return false;\n }\n\n p.removeStatus();\n p.healHealthFraction(1);\n\n Messages.add(p.getName() + \" was fully revived!\");\n return true;\n }", "private void changeState() {\n if (jobs.contains(this.currentFloor)){\n throw new AssertionError(\"Changing state of elevator no \" + ElevatorID + \" on destination floor\");\n }\n\n // empty job set -> going to IDLE state\n if (jobs.size() == 0) {\n this.currentState = IDLE;\n return;\n }\n\n Integer closestFloorDownwards = jobs.floor(this.currentFloor);\n Integer closestFloorUpwards = jobs.ceiling(this.currentFloor);\n\n switch (this.currentState) {\n // if elevator is in idle state then we need to go to the closest job possible\n case IDLE -> {\n Integer closestFloor =\n findClosestFloor(this.currentFloor, closestFloorUpwards, closestFloorDownwards);\n\n if (closestFloor < this.currentFloor) {\n this.currentState = DOWN;\n } else {\n this.currentState = UP;\n }\n }\n case DOWN -> {\n if (closestFloorDownwards != null) { // if there exists a predecessor in `jobs`\n this.currentState = DOWN; // let's continue going down\n } else {\n this.currentState = UP; // otherwise we need to go up\n }\n }\n case UP -> {\n if (closestFloorUpwards != null) { // if there exists a successor in `jobs`\n this.currentState = UP; // let's continue going up\n } else {\n this.currentState = DOWN; // otherwise we need to go down\n }\n }\n }\n }", "public void activate(){\n active = true;\n state = State.cleaving;\n }", "@Override\n public void die() {\n// System.out.println(\"STATE = dead\");\n state = ENEMY_DEAD;\n stateTime = 0;\n velocity.x = 0;\n }", "public void die() {\n\t\tdead = true;\n\t\tthis.notifyStatChangeObservers(new StatChange(StatType.LIVES_LEFT, -1));\n\t\tif (getStat(StatType.LIVES_LEFT) == 0) {\n\t\t\tmodel.setState(GameStateType.GAME_OVER);\n\t\t} else {\n\t\t\tthis.setLocation(getStartingLocation());\n\t\t\tdead = false;\n\t\t}\n\t}", "public ExecuteState() {\r\n PrevPC = 0;\r\n ChangedLoc = -1;\r\n OldInst = new CodeBlueInstruction();\r\n }", "private final void maintain(){\n\t\tif(host.getStrength()>MAINTENANCE_COST){\n\t\t\thost.expend(MAINTENANCE_COST);\n\t\t}\n\t\telse{\n\t\t\tkill();\n\t\t}\n\t}", "public boolean removeDeadTransitions() throws Exception{\n \tArrayList<Integer> st=new ArrayList<Integer>(getStates());//st fixes some arbitrary order of states\n \tboolean [][] canReach=buildConnectionMatrix(st);\n\n \t//collect reachable states\n \tStack<Integer> worklist=new Stack<Integer>();\n \tHashSet<Integer> reachableStates=new HashSet<Integer> ();\n \tfor(String var:pointers.keySet())\n \t\tworklist.push(st.indexOf(pointers.get(var)));\n \twhile(!worklist.empty()){\n \t\tint cur=worklist.pop();\n \t\treachableStates.add(st.get(cur));\n \t\tfor(int i=0;i<st.size();i++)\n \t\t\tif(canReach[cur][i]&&!worklist.contains(i)&&!reachableStates.contains(st.get(i)))\n \t\t\t\tworklist.push(i);\n \t}\n \t//remove unreachable states\n \tboolean hasUnreachableNonReferenceStates=false;//might still be a useless state\n \tfor(TreeAutomaton ta:lt){\n \tHashSet<Integer> toRemove=new HashSet<Integer>();\n \t\tfor(int s:ta.getStates())\n \t\t\tif(!reachableStates.contains(s)){\n \t\t\t\ttoRemove.add(s);\n \t\t\t}\n \tfor(int s:toRemove){\n\t\t\t\tif(!ta.isReferenceTo(s, NULL)&&!ta.isReferenceTo(s, UNDEF)&&ta.referenceTo(s)==-1)\n\t\t\t\t\thasUnreachableNonReferenceStates=true;\n \t\t\tta.removeState(s);\n \t}\n \t}\n \treturn hasUnreachableNonReferenceStates;\n }", "private void die() {\r\n\t\tisAlive = false;\r\n\t}", "public void setDead(boolean dead) {\n this.dead = dead;\n Graphics g = image.getGraphics();\n g.setColor(Color.BLACK);\n g.fillRect(0,0,pieceSize,pieceSize);\n g = getCoveredImage().getGraphics();\n g.setColor(Color.BLACK);\n g.fillRect(0,0,pieceSize,pieceSize);\n }", "private boolean tryActivate() {\n if (!active) {\n if (!pool.tryIncrementActiveCount())\n return false;\n active = true;\n }\n return true;\n }", "private boolean tryActivate() {\n if (!active) {\n if (!pool.tryIncrementActiveCount())\n return false;\n active = true;\n }\n return true;\n }", "public static void startStateGC() {\n synchronized (stateGC) {\n if(!stateGC.isAlive()) {\n stateGC.setDaemon(true);\n stateGC.start();\n }\n }\n }", "void indicateRunning()\n {\n try {\n runningLock = lockChannel.lock(STARTING, RUNNING - STARTING, false);\n notYetRunningLock.release();\n }\n catch (IOException e) {\n throw new RuntimeException(\"Cannot lock pid file: \" + e);\n }\n\n notYetRunningLock = null;\n }", "public boolean dead() {\r\n\t\treturn goalPushes == Integer.MAX_VALUE;\r\n\t}", "private boolean transitionRunStateTo(int state) {\n for (;;) {\n int s = runState;\n if (s >= state)\n return false;\n if (_unsafe.compareAndSwapInt(this, runStateOffset, s, state))\n return true;\n }\n }", "private void physicsTickDead() {\n\t\t// Check the round end counter\n\t\tif (checkRoundEndCounter()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Physics stuff\n\t\tsetThrusts();\n\t\tmoveEverything(deltaTimeDead);\n\t\tageScoreMarkers(deltaTimeAlive);\n\t\tshootBullets();\n\t\t\n\t\tcollideTankToWall();\n\t\tcollideBulletToWall();\n\t}", "@Override\r\n public FlowState call() {\r\n // TODO: We should not need? to pass the flowState because this flow is already known (reapplying same values???)\r\n FlowState flowState = getFlowState();\r\n if ( flowState == null ) {\r\n throw new FlowException(\"No flowState with id:\", getExistingFlowStateLookupKey());\r\n } else {\r\n return getFlowManagementWithCheck().continueFlowState(getExistingFlowStateLookupKey(), true, this.getInitialFlowState());\r\n }\r\n }", "public boolean isDead() {\n\t\tif(parts==0) return true; // if no parts left, the snake is dead\n\t\treturn false; // otherwise it's still alive\n\t}", "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}", "private boolean tryInactivate() {\n if (active) {\n if (!pool.tryDecrementActiveCount())\n return false;\n active = false;\n }\n return true;\n }", "private boolean tryInactivate() {\n if (active) {\n if (!pool.tryDecrementActiveCount())\n return false;\n active = false;\n }\n return true;\n }", "synchronized void revertState()\n {\n state = state.revert();\n notifyAll();\n }", "@Override\n public void kill() {\n alive = false;\n Board.getInstance().setPoints(points);\n }", "public void setAsDown () \n\t{ \n\t\tn.setFailureState(false);\n\t\tfinal SortedSet<WLightpathRequest> affectedDemands = new TreeSet<> ();\n\t\tgetOutgoingFibers().forEach(f->affectedDemands.addAll(f.getTraversingLpRequestsInAtLeastOneLp()));\n\t\tgetIncomingFibers().forEach(f->affectedDemands.addAll(f.getTraversingLpRequestsInAtLeastOneLp()));\n\t\tfor (WLightpathRequest lpReq : affectedDemands)\n\t\t\tlpReq.internalUpdateOfRoutesCarriedTrafficFromFailureState();\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tisAlive = false;\r\n\t\t\t}", "public void toggleAlive() {\n\t\tthis.isAlive = !isAlive;\n\t}", "private void stateReturnToHomeBase() {\n\t\tif (isCloserToBall()) {\n\t\t\tstate = State.ATTACKING;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isCloseTo(playerDeafaultPosition)) {\n\t\t\tif (isAlignedTo(playerDeafaultPosition)) {\n\t\t\t\tcommander.doDashBlocking(50.0d);\n\t\t\t} else {\n\t\t\t\tturnTo(playerDeafaultPosition);\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.6216395", "0.6095912", "0.595953", "0.5958203", "0.5936186", "0.58984095", "0.58938986", "0.5876889", "0.5782702", "0.57718587", "0.5754661", "0.56813025", "0.56768495", "0.5672775", "0.5630747", "0.5596882", "0.5571793", "0.5566986", "0.5547864", "0.55118245", "0.55118245", "0.5455967", "0.5452256", "0.5437777", "0.53843784", "0.53819114", "0.53650206", "0.5362272", "0.53600264", "0.53528893", "0.53474694", "0.5344678", "0.5344609", "0.5338436", "0.53203464", "0.5280115", "0.5265794", "0.5254517", "0.52437824", "0.52437824", "0.5221821", "0.52128327", "0.52080363", "0.51789176", "0.51755565", "0.51717806", "0.51599735", "0.5158698", "0.5157861", "0.5152431", "0.51379716", "0.5132221", "0.5122348", "0.5107127", "0.50830954", "0.50726336", "0.50525486", "0.5050468", "0.50444657", "0.50404215", "0.50389355", "0.5023518", "0.5014358", "0.5012401", "0.50097007", "0.5008039", "0.50072676", "0.49943736", "0.49870116", "0.4971213", "0.49669704", "0.4966172", "0.495643", "0.495643", "0.49536416", "0.4952976", "0.49526656", "0.49514174", "0.49509168", "0.4933923", "0.493148", "0.49310136", "0.49280453", "0.49262714", "0.49262714", "0.49229667", "0.49227425", "0.49222872", "0.49221468", "0.49199992", "0.49154067", "0.49087837", "0.49024868", "0.48980767", "0.48980767", "0.48970512", "0.48928496", "0.4889317", "0.4883902", "0.4880588", "0.48766774" ]
0.0
-1
When individual is died, it state must be removed from simulation. Its timers must be stopped, its death must be broadcasted to world. Its hospital need thread must end if it is alive.
public void burry() { world.death(); timerList.clear(); if(hospitalNeed != null && hospitalNeed.isAlive()) hospitalNeed.interrupt(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void Die() {\n this.setAlive(false);\n }", "public void death() {\n\t\t\tif (died==false) {\n\t\t\t\tlives-=1;\n\t\t\t\tdeathSound.play();//play the death sound\n\t\t\t\t\n\t\t\t}\n\t\t\tpauseGame(deathSound.getLength());//pause the game until the death sound is over\n\t\t\tif (lives==0) {//if you have no lives left, you died forever and the flag changes.\n\t\t\t\tdeath=true;\n\t\t\t}\n\t\t\tdied=true;\n\t\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}", "public void die()\n\t{\n\t\talive = false;\n\t}", "public void dontDie()\n\t{\n\t\ttimerList.remove(deathTimer);\n\t}", "public void setDied();", "public void exitHospital()\n\t{\n\t\tworld.getHospital().dischargeIndividual();\n\t\tworld.dischargedIndividual();\n\t}", "private void die() {\r\n\t\tisAlive = false;\r\n\t}", "public void death(){\n\t}", "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}", "public synchronized void die() {\n\t\tisAlive = false;\n\t\ttry {\n\t\t\tthis.interrupt();\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\t_logger.error(e);\n\t\t}\n\t}", "public boolean hasDied() {\n return !isAlive();\n }", "@Override\n \tpublic void notifyDeath() {\n \t\tGame.GAME_STATE = Game.GAME_STATE_DEAD;\n \t\t\n \t}", "public void die() throws KillOfAnAlreadyDeadAgent {\n\t\t\n\t}", "void die() {\n alive = false;\n setChanged();\n notifyObservers(new Pair<>(\"increaseLives\", -1));\n }", "@Override\n protected void onDeath(final Creature killer) {\n getDeathPenalty().checkCharmOfLuck();\n\n if (isInStoreMode()) {\n setPrivateStoreType(Player.STORE_PRIVATE_NONE);\n }\n if (isProcessingRequest()) {\n final Request request = getRequest();\n if (isInTrade()) {\n final Player partner = request.getOtherPlayer(this);\n sendPacket(SendTradeDone.FAIL);\n partner.sendPacket(SendTradeDone.FAIL);\n }\n request.cancel();\n }\n //cubicdata\n deleteCubics();\n deleteAgathion();\n\n boolean checkPvp = true;\n if (ServerConfig.ALLOW_CURSED_WEAPONS) {\n if (isCursedWeaponEquipped()) {\n CursedWeaponsManager.getInstance().dropPlayer(this);\n checkPvp = false;\n } else if (killer != null && killer.isPlayer() && killer.isCursedWeaponEquipped()) {\n CursedWeaponsManager.getInstance().increaseKills(((Player) killer).getCursedWeaponEquippedId());\n checkPvp = false;\n }\n }\n\n if (checkPvp) {\n doPKPVPManage(killer);\n\n altDeathPenalty(killer);\n }\n\n //And in the end of process notify death penalty that owner died :)\n getDeathPenalty().notifyDead(killer);\n\n setIncreasedForce(0);\n\n if (isInParty() && getParty().isInReflection() && getParty().getReflection() instanceof DimensionalRift) {\n ((DimensionalRift) getParty().getReflection()).memberDead(this);\n }\n\n stopWaterTask();\n stopMountFeedTask();\n\n if (!isSalvation() && isOnSiegeField() && isCharmOfCourage()) {\n ask(new ConfirmDlg(SystemMsg.YOUR_CHARM_OF_COURAGE_IS_TRYING_TO_RESURRECT_YOU, 60000), new ReviveAnswerListener(this, 100, false, 60000));\n setCharmOfCourage(false);\n }\n\n if (AllSettingsConfig.AltKillAnnounce && killer != null && killer.isPlayer())\n AnnouncementUtils.announceToAll(killer.getName() + \" убил игрока \" + getName() + \"!\");\n\n super.onDeath(killer);\n }", "private void death(Player p) {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Player \"+p.getNumber()+\" died\");\r\n\t\tp.setDead(true);\r\n\t\tp.discardAllCardsNotPlayed();\r\n\t\t\r\n\t\t// Calculates death message\r\n\t\tString deathMessage = \"\";\r\n\t\tif (p.has(\"Artifact\")) {\r\n\t\t\tif (!p.isUnderground()) {\r\n\t\t\t\tdeathMessage = \"Fortunately, they had an artifact above ground so the villagers were able to recover the treasure\";\r\n\t\t\t} else {\r\n\t\t\t\tdeathMessage = \"They perished underground so all treasure was lost\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tdeathMessage = \"They perished without an artifact so all treasure was lost\";\r\n\t\t}\r\n\t\tgameChannel.sendMessage(\":skull: **\"+getName(p)+\"** died in the dungeon.\\n\"+deathMessage).queueAfter(dragonAttackingDelay+2000, TimeUnit.MILLISECONDS);\r\n\t\t\r\n\t\t// Commented out because should be handled by App's detection\r\n\t\t// If this player was currentPlayer, endTurn if not already\r\n//\t\tif (!checkIfGameIsOver() && currentPlayer.isDead() && !turnIsEnding) {\r\n//\t\t\tendTurn();\r\n//\t\t}\r\n\t}", "public void die() {\n if (dayCountDown == 0) {\n new Holdable(getLocation()).init();\n }\n }", "@Override\n public void die() {\n// System.out.println(\"STATE = dead\");\n state = ENEMY_DEAD;\n stateTime = 0;\n velocity.x = 0;\n }", "public abstract Task onDeath() throws Exception;", "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 kill() {\r\n \t\tthis.isDead = true;\r\n \t}", "protected void fireDestroyedState() {\n\t\t\n\t\tif (!stateHandler().waitToWhen(new IsAnyState(), new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tstateHandler().setState(ParentState.DESTROYED);\n\t\t\t\tstateHandler().fireEvent();\n\t\t\t}\n\t\t})) {\n\t\t\tthrow new IllegalStateException(\"[\" + StructuralJob.this + \"] Failed set state DESTROYED\");\n\t\t}\n\t\tlogger().debug(\"[\" + this + \"] Destroyed.\");\t\t\t\t\n\t}", "private void deathRoom()\n {\n if(currentRoom.equals(deathRoom4))\n {\n alive = false;\n }\n }", "protected void kill() {\n\t\tsetDeathTime(0.6);\n\t}", "@Override\n\tprotected void on_boss_death() {\n\n\t}", "@Override\r\n\tpublic void onDeath() {\n\t\t\r\n\t}", "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}", "void dead() { this.alive = false; }", "private void physicsTickDead() {\n\t\t// Check the round end counter\n\t\tif (checkRoundEndCounter()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Physics stuff\n\t\tsetThrusts();\n\t\tmoveEverything(deltaTimeDead);\n\t\tageScoreMarkers(deltaTimeAlive);\n\t\tshootBullets();\n\t\t\n\t\tcollideTankToWall();\n\t\tcollideBulletToWall();\n\t}", "public void kill() { _isAlive = false; }", "public abstract void onDie();", "public synchronized void Kill() {\n\t dieDieDie = true;\n\t}", "public synchronized void Kill() {\n\t dieDieDie = true;\n\t}", "protected void die()\n\t{\n\t\tdead = true;\n\t\tcurrentCell.setOccupant(null);\n\t\tcurrentCell = null;\n\t}", "public void justDie()\n\t{\n\t\tsynchronized (this) {\n\t\tcurrentState.justDie();\n\t\t}\n\t}", "BossEnemy(){\n super();\n totallyDied = true;\n }", "public void simulationTerminating() {\n }", "public void simulationTerminated() {\n }", "public void die(){\n\t\tboolean success = false;\n\t\ttile.setAnimal(null);\n\t\treleasePandas();\n\n\t\twhile(!success){\n\t\t\tRandom rng = new Random();\n\t\t\tInteger idx =rng.nextInt(gf.gp.getTiles().size());\n\t\t\tif(gf.gp.getTiles().get(idx).getAnimal() == null && gf.gp.getTiles().get(idx).getEntity() == null) {\n\t\t\t\tsuccess = spawn(gf.gp.getTiles().get(idx)); break;\n\t\t\t}\n\t\t}\n\t}", "public void die()\n {\n World world;\n world=getWorld();\n world.removeObject(this);\n }", "public void die() {\n\t\tthis.hp = 0;\n\t\tthis.currentState = PlayerState.DIED;\n\t\tthis.sword = null;\n\t\tthis.setCurrentAnimation(\"dieing_\" + orientation, FRAME_DURATION);\n\t}", "public boolean deathTick(Game game) {\n\t\treturn false;\n\t}", "@Override\n public void run() {\n cs = new CommStack(this, this.csParams);\n /** time variables to control the <Actor>s lifetime */\n long time_ini; \n /** lifecicle duration in ns */\n long deltaTime; \n /** lifecicle duration in ms */\n long deltaTime_ms;\n setInitialParameters();\n /** start the comunication Thread CommStack */\n cs.start();\n \n /** while the actor is alive, keep updating it every time_pace milliseconds */\n try {\n while (alive && !SimStatus.globalActors.get(id).actorDyingQ()) {\n /** decreases lifetime as the cycles pass */\n lifetime = lifetime - time_pace; \n if (lifetime > 0) {\n /** saves current time in nanoseconds */\n time_ini = System.nanoTime();\n label = moveActor();\n SimStatus.setActorStatus(id, x, y, vx, vy, label);\n /** saves lifecycle duration */\n deltaTime = System.nanoTime() - time_ini;\n deltaTime_ms = TimeUnit.NANOSECONDS.toMillis(deltaTime);\n /** if lifecycle duration is less than the time pace, sleeps for the time remaining */\n if (deltaTime_ms <= time_pace) {\n Thread.sleep(time_pace - deltaTime_ms);\n }\n /** if lifecycle is more than 20% bigger than time pace, launches warning */\n if(deltaTime_ms > 0.2*time_pace) { \n System.err.println(\"WARNING - actor \"+id+\" lifecicle time >20% of time_pace\");\n }\n } else {\n \n /** Starts de dying process */\n System.out.println(\"Actor \" + id + \" lifetime is over...\");\n dying = true;\n /** sets actor status to 'dying' */\n SimStatus.setActorStatus(id, x, y, vx, vy, label, dying);\n /** sleep for some time, waiting for the news to spread */\n Thread.sleep(500);\n }\n }\n /** completes the dying process */\n alive = false;\n cs.join();\n SimStatus.removeActor(id);\n } catch (InterruptedException ex) {\n Logger.getLogger(Actor.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public final void die() {\n this.getLocation().removeUnit(Player.SYSTEM);\n }", "@Override\r\n\tpublic void onDeath() {\n\r\n\t}", "@Override\r\n\tpublic void onDeath() {\n\t\ta.remove();\r\n\t}", "@EventHandler(priority = EventPriority.NORMAL)\n public void Playerdeath(PlayerDeathEvent e) {\n if (plugin.hardcore) {\n //if the dead entity is Player\n if (e.getEntity() instanceof Player) {\n //get the Player\n Player player = (Player) e.getEntity();\n //System.out.println(\"onDeath\");\n\n if (player.getWorld() == plugin.skyworld) {\n\n plugin.write(null, \"debug.player-death\", \"info\", true, player.getName());\n plugin.write(player, \"plugin.ondeath.starting\", \"info\", false);\n\n Island island = new Island(player.getName(), plugin);\n try {\n island.load();\n }\n catch (SQLException ex) {\n plugin.write(null, \"admin.sql.ex-load\", \"severe\", player.getName());\n }\n if (island.exists) {\n\n try {\n island.reset();\n }\n catch (Exception ex) {\n plugin.write(null, \"admin.sql.ex-reset\", \"severe\", player.getName());\n }\n\n plugin.write(player, \"plugin.ondeath.finished\", \"info\");\n }\n }\n }\n }\n }", "public void death(){\n World w = getWorld();\n Level l = (Level)w;\n if(l.getPlayersLives().getValue() > 0){\n l.removeLife();\n l.respawn();\n }\n else{\n if(l.getPlayersLives().getValue() == 0){\n Label text = new Label(\"You lose\",50);\n getWorld().addObject(text,(getWorld().getWidth()/2),(getWorld().getHeight()/2));\n l.addScore();\n Scoring st = new Scoring(l.getScore());\n Greenfoot.delay(50);\n Greenfoot.setWorld(st);\n }\n }\n getWorld().removeObject(this);\n }", "public void onKill(EntityDeathEvent evt) {\r\n }", "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 }", "@EventHandler\n public void onEntityDeath(EntityDeathEvent event){\n if(RandomEncounters.getInstance().getLogLevel()>11){\n RandomEncounters.getInstance().logMessage(\"Something died, let me figure out if it means anything.\");\n }\n PlacedMob placedMob = PlacedMob.getInstance(event.getEntity().getUniqueId());\n if(placedMob!=null){\n placedMob.die();\n }else{\n if(RandomEncounters.getInstance().getLogLevel()>11){\n RandomEncounters.getInstance().logMessage(\"The death was not of importance, carry on.\");\n }\n }\n }", "public boolean sendDeath() {\n return true;\n }", "@Test\n void die() {\n getGame().start();\n getGame().move(getPlayer(), Direction.WEST);\n getGame().move(getPlayer(), Direction.WEST);\n assertThat(getPlayer().isAlive()).isFalse();\n verify(observer).levelLost();\n assertThat(getGame().isInProgress()).isFalse();\n }", "public void die() {\n\t\tif (this.isGodModeEnabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.life--;\n\t\tresetPlayerPosition();\n\t\tthis.collisionBox.setRect(this.tilePositionX, this.tilePositionY,\n\t\t\t\tthis.SCALE, this.SCALE);\n\t}", "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 checkForRemoval()\n {\n if (life <= 0)\n {\n SideScrollingWorld world = (SideScrollingWorld) getWorld(); \n \n world.isPacmanDead = true;\n getWorld().removeObject(this);\n }\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 boolean checkDeath() {\r\n\t\tif (death) {\r\n\t\t\tdeath = false;\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 final void dyE() {\n AppMethodBeat.i(29674);\n com.tencent.mm.blink.b.HQ().o(new Runnable() {\n public final void run() {\n AppMethodBeat.i(29666);\n w.this.ynU = true;\n al.af(w.this.ynV);\n al.n(w.this.ynV, 300);\n AppMethodBeat.o(29666);\n }\n });\n AppMethodBeat.o(29674);\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 die() {\n\t\tSpriteObject obj = PhysicsObject.getCollidableAt(player1.getX(),player1.getY() + player1.getImage().getHeight() + 3);\n\t\tSpriteObject obj2 = PhysicsObject.getCollidableAt(player1.getX() + player1.getImage().getWidth() ,player1.getY() + player1.getImage().getHeight() + 3);\n\t\tif ((obj instanceof Tile && ((Tile) obj).getType() == TileType.spike) || (obj2 instanceof Tile && ((Tile) obj2).getType() == TileType.spike)) \n\t\t{\n\t\t\tplayer1.death();\n\t\t}\n\n\t\tif (player1.getY() > 1500) {\n\t\t\tplayer1.death();\n\t\t}\n\t}", "@Override\n\tprotected void onDeathUpdate() {\n\t\thelpers.values().forEach(DragonHelper::onDeathUpdate);\n\n\t\t// unmount any riding entities\n\t\tremovePassengers();\n\n\t\t// freeze at place\n\t\tmotionX = motionY = motionZ = 0;\n\t\trotationYaw = prevRotationYaw;\n\t\trotationYawHead = prevRotationYawHead;\n\n\t\tif (isEgg()) {\n\t\t\tsetDead();\n\t\t} else {\n\t\t\t// actually delete entity after the time is up\n\t\t\tif (deathTime >= getMaxDeathTime()) {\n\t\t\t\tsetDead();\n\t\t\t}\n\t\t}\n\n\t\tdeathTime++;\n\t}", "@Override\r\n public void simulationEnded() {\n this.soundThread = null;\r\n\r\n // end the module thread\r\n this.running = false;\r\n\r\n // the simulation is not running\r\n this.runSimulationState = false;\r\n\r\n // play the background sound\r\n this.playBackgroundSound(true);\r\n }", "private void onTerminate(Terminated t){\n\t\t//If a device stops, we must remove it from the group\n\t\tActorRef deviceActor = t.getActor();\n\t\tString deviceId = actorsIds.get(deviceActor);\n\t\t\n\t\tlog.info(\"Device actor {} has been terminated\",deviceId);\n\t\t\n\t\tactorsIds.remove(deviceActor);\n\t\tdeviceActors.remove(deviceId);\n\t\t\n\t}", "public void agentDeath(Agent ag) throws InterruptedException {\n\t\n\tProcessData data = (ProcessData) agents.get(ag);\n\tVertex vertex = data.vertex;\n\tLong key = new Long(numGen.alloc());\n\n\tint nbr = removeAgentFromVertex(vertex,ag);\n\t\n\tagents.remove(ag);\n\n\tevtQ.put(new AgentMovedEvent(key,\n\t\t\t\t vertex.identity(),\n\t\t\t\t new Integer(nbr)));\n\tmovingMonitor.waitForAnswer(key);\n\n stats.add(new TerminatedStat(ag.getClass()));\n\n\t/* Detecting the end of the algorithm */\n\tif(agents.isEmpty()) {\n evtQ.put(new AlgorithmEndEvent(numGen.alloc()));\n }\n }", "public void goHospital()\n\t{\n\t\tsynchronized (this) {\n\t\tworld.hospitalizedIndividual();\n\t\tcurrentState.goHospital();\n\t\t}\n\t}", "@Override\n public void die() {\n }", "public void run()\n {\n List<Entity> ms = new LinkedList<Entity>(monsters);\n for (Entity e : ms)\n if (e.isDead())\n monsters.remove(e);\n \n // Compare the current size with the previous size.\n if (monsters.size() < spawnThread.getPreviousSize() || spawnThread.getPreviousSize() == 0 || bossWave != null)\n {\n resetIdleTimer();\n return;\n }\n \n // Clear all player inventories, and \"kill\" all players.\n List<Player> ps = new LinkedList<Player>(arenaPlayers);\n for (Player p : ps)\n {\n MAUtils.clearInventory(p);\n MAUtils.tellPlayer(p, Msg.FORCE_END_IDLE);\n playerDeath(p);\n }\n }", "@Override\n public void die() {\n _brain.mouth.say(\"aaarrrrrgggh...\");\n }", "public static boolean isDead(Entity e) {\r\n return e.getAttribute(\"state:death\", false);\r\n }", "private void Dead() {\n\t\thunger -= 5;\n\t\tthirst -= 5;\n\t\tif ((thirst < 25) && (hunger < 25)){\t\t\t// Player is very weak\n\t\t\thealth -= 15;\n\t\t}else if ((thirst < 25) || (hunger < 25)){\t\t// Player is kinda weak\n\t\t\thealth -= 5;\n\t\t}\n\t\tif (health <= 0){\t\t\t\t\t\t\t\t// Player is dead\n\t\t\taddMessage(\"Overcome by your weakness you succumb.\", \"AI\");\n\t \t\taddMessage(\"You have died\", \"AI\");\n\t \t\tmenu = MENU.GAME_OVER;\n\t\t}\n\t}", "@Override\n protected void afterKill() {\n if (timeAfterDeath > 0) {\n --timeAfterDeath;\n } else {\n if (finalAnimation > 0) {\n --finalAnimation;\n } else {\n remove();\n }\n }\n }", "public void dies(PlayerSprite player, boolean labyrinth, SpawnRate spawnValues) {\n\t}", "public void checkGameEndState() {\n\t\tfor(MapCharacter c : friendlyMissionCriticals) {\n\t\t\tif(!friendlies.contains(c))\n\t\t\t\tthrow new PlayerLosesException();\n\t\t}\n\t\tif(getEnemies().size() == 0)\n\t\t\tthrow new PlayerWinsException();\n\t}", "@Override\n\tpublic boolean isGameTied() {\t\n\t\treturn false;\n\t}", "@Override\n\tpublic void despawn() {\n\t\t\n\t}", "public void lifeLost() {\n\t\t--lives;\n\t\tif (lives == 0) {\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public void notAlive() {\n\n for (var i = ownedAnimals.size() - 1; i >= 0; i--) {\n if (ownedAnimals.get(i).healthPoints <= 0) {\n System.out.println(\"The \"\n + ownedAnimals.get(i).type\n + \" \" + ownedAnimals.get(i).animalName\n + \" died\");\n ownedAnimals.remove(i);\n\n\n }\n\n\n }\n }", "public void killAndFinish()\n\t{\n\t\tif (isKilled()) return;\n\t\tupdate(Float.MAX_VALUE);\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}", "@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)\n \tpublic void onCreatureDeath(EntityDeathEvent event)\n \t{\n \t\tif (event.getEntity() instanceof Animals == false)\n \t\t\treturn;\n \t\t\n \t\tprotectedAnimals.remove(event.getEntity().getUniqueId());\n \t}", "public Enemy deathSummon() {\n\t\treturn null;\n\t}", "private final void kill() {\n\t\tgrown=false;\t\t\n\t}", "public static void onVMDeath() {\n \tDeferredExecution.stopProcessors();\n }", "@Override\n\tpublic void onLifeStateChanged(State prevState, State newState)\n\t{\n\t\tif (newState == State.DEAD)\n\t\t{\n\t\t\tplayer.onPlayerEntityDead();\n\t\t}\n\t}", "public void robotDeath(RobotDeathEvent e) {\r\n\r\n\t\tif (gotTarget && e.getName().equals(radarTarget.getName())) {\r\n\t\t\tradarTarget = newRadarTarget();\r\n\t\t\tmrRobot.sendMessage(6, \"2\");\r\n\r\n\t\t}\r\n\t\tif (getIndexForName(e.getName()) != -1) {\r\n\t\t\ttargetTracking.remove(getIndexForName(e.getName()));\r\n\t\t}\r\n\r\n\t}", "private void dance() {\n\t\t// if they are done dancing, start sleeping\n\t\tif(danceDuration <= 0){\n\t\t\thive.dancingBees.remove(this);\n\t\t\tstate = \"SLEEPING\";\n\t\t}\n\t\telse{ // otherwise keep dancing and decrease duration of dance\n\t\t\tdanceDuration--;\n\t\t}\n\t}", "public void terminate() {\n this.isDying = true;\n //this.isStaticCollidable = false;\n //this.isDynamicCollidable = false;\n\n this.setProp(ObjectProps.PROP_STATICCOLLIDABLE, false);\n this.setProp(ObjectProps.PROP_DYNAMICCOLLIDABLE, false);\n\n this.action = DYING;\n this.velX = 0;\n this.velY = 5;\n }", "public void attackOrQuit(){\n gameState = GameState.ATTACKORQUIT;\n notifyObservers();\n }", "public boolean isDead();", "@Override\r\n\tpublic void Death(Player arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void Death(Player arg0) {\n\t\t\r\n\t}", "private void onResponseTimerTick()\r\n {\r\n EneterTrace aTrace = EneterTrace.entering();\r\n try\r\n {\r\n cleanAfterConnection(true, true);\r\n }\r\n finally\r\n {\r\n EneterTrace.leaving(aTrace);\r\n }\r\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 Individual(Simulation world) {\n\t\tmoving = new Moving(this);\n\t\tinConversation = new InConversation(this);\n\t\tinHospital = new InHospital(this);\n\t\tdead = new Dead(this);\n\t\tcurrentState = moving;\n\t\tspeed = random.nextInt(25)+1;\n\t\txSpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed * Math.cos(Math.PI/4));\n\t\tySpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed * Math.cos(Math.PI/4));\n\t\tsocialDistance = random.nextInt(10);\n\t\tconversationTime = random.nextInt(5) + 1;\n\t\tdouble[] maskChoice = {0.2, 1};\n\t\tmaskIndicator = maskChoice[random.nextInt(2)];\n\t\tindividualSize = 5;\n\t\thealthStatus = HealthStatus.HEALTHY;\n\t\tthis.world = world;\n\t\tx = random.nextInt(world.getSIMULATION_WIDTH() - individualSize);\n\t\ty = random.nextInt(world.getSIMULATION_HEIGHT() - individualSize);\n\t\ttimerList = new ArrayList<>();\n\t\t\n\t\thospitalNeed = new Thread(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tworld.getHospital().acceptIndividual();\n\t\t\t\t\tsynchronized (this) {\n\t\t\t\t\t\tcurrentState.goHospital();\n\t\t\t\t\t}\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\t\n\t\t\t}\n\t\t});\n\t\tworld.healthy();\n\t}", "@Override\n public void collide(CollisionEvent e) {\n \n if (e.getOtherBody() instanceof OptimusPrime && e.getReportingBody() instanceof Health) {\n prime.incrementHealthCount();\n healthSound.play();\n e.getReportingBody().destroy();\n \n \n }\n \n else if (e.getOtherBody() instanceof OptimusPrime && e.getReportingBody() instanceof Emerald) {\n prime.incrementEmeraldCount();\n emeraldSound.play();\n e.getReportingBody().destroy();\n }\n \n else if (e.getOtherBody() instanceof OptimusPrime && e.getReportingBody() instanceof DeadZone) {\n e.getReportingBody().destroy();\n System.exit(0);\n } \n \n else if (e.getReportingBody() instanceof Boss && e.getOtherBody() instanceof FireBall){\n e.getOtherBody().destroy();\n System.out.println(\"boss hit\");\n }\n \n else if (e.getReportingBody() instanceof StaticBody && e.getOtherBody() instanceof FireBall){\n e.getOtherBody().destroy();\n System.out.println(\"boss hit\");\n } \n \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 void die() {\n\t\tdead = true;\n\t\tthis.notifyStatChangeObservers(new StatChange(StatType.LIVES_LEFT, -1));\n\t\tif (getStat(StatType.LIVES_LEFT) == 0) {\n\t\t\tmodel.setState(GameStateType.GAME_OVER);\n\t\t} else {\n\t\t\tthis.setLocation(getStartingLocation());\n\t\t\tdead = false;\n\t\t}\n\t}", "private void bringToLife(){\n this.dead = false;\n }" ]
[ "0.6537985", "0.6381778", "0.63507223", "0.6346385", "0.634548", "0.63345873", "0.63160795", "0.6304596", "0.6172492", "0.61713", "0.6153195", "0.61440927", "0.61196387", "0.608031", "0.604367", "0.60421604", "0.6004541", "0.5992693", "0.59856695", "0.59790796", "0.5976957", "0.5933955", "0.59309113", "0.59227145", "0.59150153", "0.5910937", "0.59062654", "0.59031504", "0.5894859", "0.5872312", "0.58532363", "0.5811559", "0.5799647", "0.5799647", "0.5797969", "0.57741624", "0.5763627", "0.575412", "0.57440144", "0.5737747", "0.57186073", "0.5714677", "0.5708135", "0.5694578", "0.5688615", "0.5688447", "0.5679795", "0.5677523", "0.566639", "0.566202", "0.5658558", "0.56439424", "0.5636242", "0.5618263", "0.5595298", "0.55949223", "0.55845875", "0.55791646", "0.55774415", "0.55764264", "0.55734515", "0.55706316", "0.55674624", "0.55594295", "0.55583584", "0.55496967", "0.55413747", "0.55330825", "0.5527919", "0.5519008", "0.5511505", "0.55044836", "0.54971874", "0.5496384", "0.54893154", "0.548809", "0.5483026", "0.5480946", "0.547359", "0.54679537", "0.54623795", "0.54617685", "0.5446452", "0.543943", "0.5424019", "0.5420606", "0.5407343", "0.5406771", "0.54041904", "0.53993994", "0.53900415", "0.53890914", "0.53890914", "0.53795475", "0.53779477", "0.5376367", "0.53706145", "0.536674", "0.5366638", "0.53539604" ]
0.70409566
0
This function randomize speed of individual.
public void randomizeDirection() { xSpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed); ySpeed = (int) (Math.pow(-1, random.nextInt(2)) * speed); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void changeSpeed() {\n Random gen = new Random();\n speedX += gen.nextInt(3);\n speedY += gen.nextInt(3);\n }", "public abstract void randomize();", "private void random() {\n\n\t}", "SimulatedAnnealing() {\n generator = new Random(System.currentTimeMillis());\n }", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "private void random() {\n GameState gs = cc.getGameState();\n ArrayList<int[]> moves = cc.getPlayerMoves(player);\n ArrayList<GameState> states = nextStates(moves, gs);\n for (int[] m : moves) {\n GameState next = checkMove(m, cc);\n states.add(next);\n }\n Random rand = new Random(System.nanoTime());\n int i = rand.nextInt(states.size());\n cc.setAIMove(states.get(i));\n }", "public void randomize() {\n\t\tx = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t\ty = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t}", "private int newSpeed() {\n //makes a random speed for the ball in (-50,-15)U(15,50)\n int n = r.nextInt(71) - 35;\n if (n < 0) {\n n = n - 15;\n } else {\n n = n + 15;\n }\n return n;\n }", "@Override\r\n\tpublic void doTimeStep() {\n\t\tthis.run(Critter.getRandomInt(8));\r\n\t}", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public void calcSpeed(){\r\n Random rand = new Random();\r\n tire = rand.nextInt(10)+1;\r\n engine = rand.nextInt(10)+1;\r\n weight = rand.nextInt(10)+1;\r\n speed = ((double)(tire+engine+weight))/3;\r\n\r\n //round speed to 2 decimal places\r\n speed = speed*100;\r\n speed = Math.round(speed);\r\n speed = speed/100;\r\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "void randomize() {\r\n\t\trandomize(1, this.length());\r\n\t}", "Randomizer getRandomizer();", "public void randomize()\n {\n for (int i=0; i<list.length; i++)\n list[i] = (int)(Math.random() * 100) + 1;\n }", "static final int fast_rand()\n\t{\n\t\tRz = 36969 * (Rz & 65535) + (Rz >>> 16);// ((Rz >>> 16) & 65535);\n\t\tRw = 18000 * (Rw & 65535) + (Rw >>> 16);// ((Rw >>> 16) & 65535);\n\t\treturn (Rz << 16) + Rw;\n\t}", "public void rollRandom() {\n\t\tthis.strength = randomWithRange();\r\n\t\tthis.wisdom = randomWithRange();\r\n\t\tthis.dexterity = randomWithRange();\r\n\t\tthis.constitution = randomWithRange();\r\n\t\tthis.intelligence = randomWithRange();\r\n\t\tthis.charisma = randomWithRange();\r\n\t}", "long random(long ws) {\r\n\t\treturn (System.currentTimeMillis() % ws);\r\n\t}", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "private void moveRandomly()\r\n {\r\n if (Greenfoot.getRandomNumber (100) == 50)\r\n turn(Greenfoot.getRandomNumber(360));\r\n else\r\n move(speed);\r\n }", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "public double simulate(){\n\t\tdouble r = Math.sqrt(-2 * Math.log(Math.random()));\n\t\tdouble theta = 2 * Math.PI * Math.random();\n\t\treturn Math.exp(location + scale * r * Math.cos(theta));\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "private void randomTest(){\n\n int time = 5 ;\n\n test(time) ;\n }", "public void randomize()\n {\n int max = list.length;\n for (int i=0; i<list.length; i++)\n list[i] = (int)(Math.random() * max) + 1;\n }", "Boolean getRandomize();", "public static void s1RandomTest() {\n int key = 903836722;\n SortingLab<Integer> sli = new SortingLab<Integer>(key);\n int M = 600000;\n int N = 1000;\n double start;\n double elapsedTime;\n System.out.print(\"Sort 1 Random\\n\");\n for (; N < M; N *= 2) {\n Integer[] ai = getRandomArray(N, Integer.MAX_VALUE);\n start = System.nanoTime();\n sli.sort1(ai);\n elapsedTime = (System.nanoTime() - start) / 1_000_000_000d;\n System.out.print(N + \"\\t\");\n System.out.printf(\"%4.3f\\n\", elapsedTime);\n }\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "private void eating(){\n int sleepTime = (int)(Math.random()*2000);\n try{\n Thread.sleep(sleepTime);\n }catch (InterruptedException e){\n e.printStackTrace();\n }\n }", "public abstract int getRandomDamage();", "private void randomMove() {\n }", "@Test\n public void genRandom() {\n runAndWait(() -> genRandom(10_000, 500, 1), 32, 2000);\n runAndWait(() -> genRandom(10_000, 500, 100), 32, 2000);\n runAndWait(() -> genRandom(250_000, 4000, 50), 4, 5_000);\n }", "public void randomWalk(){\r\n int newAngle = (int) ( (double) Math.random() * 360) ;\r\n\r\n super.xVelocity = (velocity * Math.cos(newAngle * Math.PI/180));\r\n super.yVelocity = (velocity * Math.cos(newAngle * Math.PI/180));\r\n }", "public static double random() {\r\n return uniform();\r\n }", "private void thinking(){\n int sleepTime = (int)(Math.random()*2000);\n try{\n Thread.sleep(sleepTime);\n }catch (InterruptedException e){\n e.printStackTrace();\n }\n }", "public void randomize() {\r\n\t\tRandom random = new Random();// random generator used to get random int\r\n\t\tint r;// will hold the random int\r\n\t\tint num;// will hold the filtered random int that determines with entity to use for a tile\r\n\t\tfor (int i = 0; i < WIDTH_TILES; i++) {// loops x-coords\r\n\t\t\tfor (int j = 0; j < HEIGHT_TILES; j++) {// loops y-coords\r\n\t\t\t\tr = random.nextInt(32);// gets random int from 0 to 32\r\n\t\t\t\tif (r < 4) num = 0; else if (r < 8) num = 1; else if (r < 31) num = 2; else num = 3;// distributes different objects\r\n\t\t\t\tif (nodes[i * WIDTH_TILES + j].isOccupied() == false) {// if tile empty or random chosen\r\n\t\t\t\t\tnodes[i * WIDTH_TILES + j] = new Node(new Point(i * BOARD_WIDTH / WIDTH_TILES, j * BOARD_WIDTH / HEIGHT_TILES), new ImageIcon(icons[num]).getImage(), true, occupants[num]);// creates random tile\r\n\t\t\t\t}// if (random)\r\n\t\t\t}// for (j)\r\n\t\t}// for (i)\r\n\t}", "public void setSpeed() {\n\t\tthis.ySpd = this.MINSPEED + randGen.nextFloat() * (this.MAXSPEED - this.MINSPEED);\n\t\tthis.xSpd = this.MINSPEED + randGen.nextFloat() * (this.MAXSPEED - this.MINSPEED);\n\t}", "public void tick() {\r\n\t\thunger += (10 + generateRandom());\r\n\t\tthirst += (10 + generateRandom());\r\n\t\ttemp -= (1 + generateRandom());\r\n\t\tboredom += (1 + generateRandom());\r\n\t\tcageMessiness += (1 + generateRandom());\r\n\t}", "public void faster() {\n myTimer.setDelay((int) (myTimer.getDelay() * SPEED_FACTOR));\n }", "public void act() {\n if (System.currentTimeMillis() - lastTime > 5000) {\n lastTime = System.currentTimeMillis();\n int y = (int)(Math.random() * ((BackGround1.height-30)+1)+30);\n int x = (int)(Math.random() * ((BackGround1.width-15)+1)+15);\n addObject(new Coin(),x ,y);\n }\n }", "public void faster()\n {\n if(speed < 9){\n speed += 1;\n }\n }", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "@Override\n\tpublic void run() {\n\n\t\tdouble d = Math.random() * 299;\n\t\tlong val = (long) d;\n\n\t\ttry {\n\t\t\tThread.sleep(val);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (Thread.currentThread().getName().equals(\"one\")) {\n\t\t\tSystem.out.println(Thread.currentThread().getName()\n\t\t\t\t\t+ \" sleep time: \" + val);\n\n\t\t} else {\n\t\t\tSystem.out.println(Thread.currentThread().getName()\n\t\t\t\t\t+ \" sleep time: \" + val);\n\t\t}\n\n\t}", "public static long randomTime() {\n return (random.nextInt(11) + 25)*1000;\n }", "@Override\r\n\tpublic void doTimeStep() {\n\t\tdir = Critter.getRandomInt(8);\r\n\t\t\r\n\t\tnumSteps = Critter.getRandomInt(maxStep) + 1;\r\n\t\t\r\n\t\t//go a random number of steps in that direction\r\n\t\tfor(int i = 0; i < numSteps; i++) {\r\n\t\t\twalk(dir);\r\n\t\t}\t\t\r\n\t}", "static Tour rndTour() {\r\n\t\tTour tr = Tour.sequence();\r\n\t\ttr.randomize();\r\n\t\ttr.distance = tr.distance();\r\n\t\treturn tr;\r\n\t}", "public void randomTeleport() {\n Random random = new Random(seed);\n seed = random.nextInt(10000);\n int randomY = RandomUtils.uniform(random, 0, worldHeight);\n int randomX = RandomUtils.uniform(random, 0, worldWidth);\n int randomDirection = RandomUtils.uniform(random, 0, 4);\n move(randomX, randomY);\n turn(randomDirection);\n }", "public int monsterAttack(){\n Random ran = new Random();\n return ran.nextInt(4);\n }", "private int rand() {\n return (int)(Math.random()*(RAND_MAX + 1));\n }", "public static void randomDelay() {\n\n Random random = new Random();\n int delay = 500 + random.nextInt(2000);\n try {\n sleep(delay);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "void reset(){ \n cueX= width/2 -150;\n cueY= height/2;\n \n \n redX = random(right , middle); redY = random(top, bottom);\n bluX = random(left, middle); bluY= random(top, bottom);\n yelX = random(left, right); yelY= random(top, bottom);\n \n //speed\n redDX = random(1,3); redDY = random(1,3);\n bluDX = random(1,3); bluDY = random(1,3);\n yelDX = random(1,3); yelDY = random(1,3);\n cueDX = random(1,3); cueDY = random(1,3);\n}", "public void setWhoGoesFirstRandom() {\n Random ran = new Random();\n int i = ran.nextInt(2) + 1;\n if(i == 1) {\n setWhoGoesFirst(humanPlayer);\n } else {\n setWhoGoesFirst(aiPlayer);\n }\n }", "public void randomAuto() {\r\n\r\n Bitmap imageViewBitmap = _imageView.getDrawingCache();\r\n //if the bitmap is null, don't do anything\r\n if (imageViewBitmap == null) {\r\n return;\r\n }\r\n for(int i = 0; i < 1000; i++){\r\n randHelper();\r\n }\r\n invalidate();\r\n }", "protected Random get_rand_value()\n {\n return rand;\n }", "public static int randomNext() { return 0; }", "void randomize(int i, int j) {\r\n\t\tfor (int k = 0; k < (j - i + 1); k++) {\r\n\t\t\trndSwapTwo(i, j);\r\n\t\t}\r\n\t\tthis.distance = distance();\r\n\t}", "public abstract boolean isRandom();", "int random(int m)\n {\n return (int) (1 + Math.random()%m);\n }", "public void randomMove() {\r\n\t\tRandom rand = new Random();\r\n\t\tint moveNum = rand.nextInt(100)+100;\r\n\t\tcheck++;\r\n\t\tif(check >= moveNum) {\r\n\t\t\tspeed = speed*-1;\r\n\t\t\tcheck =0;\r\n\r\n\t\t}\r\n\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\t\tx += speed; setLocation(x,y); repaint();\r\n\t}", "RandomizedRarestFirstSelector(Random random) {\n this.random = random;\n }", "@Override\n public void run() {\n if (random.nextInt(10) == 0)\n addPowerUp(random.nextInt(256));\n }", "public void spinOnce()\n {\n\tfor (int x = 0; x < _fruits.length; x+= 1){\n\t /*\n\t //not sure which method for randomization is best.\n\t int oneRandInd= ((int)(Math.random()*24));\n\t int twoRandInd = ((int)(Math.random()*24));\n\t swap(oneRandInd, twoRandInd);\n\t */\n\t int randInd = (int) (Math.random()*24);\n\t swap(x, randInd);\n\t}\n }", "@Override\r\n\tpublic <T extends Actor> void performAs(T actor) {\n\t\tRandom random = new Random();\r\n\r\n\t\t\r\n\t}", "public void setRandom(Random r) {\n this.r = r;\n }", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "public static int randomSleepTime() {\n return ThreadLocalRandom.current().nextInt(2000);\n }", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "private int random_dragao_fire(Dragao dragao) {\n\t\tint spit = (int)(1 + Math.random()*5);\t\t\n\t\tif (spit == 1) {\n\t\t\tint spitX = (int)(1 + Math.random()*2);\n\t\t\tspitX--;\t\t\t\n\t\t\tint spitY = 0;\n\t\t\tif (spitX != 0) {\n\t\t\t\tspitY = (int)(1 + Math.random()*2);\n\t\t\t\tspitY--;\n\t\t\t}\t\t\t\n\t\t\treturn spit_fire (spitX, spitY, dragao);\n\t\t}\n\t\treturn 0;\n\t}", "void setRandomize(Boolean setting);", "public void makeRandomMove() {\n\t\ttry{\r\n\t\t\tif (playerId == game.getState().getTurn()){\r\n\t\t\t\tgame.execute(randPlayer.requestAction(game.getState()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(IllegalArgumentException e){\r\n\t\t\t\r\n\t\t}\r\n\t}", "private int randomHelper() {\n\t\tRandom rand = new Random();\n\t\tint randomNum = rand.nextInt((10000 - 1) + 1) + 1;\n\t\treturn randomNum;\n\t}", "public void randomizeHaplotype() {\n if (rand == null) {\n log.error(\"Cannot randomize haplotype\");\n log.error(toString());\n System.exit(1);\n }\n\n isPhased = true;\n if (rand.nextDouble() > 0.5) {\n return;\n }\n byte tmp = paternal;\n paternal = maternal;\n maternal = tmp;\n }", "private String RandomGoal() {\n\t\tList<String> list = Arrays.asList(\"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"m\", \"t\", \"t\");\n\t\tRandom rand = new Random();\n\t\tString randomgoal = list.get(rand.nextInt(list.size()));\n\n\t\treturn randomgoal;\n\t}", "public static void main(String[] args) {\n\r\n\t\tRandom rr=new Random();\r\n\t\t\r\n\t\tSystem.out.println(Math.random());//[0,1)\r\n\t\t \r\n\t\t// 第一种情况 int(强转之后最终的值一定是0)\r\n\t\t// 第二种情况 int(强转之后将小数点舍去 1-5)\r\n\t\tSystem.out.println((int)Math.random()*5);//0.99*5永远到不了5\r\n\t\tSystem.out.println((int)(Math.random()*5+1));//[1,5.)\r\n\t\t\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++){\r\n\t\t\tSystem.out.print(i%7+\"-\");\r\n\t\t\t\r\n\t\t}\r\n\t\t//1-M的随机产生\r\n\t\t//(int)(Math.random()*M+1)\r\n\t\t\r\n\t\t\r\n\t\t//产生0 1的概率不同 Math.random()<p?0:1\r\n\t\tSystem.out.println(\"----\"+rr.rand01p());\r\n\t\tSystem.out.println(\"----\"+rr.rand01());\r\n\t\tfor(int i=0;i<=11;i++){\r\n\t\t\tSystem.out.print(i%6+\"-\");\r\n\t\t \t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(rr.rand106());\r\n\t}", "@Override\n public void run() {\n while(true){\n// double a = Math.random()*Math.random();//占用 CPU\n// System.out.println(a);\n }\n }", "void mutate() {\r\n\t\tif (Math.random() < TSP.p_mutate) {\r\n\t\t\t// randomly flip two cities\r\n\t\t\trndSwapTwo();\r\n\t\t\tthis.distance = distance();\r\n\t\t}\r\n\t}", "void setRandomNo() {\n\t\tno = 10000000 + (int) (Math.random() * 90000000);\n\t}", "AttackResult randomAttack();", "public void SetRandom(boolean random);", "void saveRandom();", "public void randomChange() {\n\t\tif (Math.random() < .5) {\n\t\t\tthis.setOn(true);\n\t\t} else {\n\t\t\tthis.setOn(false);\n\t\t}\n\t}", "@Override\n public int attack() {\n return new Random().nextInt(5);\n }", "public void generateIndividual() {\n // Loop through all our destination cities and add them to our tour\n for (int cityIndex = 0; cityIndex < TourManager.numberOfCities(); cityIndex++) {\n setCity(cityIndex, TourManager.getCity(cityIndex));\n }\n // Randomly reorder the tour\n Collections.shuffle(tour);\n }", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "public void randomize() {\r\n\t\tif(randomizzatoreVariazione > 0.5)\r\n\t\t\tandamentoCurva.setVariazione(\r\n\t\t\t\t\tandamentoCurva.getVariazione() * randomizzatoreVariazione\r\n\t\t\t\t\t+ andamentoCurva.getMIN_VARIAZIONE()\r\n\t\t\t\t\t+ Math.random() * (andamentoCurva.getMAX_VARIAZIONE() - andamentoCurva.getMIN_VARIAZIONE())\r\n\t\t\t);\r\n\t\telse if(randomizzatoreVariazione < 0.5)\r\n\t\t\tandamentoCurva.setVariazione(\r\n\t\t\t\t\tandamentoCurva.getVariazione()\r\n\t\t\t\t\t- andamentoCurva.getMIN_VARIAZIONE()\r\n\t\t\t\t\t+ Math.random() * (andamentoCurva.getMAX_VARIAZIONE() - andamentoCurva.getMIN_VARIAZIONE() * randomizzatoreVariazione)\r\n\t\t\t);\r\n\t}", "public void randomWalk() {\n if (getX() % GameUtility.GameUtility.TILE_SIZE < 5 && getY() % GameUtility.GameUtility.TILE_SIZE < 5) {\n if (canChangeDirection) {\n direction = (int) (Math.random() * 3);\n direction += 1;\n direction *= 3;\n canChangeDirection = false;\n }\n }\n move(direction);\n if (timer >= timeTillChanngeDirection) {\n canChangeDirection = true;\n timer = 0;\n }\n\n if (lastLocation.x == this.getLocation().x && lastLocation.y == this.getLocation().y) {\n direction = (direction + 3) % 15;\n canChangeDirection = false;\n\n }\n lastLocation = this.getLocation();\n\n }", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "@Ignore\r\n @Test\r\n public void speedTest() throws InterruptedException {\n for (int i = 0; i < 10; i++) {\r\n singleSpeedTest();\r\n }\r\n }", "@Override\n public int orinar() {\n\n return (int) (Math.random() * 400) + 400;\n }", "public XorShiftRandom() {\n\t\tthis(System.nanoTime());\n\t}", "void move()\n {\n Random rand = new Random();\n int moveOrNot = rand.nextInt(2);//50% chance\n if(moveOrNot == 1)\n super.move();\n }", "public void touchToScatter() {\n for (int i = 0; i < pointCount; i++) {\n int speedX = random.nextInt(2 * speedXBarrier) - speedXBarrier;\n int speedY = random.nextInt(2 * speedYBarrier) - speedYBarrier;\n points.get(i).setSpeedX(speedX);\n points.get(i).setSpeedY(speedY);\n }\n }", "private String getRandomName(){\n return rndString.nextString();\n }", "public SeaUrchin()\n {\n speed = Greenfoot.getRandomNumber(2) +1;\n setRotation(Greenfoot.getRandomNumber(360)); \n }", "private void changeDelay() {\n delay = ((int) (Math.random() * 10000) + 1000) / MAX_FRAMES;\n }", "@Override\n\tpublic void doTimeStep() {\n\t\tint activity = Critter.getRandomInt(3);\n\t\tif(activity == 0) {\n\t\t\twalk(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(activity == 1) {\t\t\t\t\n\t\t\trun(Critter.getRandomInt(8));\n\t\t\tthis.moveFlag = true;\n\t\t}\n\t\telse if(this.getEnergy() >= Params.min_reproduce_energy) {\n\t\t\tCritter4 egg = new Critter4();\n\t\t\tthis.reproduce(egg,Critter.getRandomInt(8));\n\t\t}\n\t\telse {\n\t\t}\n\t}", "public void randomizeState() {\n\t\t//System.out.print(\"Randomizing State: \");\n\t\tArrayList<Integer> lst = new ArrayList<Integer>();\n\t\tfor(int i = 0; i<9; i++)// adds 0-8 to list\n\t\t\tlst.add(i);\n\t\tCollections.shuffle(lst);//randomizes list\n\t\tString str=\"\";\n\t\tfor(Integer i : lst)\n\t\t\tstr += String.valueOf(i);\n\t\t//System.out.println(str);\n\t\tcurrent = new PuzzleState(str,current.getString(current.getGoalState()));\n\t\t//pathCost++;\n\t}", "@Override\n\tpublic void run() {\n\t\tMPMergeSortTest.MPParallelRandomGen(start, end, r, data);\n\n\t}", "public static boolean charRNG() { // Character randoms initilization\n Random randomN = new Random();\n \n int speedP1 = randomN.nextInt(5) + 1; // Super 1\n int speedP2 = randomN.nextInt(5) + 1;\n \n int defP1 = randomN.nextInt(5) + 1; // Super 2\n int defP2 = randomN.nextInt(5) + 1;\n \n int attackP1 = randomN.nextInt(5) + 1; // Super 3\n int attackP2 = randomN.nextInt(5) + 1;\n \n int P1stats = ((speedP1 + defP1) + attackP1);\n int P2stats = ((speedP2 + defP2) + attackP2);\n \n return (P1stats > P2stats);\n }" ]
[ "0.6987475", "0.69424266", "0.688719", "0.65247816", "0.650006", "0.64666826", "0.6435978", "0.6384021", "0.638321", "0.63819426", "0.6377878", "0.631877", "0.631482", "0.6307231", "0.62815017", "0.6245866", "0.62257224", "0.61873245", "0.61695457", "0.6169535", "0.6151379", "0.61388415", "0.6121013", "0.6116153", "0.6112761", "0.6101273", "0.6052999", "0.6038405", "0.6037404", "0.60284126", "0.6025037", "0.6023453", "0.60156786", "0.6013605", "0.60047096", "0.59244025", "0.59223586", "0.59202266", "0.59033626", "0.5899949", "0.58997756", "0.58936185", "0.58824897", "0.587923", "0.5868586", "0.58617836", "0.585962", "0.58513886", "0.58405316", "0.58258206", "0.58231074", "0.5821547", "0.5820406", "0.58164823", "0.58147764", "0.58119833", "0.5804593", "0.58035785", "0.5801646", "0.5798142", "0.5783817", "0.57797617", "0.57765174", "0.57696986", "0.57558167", "0.57519585", "0.5751853", "0.5743872", "0.5742755", "0.57422596", "0.5741305", "0.5738425", "0.57328516", "0.57202166", "0.57106805", "0.5706135", "0.570274", "0.57008106", "0.5693104", "0.5690044", "0.5688266", "0.5678391", "0.567719", "0.5673704", "0.5651359", "0.56465226", "0.56453604", "0.5644851", "0.56434584", "0.56360316", "0.5628293", "0.5622308", "0.56204927", "0.5619623", "0.5619351", "0.56185544", "0.55965173", "0.5584336", "0.55804604", "0.5574999" ]
0.6232258
16
This function check if healthy individual is get infected or not, by using parameters of both communicating individuals and world's current spreading factor. If probability is bigger than 0 user is get infected by calling getCovid() function.
public void checkInflected(Individual other) { double probability = world.getSpreadingFactor() * (1+(Math.max(other.getConversationTime(), getConversationTime()) / 10)) * getMaskIndicator() * other.getMaskIndicator() * (1-(Math.min(other.getSocialDistance(), getSocialDistance()) / 10)); if(Math.min(probability, 1) > 0.3) getCovid(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public States infectProb(int numInfected, int numInfectedV2, int V2infectivity){\n //TODO maybe adjust probability, currently each infected neighbor adds 5% chance of infection\n int risk = numInfected * 10; // 10/100 (10% chance)\n int riskV2 = numInfectedV2 * V2infectivity;\n int riskVal = rand.nextInt(100);\n int riskValV2 = rand.nextInt(100);\n if(riskVal < risk && riskValV2 < riskV2){ //TODO test this, should trigger if risk of infection for both viruses\n if(riskVal > riskValV2) { //risk for virus 1 higher than virus 2, infected with virus 1\n myAut.numberInfectedV1++;\n myAut.numberSusceptible--;\n return States.Infected;\n }\n else return States.InfectedVirus2;\n } else if(riskVal < risk){ //infected with virus 1\n myAut.numberInfectedV1++;\n myAut.numberSusceptible--;\n return States.Infected;\n } else if(riskValV2 < riskV2){ //infected with virus 2\n return States.InfectedVirus2;\n } else return cellState;\n }", "public void infect() {\n\n if (random.getRandom() <= getProbability()) {\n isInfected = true;\n isInfectedOnThisStep = true;\n }\n }", "public boolean infect() {\n\t\t/* Remove all events related to this virus */\n\t\tfor (int i = 0; i < Sim.events.size(); i++)\n\t\t\tif (Sim.events.elementAt(i).org.equals(this))\n\t\t\t\tSim.events.elementAt(i).delete = true;\n\n\t\t/* Choose a bacteria to infect */\n\t\tBacterium chosen_bacterium = Sim.bas.get(Sim.randy.nextInt(Sim.bas\n\t\t\t\t.size()));\n\n\t\t/* check probability of successful infection */\n\t\tif ((((1 - chosen_bacterium.prob_surface) * this.prob_surface) >= Sim.randy\n\t\t\t\t.nextDouble())\n\t\t\t\t&& (((1 - chosen_bacterium.prob_enzymes) * this.prob_enzymes) >= Sim.randy\n\t\t\t\t\t\t.nextDouble()) && !chosen_bacterium.infected) {\n\n\t\t\t/* Update virus object */\n\t\t\tthis.current_ba = chosen_bacterium;\n\n\t\t\t/* Update bacteria object */\n\t\t\tchosen_bacterium.infected = true;\n\t\t\tchosen_bacterium.lp = this;\n\n\t\t\t/* Update bas_infected DataSeries in Sim */\n\t\t\tSim.bas_infected++;\n\n\t\t\t/* Create \"switch\" and \"secrete\" event */\n\t\t\tSim.events.add(new Event(this, rate_switch, EVENT_TYPE.SWITCHPHASE));\n\t\t\tSim.events.add(new Event(this, rate_secrete, EVENT_TYPE.SECRETE));\n\n\t\t\treturn true;\n\t\t\t\n\t\t} \n\t\t/* check to see if virus has failed to infect */\n\t\telse{ \n\t\t\n\t\t\t/* Remove this virus from lambda vector and update counters */\n\t\t\tfor (int i = 0; i < Sim.lps.size(); i++) {\n\t\t\t\tif (Sim.lps.elementAt(i).equals(this)) {\n\t\t\t\t\tSim.lps.remove(i);\n\t\t\t\t\tSim.lps_sum_sr -= this.prob_surface;\n\t\t\t\t\tSim.lps_sum_enz -= this.prob_enzymes;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false; \n\t\t}\n\n\t}", "@Override\r\n\tpublic boolean wasIncident() {\r\n\t\tdouble random = Math.random()*100;\r\n\t\tif(random<=25) return true;\r\n\t\treturn false;\r\n\t}", "public void progressInfectionProbV1(){\n int recoveryProb = 0;\n //TODO work on this isolation probability\n //if not isolating already, maybe isolate\n if(!isolating) {\n int isolationProb = rand.nextInt(100) * daysInfected;\n if (isolationProb > 25) //TODO this is the probability\n isolating = true;\n }\n\n //progress the infection probabilistically\n if(daysInfected >= 5) { //start recovery at infection day 5, around which symptoms start\n if(daysInfected < 14)\n recoveryProb = daysInfected * 6; //80% of cases resolve after ~2 weeks\n else\n recoveryProb = daysInfected * 3; //Cases taking over 2 weeks (more severe cases) can take up to 6 weeks to resolve\n int recov = rand.nextInt(100);\n if (recov < recoveryProb) {\n //recover\n nextState = States.Recovered;\n immuneV1 = true;\n myAut.numberInfectedV1--;\n isolating = false;\n //System.out.println(\"cell recovered\");\n } else daysInfected++;\n } else daysInfected++;\n }", "public boolean isHappening(int probability){\n return r.nextDouble() <= probability / 100.0;\n }", "public void infect() {\n\t\tPlagueAgent current = this;\n\t\tif (!current.infected) {\n\t\t\tfor (PlagueAgent a : plagueWorld.getNeighbors(current, 5)) {\n\t\t\t\tif (a.infected) {\n\t\t\t\t\tint luck = Utilities.rng.nextInt(100);\n\t\t\t\t\tif (luck < plagueWorld.VIRULENCE) {\n\t\t\t\t\t\tthis.infected = true;\n\t\t\t\t\t\tplagueWorld.newInfection();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tplagueWorld.changed();\n\t}", "float shouldAggroOnHit(IGeneticMob geneticMob, EntityLiving attacker);", "private double evaluateFaultCovFitness(String phenotype) {\n int faults = 38; // Again, should be injected\n boolean[] faultsHit = new boolean[faults];\n for (int i = 0; i < faults; i++)\n faultsHit[i] = false;\n for (int i = 0; i < phenotype.length(); i++) {\n if (phenotype.charAt(i) == '1') {\n// mark the faults found by the test\n for (int j = 0; j < faults; j++) {\n if (faultMatrix[i][j] == 1)\n faultsHit[j] = true;\n }\n }\n }\n// total collection of faults found\n int count = 0;\n for (int i = 0; i < faults; i++) {\n if (faultsHit[i])\n count++;\n }\n return count;\n }", "int accidentVelo()\r\n\t{\r\n\t\tdouble rand = Math.random()*100;\r\n\t\tSystem.out.println(rand);\r\n\t\tif ((double)rand <= 0.5) {\r\n\t\t\tSystem.out.println(\"Finalement vous auriez du y aller à pied. Vous vous vider de votre sang sur le bord du trottoir.\");\r\n\t\t\treturn 0.5;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public void getCovid()\n\t{\n\t\tsetHealthStatus(HealthStatus.INFLECTED);\n\t\tdeathTimer = new PlayPauseTimer((int) (100*(1 - world.getMortalityRate())), new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjustDie();\n\t\t\t\ttimerList.remove(deathTimer);\n\t\t\t}\n\t\t\t\n\t\t}, world.getRefreshTime());\n\t\ttimerList.add(deathTimer);\n\t\t\n\t\thospitalNeed = new Thread(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tworld.getHospital().acceptIndividual();\n\t\t\t\t\tgoHospital();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\tgoHospitalTimer = new PlayPauseTimer(25, new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\thospitalNeed.start();\n\t\t\t\ttimerList.remove(goHospitalTimer);\n\t\t\t}\n\t\t\t\n\t\t}, world.getRefreshTime());\n\t\ttimerList.add(goHospitalTimer);\n\t\tworld.infect();\n\t}", "double getCritChance();", "@Override\n public double getInfectivity(double heat, double dampness, double wealth) {\n return (infectivity * (1.0 - wealth));\n }", "public int CriticalHitCheck(int creatureSkill){\n \tcriticalChance = genRandom.nextInt(100);\n \tif(criticalChance <= creatureSkill){\n \t\tLog.write(\"A CRITICAL HIT!\");\n \t\treturn 2;\n \t}\n \treturn 1;\n }", "private void checkForAccident(double time) {\n\n\t\tdouble chance = .005D;\n\n\t\t// Materials science skill modification.\n\t\tint skill = getEffectiveSkillLevel();\n\t\tif (skill <= 3) {\n\t\t\tchance *= (4 - skill);\n\t\t} else {\n\t\t\tchance /= (skill - 2);\n\t\t}\n\n\t\t// Modify based on the workshop building's wear condition.\n\t\tchance *= workshop.getBuilding().getMalfunctionManager().getWearConditionAccidentModifier();\n\n\t\tif (RandomUtil.lessThanRandPercent(chance * time)) {\n\n\t\t\tif (person != null) {\n//\t\t\t\tlogger.info(\"[\" + person.getLocationTag().getShortLocationName() + \"] \" + person.getName() + \" has accident while manufacturing good.\");\n\t\t\t\tworkshop.getBuilding().getMalfunctionManager().createASeriesOfMalfunctions(person);\n\t\t\t} else if (robot != null) {\n//\t\t\t\tlogger.info(\"[\" + robot.getLocationTag().getShortLocationName() + \"] \" + robot.getName() + \" has accident while manufacturing godd.\");\n\t\t\t\tworkshop.getBuilding().getMalfunctionManager().createASeriesOfMalfunctions(robot);\n\t\t\t}\n\t\t}\n\t}", "int getMinigameDefenseChancesLeft();", "public void progressInfectionProbV2(int probability){\n int recoveryProb = 0;\n recoveryProb = daysInfected * probability;\n int recov = rand.nextInt(100);\n if (recov < recoveryProb) {\n //recover\n nextState = States.RecoveredVirus2;\n immuneV2 = true;\n } else daysInfected++;\n }", "float shouldEatOffTheGround(IGeneticMob geneticMob, EntityItem itemEntity);", "public float getSpawningChance()\n {\n return 0.1F;\n }", "public void infectedBy(Organism infectingOrganism) {\n\t\tinfectingOrganism._nTotalInfected++;\n\t\t_infectedGeneticCode = infectingOrganism.getGeneticCode();\n\t\t_infectedGeneration = infectingOrganism.getGeneration();\n\t\t_world.organismHasBeenInfected(this, infectingOrganism);\n\t}", "public Boolean isTransmissionEffective() { return random.nextDouble() < transmissionProb; }", "private void aimlessScout() {\n\t\ttargetFlower = null;\n\t\t// if bee is sufficiently far from flower, look for other flowers\n\t\tif((clock.time - tempTime) > 0.15) {\n\t\t\tstate = \"SCOUTING\";\n\t\t}\n\t\t// otherwise keep flying\n\t\telse{\n\t\t\tcurrentAngle += RandomHelper.nextDoubleFromTo(-Math.PI/8, Math.PI/8);\n\t\t\tspace.moveByVector(this, 4, currentAngle,0);\n\t\t\tNdPoint myPoint = space.getLocation(this);\n\t\t\tgrid.moveTo(this, (int) myPoint.getX(), (int) myPoint.getY());\n\t\t\t//energy -= exhaustionRate;\n\t\t\tfood -= highMetabolicRate;\n\t\t}\n\t}", "public static boolean isDealingBurnDamageToBothPlayersAndContinuingGame (int burnDamage) {\r\n boolean isDefeaingPlayer = (burnDamage >= Game.lifePointsPlayer);\r\n boolean isDefeatingCPU = (burnDamage >= Game.lifePointsCPU);\r\n if (isDefeaingPlayer && isDefeatingCPU) {\r\n Game.lifePointsPlayer=0;\r\n Game.lifePointsCPU=0;\r\n YuGiOhJi.informationDialog(\"Both players take \" + burnDamage + \" burn damage.\", \"\");\r\n YuGiOhJi.informationDialog(\"The life points of both players have been reduced to zero.\", \"DRAW!\");\r\n // display some hidden achievements here, if unlocked\r\n YuGiOhJi.informationDialog(\"Hidden achievement found: \\\"Worthy Adversary\\\". You let a game result in a draw.\", \"\"); Game.unlockTrophy(Game.trophyAdversaryUnlocked);\r\n // end of listing of achievements\r\n Game.over();\r\n return false; // GAME OVER\r\n }\r\n else if (isDefeaingPlayer && !isDefeatingCPU) {\r\n isDealingBattleDamageAndContinuingGame(true, burnDamage, false); // GAME OVER already happens inside the method\r\n return false; // GAME OVER\r\n }\r\n else if (!isDefeaingPlayer && isDefeatingCPU) {\r\n isDealingBattleDamageAndContinuingGame(true, burnDamage, true); // GAME OVER already happens inside the method\r\n return false; // GAME OVER\r\n }\r\n else {\r\n YuGiOhJi.informationDialog(\"Both players take \" + burnDamage + \" burn damage.\", \"\");\r\n Game.lifePointsPlayer = Game.lifePointsPlayer-burnDamage;\r\n Game.lifePointsCPU = Game.lifePointsCPU-burnDamage;\r\n YuGiOhJi.updateDisplayedLP();\r\n return true; // game continues\r\n }\r\n }", "public boolean getStatus() {\n return (rnd.nextInt(obstructionChanceBound) <= obstructionChance);\n }", "double getMissChance();", "public boolean tryInfect(Virus virus) {\n if (isInfected) {\n return true;\n }\n\n if (os.tryToInfect(virus)) {\n isInfected = true;\n return true;\n }\n\n return false;\n }", "@Override\r\n\tpublic boolean fight(String oponent) {\n\t\tint x = Critter.getRandomInt(1);\r\n\t\tif (x == 1) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean fight(String not_used) { \r\n\t\tint num = getRandomInt(100);\r\n\t\tif (num >= fearfullness) {\r\n\t\t\treturn true;\r\n\t\t}else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Test\r\n void shouldReturnOneRiskPoint() {\r\n InsuranceRiskService insuranceRiskService = new DisabilityInsuranceRiskService();\r\n InsuranceRiskRequest insuranceRiskRequest = new InsuranceRiskRequest();\r\n insuranceRiskRequest.setAge(25);\r\n HouseRequest houseRequest = new HouseRequest();\r\n houseRequest.setOwnershipStatus(\"mortgaged\");\r\n insuranceRiskRequest.setHouse(houseRequest);\r\n insuranceRiskRequest.setIncome(BigDecimal.valueOf(999999));\r\n insuranceRiskRequest.setDependents(2);\r\n insuranceRiskRequest.setMaritalStatus(\"married\");\r\n Assertions.assertEquals(1, insuranceRiskService.calculate(3, insuranceRiskRequest));\r\n }", "private void figureOutProbability() {\n\t\tMysqlDAOFactory mysqlFactory = (MysqlDAOFactory) DAOFactory\n\t\t\t\t.getDAOFactory(DAOFactory.MYSQL);\n\n\t\tstaticPr = new StaticProbability(trialId);\n\t\tstatisticPr = new StatisticProbability(trialId);\n\t\tstaticProbability = staticPr.getProbability();\n\t\tstatisticProbability = statisticPr.getProbability();\n\n\t\tfor (Entry<Integer, BigDecimal> entry : staticProbability.entrySet()) {\n\t\t\ttotalProbability.put(\n\t\t\t\t\tentry.getKey(),\n\t\t\t\t\tentry.getValue().add(statisticProbability.get(entry.getKey())).setScale(2));\n\t\t}\n\n\t\tBigDecimal summaryProbability = BigDecimal.valueOf(0);\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tsummaryProbability = summaryProbability.add(entry.getValue());\n\t\t}\n\t\t\n\t\t// figures out probability\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tentry.setValue(entry.getValue().divide(summaryProbability, 2,\n\t\t\t\t\tBigDecimal.ROUND_HALF_UP));\n\t\t}\n\t\tlog.info(\"Total probability -> \" + totalProbability);\n\t\t\n\t\t// figures out and sets margin\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tBigDecimal probability = entry.getValue();\n\t\t\tBigDecimal winCoefficient = (BigDecimal.valueOf(1.).divide(\n\t\t\t\t\tprobability, 2, BigDecimal.ROUND_HALF_UP))\n\t\t\t\t\t.multiply(BigDecimal.valueOf(1.).subtract(Constants.MARGIN));\n\t\t\tentry.setValue(winCoefficient.setScale(2, BigDecimal.ROUND_HALF_UP));\n\t\t}\n\t\tlog.info(\"Winning coefficient -> \" + totalProbability);\n\t\t\n\t\t// updates info in db\n\t\tTrialHorseDAO trialHorseDAO = mysqlFactory.getTrialHorseDAO();\n\t\tTrialHorseDTO trialHorseDTO = null;\n\t\tfor(Entry<Integer, BigDecimal> entry : totalProbability.entrySet()){\n\t\t\ttrialHorseDTO = trialHorseDAO.findTrialHorseByTrialIdHorseId(trialId, entry.getKey());\n\t\t\ttrialHorseDTO.setWinCoefficient(entry.getValue());\n\t\t\ttrialHorseDAO.updateTrialHorseInfo(trialHorseDTO);\n\t\t}\t\n\t}", "protected boolean IsHighExplosive()\r\n {\r\n \t// Wrapper function to make code a little cleaner.\r\n // isInvulnerable() is wrongly named and instead represents the specific\r\n // skull type the wither has launched\r\n \t\r\n \treturn isInvulnerable();\r\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}", "static void primitiveBoolean() {\n\n double coveragerByInsurance = 0.8;\n double billAmount = 1000.0;\n double amountPaidByInsurance = 0.0;\n double amountPaidByPatient = billAmount;\n if (isInsured) {\n amountPaidByInsurance = billAmount * coveragerByInsurance;\n amountPaidByPatient = billAmount - amountPaidByInsurance;\n }\n System.out.println(\"AmountPaidByInsurance=\" + amountPaidByInsurance);\n System.out.println(\"AmountPaidBypatient=\" + amountPaidByPatient);\n }", "public boolean inflictStaffTrance() {\n /**\n * A Staff has 20% chance of inflicting trance.\n */\n if (this.getWeapon() instanceof Staff) {\n int seed = 100;\n Random random = new Random(seed);\n int value = random.nextInt(seed);\n return value < 21;\n }\n\n return false;\n }", "public boolean encountered(){\n boolean encounter = false;\n\n int stepsNeeded = player.getDestination().getStepsNeeded();\n\n float percent = (chance * 1.0f / stepsNeeded * 1.0f) * 100;\n float result = r.nextFloat() * 100;\n\n if(result <= percent && percent >= 20) {\n encounter = true;\n }\n\n return encounter;\n }", "public void infect() {\n isInfected = true;\n }", "private void checkForPlayerChance()\n\t\t\t{\n\t\t\t\tf = false;\n\t\t\t\tfor (j = 0; j < 8; ++j)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (win[j] == 2 && lose[j] == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tf = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\tif (f == false)\n\t\t\t\t\tj = 10;\n\n\t\t\t}", "private void checkVictory()\n {\n if(throne.getEnemyHealth() <= 0)\n {\n System.out.println(\"Congrats! The land is now free from all chaos and destruction. You are now very rich and wealthy. Yay\");\n alive = false;\n }\n }", "int getIndividualDefense();", "private boolean check_vicinity(FishTankItem TankItem) {\r\n if (getDirection()) {\r\n return 0 <= (TankItem.firstCoordinate - this.firstCoordinate)\r\n && (TankItem.firstCoordinate - this.firstCoordinate) <= 7;\r\n } else {\r\n return 0 <= (this.firstCoordinate - TankItem.firstCoordinate)\r\n && (this.firstCoordinate - TankItem.firstCoordinate) <= 5;\r\n }\r\n }", "boolean hasDamage();", "boolean hasDamage();", "boolean hasDamage();", "boolean hasDamage();", "boolean hasDamage();", "public boolean isVisionary(EntityPlayer player);", "public boolean tryToContagion(Person p_sick, Person p_check) throws Exception\n\t{\n\t\tif(p_sick instanceof Sick )\n\t\t{\n\t\t\tSick p_s =(Sick)p_sick;\n\t\t\tlong contagiousTime=p_s.getContagiousTime();\n\t\t\tlong sickDays=Clock.CalcDays(contagiousTime);\n\t\t\t\n\t\t\tif(sickDays < Min_contage_time)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(p_check instanceof Sick )\n\t\t{\n\t\t\tthrow new Exception(\"Both person's are sick! A sick person cannot get sick again\");\n\t\t}\n\t\t\n\t\tdouble distance=Math.sqrt(Math.pow(p_sick.getLocation().getPoint_y()-p_check.getLocation().getPoint_y(),2)+Math.pow(p_sick.getLocation().getPoint_x()-p_check.getLocation().getPoint_x(),2));\n\t\tdouble result = contagionProbability(p_check)*Math.min(1,0.14*Math.exp(2-0.25*distance));\n\t\treturn result >=Math.random();\n\t\t\n\t}", "private boolean checkGreedyIronCurtain() {\r\n return (myself.health < 30 || enTotal.get(0) >= 8 || opponent.isIronCurtainActive || this.myTotal.get(0) < this.enTotal.get(0));\r\n }", "private void checkIfHungry(){\r\n\t\tif (myRC.getEnergonLevel() * 2.5 < myRC.getMaxEnergonLevel()) {\r\n\t\t\tmission = Mission.HUNGRY;\r\n\t\t}\r\n\t}", "private boolean startScouting(){\n\t\t// calculate motivation to forage based on amount of food in hive\n\t\tdouble motivation = 1 - (hive.food/hive.foodCapacity);\n\t\t\n\t\t// calculate motivation to follow dance based on amount of dances\n\t\tdouble danceFactor = (1-Math.exp((-1/colonySize)*hive.dancingBees.size()));\n\t\t\n\t\t// calculate whether or not bee should scout\n\t\tif(RandomHelper.nextDoubleFromTo(0,1) < scoutProb*motivation + \n\t\t\t\t(1-scoutProb)*motivation*(1-danceFactor)*scoutProb){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// otherwise follow a dance\n\t\treturn false;\n\t}", "@Override\n public boolean checkCollideSingle(GameObject gameObject, int x, int y) {\n if (!(gameObject instanceof Player) || !isAlive())\n return false;\n\n boolean result = super.withinRange(x, y);\n\n if (result) {\n if (prev + (hitInterval * 10) < System.currentTimeMillis()) {\n prev = System.currentTimeMillis();\n startHitTime = prev + 300;\n startHit = true;\n }\n }\n\n if (result) {\n if (startHitTime < System.currentTimeMillis() && startHit) {\n HUD.getInstance().removeHealth(getDamage());\n setStatus(PlayerStatus.FIGHTING);\n startHit = false;\n }\n }\n\n return result;\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 int checkChasingPlayer()\n {\n if(stunCountdown > 0)\n {\n chasingPlayer = false;\n return stunCountdown;\n }\n if(Game.getInstance().getPlayer().getCurrentRoom().isControlRoom())\n {\n chasingPlayer = false;\n return(-1);\n }\n else\n {\n List<Exit> neighbors = getCurrentRoom().getCollectionOfExits();\n for(Exit neighbor : neighbors)\n {\n if(getCurrentRoom().getExit(neighbor).equals(Game.getInstance().getPlayer().getCurrentRoom()) && neighbor.isOperating())\n {\n chasingPlayer = true;\n return(5 + (int) Math.floor(Math.random() * 6));\n }\n }\n chasingPlayer = false;\n return(-1);\n }\n }", "private void checkLoosePLayer(){\n if (hero.getHp()<=0){\n loose();\n }\n\n }", "private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}", "public void attack(Person victim)\r\n { \r\n int victimDef = 0;\r\n int hits = 0;\r\n String weaponName = \"bare hands\";\r\n \r\n victimDef = victim.getDef();\r\n \r\n //1/4 chance of critical or twice damage \r\n hits = (attack - victimDef) + (int)((Math.random()*(attack*.3))-(attack*.15));\r\n if (hits < 0)\r\n hits = 0;\r\n \r\n if (weapon!=null)\r\n weaponName = weapon.getName();\r\n \r\n //1/6 chance of missing when attacking\r\n if (!victim.equals(this))\r\n {\r\n if(Game.random(6)!=0)\r\n {\r\n //1/4 chance of double damage\r\n if (Game.random(8)!=0)\r\n say(\"I attack \" + victim.getName() + \" with my \" + weaponName);\r\n else \r\n {\r\n say(\"I inflict critical damage on \" + victim.getName() + \" with my \" + weaponName);\r\n hits += hits;\r\n }\r\n victim.suffer(hits);\r\n }\r\n else\r\n say(\"AHHH I attacked, but \" + victim.getName() + \" dodged my attack!\");\r\n }\r\n \r\n //if victim dies, hero's maxHealth increases\r\n if (victim.getHealth()<=0)\r\n {\r\n maxHealth += 10;\r\n attack += 2;\r\n defense += 1;\r\n }\r\n }", "boolean hasDefense();", "boolean hasDefense();", "boolean hasDefense();", "boolean hasDefense();", "boolean hasDefense();", "boolean hasDefense();", "public boolean muerteInesperada() {\n r = new Random();\r\n return Float.compare(r.nextFloat(), probMuerte) <= 0;\r\n }", "@ScheduledMethod(start = 1, interval = 1, priority = 6)\n\tpublic void determineIfEating() {\n\t\tisEating = (RandomHelper.nextIntFromTo(0,100) <= CFG.diningOutPercent());\n\t}", "public void infectedBy(GeneticCode infectingCode) {\n\t\t_infectedGeneticCode = infectingCode;\n\t\t_world.organismHasBeenInfected(this, null);\n\t}", "@Override\n @SuppressWarnings(\"empty-statement\")\n public void attack(){\n\n if (myTerritory.getAlpha() <= 0.5){\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getSoldiers()/4;\n defendingSoldiers = myTerritory.getSoldiers()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }\n else\n myTerritory.produceSoldiers(myTerritory.getNatRes(), myTerritory.getPeasants());\n attackingSoldiers = myTerritory.getFoodGrowth()/4;\n defendingSoldiers = myTerritory.getFoodGrowth()*3/4;\n attackedTerritoryID = (new Random()).nextInt(myTerritory.getNeighbors().numObjs) + 1;\n }", "public boolean isCurrentPlayerHungry() {\r\n\tboolean isHungry = true;\r\n\tint length = this.territory[this.currentSide].length;\r\n\tfor (short i = 0; i < length && isHungry; i++) {\r\n\t isHungry = (this.territory[this.currentSide][i] == 0);\r\n\t}\r\n\r\n\treturn isHungry;\r\n }", "private void calculateCrit(Monster target, MonsterParts part, Weapon weapon, double motionValue) throws InvalidPartException {\n \n if (target.isWeakness(part)) {\n if (Math.random() < (Math.abs((weapon.getAffinity() + weaknessExploit)/100.0)) && (weapon.getAffinity() + weaknessExploit) < 0) {\n critDamage -= weapon.getAttack()/weapon.getInflation() * 0.25 * weapon.getRawSharpness() * target.getPartMultiplierRaw(part, weapon) * motionValue;\n }\n if (Math.random() < ((weapon.getAffinity() + weaknessExploit)/100.0) && (weapon.getAffinity() + weaknessExploit) > 0) {\n critDamage += weapon.getAttack()/weapon.getInflation() * (0.25 + critBoost/100.0) * weapon.getRawSharpness() *target.getPartMultiplierRaw(part, weapon) * motionValue;\n if (criticalElement) {\n elementalCritDamage += weapon.getElementStatusDmg()/10 * 0.25 * weapon.getElementalSharpness() * target.getPartMultiplierElemental(part, weapon);\n }\n }\n } else {\n if (Math.random() < (Math.abs(weapon.getAffinity()/100.0)) && weapon.getAffinity() < 0) {\n critDamage -= weapon.getAttack()/weapon.getInflation() * 0.25 * weapon.getRawSharpness() * target.getPartMultiplierRaw(part, weapon) * motionValue;\n }\n if (Math.random() < (weapon.getAffinity()/100.0) && weapon.getAffinity() > 0) {\n critDamage += weapon.getAttack()/weapon.getInflation() * (0.25 + critBoost/100.0) * weapon.getRawSharpness() * target.getPartMultiplierRaw(part, weapon) * motionValue;\n if (criticalElement) {\n elementalCritDamage += weapon.getElementStatusDmg()/10 * 0.25 * weapon.getElementalSharpness() * target.getPartMultiplierElemental(part, weapon);\n }\n }\n }\n\n }", "public InaccurateAttackEffect() {\n\t\tsuper(Effect.Target.OPPONENT, Effect.FLIP_COIN);\n\t\tthis.numberOfHits = 1;\n\t\tthis.hitsPerEnergy = Effect.BOOL_NOT_USED;\n\t\tthis.hitsIndefinitely = Effect.BOOL_NOT_USED;\n\t}", "public Action shoot(GameState pState, Deadline pDue) {\n int firstStepShoot = 70;\n double ThresholdShootProb = 0.55;\n // If we don't have seen enough datas to make a shoot with confidence we don't shoot\n if (pState.getBird(0).getSeqLength() < firstStepShoot) {\n return new Action(-1, -1);\n }\n double bestShootProb = Double.NEGATIVE_INFINITY;\n int bestShoot = -1;\n int idBirdToShoot = -1;\n // First round we don't shoot\n if (pState.getRound() != 0) {\n\n // We are looking for the best probability to shoot\n for (int idBird = 0; idBird < pState.getNumBirds(); idBird++) {\n Bird currentBird = pState.getBird(idBird);\n\n if (currentBird.isAlive()) {\n double[][] observations = new double[currentBird.getSeqLength()][1];\n for (int idObs = 0; idObs < currentBird.getSeqLength(); idObs++) {\n observations[idObs][0] = currentBird.getObservation(idObs);\n }\n\n // Now we want to find its species and its best HMM associated\n // To do that we just have to find the HMM which best maximize the likelihood of the observations\n int currentSpecies = Constants.SPECIES_UNKNOWN;\n double bestLikelihood = Double.NEGATIVE_INFINITY;\n HMMOfBirdSpecies bestHMM = null;\n for (int idSpecies = 0; idSpecies < Constants.COUNT_SPECIES; idSpecies++) {\n if (listHMM[idSpecies] != null) {\n HMMOfBirdSpecies currentHMM = listHMM[idSpecies];\n double localLikehood = currentHMM.SequenceLikelihood(observations);\n if (localLikehood > bestLikelihood) {\n bestLikelihood = localLikehood;\n bestHMM = currentHMM;\n currentSpecies = idSpecies;\n }\n }\n\n }\n // At this moment we have the bestHMM which maximize the likelihood of our observations\n // We have also the species associated to this guess\n // We don't want to shoot at a black stork\n if (!(currentSpecies == Constants.SPECIES_BLACK_STORK) && bestLikelihood > -200 && bestHMM != null) {\n // Now we want to find the next observation which has the best probability to appear\n // We get our current State probability vector\n double[] currentPi_t = bestHMM.currentStateEstimation(observations);\n// We compute a vector which represent the probability of each observation to apperat at t+1\n double[] nextObsDist = bestHMM.NextObsDistribution(currentPi_t);\n\n // We search for the best shoot to do by maximizing the probability\n double bestLocalShootProb = Double.NEGATIVE_INFINITY;\n int bestLocalShoot = -1;\n for (int idObs = 0; idObs < Constants.COUNT_MOVE; idObs++) {\n if (nextObsDist[idObs] > bestLocalShootProb) {\n bestLocalShootProb = nextObsDist[idObs];\n bestLocalShoot = idObs;\n }\n }\n\n if (bestLocalShootProb > bestShootProb) {\n if (bestLocalShootProb >= ThresholdShootProb) {\n bestShootProb = bestLocalShootProb;\n bestShoot = bestLocalShoot;\n idBirdToShoot = idBird;\n }\n }\n\n }\n }\n }\n if (idBirdToShoot != -1) {\n System.err.println(\"shoot bird \" + idBirdToShoot + \"action \" + bestShoot + \" Prob \" + bestShootProb);\n }\n }\n return new Action(idBirdToShoot, bestShoot);\n }", "public boolean roadBlocked(Player player)\n {\n int num = 0;\n int num2 = 0;\n int num3 = 0;\n if (person_to_play == 1)\n {\n num = check4CollisionWithRed(player);\n num2 = check4CollisionWithGreen(player);\n num3 = check4CollisionWithYellow(player);\n }\n else if (person_to_play == 2)\n {\n //println(\"inside road block\");\n num = check4CollisionWithBlue(player);\n num2 = check4CollisionWithGreen(player);\n num3 = check4CollisionWithYellow(player);\n //println(\"num=\"+num);\n }\n else if (person_to_play == 3)\n {\n num = check4CollisionWithBlue(player);\n num2 = check4CollisionWithRed(player);\n num3 = check4CollisionWithYellow(player);\n }\n else if (person_to_play == 4)\n {\n num = check4CollisionWithBlue(player);\n num2 = check4CollisionWithRed(player);\n num3 = check4CollisionWithGreen(player);\n }\n if (num > 1 || num2 > 1 || num3 > 1)\n {\n return true;\n }\n return false;\n }", "public static float[] Findingleader(boolean[] ineligible,float[] stat, int numberofplayer)\n {\n float first,second,third; // initializing to negative number, so even a zero can be the leader value\n first=second=third = -100;\n for (int a = 0; a<numberofplayer; a++) // loops till a is less than numofplayer\n {\n\n if ((first<stat[a]||first==stat[a])&& ineligible[a] != true)// if stat is higher or same as first, and the stat is not empty\n {\tif(first==stat[a]) { // ignore the tie because the second value will be same as the first value\n \t}\n \telse {\n third = second; // previous second value becomes third \n second = first; // previous fisrt value becomes second now\n first = stat[a]; // replace the first value with stat[a]\n \t}\n }\n else if((second<stat[a]||second==stat[a])&& ineligible[a] != true) { // if stat is higher than or equal to second value\n \tif(second==stat[a]) { // ignoring the tie \n \t}\n \telse {\n \tthird = second; // previous second value is now assigned to third\n \tsecond = stat[a]; // second is replaced by the value of stat[a]\n \t}\n }\n else if((third<stat[a]||third==stat[a])&& ineligible[a] != true) { // if stat is higher than or equal the third value\n \tif(third==stat[a]) { // ignoring the tie value\n \t}\n \telse {\n \tthird = stat[a]; // third value is now replaced by the stat[a]\n \t}\n }\n }\n float []top3value = {first,second,third}; // using array to return more than 1 value\n return top3value; // top3value array\n }", "public void playerHasInvincibility() {\n\t\tthis.state = canBeKilled;\n\t}", "@Test\r\n void shouldReturnOneZeroPoints() {\r\n InsuranceRiskService insuranceRiskService = new DisabilityInsuranceRiskService();\r\n InsuranceRiskRequest insuranceRiskRequest = new InsuranceRiskRequest();\r\n insuranceRiskRequest.setAge(35);\r\n insuranceRiskRequest.setHouse(null);\r\n insuranceRiskRequest.setIncome(BigDecimal.valueOf(999999));\r\n insuranceRiskRequest.setDependents(2);\r\n insuranceRiskRequest.setMaritalStatus(\"single\");\r\n Assertions.assertEquals(2, insuranceRiskService.calculate(3, insuranceRiskRequest));\r\n }", "@Test\r\n void testSoftMajorityAlwaysDefect() {\r\n AlwaysDefect testStrat = new AlwaysDefect();\r\n SoftMajority testStrat2 = new SoftMajority();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n Game game = new Game(testStrat, testStrat2, 3, payoffs);\r\n game.playGame();\r\n assertEquals(testStrat2.getPoints(), 2, \"SoftMajority strategy not functioning correctly\");\r\n }", "public int computeDamageTo(Combatant opponent) { return 0; }", "public double confidenceHi() {\n\t\treturn mean() + ((constant * stddev())/Math.sqrt(trails));\n\t}", "public void goAdventuring() {\n\n game.createRandomMonster(4);\n if(RandomClass.getRandomTenPercent() == 5) {\n System.out.println(\"Your are walking down the road... Everything looks peaceful and calm.. Hit enter to continue!\");\n sc.nextLine();\n\n } else {\n game.battle();\n p.checkXp();\n }\n }", "float getSpecialProb();", "float genChance();", "public static boolean chance(int prob) {\n Random random = new Random();\n return random.nextInt(prob) == 1;\n // Do I really need to explain this??\n }", "double getExtremeSpikeProbability();", "protected void getProbabilitiesStayInJail() {\t\t\r\n\t\tboard().dice().forEachPossibleRoll((roll, size) -> {\t\t\t\r\n\t\t\t//if doubles, we're forced to leave jail (but our doubles are accounted for, we don't roll again)\r\n\t\t\tif (roll.isDoubles())\r\n\t\t\t\tboard().nextSpace(board().getSpace(justVisitingID), roll.getTotal()).updateProbAndRoll(1, (double) 1 / size, false);\r\n\t\t\telse\r\n\t\t\t\tboard().getSpace(this.ID() + 1).updateProbAndRoll(0, (double)1 / size, false);\r\n\t\t});\r\n\t}", "boolean disruption() {\n disruption_seed = disruption_seed * 1103515245 + 12345;\n long disruption_director = (disruption_seed / 65536) % 32768;//The bits considered is changed so that c4 is unique\n int disruption_director1 = (int) ((disruption_director >> 4) & 7);\n\n switch (disruption_director1) /* Check the randomness of the pseudo random generator */ {\n case 0 -> zero++;\n case 1 -> one++;\n case 2 -> two++;\n case 3 -> three++;\n case 4 -> four++;\n case 5 -> five++;\n case 6 -> six++;\n case 7 -> seven++;\n default -> other++;\n }\n\n if (/*(disruption_director == 0)||(disruption_director == 1)||(disruption_director == 2)||(disruption_director == 3)||*/(disruption_director == 4) || (disruption_director == 5) || (disruption_director == 6) || (disruption_director == 7)) /* Disrupt 50% of the time */ {\n System.out.printf(\"Disruption %d \\n\", disruption_director);\n //Sleep(100);\n return false;\n } else {\n return true;\n }\n }", "public void PSShot()\n\t{\n\t\t//collision can only occur if an enemy missile and a PlayerShip are spawned\n\t\tif(gameObj[1].size() > 0 && gameObj[3].size() > 0)\n\t\t{\n\t\t\tint mis = new Random().nextInt(gameObj[3].size());\n\t\t\tgameObj[1].remove(0);\n\t\t\tgameObj[3].remove(mis);\n\t\t\tlives--;\n\t\t\tSystem.out.println(\"An enemy missile has struck a PS -1 life\");\n\t\t\tif(lives >0) \n\t\t\t\tSystem.out.println(\"you have \" + lives + \" left\");\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Game over\");\n\t\t\t\tgameOver();\n\t\t\t}\n\t\t}else\n\t\t\tSystem.out.println(\"A player ship and an enemy missile are not spawned\");\t\t\n\t}", "private void communityChest(Player currentPlayer){\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n int nextPlayer;\n if(m_currentTurn >= m_numPlayers){\n nextPlayer = 0;\n } else {\n nextPlayer = m_currentTurn+1;\n }\n\n if(randomNum == 1){\n convertTextToSpeech(\"Your new business takes off, collect 200\");\n if(m_manageFunds) {\n Log.d(\"chance add 200\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(200);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 200\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n }\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Your friend hires your villa for a week, \" +\n \"collect 100 off the next player\");\n if(m_manageFunds) {\n Log.d(\"chance add 100\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(100);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 100\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n\n Log.d(\"chance subtract 100\", players.get(nextPlayer).getName() +\n String.valueOf(players.get(nextPlayer).getMoney()));\n players.get(nextPlayer).subtractMoney(100);\n Log.d(\"chance subtract 100\", players.get(nextPlayer).getName() +\n String.valueOf(players.get(nextPlayer).getMoney()));\n }\n }\n if(randomNum == 3){\n convertTextToSpeech(\"You receive a tax rebate, collect 300\");\n if(m_manageFunds) {\n Log.d(\"chance add 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n }\n }\n }", "private void chance(Player currentPlayer) {\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n\n if(randomNum == 1){\n convertTextToSpeech(\"Advance to Bond Street\");\n currentPlayer.setCurrentPosition(34);\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Unpaid charges. Go to jail\");\n setJail(currentPlayer);\n }\n if(randomNum == 3){\n convertTextToSpeech(\"Build a rooftop swimming pool on your apartment, pay 300\");\n if(m_manageFunds) {\n currentPlayer.subtractMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n m_freeParking += 300;\n Log.d(\"chance subtract 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance free parking\", String.valueOf(m_freeParking));\n }\n }\n }", "boolean voteSpoiled(ParticipantUserData participant) {\n for (Entry e : participantsList) {\n if (e.userData == participant) {\n\treturn e.voteSpoiled();\n }\n }\n throw new ShouldNotHappenException(\"participant unknown.\");\n }", "public int throwDefense(int[] fighter) {\n Coins coins = new Coins();\n return coins.coinTry(fighter[DEFENSE]);\n }", "public boolean fireHumanPlayer(int x, int y){\n if (turnCode == 1) {\n return false;\n }\n if(computerPlayerBoard[x][y] == board.water.ordinal() && turnCode == 0) {\n computerPlayerBoard[x][y] = board.missed.ordinal();\n turnCode = 1;\n humanPlayerMiss++;\n //check ships if sunk\n return true;\n }\n if (computerPlayerBoard[x][y] == board.ship.ordinal() && turnCode == 0) {\n computerPlayerBoard[x][y] = board.hit.ordinal();\n turnCode = 1;\n humanPlayerHits++;\n //check ships if sunk\n //\n return true;\n }\n return false;\n }", "public void setIsInfected(boolean isInfected) {\n this.isInfected = isInfected;\n }", "public static void victoryIsMine() {\n\t\tSystem.out.println(\"|| Victory is mine! ||\");\r\n\t}", "public boolean fireComputerPlayer(int x, int y){\n if(humanPlayerBoard[x][y] == board.water.ordinal() || humanPlayerBoard[x][y] == board.missed.ordinal() && turnCode == 1) {\n humanPlayerBoard[x][y] = board.missed.ordinal();\n turnCode = 0;\n computerPlayerMiss++;\n return true;\n }\n if (humanPlayerBoard[x][y] == board.ship.ordinal() || humanPlayerBoard[x][y] == board.missed.ordinal() && turnCode == 1) {\n humanPlayerBoard[x][y] = board.hit.ordinal();\n turnCode = 0;\n computerPlayerHits++;\n return true;\n }\n return false;\n }", "private void checkForCPUChance()\n\t\t\t{\n\t\t\t\tf12 = false;\n\t\t\t\tfor (m = 0; m < 8; ++m)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (lose[m] == 2 && win[m] == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tf12 = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\tif (f12 == false)\n\t\t\t\t\tm = 10;\n\n\t\t\t}", "int getIndividualAttack();", "void mining() {\n //COMPUTE ALL DATA HERE\n if (random.nextBoolean()) {\n black_toner = black_toner + random.nextInt(variation);\n black_drum = black_drum + random.nextInt(variation / 2);\n total_printed_black = total_printed_black + random.nextInt(variation);\n } else {\n black_toner = black_toner - random.nextInt(variation);\n black_drum = black_drum - random.nextInt(variation / 2);\n total_printed_black = total_printed_black - random.nextInt(variation);\n }\n\n if (black_toner <= 0) {\n black_toner = 100;\n }\n if (black_drum <= 0) {\n black_drum = 100;\n }\n if (total_printed_black <= 0) {\n total_printed_black = 100;\n }\n }", "public static void sendDetections(String ip, String puerto) {\n\n\t\ttry {\n\n\t\t\tSocket clientSocket = new Socket(ip, Integer.parseInt(puerto));\n\t\t\tSystem.out.println(\"Ready to send confirmations...\");\n\t\t\tint imagecont = 1;\n\n\t\t\t//Send confirmations all time\n\t\t\twhile(true) {\n\n\t\t\t\tif(checkDection(imagecont)) {\n\n\t\t\t\t\tsendResponse(clientSocket,imagecont);\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\tsendNoResponse(clientSocket,imagecont);\n\t\t\t\t}\n\n\t\t\t\timagecont++;\n\t\t\t}\n\t\t}\n\n\t\tcatch(UnknownHostException e) {\n\n\t\t\tSystem.out.println(e);\n\t\t}\n\n\t\tcatch(IOException e) {\n\n\t\t\tSystem.out.println(\"Server is disconnected\");\n\t\t}\n\t}", "private float getHitProbability(int x, int y) {\n\t\tfloat probability = 0;\n\t\t\n\t\tfor (int i = -TOWER_RANGE; i <= TOWER_RANGE; i++) {\n\t\t\tfor (int j = -TOWER_RANGE; j <= TOWER_RANGE; j++) {\n\t\t\t\tint curX = x + i;\n\t\t\t\tint curY = y + j;\n\t\t\t\tif (currentState.inBounds(curX, curY)\n\t\t\t\t\t\t&& distance(x, y, curX, curY) <= TOWER_RANGE) { // tower shoots in a circular range\n\t\t\t\t\tprobability = (probability + board.getTowerProbability(curX, curY)) - (probability * board.getTowerProbability(curX, curY));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn probability * TOWER_ACCURACY;\n\t}", "public void setSocialDeterminants(Person person) {\n String county = (String) person.attributes.get(Person.COUNTY);\n if (county == null) {\n county = \"AVERAGE\";\n }\n Map<String, Double> sdoh = socialDeterminantsOfHealth.get(county);\n if (sdoh != null) {\n for (String determinant : sdoh.keySet()) {\n Double probability = sdoh.get(determinant);\n if (determinant.equals(Person.UNEMPLOYED)) {\n if (probability == null) {\n throw new IllegalStateException(\"Unable to determine unemployment probability\");\n }\n person.attributes.put(Person.UNEMPLOYED, false);\n person.attributes.put(Person.EMPLOYMENT_MODEL, new Employment(probability));\n }\n person.attributes.put(determinant, (person.rand() <= probability));\n }\n }\n }", "static void yellow_fight () {\n monsterchoices_y_r = arenafight_y.nextInt(4);\n if (monsterchoices_y_r == 0) {//if integer is zero, you will fight a spider\n System.out.println(\"You encountered a giant spider.\");//#enemyobject-enemy that player tries to defeat\n spider_fight();\n }else if(monsterchoices_y_r == 1) {//if integer is 1 you would fight a goblin\n System.out.println(\"You encountered a goblin.\");//#enemyobject-enemy that player tries to defeat\n goblin_fights(); \n }else if(monsterchoices_y_r == 2) { //if integer is 2, you would fight a golbat\n System.out.println(\"You encountered a golbat.\");//#enemyobject-enemy that player tries to defeat\n golbat_fights();\n }else if(monsterchoices_y_r == 3) { //if the integer is 3, you would fight a witch\n System.out.println(\"You encountered a witch.\");//#enemyobject-enemy that player tries to defeat\n witch_fights();\n }\n \n }" ]
[ "0.62936133", "0.6258434", "0.5638628", "0.5610572", "0.56089634", "0.5414434", "0.53554887", "0.53152347", "0.5192314", "0.5157958", "0.5156981", "0.5103788", "0.50637674", "0.5059335", "0.50442", "0.50431764", "0.5025768", "0.49866617", "0.49731913", "0.48913735", "0.48842907", "0.48816508", "0.4862755", "0.48504645", "0.48481667", "0.48463297", "0.48460066", "0.48457584", "0.48357636", "0.48232284", "0.4819599", "0.48195034", "0.4812873", "0.4781829", "0.47758314", "0.47707835", "0.47677988", "0.4764849", "0.47534475", "0.47471717", "0.47452158", "0.47452158", "0.47452158", "0.47452158", "0.47452158", "0.47370717", "0.47336927", "0.4731529", "0.47223315", "0.47129822", "0.471169", "0.4709849", "0.46985358", "0.46550918", "0.4652369", "0.4650263", "0.46452278", "0.46452278", "0.46452278", "0.46452278", "0.46452278", "0.46452278", "0.4640567", "0.46255767", "0.462007", "0.46172434", "0.46068156", "0.4598021", "0.4593976", "0.45829284", "0.45825806", "0.4569311", "0.45623443", "0.4549502", "0.45423493", "0.4540386", "0.4537514", "0.45326972", "0.45240402", "0.45158926", "0.45058548", "0.45011804", "0.44938442", "0.44908136", "0.44903815", "0.44889775", "0.4487546", "0.44819438", "0.4479973", "0.44778606", "0.44752508", "0.44704193", "0.44641554", "0.44579005", "0.44527245", "0.44516763", "0.44474", "0.44467917", "0.4440469", "0.44395575" ]
0.64497983
0
metoda vraca:trueracun uspesno postavljen ; false ako nije usp postavljen
public boolean setRacun(Racun racun){ // info da li je racun postavljen uspesno if(this.racun!=null){ System.out.println("za osobu "+this.ime+ " je vec registrovan racun."); return false; } this.racun=racun; //this->return return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean tienePrepaga() {\r\n\t\treturn obraSocial != null;\r\n\t}", "public boolean souvislost(){\n\t\t\n\t\tif(pole.size() != pocetVrcholu){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "public boolean aufnehmen (T posten)\n {\n // Pruefen, ob der Posten mit Bezeichnung und Ausfuehrung schon vorhanden ist\n int index = istVerfuegbar ( posten.getBezeichnung()\n , posten.getAusfuehrung()\n , posten.getAnzahl()); \n\n // Ist der Posten schon vorhanden, so soll die Methode false zurueckliefern\n if (index >= 0)\n {\n return false;\n }\n \n // Aufnehmen des Postens in das Magazin\n return magazin.add (posten);\n }", "public boolean pobjeda() {\r\n\t\treturn !igrajPoslijePobjede && pobjeda;\t\r\n\t}", "public boolean voikoSulkea() {\n handleTallenna();\n return true;\n }", "@Override\n\tpublic boolean vender(String placa) {\n\t\treturn false;\n\t}", "public boolean esmenor(){\n //este metodo no aplica en la resolución del caso de uso planteado\n //sólo sirve para determinar si el participante es menor de edad para \n //poner como obligatorio el campo nombreTutor de acuerdo a las reglas\n //del negocio.\n return false;\n }", "private static boolean verifTapis(){\n\t\tint compte = 0;\n\t\tfor(int i = 0; i<jeu.getJoueurs().length; i++){\n\t\t\tif(jeu.getJoueurs()[i].getTapisRest()==0 || jeu.getJoueurs()[i].getMonnaie()==0){\n\t\t\t\tcompte++;\n\t\t\t}\n\t\t}\n\t\tif(compte == jeu.getJoueurs().length){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean czyUstalonyGracz()\n\t{\n\t\treturn (pojazd != null);\n\t}", "boolean sprawdz_przegrana(){\n for(int i=0;i<figura_jakas.getWspolzedne_figorki().size();i++)\n if(sprawdz_kolizje_z_innymi_klockami(0))\n return true;\n return false;\n }", "@Override\n\tpublic boolean paie() {\n\t\treturn false;\n\t}", "public boolean kraj() {\r\n\t\treturn (broj_slobodnih == 0 && !mozeLiSeSpojiti());\r\n\t}", "public boolean sucheMitspieler();", "private boolean sortieNonAtteint(){\n\t\t\t//return this.terrainDeLaPartie.getTerrain()[this.terrainDeLaPartie.getAbSortie()][this.terrainDeLaPartie.getOrdSortie()]!='R' ;\t\t\t\n\t\t\tif(this.terrainDeLaPartie.getTerrain()[terrainDeLaPartie.getAbSortie()][terrainDeLaPartie.getOrdSortie()]=='R'){\n\t\t\t\tSystem.out.println(\"###################################### SORTIE #################################\");\n\t\t\t}\n\t\t\treturn this.terrainDeLaPartie.getTerrain()[terrainDeLaPartie.getAbSortie()][terrainDeLaPartie.getOrdSortie()]!='R';\n\t\t}", "private boolean poseeSaldoAnterior() {\n boolean retorno = false;\n if(saldoAnterior !=null){\n retorno = true;\n }\n return retorno;\n }", "private boolean postoji(String ime)\n {\n Vaspitac v = this.head;\n while(v != null && !ime.equals(v.ime))\n v = v.next;\n\n // sada samo pitamo da li je v null, \n // jer ako jeste to znaci da smo dosli do kraja liste\n // i da vaspitac sa zadatim imenom ne postoji\n //\n // ternarni operator, \n // return a ? b : c;\n // ako je uslov a tacan vraca b, u suprotnom vraca c\n return v == null ? false : true;\n }", "public boolean czyZdalnie()\n\t{\n\t\treturn najlepsze == null;\n\t}", "private boolean correcto() {\r\n return (casillas.size()>numCasillaCarcel); //&&tieneJuez\r\n }", "private boolean Verific() {\n\r\n\treturn true;\r\n\t}", "public boolean perdeu() {\n\t\tif(tabuleiro.getAtiradores().length==0)\n\t\t{\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public Boolean gorbiernoConPrestamos() {\n if (super.getMundo().getGobierno().getPrestamos().size() > 0)\n return true;\n return false;\n }", "boolean puedoHipotecar(Casilla casilla){\n //Para poder hipotecar la casilla tiene que ser propiedad del jugador.\n return this.esDeMipropiedad(casilla);\n }", "private boolean temNoScript() {\r\n\t\tif (!procurouNoScript) {\r\n\t\t\ttemnoscript = regras.verificaNoscript(codHTML);\r\n\t\t\tprocurouNoScript = true;\r\n\t\t}\r\n\t\treturn temnoscript;\r\n\t}", "@Override\n\tpublic boolean paie() {\n\n\t\treturn true;\n\t}", "public boolean isPost();", "public boolean isPost();", "public boolean esPared(CoordCasilla cc)\n {\n //Gdx.app.log(\"ES PARED\", \"ANalizando (\"+cc.x+\",\"+cc.y+\")\");\n \n TiledMapTileLayer.Cell casilla=( (TiledMapTileLayer)mapaActual.getLayers().get(\"PAREDES\")).getCell(cc.x,cc.y);\n if(casilla==null)\n return false;\n int idTile=casilla.getTile().getId();\n return idTile!=Mundo.ID_TILE_MURO_TRANSITABLE_1 && idTile!=Mundo.ID_TILE_MURO_TRANSITABLE_2 && idTile!=Mundo.ID_TILE_MURO_TRANSITABLE_3;\n }", "public boolean testSouvislostiAStupneVrcholu(){\n\t\t\n\t\tif(!souvislost()){\n\t\t\tvys = \"Graf neni souvisly a proto nemuze byt ani Eulerovsky.\";\n\t\t\treturn false;\n\t\t}\n\t\tif(!muzeBytEuler()){\n\t\t\tvys = \"Stupne vrcholu nejsou bud sude nebo nebo si neodpovida jejich vstupni a vystupni stupen.\";\n\t\t\treturn false;\n\t\t}\n\t\tif(muzeBytEuler() && souvislost()){\n\t\t\tvys =\"Graf je souvisly a zaroven vsechny stupne jsou sude nebo jejich vstupni a vystupni stupen je roven.\";\n\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}", "public boolean odigraj(Koordinati poteza) {\n if (this.jeVeljavnaPoteza(poteza)) {\n plosca[poteza.getX()][poteza.getY()] = igralecNaPotezi.getPolje();\n // Potezo dodamo v odigranePoteze.\n\t\t\tthis.odigranePoteze.add(poteza);\n igralecNaPotezi = igralecNaPotezi.nasprotnik();\n return true;\n } else return false;\n }", "private boolean estaEnRevista() {\n\t\ttry{\n\t\t String Sjson= Utils.doHttpConnection(\"http://datos.labplc.mx/movilidad/taxis/\"+placa+\".json\");\n\t\t String marca=\"\",submarca=\"\",anio=\"\";\n\t\t \n\t\t JSONObject json= (JSONObject) new JSONTokener(Sjson).nextValue();\n\t\t JSONObject json2 = json.getJSONObject(\"Taxi\");\n\t\t JSONObject jsonResponse = new JSONObject(json2.toString());\n\t\t JSONObject sys = jsonResponse.getJSONObject(\"concesion\");\n\t\t \n\t\t if(sys.length()>0){\n\t\t \n\t\t\t\t\t try {\n\t\t\t\t\t\t marca = (String) sys.getString(\"marca\");\n\t\t\t\t\t\t autoBean.setMarca(marca);\n\t\t\t\t\t\t submarca = (String) sys.getString(\"submarca\");\n\t\t\t\t\t\t autoBean.setSubmarca(submarca);\n\t\t\t\t\t\t anio = (String) sys.getString(\"anio\");\n\t\t\t\t\t\t autoBean.setAnio(anio);\n\t\t\t\t\t\t \n\t\t\t\t\t\t autoBean.setDescripcion_revista(getResources().getString(R.string.con_revista));\n\t\t\t\t\t\t autoBean.setImagen_revista(imagen_verde);\n\t\t\t\t\t\t \n\t\t\t\t\t\t Calendar calendar = Calendar.getInstance();\n\t\t\t\t\t\t int thisYear = calendar.get(Calendar.YEAR);\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(thisYear-Integer.parseInt(anio)<=10){\n\t\t\t\t\t\t\t autoBean.setDescripcion_vehiculo(getResources().getString(R.string.carro_nuevo)+\" \"+getResources().getString(R.string.Anio)+\" \"+anio);\n\t\t\t\t\t\t\t autoBean.setImagen_vehiculo(imagen_verde);\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t autoBean.setDescripcion_vehiculo(getResources().getString(R.string.carro_viejo)+\" \"+getResources().getString(R.string.Anio)+\" \"+anio);\n\t\t\t\t\t\t\t autoBean.setImagen_vehiculo(imagen_rojo);\n\t\t\t\t\t\t\t PUNTOS_APP-=PUNTOS_ANIO_VEHICULO;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t return true;\n\t\t\t\t\t \n\t\t\t\t\t } catch (JSONException e) { return false;}\n\t\t }else{\n\t\t \t return false;\n\t\t }\n\t\t \n\t\t}catch(JSONException e){\n\t\t\tDatosLogBean.setDescripcion(Utils.getStackTrace(e));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public void nastaviIgru() {\r\n\t\t// nastavi igru poslije pobjede\r\n\t\tigrajPoslijePobjede = true;\r\n\t}", "protected boolean m9200e() {\n return this.this$0.b._getEtat() != 0;\n }", "@Override\n\tpublic boolean datiUscitaImpegno() {\n\t\treturn false;\n\t}", "boolean isPostive();", "protected boolean colaVacia() {\r\n return ini == -1;\r\n }", "public boolean tienePapel()\n {\n //COMPLETE\n return this.hojas > 0;\n }", "public abstract boolean muere(Casilla cas);", "private boolean temMunicao() {\n\t\t\n\t\tif (round<1) {\n\t\t\tsetSemMunicao(true);\n\t\t\treturn false;\n\t\t\t\n\t\t}else \n\t\t\tsetSemMunicao(false);\n\t\t\n\t\t\n\t\treturn true;\n\t}", "public boolean tengoProteccion() {\n\t\treturn escudo;\n\t}", "@Override\n\tpublic boolean postIt() {\n\t\treturn false;\n\t}", "private boolean jogadorTerminouAVez() {\n return this.terminouVez;\n }", "private static boolean poserTapis(){\n\t\tSystem.out.println(\"Choisisser une premiere case pour poser la premiere partie du tapis\");\n\t\tint premiereCaseTapis = console.obtenirDirection();\n\t\tint direction = premiereCaseTapis;\n\t\tint posXTapis = 0, posYTapis = 0;\n\n\t\t//Pose du premier carre de tapis\n\t\ttry{\n\t\t\tif(premiereCaseTapis == 1){\n\t\t\t\tjeu.cases[jeu.getAssam().getXPion()-2][jeu.getAssam().getYPion()-1].setCouleurTapis(tour);\n\t\t\t\tposXTapis = jeu.getAssam().getXPion()-2;\n\t\t\t\tposYTapis = jeu.getAssam().getYPion()-1;\n\t\t\t}\n\n\t\t\telse if(premiereCaseTapis == 2){\n\t\t\t\tjeu.cases[jeu.getAssam().getXPion()][jeu.getAssam().getYPion()-1].setCouleurTapis(tour);\n\t\t\t\tposXTapis = jeu.getAssam().getXPion();\n\t\t\t\tposYTapis = jeu.getAssam().getYPion()-1;\n\t\t\t}\n\n\t\t\telse if(premiereCaseTapis == 3){\n\t\t\t\tjeu.cases[jeu.getAssam().getXPion()-1][jeu.getAssam().getYPion()-2].setCouleurTapis(tour);\n\t\t\t\tposYTapis = jeu.getAssam().getYPion()-2;\n\t\t\t\tposXTapis = jeu.getAssam().getXPion()-1;\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tjeu.cases[jeu.getAssam().getXPion()-1][jeu.getAssam().getYPion()].setCouleurTapis(tour);\n\t\t\t\tposYTapis = jeu.getAssam().getYPion();\n\t\t\t\tposXTapis = jeu.getAssam().getXPion()-1;\n\t\t\t}\n\n\t\t} catch (ArrayIndexOutOfBoundsException e){\n\t\t\tconsole.afficherImpossiblePoserTapis();\n\t\t\treturn false;\n\t\t}\n\n\n\n\n\t\tconsole.afficherJeu();\n\t\tSystem.out.println(\"Choisissez la deuxieme case\");\n\n\t\t//Pose du second petit carre de tapis\n\t\twhile(true){\n\t\t\tint d = console.obtenirDirection();\n\t\t\t//pour ne pas faire de demi tour ou erreur de d\n\t\t\tif(direction == 1 && d == 2 || direction == 2 && d == 1 || direction == 3 && d == 4 || direction == 4 && d == 3 || d<1 || d>4){\n\t\t\t\tconsole.afficherImpossibleChoisirDirection();\n\t\t\t} else {\n\t\t\t\ttry{\n\t\t\t\t\tif(d == 1){\n\t\t\t\t\t\tjeu.cases[posXTapis-1][posYTapis].setCouleurTapis(tour);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(d == 2){\n\t\t\t\t\t\tjeu.cases[posXTapis+1][posYTapis].setCouleurTapis(tour);\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(d == 3){\n\t\t\t\t\t\tjeu.cases[posXTapis][posYTapis-1].setCouleurTapis(tour);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tjeu.cases[posXTapis][posYTapis+1].setCouleurTapis(tour);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t} catch (ArrayIndexOutOfBoundsException e){\n\t\t\t\t\tconsole.afficherImpossiblePoserTapis();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\tjeu.getJoueurs()[tour-1].useTapis();\n\t\treturn true;\n\n\n\t}", "public boolean almacenaTodos(){\t\t\n\t\tfor (Serializable obj : _vigilados.keySet())\n\t\t\tif (!almacena(obj, _vigilados.get(obj)))\n\t\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}", "public boolean jeVeljavnaPoteza(Koordinati poteza) { \n\t\tif (poteza.getX() < 0 || poteza.getX() >= N) {\n\t\t\treturn false;\n\t\t}\n\t\tif (poteza.getY() < 0 || poteza.getY() >= N) {\n\t\t\treturn false;\n\t\t}\n\t\tif (plosca[poteza.getX()][poteza.getY()] != Polje.PRAZNO) {\n\t\t\treturn false;\n\t\t}\n return true;\n }", "public synchronized void ProvjeriPreuzimanje() {\n dopustenoPreuzimanje = true;\n if (dopustenoPreuzimanje) {\n SveFunkcijeDretve();\n } else {\n //sleep\n }\n }", "public boolean muzeJitDomu(){\r\n return getBatoh().obsahujeVec(\"mec\");\r\n }", "public boolean isAktiv() {\n\t\treturn false;\n\t}", "public boolean PilaVacia() {\r\n return UltimoValorIngresado == null;\r\n }", "public boolean estPlein() {\n return this.tapis.size() == capacite;\n }", "public boolean prestamo(){\n boolean prestado = true;\n if (cantPres < cantLibro) {\n cantPres++;\n } else {\n prestado = false;\n }\n return prestado;\n }", "public boolean muzeBytEuler(){\n\t\turciStupneVrcholu();\n\t\t//zjisti jestli je graf orientovany\n\t\tint druhGrafu = orientaceGrafu();\n\t\t\n\t\tif(druhGrafu == 0){\n\t\t\t//pokud nejsou vsechny vrcholy sudeho stupne vrati false\n\t\t\tif(!stupneProNeoriGraf()){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(druhGrafu == 1){\n\t\t\t//pokud nejsou vstupni a vystupni stupne u kazdeho vrchlu si rovny \n\t\t\t//vrati false\n\t\t\tif(!stupneProOriGraf()){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif(druhGrafu == 2){\n\t\t\tSystem.out.println(\"Cast grafu je orientovana a cast neorientovana\");\n\t\t\treturn false;\n\t\t}\n\t\t//pokud jsou splneny podminky stupnu vraci true;\n\t\treturn true;\n\t\t\n\t}", "private Boolean esMejor() {\n if(debug) {\n System.out.println(\"**********************esMejor\");\n }\n \n if(this.solOptima == null || (this.sol.pesoEmparejamiento < this.solOptima.pesoEmparejamiento)) return true;\n else return false;\n }", "@Override\n\tpublic boolean preModify() {\n\t\tif(!cuentaPapaCorrecta(instance)) {\n\t\t\tFacesMessages.instance().add(\n\t\t\t\t\tsainv_messages.get(\"cuentac_error_ctapdrno\"));\n\t\t\treturn false;\n\t\t}\n\t\tif(!cuentaEsUnica()) {\n\t\t\tFacesMessages.instance().add(\n\t\t\t\t\tsainv_messages.get(\"cuentac_error_ctaexis\"));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public boolean verificaTrasicaoVazia(){\n\n //verifica se dentro das transicoes tem alguma saindo com valor vazio;\n for (int i = 0; i < this.transicoes.size(); i++) {\n if(this.transicoes.get(i).simbolo.equals(Automato_Servico.valorVazio)){\n return true;\n }\n }\n return false;\n }", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic boolean puedoAtacar(ElementoSoldado a) {\n\t\treturn false;\n\t}", "public boolean esPositivo() {\n\t\treturn !esNegativo();\n\t}", "private boolean isContieneLotesDetallePedidos(){\n String pResultado = \"N\";\n try {\n log.info(\"VariablesDelivery.vNumeroPedido_bk:\"+VariablesDelivery.vNumeroPedido_bk);\n log.info(\"VariablesDelivery.vCodLocal_bk:\"+VariablesDelivery.vCodLocal_bk);\n pResultado = DBDelivery.isContienLotesProductos(VariablesDelivery.vCodLocal_bk,\n VariablesDelivery.vNumeroPedido_bk);\n \n log.info(\"isContieneLotesDetallePedidos():\"+pResultado);\n } catch (Exception e) {\n pResultado = \"N\"; \n log.info(\"Error al obtener ind Productos x Lote del Pedido:\"+e.getMessage());\n }\n \n if(pResultado.trim().equalsIgnoreCase(\"N\")){\n return false;\n }\n else{\n FarmaUtility.showMessage(this,\"El pedido ya tiene los Lotes Ingresados\\n\" +\n \"Se procederá a generar el pedido.\\n\" +\n \"Gracias.\" ,tblListaDetallePedido);\n \n return true;\n }\n }", "public boolean addPost (Message post) {\n Logger.write(\"VERBOSE\", \"DB\", \"addPost(...)\");\n \n try {\n execute(DBStrings.addPost.replace(\"__SIG__\", post.getSig())\n .replace(\"__msgText__\", post.POSTgetText())\n .replace(\"__time__\", Long.toString(post.getTimestamp()))\n .replace(\"__recieverKey__\", post.POSTgetWall())\n .replace(\"__sendersKey__\", Crypto.encodeKey(getSignatory(post))));\n String[] visibleTo = post.POSTgetVisibleTo();\n for (int i = 0; i < visibleTo.length; i++)\n execute(DBStrings.addPostVisibility.replace(\"__postSig__\", post.getSig()).replace(\"__key__\", visibleTo[i]));\n return true;\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n return false;\n }\n }", "private synchronized boolean ProvjeriNoviDatum(Timestamp datum) {\n boolean doKraja = false;\n String datumKraj = konf.getKonfig().dajPostavku(\"preuzimanje.kraj\");\n SimpleDateFormat formatter = new SimpleDateFormat(\"dd.MM.yyyy\");\n Date datumProvjere = new Date(datum.getTime());\n try {\n Date date = formatter.parse(datumKraj);\n if (date.equals(datumProvjere)) {\n doKraja = true;\n }\n } catch (ParseException ex) {\n\n }\n return doKraja;\n }", "public boolean isUlaz() {\n return ulaz;\n }", "private boolean validarDatos() {\r\n\t\tboolean _esValido = true;\r\n\r\n\t\tif (txField_lugar.getText() == null || txField_lugar.getText().isEmpty())\r\n\t\t\t_esValido = false;\r\n\t\treturn _esValido;\r\n\t}", "public boolean getUsuarioSuscrito(){\n return !(suscribirClientBean.getUsuarioSuscrito(idOferta).length == 0);\r\n }", "public boolean estaVacio(){\n\t\treturn raiz==null;\n\t}", "@Override\n\tpublic boolean eliminaDipendente() {\n\t\treturn false;\n\t}", "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}", "private boolean tienePermiso(String urlStr){\n return true;\n }", "public boolean avanti();", "public boolean isAccepted_tou();", "@Override\n\tpublic Boolean vota(String listaElettorale) {\n\t\t//definisco utente registato in questo momento\n\t\tString userVotante = autenticazioneServizio.getUsername();\n\t\tVoto voto = new Voto(userVotante, listaElettorale);\n\t\taggiungiVoto(voto);\n\t\t//controlla se l'user ha già votato\n\t\taggiungiVoto(voto);\n\t\treturn true;\n//\t\tif (verificaVotoValido(userVotante)) {\n//\t\t\t//vota\n//\t\t\taggiungiVoto(voto);\n//\t\t\t\n//\t\t\treturn true;\n//\t\t} else {\n//\t\t\treturn false;\n//\t\t}\n\t}", "private boolean setPermessiRicevuti(HttpServletRequest request, HttpServletResponse response,\r\n String utente) {\r\n Gruppo g = new Gruppo();\r\n\r\n g.setRuolo(utente);\r\n if (request.getParameter((\"checkbox\").concat(utente)).equals(\"true\")) {\r\n if (!ricevuti.getGruppi().contains(g)) {\r\n ricevuti.getGruppi().add(g);\r\n }\r\n } else if (request.getParameter((\"checkbox\").concat(utente)).equals(\"false\")) {\r\n ricevuti.getGruppi().remove(g);\r\n } else {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean assegnaTrascrizione(String username, int cod_pagina) throws SQLException{\n \t\n Connection dbConnection = model.connectionDataBase.ConnectionDB.Connect();\n int cod = 0;\n \n /* recuepra id trascrittore */\n PreparedStatement stmt = dbConnection.prepareStatement(\"SELECT cod_trascrittore FROM trascrittore INNER JOIN utente ON trascrittore.cod_trascrittore = utente.id WHERE username = ? \"); //potrebbe dare problemi controllare\n stmt.setString(1, username);\n ResultSet rs = stmt.executeQuery();\n\n if (rs.next()) {\n \tcod = rs.getInt(\"cod_trascrittore\");\n }\n \n \n \n /* inserisce in trascrittori */\n String approveReview = \"UPDATE `pagine_opera` SET `cod_trascrittore` = ?, `approvata` = ? WHERE `cod_pagina` = ? \";\n PreparedStatement preparedStatement = null; //UPDATE `pagine_opera` SET `approvata` = ? WHERE `cod_pagina` = ?\n\n // Insert the values into the DB\n try {\n preparedStatement = dbConnection.prepareStatement(approveReview);\n\n preparedStatement.setInt(1, cod);\n preparedStatement.setString(2, \"no\");\n preparedStatement.setInt(3, cod_pagina);\n \n \n if (preparedStatement.executeUpdate() != 0) {\n return true;\n }\n\n \n\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n\n } finally {\n if (stmt != null) { //Ric\n stmt.close();\n }\n \n if (preparedStatement != null) {\n preparedStatement.close();\n }\n\n if (dbConnection != null) {\n dbConnection.close();\n }\n }\n \treturn false;\t\n }", "@Override\n\tpublic boolean faelltAuf(TetrominoSpielstein tetrominoSpielstein) {\n\t\treturn false;\n\t}", "public boolean potezLijevo() {\n\t\t//koordinate glave\n\t\tint i = this.zmija.get(0).i;\n\t\tint j = this.zmija.get(0).j;\n\t\t\n\t\tthis.smjer='a';\n\t\t\n\t\tif (j-1 >= 0) {\n\t\t\tif ((this.tabla[i][j-1] == '#')||(this.tabla[i][j-1] == 'o'))\n\t\t\t\treturn false;\n\t\t\telse if (this.tabla[i][j-1] == '*') \n\t\t\t\tthis.pojedi(i, j-1);\n\t\t\telse \n\t\t\t\tthis.pomjeri(i, j-1);\n\t\t}\n\t\telse if (j-1 < 0 ) {\n\t\t\tif ((this.tabla[i][this.sirinaTable-1] == '#')||(this.tabla[i][this.sirinaTable-1] == 'o')) \n\t\t\t\treturn false;\n\t\t\telse if (this.tabla[i][this.sirinaTable-1] == '*') \n\t\t\t\tthis.pojedi(i, this.sirinaTable-1);\n\t\t\telse \n\t\t\t\tthis.pomjeri(i, this.sirinaTable-1);\n\t\t}\n\t\treturn true;\n\t}", "public void ispisiSveNapomene() {\r\n\t\tint i = 0;// redni broj napomene\r\n\t\tint brojac = 0;\r\n\t\tfor (Podsjetnik podsjetnik : lista) {\r\n\r\n\t\t\ti++;\r\n\t\t\tSystem.out.println(i + \")\" + podsjetnik);\r\n\t\t\tbrojac = i;\r\n\t\t}\r\n\t\tif (brojac == 0) {\r\n\t\t\tSystem.out.println(\"Nema unesenih napomena!!\");\r\n\t\t}\r\n\r\n\t}", "public void dohvatiOtpad(KonkretniSpremnik ks) {\n VozilaLogger.printRad(this, ks);\n if (ks.getNazivBroj() == getVrsta()) {\n float nova_popunjenost = popunjenost + ks.getNapunjenost();\n if (nova_popunjenost >= nosivost) {\n notifyAllObservers();\n } else {\n popunjenost = nova_popunjenost;\n ks.isprazni();\n azurirajStatistikuOtpada(1, ks.getNapunjenost());\n }\n }\n }", "private Boolean precond() {\r\n\t\tcalculoCantidadSacar(grupoPuestosController.getIdConcursoPuestoAgr());\r\n\t\t/**\r\n\t\t * fin incidencia 0001649\r\n\t\t */\r\n\t\tBoolean respuesta = validacionesIteracion();\r\n\t\treturn respuesta;\r\n\t}", "public boolean esCompuesto() {\n\t\treturn !this.atributos.isEmpty();\n\t}", "boolean getMovimentoPassante();", "boolean potvrdiUnos(){\r\n\t\tboolean odluka = false;\r\n\t\tboolean test = true;\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\t//trazenje od korisnika da odabere opciju\r\n\t\tdo{\r\n\t\t\tSystem.out.println(\"Izvrsiti?(DA/NE)\");\r\n\t\t\tString karakter = in.next();\r\n\t\t\tif(karakter.equals(\"DA\") || karakter.equals(\"da\")){\r\n\t\t\t\todluka = true;\r\n\t\t\t\ttest = false;\r\n\t\t\t}\r\n\t\t\tif(karakter.equals(\"NE\") || karakter.equals(\"ne\")){\r\n\t\t\t\ttest = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}while(test);\r\n\t\treturn odluka;\r\n\t}", "@Override\r\n public boolean ubahStatus(int masukan) {\r\n if (masukan == 1) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "@Override\n\tpublic boolean puedoAtacar(ElementoPiedra a) {\n\t\treturn true;\n\t}", "public synchronized boolean insertarVelocidadNoEnviada() {\n\tboolean r = true;\n\n\tif (arrayLecturas.isEmpty()) {\n\t // Envio lecturas de viento desde la BBDD Local.\n\t conDB.enviarRegSensoresBBDD();\n\t}\n\t// Envio lecturas de viento desde memoria\n\tIterator<LecturasSensor> itea = arrayLecturas.iterator();\n\twhile (itea.hasNext()) {\n\t LecturasSensor lec = itea.next();\n\n\t r = IR.hiloescucha.connDB.insertaregviento(lec.getNombreSensor(),\n\t\t lec.getVelocidadAnemometro(), lec.getFecha());\n\n\t if (r == true) {\n\t\t// Una vez enviada la lectura, la borro de la BBDD Local.\n\t\tconDB.borrarRegistrosBBDD(lec);\n\t\t// Una vez enviada la lectura, la borro de memoria,\n\t\titea.remove();\n\t }\n\t}\n\treturn r;\n }", "private void peliLoppuuUfojenTuhoamiseen() {\n if (tuhotut == Ufolkm) {\n ingame = false;\n Loppusanat = \"STEVE HOLT!\";\n }\n }", "@Override\n\tpublic boolean erTom() {\n\t\treturn (bak == null);\n\t}", "public boolean anyadirIncidenciaUrgente(Incidencia incidencia){\n log.info(\"tamaño tareas urgentes: \" + this.tareasUrgentes.size());\n if (incidencia.getEstado().equals(IssueStatus.REPORTADO.toString())\n && this.tareasUrgentes.size() < this.maxNumTareasUrgentes) {\n\n this.tareasUrgentes.add(incidencia);\n incidencia.asignarPrioridadUrgente(this);\n return true;\n } else {\n return false;\n }\n }", "@Override\n\tpublic void naoAtirou() {\n\t\tatirou=false;\n\n\t}", "public boolean estavacia(){\n return inicio==null;\n }", "public void setAktiivisuus()\r\n\t{\r\n\t\tonAktiivinen = false;\r\n\t}", "@Override\n\tpublic boolean puedoPasar(ElementoPiedra a) {\n\t\treturn false;\n\t}", "public boolean verMina(){\n\r\n return espM;\r\n }", "@Override\r\n\tpublic boolean cadastrar(Loja loja) {\n\t\treturn false;\r\n\t}", "public final boolean zze() {\n return false;\n }", "public boolean estaVacia() {\n if (pieza == null)\n return true;\n else\n return false;\n }", "boolean hasUa();", "public static void TroskoviPredjenogPuta() {\n\t\tUtillMethod.izlistavanjeVozila();\n\t\tSystem.out.println(\"Unesite redni broj vozila za koje zelite da racunate predjeni put!\");\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\tSystem.out.println(\"Unesite broj kilometara koje ste presli sa odgovarajucim vozilom\");\n\t\t\t\tdouble km = UtillMethod.unesiteBroj();\n\t\t\t\tVozilo v = Main.getVozilaAll().get(redniBroj);\n\t\t\t\tdouble rezultat;\n\t\t\t\tif(v.getGorivaVozila().size()>1) {\n\t\t\t\t\tGorivo g = UtillMethod.izabirGoriva();\n\t\t\t\t\trezultat = cenaTroskaVoz(v,km,g);\n\t\t\t\t}else {\n\t\t\t\t\t rezultat = cenaTroskaVoz(v,km,v.getGorivaVozila().get(0));\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Cena troskova za predjeni put je \" + rezultat + \"Dinara!\");\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 boolean repOK(){\n if(passenger == null) return false;\n if(car == null) return false;\n return true;\n }", "public boolean isRewrittenByVulas() {\n // Somehow the containsKey does not work, use getValue instead\n //\t\tfinal boolean modif =\n // this.originalManifest.getMainAttributes().containsKey(JarWriter.MANIFEST_ENTRY_VULAS_MODIF);\n //\t\tfinal boolean sha1 =\n // this.originalManifest.getMainAttributes().containsKey(JarWriter.MANIFEST_ENTRY_ORIG_SHA1);\n final boolean modif =\n this.originalManifest.getMainAttributes().getValue(JarWriter.MANIFEST_ENTRY_VULAS_MODIF)\n != null;\n final boolean sha1 =\n this.originalManifest.getMainAttributes().getValue(JarWriter.MANIFEST_ENTRY_ORIG_SHA1)\n != null;\n return modif && sha1;\n }", "private boolean sugerencia(Palabra c){\n MaxHeap<Palabra> l = dic.opcionesSuguerencias(c);\n int d =0;\n if (!l.esVacio()) {\n Palabra n = l.elimina();\n d = JOptionPane.showConfirmDialog(null, \"---Tal vez quizo decir: \\n -\"+n.toString(), \"¿?\", JOptionPane.YES_NO_OPTION);\n if (d ==0 ) {\n c.setCadena(n);\n return false;\n }else if (d == 1) {\n return true;\n }\n }\n return false;\n }", "public boolean reverseAccrualIt() {\n log.info(toString());\n\n if (!isReceipt()) {\n CQChangeStateVP(MVALORPAGO.EMITIDO, MVALORPAGO.REVERTIDO);\n CQChangeStateVP(MVALORPAGO.IMPRESO, MVALORPAGO.REVERTIDO);\n\n }\n\n return false;\n }" ]
[ "0.67805463", "0.6545113", "0.62588173", "0.6242854", "0.6222457", "0.61925715", "0.61894035", "0.6150073", "0.61396277", "0.6131026", "0.6122011", "0.6068874", "0.60378224", "0.60250396", "0.59890825", "0.5970443", "0.5952085", "0.5950928", "0.59161395", "0.591142", "0.5899143", "0.5896782", "0.5885481", "0.58840954", "0.58791655", "0.58791655", "0.5874501", "0.5857118", "0.584646", "0.58406025", "0.5838661", "0.5828734", "0.58215636", "0.58111894", "0.5800973", "0.5763765", "0.5763062", "0.5746691", "0.5746262", "0.5722422", "0.5717611", "0.5688817", "0.56777424", "0.5677571", "0.566992", "0.5668583", "0.56559193", "0.5651387", "0.5647319", "0.5646521", "0.5642226", "0.5642165", "0.5620726", "0.56206024", "0.5613155", "0.56112623", "0.5602512", "0.55928284", "0.5592201", "0.5588058", "0.55836046", "0.5574694", "0.557448", "0.55718404", "0.55637527", "0.555754", "0.55433583", "0.5541704", "0.55408686", "0.55309266", "0.55296165", "0.5522599", "0.5521784", "0.5519984", "0.55198854", "0.55037344", "0.54910004", "0.54866433", "0.54861945", "0.5481604", "0.5481409", "0.5476138", "0.5474022", "0.54705274", "0.54492104", "0.5446319", "0.54437166", "0.5443583", "0.54378337", "0.54337376", "0.54306644", "0.54275364", "0.5422799", "0.54216564", "0.5412596", "0.5411086", "0.5410697", "0.5409312", "0.5403195", "0.5398353" ]
0.60680306
12
Devuelve las reservas segun el id de la sala
@GetMapping("/{sala}") public List<ReservasEntity> findBySalaEquals(@PathVariable Integer sala) { return reservaRepo.findBySalaEquals(sala); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadReserva() {\r\n\t\tif(listaReservas.size() != 0) {\r\n\r\n\t\t}else {\r\n\t\t\tfor(int i = 0; i < 8; i++) {\r\n\t\t\t\tReservaDAO aux = new ReservaDAO();\r\n\t\t\t\taux.load_reserva(i+1);\r\n\t\t\t\tif(aux.getTitulo() != null) {\r\n\t\t\t\t\tlistaReservas.add(aux);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void mostrarReservas() {\n\t\tint numReserva=1;\r\n\t\tfor(Reserva reserva:reservas) {\r\n\t\t\tSystem.out.println(numReserva+\" \"+reserva.toString());\r\n\t\t\tnumReserva++;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public List<ReservaEntity> getReservas() {\n LOGGER.log(Level.INFO, \"Inicia proceso de consultar todas las reservas\");\n // Note que, por medio de la inyección de dependencias se llama al método \"findAll()\" que se encuentra en la persistencia.\n List<ReservaEntity> reservas = persistence.findAllReservas();\n LOGGER.log(Level.INFO, \"Termina proceso de consultar todas las reservas\");\n return reservas;\n }", "public void ReservaEfetivadas () {\n Date hoje = new Date ();\n for (int z = 0; z < vecReserva.size(); z++) {\n if (((int) ((((entReserva)vecReserva.elementAt(z)).getDatain().getTime() - (hoje.getTime())) / 86400000L)) == 0){// Reserva será relaizada hj\n if (((entReserva)vecReserva.elementAt(z)).getPagamento().getSituacao() == 0){//Cliente fez todo o pagamento e o quarto será\n vecReservaEfetivadas.add(vecReserva.elementAt(z));\n }\n \n }\n }\n }", "Sporthall() {\n reservationsList = new ArrayList<>();\n }", "public void setReservas(List<ReservaEntity> reservas) {\r\n this.reservas = reservas;\r\n }", "public void reservarSitio() {\r\n\t\ttry {\r\n\t\t\tif (sitioId == null)\r\n\t\t\t\tMensaje.crearMensajeWARN(\"Debe seleccionar sitio para la reserva.\");\r\n\t\t\telse if (!mayorEdad && (getDniRepresentante() == null || getNombreRepresentante() == null\r\n\t\t\t\t\t|| getDniRepresentante().trim().isEmpty() || getDniRepresentante().length() < 9\r\n\t\t\t\t\t|| !Funciones.isNumeric(getDniRepresentante()) || !Funciones.validacionCedula(getDniRepresentante())\r\n\t\t\t\t\t|| getNombreRepresentante().trim().isEmpty()))\r\n\t\t\t\tMensaje.crearMensajeWARN(\"Los datos de representante son requeridos, y la cédula debe ser válida.\");\r\n\t\t\telse {\r\n\t\t\t\tif (reserva != null) {// POSEE RESERVA\r\n\t\t\t\t\tmodificarReserva();\r\n\t\t\t\t\tSystem.out.println(\"MODIFICA\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tingresarReserva();\r\n\t\t\t\t\tSystem.out.println(\"INGRESA\");\r\n\t\t\t\t}\r\n\t\t\t\tfinalizado = true;\r\n\t\t\t\treserva = mngRes.buscarReservaPorID(getDniEstudiante(), periodo.getPrdId());// CARGAR\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// RESERVA\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ACTUAL\r\n\t\t\t\tcargarSitiosLibres();\r\n\t\t\t\tcargarEstudiantesSitio();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tMensaje.crearMensajeERROR(\"Error al realizar reserva: \" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public Prenotazione getReservation(int id)\n {\n Prenotazione Reservation = null;\n final String sql = \"SELECT id, data_p, ora_inizio, ora_fine, clienti, ufficio_id, utente_id FROM prenotazioni WHERE id = ?\";\n\n try {\n Connection conn = DBConnect.getInstance().getConnection();\n PreparedStatement st = conn.prepareStatement(sql);\n st.setInt(1, id);\n\n ResultSet rs = st.executeQuery();\n\n while (rs.next()) {\n Reservation = new Prenotazione(id, rs.getString(\"data_p\"), rs.getInt(\"ora_inizio\"), rs.getInt(\"ora_fine\"), rs.getInt(\"clienti\"),rs.getInt(\"ufficio_id\"),rs.getString(\"utente_id\"));\n }\n\n conn.close();\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return Reservation;\n }", "public long reserva_de_entradas(int identificador_evento, Date fechaevento, Horario[] listahorarios ) throws ParseException {\n fgen.info (\"Identificador del evento\" + identificador_evento);\n fgen.info (\"Fecha del evento\" + fechaevento);\n ArrayList<Horario> horariosReserva = new ArrayList<Horario>();\n for (int i = 0; i < listahorarios.length; i++) {\n \n Horario horario = listahorarios[i];\n fgen.info (\"Horario : \" + horario.getHorario().toString()); \n horariosReserva.add(horario);\n List<Disponibilidad> listadisponibles = listahorarios[i].disponibilidades;\n for (int j = 0; j < listadisponibles.size() ; j++) { \n fgen.info (\" Disponibilidad - Cantidad: \" + listadisponibles.get(j).getCantidad());\n fgen.info (\" Disponibilidad - Precio: \" + listadisponibles.get(j).getPrecio());\n fgen.info (\" Disponibilidad - Sector: \" + listadisponibles.get(j).getSector());\n } \n \n \n } \n //Inicializo o tomo lo que esta en memoria de la lista de reservas\n ListaReservas reservas= new ListaReservas(); \n // busco el evento y que la lista de horarios sea en la que quiero reservar\n ListaEventos eventos = new ListaEventos();\n Calendar c = Calendar.getInstance();\n c.setTime(fechaevento);\n Evento e = eventos.buscarEvento(identificador_evento, c);\n List<Horario> horariosRetornar = new ArrayList<Horario>();\n if(e != null)\n {\n horariosRetornar = e.getHorarios();\n } \n \n if (horariosRetornar != null)\n {\n for (int i = 0; i < horariosRetornar.size(); i++) {\n for (int j = 0; j < listahorarios.length; j++) {\n Date fechaE = horariosRetornar.get(i).getHorario().getTime(); \n Date fechaEventoDate = listahorarios[j].hora.getTime(); \n if(fechaE.equals(fechaEventoDate)) \n { for (int k = 0; k < horariosRetornar.get(i).disponibilidades.size(); k++) {\n for (int l = 0; l < listahorarios[j].disponibilidades.size(); l++) {\n Disponibilidad d= horariosRetornar.get(i).disponibilidades.get(k);\n Disponibilidad r= listahorarios[j].disponibilidades.get(l);\n if (d.cantidad >= r.cantidad && d.sector.equalsIgnoreCase(r.sector) && d.precio==r.precio)\n {\n d.setCantidad(d.cantidad-r.cantidad);\n //Reserva reserv= new Reserva();\n //reservas.contador_Id= reservas.contador_Id +1;\n //reserv.idReserva= reservas.contador_Id;\n //reserv.Estado=1;\n //reserv.idEvento = identificador_evento;\n //reserv.horarios.add(listahorarios[j]);\n //reservas.listaReserva.add(reserv);\n //return reserv.idReserva;\n }\n else if(d.cantidad < r.cantidad && d.sector.equalsIgnoreCase(r.sector) && d.precio==r.precio)\n {\n //Si hay alguna solicitud de de reserva que no se pueda cumplir. Re reorna 0.\n //TODO: Hay que volver para atras las cantidades modificadas.\n return 0;\n }\n \n }\n \n }\n }\n }\n }\n Reserva reserv= new Reserva();\n reservas.contador_Id= reservas.contador_Id +1;\n reserv.idReserva= reservas.contador_Id;\n reserv.Estado=1;\n reserv.idEvento = identificador_evento;\n reserv.horarios = horariosReserva;\n reserv.fechaEvento = c;\n reservas.listaReserva.add(reserv);\n return reserv.idReserva;\n }\n \n return 0;\n }", "public Reserva(int id,Timestamp fechaInicio,Timestamp fechaFin,Recurso recurso,Usuario usuario,String estado,String tipo){\n this.id=id;\n this.fechaInicio=fechaInicio;\n this.fechaFin=fechaFin;\n this.recurso=recurso;\n this.usuario=usuario;\n this.estado=estado;\n this.tipo=tipo;\n }", "public List<Reserva> getAllReservas(){\n return repositorioReserva.findAll();\n }", "public List<Boardreservation> getBoardReservations(int boardID);", "public ListaReservasBean() {\r\n\t\tthis.listaReservas = new ArrayList<ReservaDAO>();\r\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\treturn \"Reservas [id=\" + id + \", id_habitacion=\" + id_habitacion + \", dni=\" + dni + \", desde=\" + desde\r\n\t\t\t\t+ \", hasta=\" + hasta + \"]\";\r\n\t}", "public static void actualizarCreencias(int id) {\n\t\tint j =0;\t\t\n\t\t//Actualizamos las creecias del jugador \n\t\tint i =0;\n\t\tfor(j =0; j < GestorPartida.getContJugadores();j++) {\n\t\t\t\n\t\t\t\n\t\t\tif(GestorPartida.getJugadores()[j].getId() != id) {\n\t\t\t\t//Filtramos que los jugadores que vayan a actualizar sus creencias sean los de la sala del jugador que acaba de realizar una accion, excepto las suyas propias\t\t\t\n\t\t\t\tif(GestorPartida.getJugadores()[j].getSala().equalsIgnoreCase(GestorPartida.getJugadores()[id].getSala()) && GestorPartida.getJugadores()[j].getId() != id) {\n\t\t\t\t\t//Actualizamos la sala por si el jugador se acaba de mover\n\t\t\t\t\tGestorPartida.getJugadores()[id].getCreencias().setSalaPersona(GestorPartida.getJugadores()[j].getSala(), i);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tfor(j = 0; j < GestorPartida.getContObjetosJugador();j++) {\n\t\t\t//Comprobamos que el jugador coincida con un poseedor de un objeto\n\t\t\tif(GestorPartida.getObjetoJugador()[j].getJugador().getSala().equalsIgnoreCase(GestorPartida.getJugadores()[id].getSala())) {\n\t\t\t\tfor(int x =0; GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x]!=null ; x++) {\n\t\t\t\t\t//Cogemos la posicion del objeto donde esta el objeto dentro de las creencias\n\t\t\t\t\tif(GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x].equalsIgnoreCase(GestorPartida.getObjetoJugador()[j].getNombreObjeto())) {\n\t\t\t\t\t\tGestorPartida.getJugadores()[id].getCreencias().setLugarObjeto(GestorPartida.getObjetoJugador()[j].getJugador().getNombre(), x);\n\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\tfor(j = 0; j < GestorPartida.getContObjetosSala();j++) {\n\t\t\t//Comprobamos si hay objetos en la sala del jugador\n\t\t\tif(GestorPartida.getObjetoSala()[j].getSala().getNombre().equalsIgnoreCase(GestorPartida.getJugadores()[id].getSala())) {\n\t\t\t\tfor(int x =0; GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x]!=null ; x++) {\n\t\t\t\t\t//Cogemos la posicion del objeto donde esta el objeto dentro de las creencias\n\t\t\t\t\tif(GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x].equalsIgnoreCase(GestorPartida.getObjetoSala()[j].getNombreObjeto())) {\n\t\t\t\t\t\tGestorPartida.getJugadores()[id].getCreencias().setLugarObjeto(GestorPartida.getObjetoSala()[j].getSala().getNombre(), x);\n\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\t\n\t\t\n\t}", "private void getAllIds() {\n try {\n ArrayList<String> NicNumber = GuestController.getAllIdNumbers();\n for (String nic : NicNumber) {\n combo_nic.addItem(nic);\n\n }\n } catch (Exception ex) {\n Logger.getLogger(ModifyRoomReservation.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void mostrarReservas() {\n\t\tJFReservasAdmin jfres =new JFReservasAdmin();\n\t\tjfres.setVisible(true);\n\t\t\n\t\tMap<Integer,Reserva> reservas = modelo.obtenerReservasPeriodo(per.getIdPeriodo());\n\t\tDefaultTableModel dtm = new DefaultTableModel(new Object[][] {},\n\t\t\t\tnew String[] { \"Dia\", \"Hora\", \"Email\" });\n\n\t\tfor (Integer key : reservas.keySet()) {\n\n\t\t\tdtm.addRow(new Object[] { reservas.get(key).getReserva_dia(), reservas.get(key).getReserva_hora(),reservas.get(key).getEmail() });\n\t\t}\n\t\tjfres.tReservas.setModel(dtm);\n\t}", "void Planificar(Reserva unaReserva);", "public KListObject<KAssurer_lecon> chargerListeRDVEleve(int id){\r\n\t\tint idAgenda;\r\n\t\t\r\n\t\tKListObject<KAssurer_lecon> Kliste =new KListObject<KAssurer_lecon>(KAssurer_lecon.class);\r\n\t\tKAssurer_lecon lecon = null;\r\n\t\tKListObject<KAgenda> Kliste1 =new KListObject<KAgenda>(KAgenda.class);\r\n\t\tKliste1.loadFromDb(BDD.db,\"select * from agenda where id in (select idAgenda from assurer_lecon where ideleve =\"+id+\") \" +\r\n\t\t\t\t\"order by date_agenda asc, heure_agenda asc\");\r\n\t\t\r\n\t\tfor(int i = 0; i<Kliste1.count(); i++){\r\n\t\t\tidAgenda = ((Integer)Kliste1.get(i).getId());\r\n\t\t\tlecon = new KAssurer_lecon();\r\n\t\t\ttry {\r\n\t\t\t\tlecon.loadOne(BDD.db,\" idAgenda = \"+idAgenda+\" and idEleve =\"+id);\r\n\t\t\t\tKliste.add(lecon);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace(); \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Kliste;\r\n\t}", "public void loadReserva(String User) {\r\n\t\tif(listaReservas.size() != 0) {\r\n\r\n\t\t}else {\r\n\t\t\tfor(int i = 0; i < 8; i++) {\r\n\t\t\t\tReservaDAO aux = new ReservaDAO();\r\n\t\t\t\taux.load_reserva(User, i+1);\r\n\t\t\t\tif(aux.getTitulo() != null) {\r\n\t\t\t\t\tlistaReservas.add(aux);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void votaRisposta(Integer id, int voto) {\n\t\t\n\t\tDB db = getDB();\n\t\tMap<Long, Risposta> risposte = db.getTreeMap(\"risposte\");\n\t\tlong hashCode = id.hashCode();\n\t\tRisposta risposta = risposte.get(hashCode);\n\t\trisposta.setVoto(voto);\n\t\trisposte.put(hashCode, risposta);\n\t\tdb.commit();\n\t}", "@Override\n\tpublic ArrayList<Risposta> getRisposte(int id) {\n\t\tDB db = getDB();\n\t\tArrayList<Risposta> risposte = new ArrayList<Risposta>();\n\t\tMap<Long, Risposta> list = db.getTreeMap(\"risposte\");\n\t\tfor(Map.Entry<Long, Risposta> risposta : list.entrySet())\n\t\t\tif(risposta.getValue() instanceof Risposta) {\n\t\t\t\tif(risposta.getValue().getDomandaID() == id)\n\t\t\t\t\trisposte.add((Risposta)risposta.getValue());\n\t\t\t}\n\t\treturn risposte;\n\t}", "public void setReservationId(int i) { reservationId = i; }", "public List<Reservation> findByReservationUser_Id(@Param(\"id\") int id);", "public List<ReservationDTO> seachReservationBypid(int pid) {\n\t\treturn dao.seachReservationBypid(pid);\r\n\t}", "public void removeReserva(int id) {\r\n\t\tfor(int i = 0; i < listaReservas.size(); i++) {\r\n\t\t\tif(listaReservas.get(i).getIdReserva() == id) {\r\n\t\t\t\tlistaReservas.remove(i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public ArrayList<Object> getGuestsReservations(int guestId){\n \n return dbf.getGuestsReservations(guestId); \n }", "private void sucesso(JSONArray jsonArrayReservas) throws JSONException {\n reservasAdapter.clear();\n\n if (jsonArrayReservas.length() > 0) {\n\n for (int i = 0; i < jsonArrayReservas.length(); i++) {\n\n Reserva reserva = gson.fromJson(jsonArrayReservas.get(i).toString(), Reserva.class);\n\n Log.d(\"DEBUG\", \"Reserva: \" + reserva.toString());\n\n reservasAdapter.add(reserva);\n\n }\n\n } else\n panelSemRegistros.setVisibility(View.VISIBLE);\n\n }", "public Reserva getReservaById(Long id) throws Exception {\n\t\t\tDAOReserva daoReserva = new DAOReserva();\n\t\t\tReserva reserva = null;\n\t\t\ttry \n\t\t\t{\n\t\t\t\tthis.conn = darConexion();\n\t\t\t\tdaoReserva.setConn(conn);\n\t\t\t\treserva = daoReserva.findReservaById(id);\n\t\t\t\tif(reserva == null)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception(\"El reserva con el codigo = \" + id + \" no se encuentra persistido en la base de datos.\");\t\t\t\t\n\t\t\t\t}\n\t\t\t} \n\t\t\tcatch (SQLException sqlException) {\n\t\t\t\tSystem.err.println(\"[EXCEPTION] SQLException:\" + sqlException.getMessage());\n\t\t\t\tsqlException.printStackTrace();\n\t\t\t\tthrow sqlException;\n\t\t\t} \n\t\t\tcatch (Exception exception) {\n\t\t\t\tSystem.err.println(\"[EXCEPTION] General Exception:\" + exception.getMessage());\n\t\t\t\texception.printStackTrace();\n\t\t\t\tthrow exception;\n\t\t\t} \n\t\t\tfinally {\n\t\t\t\ttry {\n\t\t\t\t\tdaoReserva.cerrarRecursos();\n\t\t\t\t\tif(this.conn!=null){\n\t\t\t\t\t\tthis.conn.close();\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (SQLException exception) {\n\t\t\t\t\tSystem.err.println(\"[EXCEPTION] SQLException While Closing Resources:\" + exception.getMessage());\n\t\t\t\t\texception.printStackTrace();\n\t\t\t\t\tthrow exception;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn reserva;\n\t\t}", "public int[] setReservacion(String tipo) {\n\tint[] cord = new int[2];\n\tfor(int i = 0;i<mun_pisos;i++) {\n\t\tfor(int y = 0;y<getNum_habitaciones_x_piso(i);y++) {\n\t\t\tif(getEstado(i,y).equals(\"Libre\")&&(getTipo(i, y).equals(tipo))) {//si encuentra una habitacion libre se le asigna y listo\n\t\t\t\tcord[0]=i;\n\t\t\t\tcord[1]=y;\n\t\t\t\treturn cord;\n\t\t\t}\n\t\t}\n\t}\n\treturn cord;\n}", "public List<Prenotazione> getAllReservations(QueryParamsMap queryParamsMap) {\n final String sql = \"SELECT id, data_p , ora_inizio, ora_fine, clienti, ufficio_id, utente_id FROM prenotazioni\";\n\n List<Prenotazione> reservations = new LinkedList<>();\n\n try {\n Connection conn = DBConnect.getInstance().getConnection();\n PreparedStatement st = conn.prepareStatement(sql);\n\n ResultSet rs = st.executeQuery();\n\n Prenotazione old = null;\n while(rs.next()) {\n if(old == null){\n old = new Prenotazione(rs.getInt(\"id\"), rs.getString(\"data_p\"), rs.getInt(\"ora_inizio\"), rs.getInt(\"ora_fine\"), rs.getInt(\"clienti\"), rs.getInt(\"ufficio_id\"), rs.getString(\"utente_id\"));\n }\n else if(old.getFinalHour() == rs.getInt(\"ora_fine\") && old.getDate().equals(rs.getString(\"data_p\")) && old.getOfficeId() == rs.getInt(\"ufficio_id\") && old.getUserId() == rs.getString(\"utente_id\"))\n old = new Prenotazione(old.getId(), old.getDate(), old.getStartHour(), rs.getInt(\"ora_fine\"), old.getClients() + rs.getInt(\"clienti\"), old.getOfficeId(), old.getUserId());\n else {\n reservations.add(old);\n Prenotazione t = new Prenotazione(rs.getInt(\"id\"), rs.getString(\"data_p\"), rs.getInt(\"ora_inizio\"), rs.getInt(\"ora_fine\"), rs.getInt(\"clienti\"), rs.getInt(\"ufficio_id\"), rs.getString(\"utente_id\"));\n reservations.add(t);\n }\n }\n\n conn.close();\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return reservations;\n }", "List<Reservierung> selectAll() throws ReservierungException;", "private void ingresarReserva() throws Exception {\r\n\t\tif (mngRes.existeReservaPeriodo(getSitio().getId())) {\r\n\t\t\tif (mayorEdad) {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(), null);\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t} else {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(),\r\n\t\t\t\t\t\tgetDniRepresentante() + \";\" + getNombreRepresentante());\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t}\r\n\t\t\tMensaje.crearMensajeINFO(\"Reserva realizada correctamente, no olvide descargar su contrato.\");\r\n\t\t} else {\r\n\t\t\tMensaje.crearMensajeWARN(\"El sitio seleccionado ya esta copado, favor eliga otro.\");\r\n\t\t}\r\n\t}", "public void era (int idProcedimiento){\n // crear nuevo objeto Registro con el id correspondiente\n Registro registroNuevo = new Registro();\n registroNuevo.setIdentificadorProcedimiento(idProcedimiento);\n this.pilaEras.push(registroNuevo);\n }", "public void cargarEstudiantesSitio() {\r\n\t\tList<ArrMatriculado> listado = mngRes.matriculadosEnSitioPorPeriodo(sitioId, periodo.getPrdId());\r\n\t\tgetReservasSitio().clear();\r\n\t\tif (listado != null && !listado.isEmpty())\r\n\t\t\tgetReservasSitio().addAll(listado);\r\n\t}", "private void cargarRegistro() {\n\t\tif (filaId != null) {\n\t\t\tCursor bar = bdHelper.getBar(filaId);\n // Indicamos que queremos controlar el Cursor\n\t\t\tstartManagingCursor(bar);\n\n\t\t\t// Obtenemos el campo categoria\n\t\t\tString categoria = bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_CATEGORIA));\n\t\t\t// Seleccionamos la categoría en el Spinner\n\t\t\tfor (int i=0; i<categoriaSpinner.getCount();i++){\n\t\t\t\t// Cargamos una de la opciones del listado desplegable\n\t\t\t\tString s = (String) categoriaSpinner.getItemAtPosition(i);\n\t\t\t\t// Si coindice con la que está en la BD la seleccionamos en el listado desplegable\n\t\t\t\tif (s.equalsIgnoreCase(categoria)){\n\t\t\t\t\tcategoriaSpinner.setSelection(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Obtenemos el campo relacion calidad-precio\n\t\t\tString relacion = bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_RELACION));\n\t\t\t// Seleccionamos en el Spinner la relacion c-p\n\t\t\tfor (int i=0; i<relacionSpinner.getCount();i++){\n\t\t\t\t// Cargamos una de la opciones del listado desplegable\n\t\t\t\tString s = (String) relacionSpinner.getItemAtPosition(i);\n\t\t\t\t// Si coindice con la que está en la BD la seleccionamos en el listado desplegable\n\t\t\t\tif (s.equalsIgnoreCase(relacion)){\n\t\t\t\t\trelacionSpinner.setSelection(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Obtenemos el campo del acompañante\n\t\t\tString acompanante = bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_ACOMPANANTE));\n\t\t\t// Seleccionamos el formato en el Spinner\n\t\t\tfor (int i=0; i<acompananteSpinner.getCount();i++){\n\t\t\t\t// Cargamos una de la opciones del listado desplegable\n\t\t\t\tString s = (String) acompananteSpinner.getItemAtPosition(i);\n\t\t\t\t// Si coindice con la que está en la BD la seleccionamos en el listado desplegable\n\t\t\t\tif (s.equalsIgnoreCase(acompanante)){\n\t\t\t\t\tacompananteSpinner.setSelection(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Rellenamos las Vistas\n\t\t\tnombreText.setText(bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_NOMBRE)));\n\t\t\tdireccionText.setText(bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_DIRECCION)));\n\t\t\tnotasText.setText(bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_NOTAS)));\n\t\t\tprecioText.setText(bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_PRECIO)));\n\t\t\tvaloracionRB.setRating(bar.getFloat(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_VALORACION)));\n\n // Tratamos las fechas del registro\n\t\t\tlong fecha = bar.getLong(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_FEC_ULT_VIS));\n\t\t\tprimeraFecha.setTimeInMillis(fecha);\n\t\t\tfecha = bar.getLong(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_FEC_PRI_VIS));\n\t\t\tif (fecha>0) {\n\t\t\t\tultimaFecha=Calendar.getInstance();\n\t\t\t\tultimaFecha.setTimeInMillis(fecha);\n\t\t\t}\n\t\t\t// Dejamos de controlar el cursor de la BD\n\t\t\tstopManagingCursor(bar);\n\t\t}\n\t}", "private void carregarAlunosTurma() {\n AcessoFirebase.getFirebase().addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n getUidUsuariosTurma(dataSnapshot);\n montandoArrayListUsuarios(dataSnapshot);\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n }\n });\n }", "public EstacionServicio getListadoPorId(int id) throws Exception {\n\t\t\t\t\n\t\t\t\tConnection conn = ds.getConnection();\n\t\t\t\tEstacionServicio idLista = null;\n\t\t\t\tPreparedStatement stmt = conn.prepareStatement(\"SELECT * FROM ESTACION_SERVICIO WHERE id = ?\");\n\t\t\t\tstmt.setInt(1, id);\n\t\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\t\tif (rs.next()){\n\t\t\t\t\tidLista = new EstacionServicio(rs.getInt(1),rs.getString(2),rs.getDate(3),rs.getFloat(4),rs.getFloat(5),rs.getString(6));\n\t\t\t\t}\n\t\t\t\tif (rs != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\trs.close();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stmt != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tstmt.close();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\treturn idLista;\n\t\t\t\n\t\t\t}", "public Reservation[] findResaClient(int id_client){\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tPreparedStatement prepare;\r\n\t\t\tprepare = SC.prepareStatement(\"SELECT * FROM reservation where id_client=?\");\r\n\t\t\tprepare.setInt(1, id_client);\r\n\t\t\tResultSet result = prepare.executeQuery();\r\n\t\t\t\r\n\t\t\tPreparedStatement prepareCount = SC.prepareStatement(\"SELECT COUNT(*) FROM reservation where id_client=?\"); \r\n\t\t\tprepareCount.setInt(1, id_client);\r\n\t\t\tResultSet resultCount = prepareCount.executeQuery();\r\n\t\t\t\r\n\t\t\tReservation[] reservation = new Reservation[resultCount.getInt(1)];\r\n\t\t\tfor(int i=0; i<reservation.length;i++){\r\n\t\t\t\treservation[i] = find(result.getInt(\"Id_reservation\"));\r\n\t\t\t\tresult.next();\r\n\t\t\t}\r\n\t\t\treturn reservation;\r\n\t\t\t\r\n\t\t\t\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Transactional\r\n\tpublic List<Room> getReservable(Integer posti, LocalDate from, LocalDate to){\r\n\t\tList<Room> l= this.getPosti(posti);\r\n\t\tl.removeAll(this.getReservedFromTo(from, to));\r\n\t\treturn l;\r\n\t}", "private void atualizarTela() {\n\t\tSystem.out.println(\"\\n*** Refresh da Pagina / Consultando Todos os Registro da Tabela PressaoArterial\\n\");\n\t\tpressaoArterial = new PressaoArterial();\n\t\tlistaPressaoArterial = pressaoArterialService.buscarTodos();\n\n\t}", "public ReservaEntity getReserva(Long reservasId) \n {\n LOGGER.log(Level.INFO, \"Inicia proceso de consultar la reserva con id = {0}\", reservasId);\n // Note que, por medio de la inyección de dependencias se llama al método \"find(id)\" que se encuentra en la persistencia.\n ReservaEntity reservaEntity = persistence.findReserva(reservasId);\n if (reservaEntity == null) \n {\n LOGGER.log(Level.SEVERE, \"La reserva con el id = {0} no existe\", reservasId);\n }\n LOGGER.log(Level.INFO, \"Termina proceso de consultar la reserva con id = {0}\", reservasId);\n return reservaEntity;\n }", "public List<Reserva> getAllReservas() throws Exception {\n\t\t\tDAOReserva daoReserva = new DAOReserva();\n\t\t\tList<Reserva> reservas;\n\t\t\ttry \n\t\t\t{\n\t\t\t\tthis.conn = darConexion();\n\t\t\t\tdaoReserva.setConn(conn);\n\t\t\t\t\n\t\t\t\t//Por simplicidad, solamente se obtienen los primeros 50 resultados de la consulta\n\t\t\t\treservas = daoReserva.getReserva();\n\t\t\t}\n\t\t\tcatch (SQLException sqlException) {\n\t\t\t\tSystem.err.println(\"[EXCEPTION] SQLException:\" + sqlException.getMessage());\n\t\t\t\tsqlException.printStackTrace();\n\t\t\t\tthrow sqlException;\n\t\t\t} \n\t\t\tcatch (Exception exception) {\n\t\t\t\tSystem.err.println(\"[EXCEPTION] General Exception:\" + exception.getMessage());\n\t\t\t\texception.printStackTrace();\n\t\t\t\tthrow exception;\n\t\t\t} \n\t\t\tfinally {\n\t\t\t\ttry {\n\t\t\t\t\tdaoReserva.cerrarRecursos();\n\t\t\t\t\tif(this.conn!=null){\n\t\t\t\t\t\tthis.conn.close();\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (SQLException exception) {\n\t\t\t\t\tSystem.err.println(\"[EXCEPTION] SQLException While Closing Resources:\" + exception.getMessage());\n\t\t\t\t\texception.printStackTrace();\n\t\t\t\t\tthrow exception;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn reservas;\n\t\t}", "public List<UsuarioDto> getAvalesByIdSolicitud(BigInteger idSolicitud) throws BusinessException {\n try {\n\n List<UsuarioDto> avales = avaSolDao.getAvalesByIdSolicitud(idSolicitud);\n\n for (UsuarioDto aval : avales) {\n /*Cuando el usuario está activo*/\n if(aval.getEstatus()==null){\n aval.setEstatus(0);\n }\n \n if (aval.getEstatus() == 1) {\n aval.setEstatusStr(Constantes.USR_ACTIVO);\n } else {\n aval.setEstatusStr(Constantes.USR_BAJA);\n }\n\n switch (aval.getEstatusAvalInt()) {\n case 1:\n aval.setEstatusAvalStr(Constantes.SOLAVA_PENDIENTE);\n break;\n case 2:\n aval.setEstatusAvalStr(Constantes.SOLAVA_VALIDANDO);\n break;\n case 3:\n aval.setEstatusAvalStr(Constantes.SOLAVA_APROBADO);\n break;\n case 4:\n aval.setEstatusAvalStr(Constantes.SOLAVA_RECHAZADO);\n break;\n }\n }\n\n return avales;\n } catch (IntegracionException ex) {\n throw new BusinessException(ex.getMessage(), ex);\n }\n }", "public Coordenadas_Ruta(Integer id, Context context)\n {\n this.id = id;\n this.context = context;\n this.coordenadasList = new ArrayList<Coordenada>();\n this.jsonParser = new JSONParser();\n List<Coordenada> aux = CoordenadaRepo.coordenadas_ruta(context, id.longValue());\n if(RutaRepo.isValid(context, id.longValue()) != -1 && aux.size() > 0)\n {\n for(Coordenada coordenada : aux)\n {\n this.coordenadasList.add(coordenada);\n }\n internet = false;\n Log.i(\"coordenadas: \", \"obtenidas de manera local\");\n }\n else\n {\n hasInternet conexion = new hasInternet(this.context);\n try {\n internet = conexion.execute().get();\n }\n catch(Exception e)\n {\n internet = false;\n }\n }\n }", "public static ArrayList<Krediti> idPoiskKrediti() {\r\n\t\tArrayList<Krediti> foundKrediti = new ArrayList<Krediti>();\r\n\t\tint i = 0;\r\n\t\tScanner n = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Vvedite Id\");\r\n\t\tint t = n.nextInt();// number of rooms\r\n\t\tfor (Krediti kredit : kred) {\r\n\t\t\tif (kredit.getId() == t) {\r\n\t\t\t\tfoundKrediti.add(kredit);\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn foundKrediti;\r\n\t}", "@Override\r\n\tpublic List<Reservation> rechercherReservation(Voyage v, Client c) {\n\t\treturn null;\r\n\t}", "public void reemplazarRutina(RutinaG rutina, String id) {\n\n ContentValues registro = prepararRegistroRutina(rutina);\n bdHelperRutinas.updateTabla(DataBaseManagerRutinas.TABLE_NAME, registro, DataBaseManagerRutinas.CN_ID + \" ='\" + id + \"'\");\n\n }", "private void idGrupos() {\n\t\tmyHorizontalListView.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tURL_BOOKS = \"http://tutoriapps.herokuapp.com/api/v1/groups/\"\n\t\t\t\t\t\t+ gid[position].toString() + \"/books.json?auth_token=\";\n\t\t\t\tposicionId = gid[position].toString();\n\t\t\t\tvalorUltimo = 0;\n\t\t\t\tnuevo = 0;\n\t\t\t\taa.clear();\n\t\t\t\tgetData();\n\t\t\t}\n\t\t});\n\t}", "@GetMapping(\"/prueba/{nombre}/{apellido}\")\n\tpublic List<ReservasEntity> findReservasByUser(@PathVariable(\"nombre\") String nombre,@PathVariable(\"apellido\") String apellido){\n\t\treturn reservaRepo.findReservasByUser(nombre,apellido);\n\t}", "public static void BuscarReserva (Variables var,Menus Menus,BaseDades db,Reserva res, TReserva reserva,sMissatges missatge, bComprobadors comp){\r\n comp.bBuscar = true; \r\n \r\n //Mostra el menu de Buscar Reserva\r\n Menus(Menus.MenuBuscarReserva);\r\n \r\n //Llegeix les dades per buscar reserva\r\n reserva.iTelefon = sLlegirNumero(missatge.nTelefonReserva);\r\n\r\n //Mostra la Reserva\r\n MostrarReserva(var, db, res, reserva, Menus, comp);\r\n //Comprueba si la reserva se ha mostrado, sino muestra mensaje de no encontrada\r\n if(comp.bBuscar == true){\r\n Mostra(missatge.sReservaNoTrobada);\r\n }\r\n }", "public ArrayList<Reservering> zoekReserveringenVanAuto(int autoid){\r\n\t\tArrayList<Reservering> terug = new ArrayList<Reservering>();\r\n\t\ttry{\r\n\t\t\tString sql = \"SELECT * FROM Reservering WHERE autoid=\" + autoid;\r\n\t\t\tStatement stmt = con.createStatement();\r\n\t\t\tResultSet rs = stmt.executeQuery(sql);\r\n\t\t\twhile (rs.next()) { // rs.next() geeft false als er niets meer is\u000b \r\n\t\t\t\tint id = rs.getInt(\"reserveringid\");\r\n\t\t\t\tint dP = rs.getInt(\"deParkeerplek\");\r\n\t\t\t\tjava.sql.Date bdat = rs.getDate(\"beginDat\");\r\n\t\t\t\tjava.util.Date bD = new Date(bdat.getTime());\r\n\t\t\t\tjava.sql.Date edat = rs.getDate(\"eindDat\");\r\n\t\t\t\tjava.util.Date eD = new Date(edat.getTime());\r\n\t\t\t\tString isGeweest = rs.getString(\"isGeweest\");\r\n\t\t\t\tConnectDBAuto autoconn = new ConnectDBAuto(con);\r\n\t\t\t\tAuto a = autoconn.zoekAuto(autoid);\r\n\t\t\t\tReservering nieuw = new Reservering(a, id, bD, eD, dP);\r\n\t\t\t\tif(isGeweest.equals(\"t\")){\r\n\t\t\t\t\tnieuw.setGeweest(true);\r\n\t\t\t\t}\r\n\t\t\t\tterug.add(nieuw);\r\n\t\t\t}\r\n\t\t\tstmt.close();\r\n\t\t}\r\n\t\tcatch(Exception ex){\r\n\t\t\tSystem.out.println(\"Probleem bij reservering zoeken \" + ex);\r\n\t\t}\r\n\t\treturn terug;\t\t\r\n\t}", "public SpielerNewZustandsDaten(int id, String status, int siegpunkte, ArrayList<ResourceType> resourcen, int ritterGespielt, ArrayList<DevelopmentCardType> entwicklungsKarten) { // Entwicklungskarten and Rittermacht are still missing please add when they are implemented for the players \r\n\t\tthis.id = id;\r\n\t\tName = null;\r\n\t\tStatus = status;\r\n\t\tSiegpunkte = siegpunkte;\r\n\t\tRohstoffe = new RohstoffDaten(resourcen);\r\n\t\tRittermacht = ritterGespielt;\r\n\t\tEntwicklungskarten = new EntwicklungKarteDatenDaten(entwicklungsKarten);\r\n\t\t\r\n\t}", "public Vector obtenerListaCagoBuscarIdCargo(int idCargo) throws SQLException {\n Vector listaCargo = new Vector();\n String sql = \"Select idCargo, idDocumento, numeroDocumento, Documento, \"\n + \"Fecha FechaCargo, Hora HoraCargo, Area AreaCargo, Asunto, Institucion, Recepcionista, estadoCargo From vCargoDocumento Where idCargo = \"+ idCargo;\n st = con.createStatement();\n ResultSet rs = st.executeQuery(sql);\n while (rs.next()) {\n Vector ovCargo = new Vector();\n ovCargo.add(rs.getInt(1));\n ovCargo.add(rs.getInt(2));\n ovCargo.add(rs.getString(3));\n ovCargo.add(rs.getString(4));\n ovCargo.add(rs.getString(5));\n ovCargo.add(rs.getString(6));\n ovCargo.add(rs.getString(7));\n ovCargo.add(rs.getString(8));\n ovCargo.add(rs.getString(9));\n ovCargo.add(rs.getString(10));\n ovCargo.add(rs.getInt(11));\n// System.out.println(rs.getInt(1));\n// System.out.println(rs.getInt(2));\n// System.out.println(rs.getInt(3));\n// System.out.println(rs.getInt(4));\n// System.out.println(rs.getInt(5));\n// System.out.println(rs.getInt(6));\n// System.out.println(rs.getInt(7));\n// System.out.println(rs.getInt(8));\n// System.out.println(rs.getInt(9));\n// System.out.println(rs.getInt(10));\n// System.out.println(rs.getInt(11));\n listaCargo.add(ovCargo);\n }\n return listaCargo;\n }", "public void adicionarServicos() {\n int i;\n if (hospedesCadastrados.isEmpty()) {\n System.err.println(\"Não existem hospedes cadastrados!\\n\");\n } else {\n\n System.err.println(\"Digite o cpf do hospede que deseja adicionar servicos:\");\n listarHospedes();\n int cpf = verifica();\n for (i = 0; i < hospedesCadastrados.size(); i++) {\n if (hospedesCadastrados.get(i).getCpf() == cpf) {//pega o indice i do objeo pessoa, pega o id da pessoa e compara com o id da pessoa digitada\n if (hospedesCadastrados.get(i).getContrato().isSituacao()) {//verifica se a situaçao do contrato ainda está aberta para esse hospede\n\n System.err.println(\"O que deseja editar do contrato\\n\");\n //adicionar carro, trocar de quarto, adicionar conta de restaurante,\n //encerrar contrato\n\n System.err.println(\"Adicionar carro (1):\\nAdicionar restaurante (2):\\n\"\n + \"Adicionar horas de BabySitter (3):\\nAdicionar quarto(4):\\n\");\n int caso = verifica();\n switch (caso) {\n case 1://carro\n if (carrosCadastrados.isEmpty()) {\n System.err.println(\"Nao existem carros cadastrados!\\n\");\n } else {\n listarCarros();\n System.err.println(\"Digite o id do carro que deseja contratar:\\n\");\n int idCarro = verifica();\n\n for (int j = 0; j < carrosCadastrados.size(); j++) {\n if (carrosCadastrados.get(j).getId() == idCarro) {\n if (carrosCadastrados.get(j).isEstado()) {\n System.err.println(\"Esse carro já está cadastrado.\\n\");\n } else {\n hospedesCadastrados.get(i).getContrato().setCarros(carrosCadastrados.get(j));\n carrosCadastrados.get(j).setEstado(true);\n }\n }\n }\n }\n break;\n\n case 2://restaurante\n System.err.println(\"Digite o quanto deseja gastar no restaurente\\n\");\n double valorRestaurante = ler.nextDouble();\n// idd();\n// int idRestaurante = id;\n// Restaurante restaurante = new Restaurante(idRestaurante, valorRestaurante);\n hospedesCadastrados.get(i).getContrato().setValorRestaurante(valorRestaurante);\n break;\n case 3://babysitter\n System.err.println(\"Digite o tempo gasto no BabySytter em horas\\n\");\n double tempoBaby = ler.nextDouble();\n hospedesCadastrados.get(i).getContrato().setHorasBaby(tempoBaby);\n break;\n case 4://quartos\n\n if (quartosCadastrados.isEmpty()) {\n\n } else {\n System.err.println(\"Digite o numero do quarto que deseja contratar:\\n\");\n listarQuartos();\n int num = verifica();\n System.err.println(\"Digite a quantidade de dis que pretente alugar o quarto:\\n\");\n int dias = verifica();\n for (int j = 0; j < quartosCadastrados.size(); j++) {\n if (num == quartosCadastrados.get(j).getNumero()) {//verifica se o numero digitado é igual ao numero do quarto do laco\n if (quartosCadastrados.get(j).getEstado()) {//verifica se o estado do quarto está como true\n System.err.println(\"Este quarto já está cadastrado em um contrato\");\n } else {//se o estado tiver em true é porque o quarto ja está cadastrado\n\n hospedesCadastrados.get(i).getContrato().setQuartos(quartosCadastrados.get(j));\n hospedesCadastrados.get(i).getContrato().getQuartosCadastrados().get(j).setDias(dias);\n hospedesCadastrados.get(i).getContrato().getQuartosCadastrados().get(j).setEstado(true);//seta o estado do quarto como ocupado\n System.err.println(\"Quarto cadastrado!\\n\");\n }\n\n }\n\n }\n\n//remove all remove todas as pessoas com tal nome\t\n }\n break;\n\n }\n } else {\n System.err.println(\"O contrato deste Hospede encontra-se encerrado\");\n break;\n }\n }\n }\n }\n }", "public void skratiListu() {\n if (!jePrazna()) {\n int n = Svetovid.in.readInt(\"Unesite broj elemenata za skracivanje: \");\n obrniListu(); //Zato sto se trazi odsecanje poslednjih n elemenata\n while (prvi != null && n > 0) {\n prvi = prvi.veza;\n n--;\n }\n obrniListu(); //Vraca listu u prvobitni redosled\n }\n }", "public Reservation(int id, int showID, String seats, String user) {\n this.ID = id;\n this.showID = showID;\n this.seats = seats;\n this.user = user;\n }", "public void consultasSeguimiento() {\r\n try {\r\n switch (opcionMostrarAnalistaSeguim) {\r\n case \"Cita\":\r\n ListSeguimientoRadicacionesConCita = Rad.ConsultasRadicacionYSeguimiento(2, mBsesion.codigoMiSesion());\r\n break;\r\n case \"Entrega\":\r\n ListSeguimientoRadicacionesConCita = Rad.ConsultasRadicacionYSeguimiento(3, mBsesion.codigoMiSesion());\r\n break;\r\n }\r\n } catch (Exception e) {\r\n mbTodero.setMens(\"Error en el metodo '\" + this.getClass() + \".consultasSeguimiento()' causado por: \" + e.getMessage());\r\n mbTodero.error();\r\n }\r\n\r\n }", "public Reservering zoekReservering(int id){\r\n\t\tReservering terug = null;\r\n\t\ttry{\r\n\t\t\tString sql = \"SELECT * FROM Reservering WHERE reserveringid=\" + id;\r\n\t\t\tStatement stmt = con.createStatement();\r\n\t\t\tResultSet rs = stmt.executeQuery(sql);\r\n\t\t\twhile (rs.next()) { // rs.next() geeft false als er niets meer is\u000b \r\n\t\t\t\tint dP = rs.getInt(\"deParkeerplek\");\r\n\t\t\t\tjava.sql.Date bdat = rs.getDate(\"beginDat\");\r\n\t\t\t\tjava.util.Date bD = new Date(bdat.getTime());\r\n\t\t\t\tjava.sql.Date edat = rs.getDate(\"eindDat\");\r\n\t\t\t\tjava.util.Date eD = new Date(edat.getTime());\r\n\t\t\t\tint autoid = rs.getInt(\"autoid\");\r\n\t\t\t\tString isGeweest = rs.getString(\"isGeweest\");\r\n\t\t\t\tConnectDBAuto autoconn = new ConnectDBAuto(con);\r\n\t\t\t\tAuto a = autoconn.zoekAuto(autoid);\r\n\t\t\t\tterug = new Reservering(a, id, bD, eD, dP);\r\n\t\t\t\tif(isGeweest.equals(\"t\")){\r\n\t\t\t\t\tterug.setGeweest(true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tstmt.close();\r\n\t\t}\r\n\t\tcatch(Exception ex){\r\n\t\t\tSystem.out.println(\"Probleem bij reservering zoeken \" + ex);\r\n\t\t}\r\n\t\treturn terug;\t\t\r\n\t}", "@Override\n public Venta BuscarporID(int ID) {\n DAOUsuarios dao_e = new DAOUsuarios();\n try {\n sql = \"SELECT * FROM VENTA WHERE idventa=\"+ID;\n conex=getConexion();\n pstm=conex.prepareStatement(sql);\n rsset=pstm.executeQuery();\n \n Usuario ne;\n Venta ven = null;\n \n while(rsset.next()){\n int numventa = rsset.getInt(1);\n String fechaE = rsset.getString(4);\n ne = dao_e.BuscarporID(rsset.getInt(2));\n \n List<DET_Venta> compras = Ver_DET_VENTAS(numventa);\n ven = new Venta(rsset.getString(1),rsset.getDouble(5), fechaE, ne,null,compras); \n }\n return ven;\n } catch (SQLException | ClassNotFoundException ex) {\n Logger.getLogger(DAOVentas.class.getName()).log(Level.SEVERE, null, ex);\n }finally{\n try {\n conex.close();\n pstm.close();\n rsset.close();\n } catch (SQLException ex) {\n Logger.getLogger(DAOVentas.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n return null;\n }", "Reserva Obtener();", "Reservation loadReservation(int id) throws DataAccessException;", "@Override\n\tpublic List<Producto> productos(int id) {\n\n\t\tQuery query = entity.createQuery(\"FROM Seccion s WHERE s.id =: id_seccion\",Seccion.class);\n\t\tquery.setParameter(\"id_seccion\", id);\n \n Seccion seccion = (Seccion)query.getSingleResult();\t\n \n return seccion.getProductos();\t\n\t}", "Regione(Terreno tipoTerreno, int ID) {\n\t\tthis.tipoTerreno = tipoTerreno;\n\t\tthis.ID = ID;\n\t\tpecore = new ArrayList<Agnello>();\n\t}", "@Test\n @DisplayName(\"Testataan kaikkien tilausten haku\")\n void getAllReservations() {\n assertEquals(0, reservationsDao.getAllReservations().size());\n\n TablesEntity table1 = new TablesEntity();\n table1.setSeats(2);\n tablesDao.createTable(table1);\n // Test that returns the same number as created reservations\n ReservationsEntity firstReservation = new ReservationsEntity(\"amal\",\"46111222\", new Date(System.currentTimeMillis()), table1.getId(),new Time(1000),new Time(2000));\n reservationsDao.createReservation(firstReservation);\n\n TablesEntity table2 = new TablesEntity();\n table2.setSeats(2);\n tablesDao.createTable(table2);\n reservationsDao.createReservation(new ReservationsEntity(\"juho\", \"46555444\", new Date(System.currentTimeMillis()), table2.getId(), new Time(1000),new Time(2000)));\n\n List<ReservationsEntity> reservations = reservationsDao.getAllReservations();\n assertEquals(2, reservations.size());\n assertEquals(firstReservation, reservations.get(0));\n }", "public void fillPassengersOnPlane(){//private, ändrar till public för grafiska\r\n //int i = 0;\r\n //for (Passenger p : passengers) {//fel med foreach tror jag\r\n for(int i = 0; i < 10; i++){\r\n if (passengers.size() >= 10) {\r\n passengers.get(i).setFirstName(\"Passenger\");//p\r\n passengers.get(i).setLastName(\"Unnamed\" + i);\r\n passengers.get(i).setAge(35 + i);\r\n passengers.get(i).setDestination(getDestination());\r\n passengers.get(i).setSeatNr(i + 1);\r\n if (i < 5) {\r\n passengers.get(i).setTicketPrice(21500);\r\n } else {\r\n passengers.get(i).setTicketPrice(5300);\r\n }\r\n if (seats.size() >= 10) {\r\n seats.get(i).setBooked(true);\r\n seats.get(i).setSeatNumber(i + 1);\r\n seats.get(i).setPassenger(passengers.get(i)); \r\n } else {\r\n seats.add(i, new Seat(i + 1, passengers.get(i)));\r\n }\r\n }\r\n else {\r\n Passenger nyP = new Passenger();\r\n nyP.setFirstName(\"Passenger\");//p\r\n nyP.setLastName(\"Unnamed\" + i);\r\n nyP.setAge(35 + i);\r\n nyP.setDestination(getDestination());\r\n nyP.setSeatNr(i + 1);\r\n if (i < 5) {\r\n nyP.setTicketPrice(21500);\r\n } else {\r\n nyP.setTicketPrice(5300);\r\n }\r\n passengers.add(nyP);\r\n \r\n if (seats.size() >= 10) {\r\n seats.get(i).setBooked(true);\r\n seats.get(i).setSeatNumber(i + 1);\r\n seats.get(i).setPassenger(nyP); \r\n } else {\r\n seats.add(i, new Seat(i + 1, nyP));\r\n }\r\n } \r\n }\r\n }", "private void crearElementos() {\n\n\t\tRotonda rotonda1 = new Rotonda(new Posicion(400, 120), \"5 de octubre\");\n\t\tthis.getListaPuntos().add(rotonda1);\n\n\t\tCiudad esquel = new Ciudad(new Posicion(90, 180), \"Esquel\");\n\t\tthis.getListaPuntos().add(esquel);\n\n\t\tCiudad trelew = new Ciudad(new Posicion(450, 200), \"Trelew\");\n\t\tthis.getListaPuntos().add(trelew);\n\n\t\tCiudad comodoro = new Ciudad(new Posicion(550, 400), \"Comodoro\");\n\t\tthis.getListaPuntos().add(comodoro);\n\n\t\tCiudad rioMayo = new Ciudad(new Posicion(350, 430), \"Rio Mayo\");\n\t\tthis.getListaPuntos().add(rioMayo);\n\n\t\t// --------------------------------------------------------\n\n\t\tRutaDeRipio rutaRipio = new RutaDeRipio(230, 230, rotonda1, esquel);\n\t\tthis.getListaRuta().add(rutaRipio);\n\n\t\tRutaPavimentada rutaPavimentada1 = new RutaPavimentada(380, 100, trelew, comodoro);\n\t\tthis.getListaRuta().add(rutaPavimentada1);\n\n\t\tRutaPavimentada rutaPavimentada2 = new RutaPavimentada(800, 120, esquel, comodoro);\n\t\tthis.getListaRuta().add(rutaPavimentada2);\n\n\t\tRutaDeRipio rutaripio3 = new RutaDeRipio(380, 100, trelew, comodoro);\n\t\tthis.getListaRuta().add(rutaripio3);\n\n\t\tRutaEnConstruccion rutaConst1 = new RutaEnConstruccion(180, 70, rioMayo, comodoro);\n\t\tthis.getListaRuta().add(rutaConst1);\n\n\t\tRutaPavimentada rutaPavimentada3 = new RutaPavimentada(600, 110, rioMayo, esquel);\n\t\tthis.getListaRuta().add(rutaPavimentada3);\n\t}", "Object getDados(long id);", "@Override\r\n\tpublic ReservaBean obtienePorPK(int id) throws Exception {\n\t\treturn null;\r\n\t}", "public void initialiserListeRdvReference(int idEleve){\r\n\r\n\t\tKlisteRdvBDD.loadFromDb(BDD.db,\"select * from assurer_lecon where idELEVE = \"+idEleve+\" order by idAgenda asc\");\r\n\t\t\r\n\t\tKlisteRdvAgenda.loadFromDb(BDD.db,\"select * from agenda where id in (select idAgenda from assurer_lecon where ideleve =\"+idEleve+\") \" +\r\n\t\t\t\t\"order by id asc\");\r\n\t}", "public void tampil_siswa(){\n try {\n Connection con = conek.GetConnection();\n Statement stt = con.createStatement();\n String sql = \"select id from nilai order by id asc\"; // disini saya menampilkan NIM, anda dapat menampilkan\n ResultSet res = stt.executeQuery(sql); // yang anda ingin kan\n \n while(res.next()){\n Object[] ob = new Object[6];\n ob[0] = res.getString(1);\n \n comboId.addItem(ob[0]); // fungsi ini bertugas menampung isi dari database\n }\n res.close(); stt.close();\n \n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }", "public void ConsultaVehiculosSQlite() {\n preguntas = mydb.getCartList();\n for( int i = 0 ; i < preguntas.size() ; i++ ){\n //Toast.makeText(getApplicationContext(), preguntas.get( i ).getPregunta(), Toast.LENGTH_SHORT).show();\n persons.add(new Solicitud(\"Pregunta \" + String.valueOf(i+1) +\": \"+preguntas.get( i ).getPregunta(),\"Fecha: \"+ preguntas.get( i ).getFecha(), R.drawable.solicitudes,\"Motivo: \"+preguntas.get( i ).getMotivo(),\"Observacion: \"+preguntas.get( i ).getObservacion(),\"\"));\n }\n }", "protected void showReservations() {\n storageDao.findAllRented()\n .forEach(System.out::println);\n }", "public List<Reserva> getAllReservas() throws Exception {\n\t\tDAOReserva dao = new DAOReserva();\n\t\tList<Reserva> res;\n\t\ttry \n\t\t{\n\t\t\tthis.conn = darConexion();\n\t\t\tdao.setConn(conn);\n\t\t\tres = dao.getReservas();\n\n\t\t}\n\t\tcatch (SQLException sqlException) {\n\t\t\tSystem.err.println(\"[EXCEPTION] SQLException:\" + sqlException.getMessage());\n\t\t\tsqlException.printStackTrace();\n\t\t\tthrow sqlException;\n\t\t} \n\t\tcatch (Exception exception) {\n\t\t\tSystem.err.println(\"[EXCEPTION] General Exception:\" + exception.getMessage());\n\t\t\texception.printStackTrace();\n\t\t\tthrow exception;\n\t\t} \n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tdao.cerrarRecursos();\n\t\t\t\tif(this.conn!=null){\n\t\t\t\t\tthis.conn.close();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (SQLException exception) {\n\t\t\t\tSystem.err.println(\"[EXCEPTION] SQLException While Closing Resources:\" + exception.getMessage());\n\t\t\t\texception.printStackTrace();\n\t\t\t\tthrow exception;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "public ArrayList<Reserva> getReservasDoVeiculo() {\n\t\treturn reservasDoVeiculo;\n\t}", "public Reserva(){super();}", "private void caricaLista() {\n /** variabili e costanti locali di lavoro */\n ArrayList unaLista = null;\n CampoDati unCampoDati = null;\n CDBLinkato unCampoDBLinkato = null;\n //@todo da cancellare\n try { // prova ad eseguire il codice\n /* recupera il campo DB specializzato */\n unCampoDBLinkato = (CDBLinkato)unCampoParente.getCampoDB();\n\n /* recupera la lista dal campo DB */\n unaLista = unCampoDBLinkato.caricaLista();\n\n /* recupera il campo dati */\n unCampoDati = unCampoParente.getCampoDati();\n\n /* registra i valori nel modello dei dati del campo */\n if (unaLista != null) {\n unCampoDati.setValoriInterni(unaLista);\n// unCampoDatiElenco.regolaElementiAggiuntivi();\n } /* fine del blocco if */\n\n } catch (Exception unErrore) { // intercetta l'errore\n /* mostra il messaggio di errore */\n Errore.crea(unErrore);\n } /* fine del blocco try-catch */\n\n }", "public void llenarVuelos()\n\t{\n\t\tResultSet resultado = null;\n\t\ttry\n\t\t{\n\t\t\tvuelos.removeAllItems();\n\t\t\tresultado = controladorBD.consultarVuelos();\n\n\t\t\twhile (resultado.next())\n\t\t\t{\n\t\t\t\tString id = resultado.getString(\"vuelo_id\");\n\t\t\t\tDate fecha = resultado.getDate(\"fecha\");\n\t\t\t\tint cupoMax = resultado.getInt(\"cupoMax\");\n\t\t\t\tString origen = resultado.getString(\"origen\");\n\t\t\t\tString destino = resultado.getString(\"destino\");\n\t\t\t\tint cupoActual = resultado.getInt(\"cupo_actual\");\n\t\t\t\tString hora = resultado.getString(\"hora\");\n\n\t\t\t\tVuelo v = new Vuelo(id, fecha, cupoMax, origen, destino, cupoActual, hora);\n\t\t\t\tvuelos.addItem(v);\n\t\t\t}\n\n\t\t} catch (ClassNotFoundException e)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(PanelPasabordoVendedor.this, \"Error obteniendo vuelos\");\n\t\t} catch (SQLException e)\n\t\t{\n\t\t\tJOptionPane.showMessageDialog(PanelPasabordoVendedor.this, \"Error obteniendo vuelos\");\n\t\t} finally\n\t\t{\n\t\t\tif (resultado != null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tresultado.close();\n\t\t\t\t} catch (SQLException e)\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showMessageDialog(PanelPasabordoVendedor.this, \"Error cerrando la conexión\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public Venda Buscar(int id) {\n Venda v;\n\n v = em.find(Venda.class, id);\n\n// transaction.commit();\n return v;\n }", "@Override\n\t/*Método para usarse en el momento de ver las reservas de un determinado usuaario en el panel del mismo*/\n\tpublic String verReservas(String nombreusuario) {\n\t\tGson json= new Gson(); \n\t\tDBConnection con = new DBConnection();\n\t\tString sql =\"Select * from alquileres alq, peliculas p where alq.pelicula=p.id and alq.usuario LIKE '\"+nombreusuario+\"' order by p.titulo\"; //Seleccion de los alquileres relacionados con el usuario \n\t\ttry {\n\t\t\t\n\t\t\tArrayList<Alquiler> datos= new ArrayList<Alquiler>(); //ArrayList que va a almacenar los alquileres del usuario\n\t\t\t\n\t\t\tStatement st = con.getConnection().createStatement();\n\t\t\tResultSet rs = st.executeQuery(sql);\n\t\t\t\n\t\t\t//Se cogen los datos necesarios \n\t\t\twhile(rs.next()) {\n\t\t\t\tString idpelicula=rs.getString(\"id\");\n\t\t\t\tint numero_alquiler=rs.getInt(\"numero_alquiler\");\n\t\t\t\tString fecha=rs.getString(\"fecha_alquiler\");\n\t\t\t\tString titulo= rs.getString(\"titulo\"); \n\t\t\t\tString genero= rs.getString(\"genero\"); \n\t\t\t\tString cadenaestreno=rs.getString(\"estreno\");\n\t\t\t\tString estreno=\"\"; \n\t\t\t\t\n\t\t\t\t//comprobación y asignación del atributo estreno:\n\t\t\t\t/*Como en la base de datos se guarda como una cadena de texto, cuando se devuelve\n\t\t\t\t * hay que comprobar su valor y dependiendo del que sea pasarlo a una cadena para pasarla a la clase \n\t\t\t\t * Alquiler*/\n\t\t\t\t\n\t\t\t\tif(cadenaestreno.equals(\"true\")) {\n\t\t\t\t\testreno=\"Si\";\n\t\t\t\t}else if(cadenaestreno.equals(\"false\")) {\n\t\t\t\t\testreno=\"No\";\n\t\t\t\t}\n\t\t\t\tAlquiler alquiler=new Alquiler(numero_alquiler,idpelicula,fecha,titulo,genero,estreno); //uso esta clase para poder enviar los datos\n\t\t\t\tdatos.add(alquiler); //añado el alquiler a los datos que se van a devolver\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tst.close();\n\t\treturn json.toJson(datos); //devuelvo la lista de los datos en JSON \n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\treturn e.getMessage();\n\t\t}finally {\n\t\t\tcon.desconectar();\n\t\t}\n\t}", "private void storeDisplayedStageplaats(){\n if (this.geselecteerdeStageplaats == null){\n this.geselecteerdeStageplaats = new Stageplaats();\n }\n \n this.geselecteerdeStageplaats.setTitel(this.jTextFieldTitel.getText());\n this.geselecteerdeStageplaats.setOmschrijving(this.jTextAreaOmschrijving.getText());\n this.geselecteerdeStageplaats.setAantalPlaatsen(this.jSliderAantalPlaatsen.getValue());\n this.geselecteerdeStageplaats.setPeriode(this.jTextFieldPeriode.getText());\n this.geselecteerdeStageplaats.setBegeleiding(this.jTextAreaBegeleiding.getText());\n this.geselecteerdeStageplaats.setExtraKennisVereist(this.jTextAreaVereisteKennis.getText());\n this.geselecteerdeStageplaats.setVoorzieningen(this.jTextAreaVoorzieningen.getText());\n this.geselecteerdeStageplaats.setSitueertID((Situeert)this.jComboBoxSitueert.getSelectedItem());\n this.geselecteerdeStageplaats.getSitueertID().setSpecialisatieID((Specialisatie)this.jComboBoxSpecialisatie.getSelectedItem());\n \n }", "private void buscar (String valor){\n try {\n int f,i;\n conn=App.ConnectionBd.Enlace(conn);\n String sql1=\"Select * from Reserva where idReserva like '%\"+valor+\"%' or tipoReserva like '%\"+valor+\"%';\";\n \n Statement st1=conn.createStatement();\n ResultSet rs1=st1.executeQuery(sql1);\n String datos[]=new String[7];\n f=datostabla.getRowCount();\n if(f>0)\n for(i=0;i<f;i++)\n datostabla.removeRow(0);\n while(rs1.next()) {\n datos[0]=(String)rs1.getString(1);\n datos[1]=(String)rs1.getString(2);\n datos[2]=(String)rs1.getString(3);\n datos[3]=(String)rs1.getString(5);\n datos[4]=(String)rs1.getString(6);\n datos[5]=(String)rs1.getString(7);\n datos[6]=(String)rs1.getString(9);\n datostabla.addRow(datos);\n }\n conn.close();\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(null, \"Error al buscar datos, verifique porfavor\");\n }\n }", "@Override\n public Pessoa buscar(int id) {\n try {\n for (Pessoa p : pessoa.getPessoas()){\n if(p.getCodPessoa()== id){\n return p;\n }\n }\n } catch (Exception ex) {\n Logger.getLogger(AnimalDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "public ArrayList<VMSpDatosPuestosAlquilados> GetStallsPerRental(int idClient){\n ArrayList<VMSpDatosPuestosAlquilados> s = new ArrayList<VMSpDatosPuestosAlquilados>();\n try {\n Statement stmt = conn.createStatement();\n ResultSet query = stmt.executeQuery(\"sp_mostrar_datos_puestos_alquilados_por_cliente \" + idClient);\n while (query.next()) {\n VMSpDatosPuestosAlquilados vm = new VMSpDatosPuestosAlquilados();\n vm.setPiso(query.getInt(\"Piso\"));\n vm.setCantidad_de_computadoras(query.getInt(\"Cantidad de computadoras\"));\n vm.setCantidad_de_sillas(query.getString(\"Cantidad sillas\"));\n vm.setTiene_ventana(query.getString(\"Tiene ventana?\"));\n vm.setTiene_acesso_a_sala_de_reuniones(query.getString(\"Tiene acesso a sala de reuniones?\"));\n vm.setPrecio_mensual(query.getDouble(\"Precio mensual\"));\n vm.setFecha_de_alquiler(query.getString(\"Fecha de alquiler\"));\n s.add(vm);\n }\n query.close();\n stmt.close();\n conn.close();\n } catch (SQLException ex) {\n Logger.getLogger(ClientManager.class.getName()).log(Level.SEVERE, null, ex);\n }\n return s;\n }", "private void atualizarTela() {\n\t\tSystem.out.println(\"\\n*** Refresh da Pagina / Consultando Todos os Registro da Tabela Paciente\\n\");\n\t\tpaciente = new Paciente();\n\t\tlistaPaciente = pacienteService.buscarTodos();\n\t\t\n\t}", "private void cargarAutos() {\n Auto autos[]={\n new Auto(\"Bocho\",\"1994\"),\n new Auto(\"Jetta\",\"1997\"),\n new Auto(\"Challenger\",\"2011\"),\n new Auto(\"Ferrari\",\"2003\")\n };\n for (Auto auto : autos) {\n cboAutos.addItem(auto);\n \n }\n spnIndice.setModel(new SpinnerNumberModel(0, 0, autos.length-1, 1));\n }", "public List<Anuncio> getAnuncios(String idRevista) throws Exception{\n List<Anuncio> artigos = new ArrayList<>();\n Anuncio a = null;\n String idR, titulo, conteudo, categoria,nrConsultas,contacto,empresaID;\n\n try{\n connection = con.connect();\n PreparedStatement\n stm = connection.prepareStatement(\"SELECT Anuncio_ID FROM AnuncioRevista \" +\n \"WHERE Revista_ID = \" + idRevista);\n ResultSet rs = stm.executeQuery();\n ResultSet r;\n while(rs.next()){\n stm = connection.prepareStatement(\"SELECT * FROM Anuncio \" +\n \"WHERE ID = \" + rs.getString(\"Anuncio_ID\"));\n r = stm.executeQuery();\n if(r.next()){\n idR = r.getString(\"ID\");\n titulo = r.getString(\"Titulo\");\n conteudo = r.getString(\"Conteudo\");\n categoria = r.getString(\"Categoria\");\n nrConsultas = r.getString(\"NrConsultas\");\n contacto = r.getString(\"Contacto\");\n empresaID = r.getString(\"Empresa_ID\");\n a = new Anuncio(idR,titulo,conteudo,categoria,nrConsultas,contacto,empresaID);\n artigos.add(a);\n }\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n finally {\n con.close(connection);\n }\n return artigos;\n }", "public ArrayList<String> consultar(){\n PreparedStatement ps = null;\n ResultSet rs = null;\n Connection con = getConexion();\n PlanDeEstudio plan = new PlanDeEstudio();\n ArrayList<String> planes = new ArrayList<>();\n \n String sql = \"SELECT * FROM plan_estudio\";\n \n try{\n ps = con.prepareStatement(sql);\n rs = ps.executeQuery();\n \n while (rs.next()) {\n plan.setiD(Integer.parseInt((rs.getString(\"id_plan_estudio\"))));\n planes.add(Integer.toString((plan.getiD())));\n }\n return planes;\n \n }catch (SQLException e){\n System.err.println(e);\n return planes;\n \n } finally {\n try {\n con.close();\n } catch (SQLException e){\n System.err.println(e);\n }\n }\n }", "public List<Reservation> findReservations(ReservableRoomId reservableRoomId) {\n\n return reservationRepository.findByReservableRoomReservableRoomIdOrderByStartTimeAsc(reservableRoomId);\n\n }", "public void fill_table()\n {\n Secante secante = new Secante(GraficaSecanteController.a, GraficaSecanteController.b, GraficaSecanteController.ep, FuncionController.e);\n list = secante.algoritmo();\n }", "public List<Artigo> getArtigos(String idRevista){\n List<Artigo> artigos = new ArrayList<>();\n Artigo a;\n String id, revistaID, titulo, corpo, nrConsultas,categoria;\n LocalDate data;\n\n try{\n connection = con.connect();\n PreparedStatement\n stm = connection.prepareStatement(\"SELECT * FROM Artigo \" +\n \"INNER JOIN Revista ON Artigo.Revista_ID = Revista.ID \" +\n \"WHERE Artigo.Revista_ID = \" + idRevista);\n ResultSet rs = stm.executeQuery();\n while(rs.next()){\n id = rs.getString(\"ID\");\n revistaID = rs.getString(\"Revista_ID\");\n data = rs.getDate(\"Data\").toLocalDate();\n titulo = rs.getString(\"Titulo\");\n corpo = rs.getString(\"Corpo\");\n nrConsultas = rs.getString(\"NrConsultas\");\n categoria = rs.getString(\"Categoria\");\n a = new Artigo(id,revistaID,data,titulo,corpo,nrConsultas, categoria);\n artigos.add(a);\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n finally {\n con.close(connection);\n }\n return artigos;\n }", "public List<SalesItems> toListSalesItems(int vendaId){\n \n List<SalesItems> list = new ArrayList<>();\n String sql = \"select i.id, p.descricao, i.qtd, p.preco, \"\n + \"i.subtotal from tb_itensvendas as i \"\n + \"inner join tb_produtos as p on(i.produto_id = p.id) \"\n + \"where i.venda_id = ? \";\n \n try{\n \n PreparedStatement st = conn.prepareStatement(sql);\n \n st.setInt(1, vendaId);\n \n \n ResultSet rs = st.executeQuery();\n \n while(rs.next()){\n SalesItems item = new SalesItems();\n Product product = new Product();\n \n item.setId(rs.getInt(\"i.id\"));\n product.setDescricao(rs.getString(\"p.descricao\"));\n item.setQtd(rs.getInt(\"i.qtd\"));\n product.setPreco(rs.getDouble(\"p.preco\"));\n item.setSubtotal(rs.getDouble(\"i.subtotal\"));\n \n \n \n \n \n item.setProduto(product);\n \n list.add(item);\n \n }\n \n return list;\n \n }\n catch(SQLException error){\n JOptionPane.showMessageDialog(null, \"Erro: \" + error);\n return null;\n }\n }", "public static void makeReservation(int i){\n setChanged(i,\"reserved\");\n setReserved(true);\n }", "public Imovel consultarImovelDadosCadastrais(Integer idImovel) throws ControladorException {\r\n\r\n\t\tImovel imovel = null;\r\n\t\tCollection colecaoImovel = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tcolecaoImovel = this.repositorioImovel.consultarImovelDadosCadastrais(idImovel);\r\n\r\n\t\t} catch (ErroRepositorioException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t\tthrow new ControladorException(\"erro.sistema\", ex);\r\n\t\t}\r\n\r\n\t\tif (colecaoImovel != null && !colecaoImovel.isEmpty()) {\r\n\r\n\t\t\timovel = new Imovel();\r\n\r\n\t\t\timovel.setId(idImovel);\r\n\r\n\t\t\tQuadra quadra = new Quadra();\r\n\r\n\t\t\tIterator imovelIterator = colecaoImovel.iterator();\r\n\r\n\t\t\tObject[] arrayImovel = (Object[]) imovelIterator.next();\r\n\r\n\t\t\tLigacaoAguaSituacao ligacaoAguaSituacao = null;\r\n\t\t\t// id ligacaoAguaSituacao - 0\r\n\t\t\tif (arrayImovel[0] != null) {\r\n\t\t\t\tligacaoAguaSituacao = new LigacaoAguaSituacao();\r\n\r\n\t\t\t\tligacaoAguaSituacao.setDescricao((String) arrayImovel[0]);\r\n\t\t\t\timovel.setLigacaoAguaSituacao(ligacaoAguaSituacao);\r\n\t\t\t}\r\n\r\n\t\t\tLigacaoEsgotoSituacao ligacaoEsgotoSituacao = null;\r\n\t\t\t// id ligacaoEsgotoSituacao - 1\r\n\t\t\tif (arrayImovel[1] != null) {\r\n\t\t\t\tligacaoEsgotoSituacao = new LigacaoEsgotoSituacao();\r\n\r\n\t\t\t\tligacaoEsgotoSituacao.setDescricao((String) arrayImovel[1]);\r\n\t\t\t\timovel.setLigacaoEsgotoSituacao(ligacaoEsgotoSituacao);\r\n\t\t\t}\r\n\r\n\t\t\tImovelPerfil imovelPerfil = null;\r\n\t\t\t// descricao imovelPerfil - 2\r\n\t\t\tif (arrayImovel[2] != null) {\r\n\t\t\t\timovelPerfil = new ImovelPerfil();\r\n\r\n\t\t\t\timovelPerfil.setDescricao((String) arrayImovel[2]);\r\n\t\t\t\timovel.setImovelPerfil(imovelPerfil);\r\n\t\t\t}\r\n\r\n\t\t\tDespejo despejo = null;\r\n\t\t\t// descricao despejo - 3\r\n\t\t\tif (arrayImovel[3] != null) {\r\n\t\t\t\tdespejo = new Despejo();\r\n\r\n\t\t\t\tdespejo.setDescricao((String) arrayImovel[3]);\r\n\t\t\t\timovel.setDespejo(despejo);\r\n\t\t\t}\r\n\r\n\t\t\t// area construida - 4\r\n\t\t\tif (arrayImovel[4] != null) {\r\n\t\t\t\timovel.setAreaConstruida((BigDecimal) arrayImovel[4]);\r\n\t\t\t}\r\n\r\n\t\t\t// area construida faixa - menor 5\r\n\t\t\tAreaConstruidaFaixa areaConstruidaFaixa = null;\r\n\t\t\tif (arrayImovel[5] != null) {\r\n\t\t\t\tareaConstruidaFaixa = new AreaConstruidaFaixa();\r\n\t\t\t\tareaConstruidaFaixa.setMenorFaixa((Integer) arrayImovel[5]);\r\n\t\t\t}\r\n\r\n\t\t\t// area construida faixa - maior 6\r\n\t\t\tif (arrayImovel[6] != null) {\r\n\t\t\t\tif (areaConstruidaFaixa == null) {\r\n\t\t\t\t\tareaConstruidaFaixa = new AreaConstruidaFaixa();\r\n\t\t\t\t}\r\n\t\t\t\tareaConstruidaFaixa.setMaiorFaixa((Integer) arrayImovel[6]);\r\n\t\t\t}\r\n\r\n\t\t\timovel.setAreaConstruidaFaixa(areaConstruidaFaixa);\r\n\r\n\t\t\t// testada do lote - 7\r\n\t\t\tif (arrayImovel[7] != null) {\r\n\t\t\t\timovel.setTestadaLote((Short) arrayImovel[7]);\r\n\t\t\t}\r\n\r\n\t\t\t// volumente reservatorio inferior 8\r\n\t\t\tif (arrayImovel[8] != null) {\r\n\t\t\t\timovel.setVolumeReservatorioInferior((BigDecimal) arrayImovel[8]);\r\n\t\t\t}\r\n\r\n\t\t\t// Volume Reservatorio Inferior - menor 9\r\n\t\t\tReservatorioVolumeFaixa reservatorioVolumeFaixaInferior = null;\r\n\t\t\tif (arrayImovel[9] != null) {\r\n\t\t\t\treservatorioVolumeFaixaInferior = new ReservatorioVolumeFaixa();\r\n\t\t\t\treservatorioVolumeFaixaInferior.setVolumeMenorFaixa((BigDecimal) arrayImovel[9]);\r\n\t\t\t}\r\n\r\n\t\t\t// Volume Reservatorio Inferior - maior 10\r\n\t\t\tif (arrayImovel[10] != null) {\r\n\t\t\t\tif (reservatorioVolumeFaixaInferior == null) {\r\n\t\t\t\t\treservatorioVolumeFaixaInferior = new ReservatorioVolumeFaixa();\r\n\t\t\t\t}\r\n\t\t\t\treservatorioVolumeFaixaInferior.setVolumeMaiorFaixa((BigDecimal) arrayImovel[10]);\r\n\t\t\t}\r\n\r\n\t\t\timovel.setReservatorioVolumeFaixaInferior(reservatorioVolumeFaixaInferior);\r\n\r\n\t\t\t// volumente reservatorio superior 11\r\n\t\t\tif (arrayImovel[11] != null) {\r\n\t\t\t\timovel.setVolumeReservatorioSuperior((BigDecimal) arrayImovel[11]);\r\n\t\t\t}\r\n\r\n\t\t\t// Volume Reservatorio Superior - menor 12\r\n\t\t\tReservatorioVolumeFaixa reservatorioVolumeFaixaSuperior = null;\r\n\t\t\tif (arrayImovel[12] != null) {\r\n\t\t\t\treservatorioVolumeFaixaSuperior = new ReservatorioVolumeFaixa();\r\n\t\t\t\treservatorioVolumeFaixaSuperior.setVolumeMenorFaixa((BigDecimal) arrayImovel[12]);\r\n\t\t\t}\r\n\r\n\t\t\t// Volume Reservatorio Superior - maior 13\r\n\t\t\tif (arrayImovel[13] != null) {\r\n\t\t\t\tif (reservatorioVolumeFaixaSuperior == null) {\r\n\t\t\t\t\treservatorioVolumeFaixaSuperior = new ReservatorioVolumeFaixa();\r\n\t\t\t\t}\r\n\t\t\t\treservatorioVolumeFaixaSuperior.setVolumeMaiorFaixa((BigDecimal) arrayImovel[13]);\r\n\t\t\t}\r\n\r\n\t\t\timovel.setReservatorioVolumeFaixaSuperior(reservatorioVolumeFaixaSuperior);\r\n\r\n\t\t\t// Volume Piscina - 14\r\n\t\t\tif (arrayImovel[14] != null) {\r\n\t\t\t\timovel.setVolumePiscina((BigDecimal) arrayImovel[14]);\r\n\t\t\t}\r\n\r\n\t\t\t// Volume Piscina - menor 15\r\n\t\t\tPiscinaVolumeFaixa piscinaVolumeFaixa = null;\r\n\t\t\tif (arrayImovel[15] != null) {\r\n\t\t\t\tpiscinaVolumeFaixa = new PiscinaVolumeFaixa();\r\n\t\t\t\tpiscinaVolumeFaixa.setVolumeMenorFaixa((BigDecimal) arrayImovel[15]);\r\n\t\t\t}\r\n\r\n\t\t\t// Volume Piscina - maior 16\r\n\t\t\tif (arrayImovel[16] != null) {\r\n\t\t\t\tif (piscinaVolumeFaixa == null) {\r\n\t\t\t\t\tpiscinaVolumeFaixa = new PiscinaVolumeFaixa();\r\n\t\t\t\t}\r\n\t\t\t\tpiscinaVolumeFaixa.setVolumeMaiorFaixa((BigDecimal) arrayImovel[16]);\r\n\t\t\t}\r\n\r\n\t\t\timovel.setPiscinaVolumeFaixa(piscinaVolumeFaixa);\r\n\r\n\t\t\t// Fonte Abastecimento- 17\r\n\t\t\tFonteAbastecimento fonteAbastecimento = null;\r\n\t\t\tif (arrayImovel[17] != null) {\r\n\t\t\t\tfonteAbastecimento = new FonteAbastecimento();\r\n\t\t\t\tfonteAbastecimento.setDescricao((String) arrayImovel[17]);\r\n\t\t\t\timovel.setFonteAbastecimento(fonteAbastecimento);\r\n\t\t\t}\r\n\r\n\t\t\t// Poco Tipo- 18\r\n\t\t\tPocoTipo pocoTipo = null;\r\n\t\t\tif (arrayImovel[18] != null) {\r\n\t\t\t\tpocoTipo = new PocoTipo();\r\n\t\t\t\tpocoTipo.setDescricao((String) arrayImovel[18]);\r\n\t\t\t\timovel.setPocoTipo(pocoTipo);\r\n\t\t\t}\r\n\r\n\t\t\t// Distrito Operacional- 19\r\n\t\t\tDistritoOperacional distritoOperacional = null;\r\n\t\t\tif (arrayImovel[19] != null) {\r\n\t\t\t\tdistritoOperacional = new DistritoOperacional();\r\n\t\t\t\tdistritoOperacional.setDescricao((String) arrayImovel[19]);\r\n\r\n\t\t\t\tquadra.setDistritoOperacional(distritoOperacional);\r\n\t\t\t}\r\n\r\n\t\t\t// Pavimento Rua- 20\r\n\t\t\tPavimentoRua pavimentoRua = null;\r\n\t\t\tif (arrayImovel[20] != null) {\r\n\t\t\t\tpavimentoRua = new PavimentoRua();\r\n\t\t\t\tpavimentoRua.setDescricao((String) arrayImovel[20]);\r\n\t\t\t\timovel.setPavimentoRua(pavimentoRua);\r\n\t\t\t}\r\n\r\n\t\t\t// Pavimento Cal�ada- 21\r\n\t\t\tPavimentoCalcada pavimentoCalcada = null;\r\n\t\t\tif (arrayImovel[21] != null) {\r\n\t\t\t\tpavimentoCalcada = new PavimentoCalcada();\r\n\t\t\t\tpavimentoCalcada.setDescricao((String) arrayImovel[21]);\r\n\t\t\t\timovel.setPavimentoCalcada(pavimentoCalcada);\r\n\t\t\t}\r\n\r\n\t\t\t// Numero IPTU- 22\r\n\t\t\tif (arrayImovel[22] != null) {\r\n\t\t\t\timovel.setNumeroIptu((String) arrayImovel[22]);\r\n\t\t\t}\r\n\r\n\t\t\t// Numero CELPE- 23\r\n\t\t\tif (arrayImovel[23] != null) {\r\n\t\t\t\timovel.setNumeroCelpe((Long) arrayImovel[23]);\r\n\t\t\t}\r\n\r\n\t\t\t// Coordenada X- 24\r\n\t\t\tif (arrayImovel[24] != null) {\r\n\t\t\t\timovel.setCoordenadaX((String) arrayImovel[24]);\r\n\t\t\t}\r\n\t\t\t// Coordenada Y- 25\r\n\t\t\tif (arrayImovel[25] != null) {\r\n\t\t\t\timovel.setCoordenadaY((String) arrayImovel[25]);\r\n\t\t\t}\r\n\r\n\t\t\t// Cadastro Ocorrencia- 26\r\n\t\t\tCadastroOcorrencia cadastroOcorrencia = null;\r\n\t\t\tif (arrayImovel[26] != null) {\r\n\t\t\t\tcadastroOcorrencia = new CadastroOcorrencia();\r\n\t\t\t\tcadastroOcorrencia.setDescricao((String) arrayImovel[26]);\r\n\t\t\t\timovel.setCadastroOcorrencia(cadastroOcorrencia);\r\n\t\t\t}\r\n\t\t\t// Elo Anormalidade- 27\r\n\t\t\tEloAnormalidade eloAnormalidade = null;\r\n\t\t\tif (arrayImovel[27] != null) {\r\n\t\t\t\teloAnormalidade = new EloAnormalidade();\r\n\t\t\t\teloAnormalidade.setDescricao((String) arrayImovel[27]);\r\n\t\t\t\timovel.setEloAnormalidade(eloAnormalidade);\r\n\t\t\t}\r\n\r\n\t\t\t// Indicador Imovel Condominio- 28\r\n\t\t\tif (arrayImovel[28] != null) {\r\n\t\t\t\timovel.setIndicadorImovelCondominio((Short) arrayImovel[28]);\r\n\t\t\t}\r\n\r\n\t\t\t// Imovel Condominio- 29\r\n\t\t\tImovel imovelCondominio = null;\r\n\t\t\tif (arrayImovel[29] != null) {\r\n\t\t\t\timovelCondominio = new Imovel();\r\n\t\t\t\timovelCondominio.setId((Integer) arrayImovel[29]);\r\n\t\t\t\timovel.setImovelCondominio(imovelCondominio);\r\n\t\t\t}\r\n\r\n\t\t\t// Imovel Principal- 30\r\n\t\t\tImovel imovelPrincipal = null;\r\n\t\t\tif (arrayImovel[30] != null) {\r\n\t\t\t\timovelPrincipal = new Imovel();\r\n\t\t\t\timovelPrincipal.setId((Integer) arrayImovel[30]);\r\n\t\t\t\timovel.setImovelPrincipal(imovelPrincipal);\r\n\t\t\t}\r\n\r\n\t\t\t// Numero Pontos Utilizacao- 31\r\n\t\t\tif (arrayImovel[31] != null) {\r\n\t\t\t\timovel.setNumeroPontosUtilizacao((Short) arrayImovel[31]);\r\n\t\t\t}\r\n\r\n\t\t\t// Numero Moradores- 32\r\n\t\t\tif (arrayImovel[32] != null) {\r\n\t\t\t\timovel.setNumeroMorador((Short) arrayImovel[32]);\r\n\t\t\t}\r\n\r\n\t\t\t// Jardim- 33\r\n\t\t\tif (arrayImovel[33] != null) {\r\n\t\t\t\timovel.setIndicadorJardim((Short) arrayImovel[33]);\r\n\t\t\t}\r\n\r\n\t\t\t// Divis�o de Esgoto- 34\r\n\t\t\tBacia bacia = null;\r\n\t\t\tif (arrayImovel[34] != null) {\r\n\t\t\t\tbacia = new Bacia();\r\n\t\t\t\tbacia.setDescricao((String) arrayImovel[34]);\r\n\r\n\t\t\t\t// Divis�o de Esgoto\r\n\t\t\t\tif (arrayImovel[36] != null) {\r\n\t\t\t\t\tSistemaEsgoto sistemaEsgoto = new SistemaEsgoto();\r\n\t\t\t\t\tDivisaoEsgoto divisaoEsgoto = new DivisaoEsgoto();\r\n\r\n\t\t\t\t\tdivisaoEsgoto.setDescricao((String) arrayImovel[36]);\r\n\r\n\t\t\t\t\tsistemaEsgoto.setDivisaoEsgoto(divisaoEsgoto);\r\n\t\t\t\t\tbacia.setSistemaEsgoto(sistemaEsgoto);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tquadra.setBacia(bacia);\r\n\t\t\t}\r\n\t\t\timovel.setQuadra(quadra);\r\n\r\n\t\t\t// Tipo Habita��o - 37\r\n\t\t\tif (arrayImovel[37] != null) {\r\n\t\t\t\tImovelTipoHabitacao imovelTipoHabitacao = new ImovelTipoHabitacao();\r\n\t\t\t\timovelTipoHabitacao.setDescricao((String) arrayImovel[37]);\r\n\t\t\t\timovel.setImovelTipoHabitacao(imovelTipoHabitacao);\r\n\t\t\t}\r\n\r\n\t\t\t// Tipo Propriedade - 38\r\n\t\t\tif (arrayImovel[38] != null) {\r\n\t\t\t\tImovelTipoPropriedade imovelTipoPropriedade = new ImovelTipoPropriedade();\r\n\t\t\t\timovelTipoPropriedade.setDescricao((String) arrayImovel[38]);\r\n\t\t\t\timovel.setImovelTipoPropriedade(imovelTipoPropriedade);\r\n\t\t\t}\r\n\r\n\t\t\t// Tipo Contrucao - 39\r\n\t\t\tif (arrayImovel[39] != null) {\r\n\t\t\t\tImovelTipoConstrucao imovelTipoConstrucao = new ImovelTipoConstrucao();\r\n\t\t\t\timovelTipoConstrucao.setDescricao((String) arrayImovel[39]);\r\n\t\t\t\timovel.setImovelTipoConstrucao(imovelTipoConstrucao);\r\n\t\t\t}\r\n\r\n\t\t\t// Tipo Cobertura - 40\r\n\t\t\tif (arrayImovel[40] != null) {\r\n\t\t\t\tImovelTipoCobertura imovelTipoCobertura = new ImovelTipoCobertura();\r\n\t\t\t\timovelTipoCobertura.setDescricao((String) arrayImovel[40]);\r\n\t\t\t\timovel.setImovelTipoCobertura(imovelTipoCobertura);\r\n\t\t\t}\r\n\r\n\t\t\t// Indicador Exclus�o - 41\r\n\t\t\tif (arrayImovel[41] != null) {\r\n\t\t\t\timovel.setIndicadorExclusao((Short) arrayImovel[41]);\r\n\t\t\t}\r\n\r\n\t\t\t// Nome Imovel - 42\r\n\t\t\tif (arrayImovel[42] != null) {\r\n\t\t\t\timovel.setNomeImovel((String) arrayImovel[42]);\r\n\t\t\t}\r\n\r\n\t\t\t// Municipio - 43\r\n\t\t\tif (arrayImovel[43] != null) {\r\n\t\t\t\tLocalidade localidade = new Localidade();\r\n\t\t\t\tMunicipio municipio = (Municipio) arrayImovel[43];\r\n\t\t\t\tlocalidade.setMunicipio(municipio);\r\n\t\t\t\timovel.setLocalidade(localidade);\r\n\t\t\t}\r\n\t\t\t// Indicador Exclus�o - 44\r\n\t\t\tif (arrayImovel[41] != null) {\r\n\t\t\t\timovel.setIndicadorNivelInstalacaoEsgoto((Short) arrayImovel[44]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn imovel;\r\n\t}", "public static ArrayList<Vkladi> idPoiskVkladi() {\r\n\t\tArrayList<Vkladi> foundVkladi = new ArrayList<Vkladi>();\r\n\r\n\t\tint i = 0;\r\n\t\tScanner n = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Vvedite Id\");\r\n\t\tint t = n.nextInt();\r\n\t\tfor (Vkladi vkla : vklad) {\r\n\t\t\tif (vkla.getId() == t) {\r\n\t\t\t\tfoundVkladi.add(vkla);\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn foundVkladi;\r\n\t}", "@Override\n public ModeloCuestionario visualizarModelo(Integer id) {\n ModeloCuestionario visualiza = modeloCuestionarioRepository.findOne(id);\n List<AreasCuestionario> listaAreas = areaCuestionarioService\n .findDistinctByIdCuestionarioAndFechaBajaIsNullOrderByOrdenAsc(id);\n for (AreasCuestionario area : listaAreas) {\n List<PreguntasCuestionario> listaPreguntas = preguntasRepository\n .findByAreaAndFechaBajaIsNullOrderByOrdenAsc(area);\n area.setPreguntas(listaPreguntas);\n }\n visualiza.setAreas(listaAreas);\n return visualiza;\n }", "public void setIdLocacion(Integer idLocacion);", "@Override\n public Collection<resumenSemestre> resumenSemestre(int idCurso, int mesApertura, int mesCierre) throws Exception {\n Collection<resumenSemestre> retValue = new ArrayList();\n Connection c = null;\n PreparedStatement pstmt = null;\n ResultSet rs = null;\n try {\n c = DBUtils.getConnection();\n pstmt = c.prepareStatement(\"select ma.nombremateria, p.idcuestionario as test, \"\n + \"round(avg(p.puntaje),2) as promedio, cue.fechainicio, MONTH(cue.fechacierre) as mes \"\n + \"from puntuaciones p, cuestionario cue, curso cu, materia ma \"\n + \"where cu.idcurso = ma.idcurso and ma.idmateria = cue.idmateria \"\n + \"and cue.idcuestionario = p.idcuestionario and cu.idcurso = ? \"\n + \"and MONTH(cue.fechacierre) >= ? AND MONTH(cue.fechacierre) <= ? and YEAR(cue.fechacierre) = YEAR(NOW())\"\n + \"GROUP by ma.nombremateria, MONTH(cue.fechacierre) ORDER BY ma.nombremateria\");\n pstmt.setInt(1, idCurso );\n pstmt.setInt(2, mesApertura);\n pstmt.setInt(3, mesCierre);\n rs = pstmt.executeQuery();\n while (rs.next()) { \n retValue.add(new resumenSemestre(rs.getString(\"nombremateria\"), rs.getInt(\"test\"), rs.getInt(\"promedio\"), rs.getInt(\"mes\")));\n }\n return retValue;\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if (rs != null) {\n rs.close();\n }\n if (pstmt != null) {\n pstmt.close();\n }\n DBUtils.closeConnection(c);\n } catch (SQLException ex) {\n Logger.getLogger(JdbcCursoRepository.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n return retValue;\n\n\n }", "public ArrayList<String> ObtenerDestinatariosAnuncio(int id){\n ArrayList<String> destinatarios = new ArrayList<String>();\n try{\n Connection conect = getConection();\n Properties sqlProp = new Properties();\n InputStream is = new FileInputStream(sqlPropertiesPath);\n sqlProp.load(is);\n PreparedStatement ps = conect.prepareStatement(sqlProp.getProperty(\"obtenerById.Destinatario\"));\n ps.setInt(1, id);\n ResultSet rs= ps.executeQuery();\n while(rs.next()){\n destinatarios.add(rs.getString(1));\n }\n }catch(Exception e){\n e.printStackTrace();\n }\n\n return destinatarios;\n }", "private List<ItemMovement> uitGraven(Slot slot, Gantry gantry){\n\n List<ItemMovement> itemMovements = new ArrayList<>();\n Richting richting = Richting.NaarVoor;\n\n //Recursief naar boven gaan, doordat we namelijk eerste de gevulde parents van een bepaald slot moeten uithalen\n if(slot.getParent() != null && slot.getParent().getItem() != null){\n itemMovements.addAll(uitGraven(slot.getParent(), gantry));\n }\n\n //Slot in een zo dicht mogelijke rij zoeken\n boolean newSlotFound = false;\n Slot newSlot = null;\n int offset = 1;\n do { //TODO: als storage vol zit en NaarVoor en NaarAchter vinden geen vrije plaats => inf loop\n // bij het NaarAchter lopen uw index telkens het negatieve deel nemen, dus deze wordt telkens groter negatief.\n //AANPASSING\n Integer locatie = richting==Richting.NaarVoor? (slot.getCenterY() / 10) + offset : (slot.getCenterY() / 10) - offset;\n //we overlopen eerst alle richtingen NaarVoor wanneer deze op zen einde komt en er geen plaats meer is van richting veranderen naar achter\n // index terug op 1 zetten omdat de indexen ervoor al gecontroleerd waren\n if (grondSlots.get(locatie) == null) {\n //Grootte resetten en richting omdraaien\n offset = 1;\n richting = Richting.NaarAchter;\n continue;\n }\n\n Set<Slot> ondersteRij = new HashSet<>(grondSlots.get(locatie).values());\n newSlot = GeneralMeasures.zoekLeegSlot(ondersteRij);\n\n if(newSlot != null){\n newSlotFound = true;\n }\n //telkens één slot verder gaan\n offset += 1;\n }while(!newSlotFound);\n // vanaf er een nieuw vrij slot gevonden is deze functie verlaten\n\n //verplaatsen\n itemMovements.addAll(GeneralMeasures.createMoves(pickupPlaceDuration,gantry, slot, newSlot));\n update(Operatie.VerplaatsIntern, newSlot, slot);\n\n return itemMovements;\n }" ]
[ "0.69616634", "0.6294376", "0.62084544", "0.6189069", "0.614088", "0.607596", "0.6061222", "0.59510916", "0.5861261", "0.5854316", "0.58444625", "0.5745437", "0.5739007", "0.5737929", "0.5730324", "0.57290673", "0.56851184", "0.5680945", "0.567818", "0.56735235", "0.5670945", "0.5639981", "0.5637109", "0.5635472", "0.56344", "0.56303173", "0.56000423", "0.55895066", "0.55715454", "0.5569796", "0.55646133", "0.5515234", "0.5507807", "0.5486157", "0.54603183", "0.5457881", "0.54577476", "0.54531246", "0.5437981", "0.5434839", "0.5434726", "0.54225063", "0.540405", "0.53935784", "0.53904253", "0.53719956", "0.5358728", "0.53525984", "0.5343835", "0.53434473", "0.53400934", "0.53393215", "0.5324281", "0.5321955", "0.53211194", "0.5317451", "0.53121275", "0.53099054", "0.5305426", "0.53040296", "0.530212", "0.52980894", "0.529639", "0.52948797", "0.52938604", "0.5289767", "0.5278113", "0.5270812", "0.5269628", "0.5269107", "0.5267728", "0.52659106", "0.5263702", "0.5263439", "0.5259806", "0.52564394", "0.5252652", "0.52507204", "0.52506703", "0.5245534", "0.5243556", "0.5238347", "0.5229975", "0.5228249", "0.52258945", "0.5220886", "0.5220259", "0.5219931", "0.52122545", "0.5210002", "0.5208971", "0.5205493", "0.51936", "0.5190338", "0.51880443", "0.5186828", "0.5178387", "0.51772887", "0.5172099", "0.51685286" ]
0.5547821
31
Devuelve las reservas realizadas entre la primera fecha y la segunda
@GetMapping("/fechaBetween/{fecha1}/{fecha2}") List<ReservasEntity> findByFechaBetween(@PathVariable("fecha1") @DateTimeFormat(pattern = "yyyy-MM-dd") Date fecha1, @PathVariable("fecha2") @DateTimeFormat(pattern = "yyyy-MM-dd") Date fecha2) { return reservaRepo.findByFechaBetween(fecha1, fecha2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void ReservaEfetivadas () {\n Date hoje = new Date ();\n for (int z = 0; z < vecReserva.size(); z++) {\n if (((int) ((((entReserva)vecReserva.elementAt(z)).getDatain().getTime() - (hoje.getTime())) / 86400000L)) == 0){// Reserva será relaizada hj\n if (((entReserva)vecReserva.elementAt(z)).getPagamento().getSituacao() == 0){//Cliente fez todo o pagamento e o quarto será\n vecReservaEfetivadas.add(vecReserva.elementAt(z));\n }\n \n }\n }\n }", "public long reserva_de_entradas(int identificador_evento, Date fechaevento, Horario[] listahorarios ) throws ParseException {\n fgen.info (\"Identificador del evento\" + identificador_evento);\n fgen.info (\"Fecha del evento\" + fechaevento);\n ArrayList<Horario> horariosReserva = new ArrayList<Horario>();\n for (int i = 0; i < listahorarios.length; i++) {\n \n Horario horario = listahorarios[i];\n fgen.info (\"Horario : \" + horario.getHorario().toString()); \n horariosReserva.add(horario);\n List<Disponibilidad> listadisponibles = listahorarios[i].disponibilidades;\n for (int j = 0; j < listadisponibles.size() ; j++) { \n fgen.info (\" Disponibilidad - Cantidad: \" + listadisponibles.get(j).getCantidad());\n fgen.info (\" Disponibilidad - Precio: \" + listadisponibles.get(j).getPrecio());\n fgen.info (\" Disponibilidad - Sector: \" + listadisponibles.get(j).getSector());\n } \n \n \n } \n //Inicializo o tomo lo que esta en memoria de la lista de reservas\n ListaReservas reservas= new ListaReservas(); \n // busco el evento y que la lista de horarios sea en la que quiero reservar\n ListaEventos eventos = new ListaEventos();\n Calendar c = Calendar.getInstance();\n c.setTime(fechaevento);\n Evento e = eventos.buscarEvento(identificador_evento, c);\n List<Horario> horariosRetornar = new ArrayList<Horario>();\n if(e != null)\n {\n horariosRetornar = e.getHorarios();\n } \n \n if (horariosRetornar != null)\n {\n for (int i = 0; i < horariosRetornar.size(); i++) {\n for (int j = 0; j < listahorarios.length; j++) {\n Date fechaE = horariosRetornar.get(i).getHorario().getTime(); \n Date fechaEventoDate = listahorarios[j].hora.getTime(); \n if(fechaE.equals(fechaEventoDate)) \n { for (int k = 0; k < horariosRetornar.get(i).disponibilidades.size(); k++) {\n for (int l = 0; l < listahorarios[j].disponibilidades.size(); l++) {\n Disponibilidad d= horariosRetornar.get(i).disponibilidades.get(k);\n Disponibilidad r= listahorarios[j].disponibilidades.get(l);\n if (d.cantidad >= r.cantidad && d.sector.equalsIgnoreCase(r.sector) && d.precio==r.precio)\n {\n d.setCantidad(d.cantidad-r.cantidad);\n //Reserva reserv= new Reserva();\n //reservas.contador_Id= reservas.contador_Id +1;\n //reserv.idReserva= reservas.contador_Id;\n //reserv.Estado=1;\n //reserv.idEvento = identificador_evento;\n //reserv.horarios.add(listahorarios[j]);\n //reservas.listaReserva.add(reserv);\n //return reserv.idReserva;\n }\n else if(d.cantidad < r.cantidad && d.sector.equalsIgnoreCase(r.sector) && d.precio==r.precio)\n {\n //Si hay alguna solicitud de de reserva que no se pueda cumplir. Re reorna 0.\n //TODO: Hay que volver para atras las cantidades modificadas.\n return 0;\n }\n \n }\n \n }\n }\n }\n }\n Reserva reserv= new Reserva();\n reservas.contador_Id= reservas.contador_Id +1;\n reserv.idReserva= reservas.contador_Id;\n reserv.Estado=1;\n reserv.idEvento = identificador_evento;\n reserv.horarios = horariosReserva;\n reserv.fechaEvento = c;\n reservas.listaReserva.add(reserv);\n return reserv.idReserva;\n }\n \n return 0;\n }", "public static void main(String[] args) {\n Calendar dataVencimento = Calendar.getInstance();\n System.out.printf(\"A data de vencimento do boleto é: %tF\\n\", dataVencimento);\n\n // Pegando a data do vencimento do boleto e adicionando 10 dias para que seja a data limite de pagamento sem juros.\n dataVencimento.add(Calendar.DATE, 10);\n System.out.printf(\"A data limite para fazer o pagamento sem juros é: %tF\\n\", dataVencimento);\n\n /*\n Fazendo a verificação de quando ocorrerá o vencimento\n Caso seja em um sábado, a data de vencimento terá um acréscimo de 2 dias, para que seja no próximo dia útil (segunda-feira).\n Caso seja em um domingo, a data de vencimento terá um acréscimo de 1 dia, para que seja no próximo dia últil (segunda-feira).\n Caso seja em qualquer outro dia, continua valendo a data inicial.\n */\n if (dataVencimento.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) {\n dataVencimento.add(Calendar.DATE, 2);\n System.out.printf(\"O vencimento seria em um sábado. Data alterada para a próxima segunda-feira, dia %tF\\n\", dataVencimento.getTime());\n } else if (dataVencimento.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {\n dataVencimento.add(Calendar.DATE, 1);\n System.out.printf(\"O vencimento seria em um domingo. Data alterada para a próxima segunda-feira, dia %tF\\n\", dataVencimento.getTime());\n }\n }", "public AgendaMB() {\n GregorianCalendar dtMax = new GregorianCalendar(); \n Date dt = new Date();\n dtMax.setTime(dt); \n GregorianCalendar dtMin = new GregorianCalendar(); \n dtMin.setTime(dt);\n dtMin.add(Calendar.DAY_OF_MONTH, 1);\n dtMax.add(Calendar.DAY_OF_MONTH, 40);\n dataMax = dtMax.getTime();\n dataMin = dtMin.getTime(); \n }", "public Calendar setReservationDate(){\n\t\t\n\t\t\n\t\tint currentMonth = Calendar.getInstance().get(Calendar.MONTH)+1; //Month starts from zero in Java\n\t\tint currentYear = Calendar.getInstance().get(Calendar.YEAR);\n\t\tint currentDate = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n\t\tint currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);\n\t\tint currentMinute = Calendar.getInstance().get(Calendar.MINUTE);\n\t\t\n\t\t\n\t\tSystem.out.println(\"Current Year \"+ currentYear );\n\t\tSystem.out.println(\"Current Month \"+ currentMonth );\n\t\tSystem.out.println(\"Today's date \"+ currentDate );\n\t\tSystem.out.println(\"Current Hour \"+ currentHour );\n\t\tSystem.out.println(\"Current Minute \"+ currentMinute );\n\t\tSystem.out.println(\"\\t---\\t---\\t---\\t---\\t---\");\n\t\tint inputMonth, inputYear, inputDate, inputHour, inputMinute;\n\t\t\n\t\tCalendar reserveDate = Calendar.getInstance();\n\t\t\n\t\tSystem.out.print(\"Enter the year: \");\n\t\tinputYear = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputYear < currentYear){\n\t\t\tSystem.out.println(\"Old year entry is not allowed !\\n\");\n\t\t\tSystem.out.print(\"Enter the year: \");\n\t\t\tinputYear = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\t\n\t\treserveDate.set(Calendar.YEAR,inputYear); \n\t\n\t\tSystem.out.print(\"Enter the month: \");\n\t\tinputMonth = scan.nextInt();\t\n\t\tscan.nextLine();\n\t\t\n\t\twhile (inputMonth < 1 || inputMonth > 12){\n\t\t\tSystem.out.println(\"Invalid Month entry!\");\n\t\t\tSystem.out.print(\"Enter the month again: \");\n\t\t\tinputMonth = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputMonth < currentMonth) && (inputYear == currentYear)){\n\t\t\t\t\t\n\t\t\tSystem.out.println(\"Old month entry is not allowed !\\n\");\n\t\t\tSystem.out.print(\"Enter the month: \");\n\t\t\tinputMonth = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t\t\n\t\t}\n\t\treserveDate.set(Calendar.MONTH,inputMonth-1);//MONTH is from 0 to 11.\n\t\t\n\t\tSystem.out.print(\"Enter the date for reservation: \");\n\t\tinputDate = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputDate < 1 || inputDate > 31){\n\t\t\tSystem.out.println(\"Invalid date entry!\");\n\t\t\tSystem.out.print(\"Enter the date again: \");\n\t\t\tinputDate = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputDate < currentDate) && (inputMonth == currentMonth)&&(inputYear==currentYear)){\n\t\t\tSystem.out.println(\"Past Day is not allowed!\\n\");\n\t\t\tSystem.out.print(\"Enter the date for reservation: \");\n\t\t\tinputDate = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\treserveDate.set(Calendar.DAY_OF_MONTH,inputDate);\n\t\t\n\t\tSystem.out.print(\"Enter hour (24-hr format): \");\n\t\tinputHour = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputHour < 0 || inputHour > 23){\n\t\t\tSystem.out.println(\"Invalid hour entry!\");\n\t\t\tSystem.out.print(\"Enter the hour again: \");\n\t\t\tinputHour = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile(inputHour < currentHour && inputDate == currentDate&&inputMonth == currentMonth&&inputYear==currentYear){\n\t\t\t\n\t\t\tif (inputHour < 0 && inputHour > 23){\n\t\t\t\tSystem.out.println(\"Invalid Hour entry\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Past hour is not allowed!\\n\");\n\t\t\t\tSystem.out.print(\"Enter hour (24-hr format): \");\n\t\t\t\tinputHour = scan.nextInt();\n\t\t\t\tscan.nextLine();\n\t\t\t}\n\t\t}\n\t\treserveDate.set(Calendar.HOUR_OF_DAY,inputHour); //This uses 24 hour clock\n\t\t\n\t\tSystem.out.print(\"Enter minute: \");\n\t\tinputMinute = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile(inputMinute < 0 || inputMinute > 59){\n\t\t\tSystem.out.println(\"Invalid Minute entry\");\n\t\t\tSystem.out.print(\"Enter minute again: \");\n\t\t\tinputMinute = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputMinute-currentMinute) <= 0 && inputHour == currentHour){\n\t\t\t\n\t\t\t//System.out.println(\"Reservation can only be made 30 minutes earlier or invalid input !\");\n\t\t\tSystem.out.print(\"Invalid minute\");\n\t\t\tSystem.out.print(\"Enter minute again: \");\n\t\t\tinputMinute = scan.nextInt();\t\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\treserveDate.set(Calendar.MINUTE,inputMinute);\n\t\tSystem.out.println(\"Date Reserved!\");\n\t\treturn reserveDate;\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tDate date = new Date();\r\n\t\t\r\n\t\tLocalDate diaHoy = LocalDate.now();\r\n\t\tLocalDate diaFin = diaHoy.plusDays(15);\r\n\t\t\r\n\t\tCursoVacacional curso1 = new CursoVacacional();\r\n\t\tcurso1.setNombre(\"Volley Principiantes\");\r\n\t\tcurso1.setFechaInicio(diaHoy);\r\n\t\tcurso1.setFechaFin(diaFin);\r\n\t\t\r\n\t\tSystem.out.println(\"Nombre: \" +curso1.getNombre());\r\n\t\tSystem.out.println(\"F I: \" + curso1.getFechaInicio());\r\n\t\tSystem.out.println(\"F F: \" + curso1.getFechaFin());\r\n\t\t\r\n\t\tLocalDate diaHoy2 = LocalDate.now();\r\n\t\tLocalDate diaQueInicio = diaHoy2.minusDays(2);\r\n\t\tLocalDate diaQueFinaliza = diaQueInicio.plusDays(20);\r\n\t\t\r\n\t\tCursoVacacional curso2 = new CursoVacacional();\r\n\t\tcurso2.setNombre(\"Volley Principiantes\");\r\n\t\tcurso2.setFechaInicio(diaHoy);\r\n\t\tcurso2.setFechaFin(diaFin);\r\n\t\t\r\n\t\tSystem.out.println(\"Nombre: \" +curso2.getNombre());\r\n\t\tSystem.out.println(\"F I: \" + curso2.getFechaInicio());\r\n\t\tSystem.out.println(\"F F: \" + curso2.getFechaFin());\r\n\t\t\r\n\t\t\r\n\t}", "@Schedule(hour = \"2\")\n public void allocateCurrentDayReservation() {\n \n Calendar c = Calendar.getInstance();\n Date dateTime = c.getTime();\n \n reservationSessionBeanLocal.allocateCarsToReservations(dateTime);\n }", "private void obtenerGastosDiariosMes() {\n\t\t// Obtenemos las fechas actuales inicial y final\n\t\tCalendar calendar = Calendar.getInstance();\n calendar.setTime(new Date());\n int diaFinalMes = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);\n\n\t\tList<Movimiento> movimientos = this.movimientoService.obtenerMovimientosFechaUsuario(idUsuario, LocalDate.of(LocalDate.now().getYear(),LocalDate.now().getMonthValue(),1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDate.of(LocalDate.now().getYear(),LocalDate.now().getMonthValue(), diaFinalMes));\n\t\tList<Double> listaGastos = new ArrayList<Double>();\n\t\tList<String> listaFechas = new ArrayList<String>();\n\t\t\n\t\tDate fechaUtilizadaActual = null;\n\t\tdouble gastoDiario = 0;\n\t\t\n\t\tfor (Iterator iterator = movimientos.iterator(); iterator.hasNext();) {\n\t\t\tMovimiento movimiento = (Movimiento) iterator.next();\n\t\t\tif(fechaUtilizadaActual == null) { //Comprobamos si se acaba de entrar en el bucle para inicializar la fecha del movimiento\n\t\t\t\tfechaUtilizadaActual = movimiento.getFecha();\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Si hemos cambiado de fecha del movimiento se procede a guardar los datos recogidos\n\t\t\tif(!fechaUtilizadaActual.equals(movimiento.getFecha())) {\n\t\t\t\tlistaGastos.add(gastoDiario);\n\t\t\t\tlistaFechas.add(fechaUtilizadaActual.getDate()+\"/\"+Utils.getMonthForInt(fechaUtilizadaActual.getMonth()).substring(0, 3));\n\t\t\t\tgastoDiario = 0; // Reiniciamos el contador del gasto\n\t\t\t\tfechaUtilizadaActual = movimiento.getFecha(); // Almacenemos la fecha del nuevo gasto\n\t\t\t}\n\t\t\t\n\t\t\t// Si el movimiento que se ha realizado es un gasto lo sumamos al contador de gasto\n\t\t\tif(movimiento.getTipo().equals(TipoMovimiento.GASTO)) {\n\t\t\t\tgastoDiario += movimiento.getCantidad();\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Comprobamos si es el ultimo item del iterador y almacenamos sus datos\n\t\t\tif(!iterator.hasNext()) {\n\t\t\t\tlistaGastos.add(gastoDiario);\n\t\t\t\tlistaFechas.add(fechaUtilizadaActual.getDate()+\"/\"+Utils.getMonthForInt(fechaUtilizadaActual.getMonth()).substring(0, 3));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tthis.listadoGastosDiariosDiagrama = new Double[listaGastos.size()];\n\t\tthis.listadoGastosDiariosDiagrama = listaGastos.toArray(this.listadoGastosDiariosDiagrama);\n\t\tthis.fechasDiagrama = new String[listaFechas.size()];\n\t\tthis.fechasDiagrama = listaFechas.toArray(this.fechasDiagrama);\n\t\t\n\t}", "public void liquidarEmpleado(Fecha fechaLiquidacion) {\n //COMPLETE\n double prima=0; \n boolean antiguo=false;\n double aniosEnServicio=fechaLiquidacion.getAnio()-this.fechaIngreso.getAnio();\n if(aniosEnServicio>0&&\n fechaLiquidacion.getMes()>this.fechaIngreso.getMes())\n aniosEnServicio--; \n \n //System.out.println(\"A:\"+aniosEnServicio+\":\"+esEmpleadoLiquidable(fechaLiquidacion));\n if(esEmpleadoLiquidable(fechaLiquidacion)){\n this.descuentoSalud=salarioBase*0.04;\n this.descuentoPension=salarioBase*0.04;\n this.provisionCesantias=salarioBase/12;\n if(fechaLiquidacion.getMes()==12||fechaLiquidacion.getMes()==6)\n prima+=this.salarioBase*0.5; \n if(aniosEnServicio<6&&\n fechaLiquidacion.getMes()==this.fechaIngreso.getMes())prima+=((aniosEnServicio*5)/100)*this.salarioBase;\n if(aniosEnServicio>=6&&fechaLiquidacion.getMes()==this.fechaIngreso.getMes()) prima+=this.salarioBase*0.3;\n\n this.prima=prima;\n this.setIngresos(this.salarioBase+prima);\n \n this.setDescuentos(this.descuentoSalud+this.descuentoPension);\n this.setTotalAPagar(this.getIngresos()-this.getDescuentos());\n }\n\n }", "private void Calculation() {\n\t\tint calStd = jetztStunde + schlafStunde;\n\t\tint calMin = jetztMinute + schlafMinute;\n\n\t\ttotalMin = calMin % 60;\n\t\ttotalStunde = calStd % 24 + calMin / 60;\n\n\t}", "void getCurrentPeriodo();", "public List<Reserva> getReservasPeriod(String dateOne, String dateTwo){\n /**\n * Instancia de SimpleDateFormat para dar formato correcto a fechas.\n */\n SimpleDateFormat parser = new SimpleDateFormat(\"yyyy-MM-dd\");\n /**\n * Crear nuevos objetos Date para recibir fechas fomateadas.\n */\n Date dateOneFormatted = new Date();\n Date dateTwoFormatted = new Date();\n /**\n * Intentar convertir las fechas a objetos Date; mostrar registro de\n * la excepción si no se puede.\n */\n try {\n dateOneFormatted = parser.parse(dateOne);\n dateTwoFormatted = parser.parse(dateTwo);\n } catch (ParseException except) {\n except.printStackTrace();\n }\n /**\n * Si la fecha inicial es anterior a la fecha final, devuelve una lista\n * de Reservas creadas dentro del intervalo de fechas; si no, devuelve\n * un ArrayList vacío.\n */\n if (dateOneFormatted.before(dateTwoFormatted)){\n return repositorioReserva.findAllByStartDateAfterAndStartDateBefore\n (dateOneFormatted, dateTwoFormatted);\n } else {\n return new ArrayList<>();\n }\n }", "public void calcularCost() {\r\n cost = 0;\r\n int a = 0;\r\n try {\r\n String r = DataR.toString()+ \" \" + horaR;\r\n String d = DataD.toString()+ \" \" + horaD;\r\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\r\n Date dateR = simpleDateFormat.parse(r);\r\n Date dateD = simpleDateFormat.parse(d);\r\n a = (int) ((dateD.getTime() - dateR.getTime())/(1000*3600));\r\n \r\n \r\n } catch (ParseException ex) {\r\n Logger.getLogger(Reserva.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n if(a > 24) {\r\n cost += 15*(a/(24));\r\n a -= (((int)(a/24))*24);\r\n }\r\n if(a%3600 == 0) {\r\n cost += 1;\r\n }\r\n if(a%3600 > 0) {\r\n cost += 1;\r\n }\r\n \r\n }", "public void introducirPagosALojamientoHotelFechas(Date fechaInicial, Date fechaFinal,TablaModelo modelo){\n long tiempo = fechaInicial.getTime();\n java.sql.Date fechaInicialSql = new java.sql.Date(tiempo);\n long tiempo2= fechaFinal.getTime();\n java.sql.Date fechaFinalSQL = new java.sql.Date(tiempo2);\n try {\n PreparedStatement declaracion;// prepara la orden \n declaracion = conexion.prepareStatement(\"SELECT ALOJAMIENTO.Id,ALOJAMIENTO.Id_Reservacion,RESERVACION.Fecha_Entrada, RESERVACION.Fecha_Salida,RESERVACION.Precio FROM RESERVACION JOIN ALOJAMIENTO WHERE RESERVACION.Id=ALOJAMIENTO.Id_Reservacion AND RESERVACION.Fecha_Entrada>=? AND RESERVACION.Fecha_Entrada<=? AND RESERVACION.Check_In=1;\");\n declaracion.setDate(1,fechaInicialSql);\n declaracion.setDate(2,fechaFinalSQL);// pago de alojamiento en rango fchas\n ResultSet resultado = declaracion.executeQuery();\n while (resultado.next()) {\n Object objeto[] = new Object[6];// pago de alojamiento en rango fchas\n objeto[0] = resultado.getInt(1);\n objeto[1] = resultado.getInt(2);\n objeto[2] = resultado.getDate(3);\n objeto[3] = resultado.getDate(4);// pago de alojamiento en rango fchas\n objeto[4] = resultado.getInt(5);\n String fechaInicialProbar=objeto[2].toString();\n String fechaFinalProbar=objeto[3].toString();// pago de alojamiento en rango fchas\n String precioProbar = objeto[4].toString();// pago de alojamiento en rango fchas\n int total=habitacion.hacerTotalAlojamiento(fechaInicialProbar, fechaFinalProbar, precioProbar);\n objeto[5]= total;\n modelo.addRow(objeto);\n } // maneja el resultado \n\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }", "private void crearTurnos(){\n Date a = new Date();\n if((dateSeleccion.getDatoFecha()).getDay()>= a.getDay()){\n Calendar dia = Calendar.getInstance();//crear una instancia de calendario se usa para hora empieza\n Calendar aux = Calendar.getInstance();//instancia para horatermina \n dia.setTime(dateSeleccion.getDatoFecha()); //dia que seleccione en el combo\n\n dia.set(Calendar.HOUR_OF_DAY,this.cita.getMedico().getHorarioInicio().getHours());\n dia.set(Calendar.MINUTE,this.cita.getMedico().getHorarioInicio().getMinutes());\n aux.setTime(dateSeleccion.getDatoFecha()); //dia que seleccione en el combo\n aux.set(Calendar.HOUR_OF_DAY,this.cita.getMedico().getHorarioInicio().getHours());\n aux.set(Calendar.MINUTE,this.cita.getMedico().getHorarioInicio().getMinutes()+this.cita.getMedico().getTiempoTurno());\n int rango = (this.cita.getMedico().getHorarioFinal().getHours()\n -this.cita.getMedico().getHorarioInicio().getHours())*60;\n int cantTurnosDia = rango/this.cita.getMedico().getTiempoTurno();\n for (int i=1;i<=cantTurnosDia;i++){\n this.controlador.agregarTurno(this.cita.getMedico(), dia.getTime(), aux.getTime());\n aux.add(Calendar.MINUTE, this.cita.getMedico().getTiempoTurno());\n dia.add(Calendar.MINUTE, this.cita.getMedico().getTiempoTurno());\n }\n //se pueden crear duplicados\n }\n }", "private void generateDefaultTimeSlots() {\n\t\tLocalTime startTime = LocalTime.of(9, 0); // 9AM start time\n\t\tLocalTime endTime = LocalTime.of(19, 0); // 5PM end time\n\n\t\tfor (int i = 1; i <= 7; i++) {\n\t\t\tList<Timeslot> timeSlots = new ArrayList<>();\n\t\t\tLocalTime currentTime = startTime.plusMinutes(15);\n\t\t\twhile (currentTime.isBefore(endTime) && currentTime.isAfter(startTime)) {\n\t\t\t\tTimeslot newSlot = new Timeslot();\n\t\t\t\tnewSlot.setTime(currentTime);\n\t\t\t\tnewSlot = timeslotRepository.save(newSlot);\n\t\t\t\ttimeSlots.add(newSlot);\n\t\t\t\tcurrentTime = currentTime.plusHours(1); // new slot after one hour\n\t\t\t}\n\t\t\tDay newDay = new Day();\n\t\t\tnewDay.setTs(timeSlots);\n\t\t\tnewDay.setDayOfWeek(DayOfWeek.of(i));\n\t\t\tdayRepository.save(newDay);\n\t\t}\n\t}", "public void mostrarReservas() {\n\t\tint numReserva=1;\r\n\t\tfor(Reserva reserva:reservas) {\r\n\t\t\tSystem.out.println(numReserva+\" \"+reserva.toString());\r\n\t\t\tnumReserva++;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public void generateSchedule(){\n\t\t\n\t}", "public void introducirPagosALojamientoClienteFechas(Date fechaInicial, Date fechaFinal,TablaModelo modelo,String dpiCliente){\n long tiempo = fechaInicial.getTime();\n java.sql.Date fechaInicialSql = new java.sql.Date(tiempo);\n long tiempo2= fechaFinal.getTime();\n java.sql.Date fechaFinalSQL = new java.sql.Date(tiempo2);// pago de alojamiento en rango fchas\n try {\n PreparedStatement declaracion;// prepara la orden \n declaracion = conexion.prepareStatement(\"SELECT ALOJAMIENTO.Id,ALOJAMIENTO.Id_Reservacion,RESERVACION.Fecha_Entrada, RESERVACION.Fecha_Salida,RESERVACION.Precio FROM RESERVACION JOIN ALOJAMIENTO WHERE RESERVACION.Id=ALOJAMIENTO.Id_Reservacion AND RESERVACION.Fecha_Entrada>=? AND RESERVACION.Fecha_Entrada<=? AND RESERVACION.Dpi_Cliente=? AND RESERVACION.Check_In=1;\");\n declaracion.setDate(1,fechaInicialSql);\n declaracion.setDate(2,fechaFinalSQL);// pago de alojamiento en rango fchas\n declaracion.setString(3, dpiCliente);\n ResultSet resultado = declaracion.executeQuery();\n while (resultado.next()) {\n Object objeto[] = new Object[6];\n objeto[0] = resultado.getInt(1);\n objeto[1] = resultado.getInt(2);\n objeto[2] = resultado.getDate(3);// pago de alojamiento en rango fchas\n objeto[3] = resultado.getDate(4);\n objeto[4] = resultado.getInt(5);\n String fechaInicialProbar=objeto[2].toString();\n String fechaFinalProbar=objeto[3].toString();// pago de alojamiento en rango fchas\n String precioProbar = objeto[4].toString();\n int total=habitacion.hacerTotalAlojamiento(fechaInicialProbar, fechaFinalProbar, precioProbar);\n objeto[5]= total;\n modelo.addRow(objeto);\n } // maneja el resultado \n\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }", "private void getIntialCalender() {\n\n\t\ttry {\n\n\t\t\tc = Calendar.getInstance();\n\t\t\tString[] fields = Global_variable.str_booking_date.split(\"[-]\");\n\n\t\t\tString str_year = fields[0];\n\t\t\tString str_month = fields[1];\n\t\t\tString str_day = fields[2];\n\n\t\t\tSystem.out.println(\"!!!!\" + fields[0]);\n\t\t\tSystem.out.println(\"!!!!\" + fields[1]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields[2]);\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tyear = Integer.parseInt(str_year);\n\t\t\t} else {\n\t\t\t\tyear = c.get(Calendar.YEAR);\n\t\t\t}\n\n\t\t\tif (str_month.length() != 0) {\n\t\t\t\tmonth = Integer.parseInt(str_month) - 1;\n\t\t\t} else {\n\t\t\t\tmonth = c.get(Calendar.MONTH);\n\t\t\t}\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tday = Integer.parseInt(str_day);\n\t\t\t} else {\n\t\t\t\tday = c.get(Calendar.DAY_OF_MONTH);\n\t\t\t}\n\n\t\t\tString[] fields1 = Global_variable.str_booking_time.split(\"[:]\");\n\n\t\t\tString str_hour = fields1[0];\n\t\t\tString str_minutes = fields1[1];\n\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[0]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[1]);\n\n\t\t\tif (str_hour.length() != 0) {\n\t\t\t\thour = Integer.parseInt(str_hour);\n\t\t\t} else {\n\t\t\t\thour = c.get(Calendar.HOUR_OF_DAY);\n\t\t\t}\n\n\t\t\tif (str_minutes.length() != 0) {\n\t\t\t\tminutes = Integer.parseInt(str_minutes);\n\t\t\t} else {\n\t\t\t\tminutes = c.get(Calendar.MINUTE);\n\t\t\t}\n\n\t\t\tcurrDate = new java.sql.Date(System.currentTimeMillis());\n\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\tCalendar c1 = Calendar.getInstance();\n\t\t\tc1.setTime(new Date()); // Now use today date.\n\t\t\tc1.add(Calendar.DATE, 30); // Adding 30 days\n\t\t\toutput = sdf.format(c1.getTime());\n\t\t\tSystem.out.println(\"!!!!!!!!!!!!!!!\" + output);\n\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\tint[] a = {3,5,-1,2,-1,-11,1,-2,4};\n//\t\tint[] a = {1,0,-1};\n//\t\trearrange(a);\n//\t\tfor(int i = 0; i < a.length; i++)\n//\t\t\tSystem.out.print(a[i] + \" \");\n//\t\tSystem.out.println();\n\t\t\n\t\tString d = \"01/01/2015\";\n\t\tString[] date = d.split(\"/\");\n//\t\tSystem.out.println(date);\n//\t\tCalendar c = Calendar.getInstance();\n//\t\tint startYear = Integer.parseInt(date[2]);\n//\t\tint startMonth = Integer.parseInt(date[1]);\n//\t\tint startDate = Integer.parseInt(date[0]);\n//\t\tc.set(startYear, startMonth, startDate);\n//\t\tString[] days = {\"Monday\",\"Thursday\"};\n//\t\tString[] res = recurringTask(d, 2, days, 4);\n//\t\tfor(int i = 0; i < res.length; i++)\n//\t\t\tSystem.out.println(res[i]);\n//\t\t System.out.println(c.get(Calendar.DAY_OF_MONTH));\n//\t\t System.out.println(c.get(Calendar.DAY_OF_WEEK));\n//\t\t System.out.println(c.get(Calendar.DATE));\n\t\t \n\t\tSystem.out.println(Math.floor(2.4)); \n\t\tdouble[] departures = {2.4,1};\n\t\tdouble[] dest = {5,7.3};\n\t\t \n\t \n\t\t\t\t\n\t\t\t\t\n\t\n\t\t\n\t\t \n\t\t \n\t\t \n\t\t\t\n\t\t\n\t}", "private void populaHorarioAula()\n {\n Calendar hora = Calendar.getInstance();\n hora.set(Calendar.HOUR_OF_DAY, 18);\n hora.set(Calendar.MINUTE, 0);\n HorarioAula h = new HorarioAula(hora, \"Segunda e Quinta\", 1, 3, 1);\n horarioAulaDAO.insert(h);\n\n hora.set(Calendar.HOUR_OF_DAY, 5);\n h = new HorarioAula(hora, \"Terca e Sexta\", 1, 3, 1);\n horarioAulaDAO.insert(h);\n\n hora.set(Calendar.HOUR_OF_DAY, 15);\n h = new HorarioAula(hora, \"Terca e Sexta\", 2, 5, 3);\n horarioAulaDAO.insert(h);\n\n hora.set(Calendar.HOUR_OF_DAY, 5);\n h = new HorarioAula(hora, \"Terca e Sexta\", 2, 5, 3);\n horarioAulaDAO.insert(h);\n\n hora.set(Calendar.HOUR_OF_DAY, 10);\n h = new HorarioAula(hora, \"Terca e Sexta\", 2, 5, 3);\n horarioAulaDAO.insert(h);\n\n hora.set(Calendar.HOUR_OF_DAY, 5);\n h = new HorarioAula(hora, \"Quarta e Sexta\", 3, 5, 3);\n horarioAulaDAO.insert(h);\n\n hora.set(Calendar.HOUR_OF_DAY, 5);\n h = new HorarioAula(hora, \"Sexta\", 1, 1, 2);\n horarioAulaDAO.insert(h);\n\n hora.set(Calendar.HOUR_OF_DAY, 19);\n h = new HorarioAula(hora, \"Sexta\", 2, 1, 1);\n horarioAulaDAO.insert(h);\n\n hora.set(Calendar.HOUR_OF_DAY, 5);\n h = new HorarioAula(hora, \"Segunda\", 3, 6, 4);\n horarioAulaDAO.insert(h);\n\n }", "public void setupDays() {\n\n //if(days.isEmpty()) {\n days.clear();\n int day_number = today.getActualMaximum(Calendar.DAY_OF_MONTH);\n SimpleDateFormat sdf = new SimpleDateFormat(\"EEEE\");\n SimpleDateFormat sdfMonth = new SimpleDateFormat(\"MMM\");\n today.set(Calendar.DATE, 1);\n for (int i = 1; i <= day_number; i++) {\n OrariAttivita data = new OrariAttivita();\n data.setId_utente(mActualUser.getID());\n\n //Trasformare in sql date\n java.sql.Date sqldate = new java.sql.Date(today.getTimeInMillis());\n data.setGiorno(sqldate.toString());\n\n data.setDay(i);\n data.setMonth(today.get(Calendar.MONTH) + 1);\n\n data.setDay_of_week(today.get(Calendar.DAY_OF_WEEK));\n Date date = today.getTime();\n String day_name = sdf.format(date);\n data.setDay_name(day_name);\n data.setMonth_name(sdfMonth.format(date));\n\n int indice;\n\n if (!attivitaMensili.isEmpty()) {\n if ((indice = attivitaMensili.indexOf(data)) > -1) {\n OrariAttivita temp = attivitaMensili.get(indice);\n if (temp.getOre_totali() == 0.5) {\n int occurence = Collections.frequency(attivitaMensili, temp);\n if (occurence == 2) {\n for (OrariAttivita other : attivitaMensili) {\n if (other.equals(temp) && other.getCommessa() != temp.getCommessa()) {\n data.setOtherHalf(other);\n data.getOtherHalf().setModifica(true);\n }\n }\n\n }\n }\n data.setFromOld(temp);\n data.setModifica(true);\n }\n }\n isFerie(data);\n\n\n //Aggiungi la data alla lista\n days.add(data);\n\n //Aggiugni un giorno alla data attuale\n today.add(Calendar.DATE, 1);\n }\n\n today.setTime(actualDate);\n\n mCalendarAdapter.notifyDataSetChanged();\n mCalendarList.setAdapter(mCalendarAdapter);\n showProgress(false);\n }", "CurrentReservation createCurrentReservation();", "public static void main(String[] args) {\n\t\tSystem.out.println(System.currentTimeMillis()); // Quantos Milisegundos desde data 01/01/1970\n\t\t\n\t\t// Data Atual\n\t\tDate agora = new Date();\n\t\tSystem.out.println(\"Data Atual: \"+agora);\n\t\t\n\t\tDate data = new Date(1_000_000_000_000L);\n\t\tSystem.out.println(\"Data com 1.000.000.000.000ms: \"+data);\n\t\t\n\t\t// METODOS\n\t\tdata.getTime();\n\t\tdata.setTime(1_000_000_000_000L);\n\t\tSystem.out.println(data.compareTo(agora)); // -1 para anterior, 0 para igual, +1 para posterior\n\t\t\n\t\t// GregorianCalendar\n\t\tCalendar c = Calendar.getInstance();\n\t\tc.set(1980, Calendar.FEBRUARY, 12);\n\t\tSystem.out.println(c.getTime());\n\t\tSystem.out.println(c.get(Calendar.YEAR)); // Ano\n\t\tSystem.out.println(c.get(Calendar.MONTH)); // Mes 0 - 11\n\t\tSystem.out.println(c.get(Calendar.DAY_OF_MONTH)); // Dia do mes\n\t\t\n\t\tc.set(Calendar.YEAR,2016); // Altera o Ano\n\t\tc.set(Calendar.MONTH, 10); // Altera o Mes 0 - 11\n\t\tc.set(Calendar.DAY_OF_MONTH, 24); // Altera o Dia do mes\n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\tc.clear(Calendar.MINUTE); // limpa minutos\n\t\tc.clear(Calendar.SECOND); // limpa segundos\n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\tc.add(Calendar.DAY_OF_MONTH,1); // adiciona dias (avança o mes e ano)\n\t\tc.add(Calendar.YEAR,1); // adiciona o ano \n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\tc.roll(Calendar.DAY_OF_MONTH,20); // adiciona dias (não avança o mes e ano)\n\t\tSystem.out.println(c.getTime());\n\t\t\n\t\t// Saudação com Bom dia, Boa arde ou Boa noite\n\t\tCalendar c1 = Calendar.getInstance();\n\t\tint hora = c1.get(Calendar.HOUR_OF_DAY);\n\t\tSystem.out.println(hora);\n\t\tif(hora <= 12){\n\t\t\tSystem.out.println(\"Bom Dia\");\n\t\t} else if(hora > 12 && hora < 18){\n\t\t\tSystem.out.println(\"Boa Tarde\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Boa Noite\");\n\t\t}\n\t\t\n\n\t}", "public void initTempsPassage() {\r\n\t\tlong dureeTotale = heureDepart.getTime();\r\n\t\ttempsPassage = new Date[getItineraire().size()][2];\r\n\r\n\t\tfor (int i = 0; i < getItineraire().size(); i++) {\r\n\t\t\tfor (int j = 0; j < getItineraire().get(i).getTroncons().size(); j++) {\r\n\t\t\t\tdureeTotale += getItineraire().get(i).getTroncons().get(j).getLongueur() * 1000 / VITESSE;// Duree\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// des\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// trajets\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// en\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// seconde\r\n\r\n\t\t\t}\r\n\t\t\tif (i < listeLivraisons.size()) {\r\n\t\t\t\tif (listeLivraisons.get(i).getDebutPlageHoraire() != null\r\n\t\t\t\t\t\t&& listeLivraisons.get(i).getDebutPlageHoraire().getTime() > dureeTotale) {\r\n\t\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t\t\ttempsPassage[i][1] = new Date(listeLivraisons.get(i).getDebutPlageHoraire().getTime());\r\n\t\t\t\t\tdureeTotale = listeLivraisons.get(i).getDebutPlageHoraire().getTime();\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t\t}\r\n\t\t\t\tdureeTotale += listeLivraisons.get(i).getDuree() * 1000; // duree\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// de\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// livraison\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// en\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ms\r\n\t\t\t} else {\r\n\t\t\t\ttempsPassage[i][0] = new Date(dureeTotale);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\theureArrivee = new Date(dureeTotale);\r\n\t}", "@Override\n public long minutosLibres(Integer idEstacion, Date inicio, Date fin) {\n long minutos = Math.abs(fin.getTime() - inicio.getTime())/60000;\n List<Ejecucion> ejecuciones = null;\n String sql = \"SELECT eje FROM Recurso rec, Ejecucion eje WHERE rec.estacion.idestaciones = :idEstacion AND eje.recurso.idrecurso = rec.idrecurso AND eje.fechafin >= :inicio AND eje.fechainicio < :fin\";\n ejecuciones = getCurrentSession().createQuery(sql).setParameter(\"idEstacion\", idEstacion).setParameter(\"inicio\", inicio).setParameter(\"fin\", fin).list();\n \n if (ejecuciones != null) {\n for (Ejecucion next : ejecuciones) {\n Date inicioEjecucion = next.getFechainicio();\n Date finEjecucion = next.getFechafin();\n if (inicioEjecucion.before(inicio) && finEjecucion.before(fin)) {\n //Comienza en inicio y finaliza en el fin de la ejecucion\n minutos = minutos - Math.abs(finEjecucion.getTime() - inicio.getTime())/60000;\n\n } else if (inicioEjecucion.after(inicio) && finEjecucion.before(fin)) {\n //Comienza en inicio de la ejecucion y finaliza en el fin de la ejecucion\n minutos = minutos - Math.abs(fin.getTime() - inicioEjecucion.getTime())/60000;\n\n }else if (inicioEjecucion.after(inicio) && finEjecucion.after(fin)){\n //Comienza en inicio de la ejecucion y finaliza en el fin\n minutos = minutos - Math.abs(fin.getTime() - inicioEjecucion.getTime())/60000;\n\n } else if (inicioEjecucion.before(inicio) && finEjecucion.after(fin)) {\n //Comienza en inicio y finaliza en el fin\n minutos = minutos - Math.abs(fin.getTime() - inicio.getTime())/60000;\n }\n /*if (inicioEjecucion.before(inicio) && finEjecucion.before(fin)) {\n //Comienza en inicio y finaliza en el fin de la ejecucion\n minutos = minutos + (fin.getTime() - inicio.getTime())/60000;\n\n } else if (inicioEjecucion.after(inicio) && finEjecucion.before(fin)) {\n //Comienza en inicio de la ejecucion y finaliza en el fin de la ejecucion\n minutos = minutos + ((fin.getTime() - inicio.getTime()) + (inicioEjecucion.getTime() - inicio.getTime()))/60000;\n\n }else if (inicioEjecucion.after(inicio) && finEjecucion.after(fin)){\n //Comienza en inicio de la ejecucion y finaliza en el fin\n minutos = minutos + Math.abs(inicioEjecucion.getTime() - inicio.getTime())/60000;\n\n }*/\n }\n }\n return minutos;\n }", "public void loadReserva() {\r\n\t\tif(listaReservas.size() != 0) {\r\n\r\n\t\t}else {\r\n\t\t\tfor(int i = 0; i < 8; i++) {\r\n\t\t\t\tReservaDAO aux = new ReservaDAO();\r\n\t\t\t\taux.load_reserva(i+1);\r\n\t\t\t\tif(aux.getTitulo() != null) {\r\n\t\t\t\t\tlistaReservas.add(aux);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void ingresarReserva() throws Exception {\r\n\t\tif (mngRes.existeReservaPeriodo(getSitio().getId())) {\r\n\t\t\tif (mayorEdad) {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(), null);\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t} else {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(),\r\n\t\t\t\t\t\tgetDniRepresentante() + \";\" + getNombreRepresentante());\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t}\r\n\t\t\tMensaje.crearMensajeINFO(\"Reserva realizada correctamente, no olvide descargar su contrato.\");\r\n\t\t} else {\r\n\t\t\tMensaje.crearMensajeWARN(\"El sitio seleccionado ya esta copado, favor eliga otro.\");\r\n\t\t}\r\n\t}", "private void inicializarFechaHora(){\n Calendar c = Calendar.getInstance();\r\n year1 = c.get(Calendar.YEAR);\r\n month1 = (c.get(Calendar.MONTH)+1);\r\n String mes1 = month1 < 10 ? \"0\"+month1 : \"\" +month1;\r\n String dia1 = \"01\";\r\n\r\n String date1 = \"\"+dia1+\"/\"+mes1+\"/\"+year1;\r\n txt_fecha_desde.setText(date1);\r\n\r\n\r\n day2 = c.getActualMaximum(Calendar.DAY_OF_MONTH) ;\r\n String date2 = \"\"+day2+\"/\"+mes1+\"/\"+ year1;\r\n\r\n Log.e(TAG,\"date2: \" + date2 );\r\n txt_fecha_hasta.setText(date2);\r\n\r\n }", "public void GetAvailableDates()\n\t{\n\t\topenDates = new ArrayList<TimePeriod>(); \n\t\t\n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t\t\t\n\t\t\tString query = \"SELECT startDate, endDate FROM Available WHERE available_hid = '\"+hid+\"'\"; \n\t\t\tResultSet rs = con.stmt.executeQuery(query);\n\t\t\t\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tTimePeriod tp = new TimePeriod(); \n\t\t\t\ttp.stringStart = rs.getString(\"startDate\"); \n\t\t\t\ttp.stringEnd = rs.getString(\"endDate\"); \n\t\t\t\ttp.StringToDate();\n\t\t\t\t\n\t\t\t\topenDates.add(tp); \n\t\t\t}\n\t\t\tcon.closeConnection(); \n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "public void reservarSitio() {\r\n\t\ttry {\r\n\t\t\tif (sitioId == null)\r\n\t\t\t\tMensaje.crearMensajeWARN(\"Debe seleccionar sitio para la reserva.\");\r\n\t\t\telse if (!mayorEdad && (getDniRepresentante() == null || getNombreRepresentante() == null\r\n\t\t\t\t\t|| getDniRepresentante().trim().isEmpty() || getDniRepresentante().length() < 9\r\n\t\t\t\t\t|| !Funciones.isNumeric(getDniRepresentante()) || !Funciones.validacionCedula(getDniRepresentante())\r\n\t\t\t\t\t|| getNombreRepresentante().trim().isEmpty()))\r\n\t\t\t\tMensaje.crearMensajeWARN(\"Los datos de representante son requeridos, y la cédula debe ser válida.\");\r\n\t\t\telse {\r\n\t\t\t\tif (reserva != null) {// POSEE RESERVA\r\n\t\t\t\t\tmodificarReserva();\r\n\t\t\t\t\tSystem.out.println(\"MODIFICA\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tingresarReserva();\r\n\t\t\t\t\tSystem.out.println(\"INGRESA\");\r\n\t\t\t\t}\r\n\t\t\t\tfinalizado = true;\r\n\t\t\t\treserva = mngRes.buscarReservaPorID(getDniEstudiante(), periodo.getPrdId());// CARGAR\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// RESERVA\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ACTUAL\r\n\t\t\t\tcargarSitiosLibres();\r\n\t\t\t\tcargarEstudiantesSitio();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tMensaje.crearMensajeERROR(\"Error al realizar reserva: \" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void dataPadrao() {\n Calendar c = Calendar.getInstance();\n SimpleDateFormat s = new SimpleDateFormat(\"dd/MM/yyyy\");\n String dataAtual = s.format(c.getTime());\n c.add(c.MONTH, 1);\n String dataAtualMaisUm = s.format(c.getTime());\n dataInicial.setText(dataAtual);\n dataFinal.setText(dataAtualMaisUm);\n }", "public static void main(String[] args){\n \r\n Log.registroTraza( \"Iniciando ejecución de la tarea SolicitudesAVencerse\");\r\n \r\n String strSQL, strFechaRecibo, strReqRpta, strRadicado, strIdResp = \"\";\r\n int totalSolAlertadas=0, totalSolVencidas=0;\r\n String[] strTemp = null;\r\n int lgTiempoRpta, lgRestante, lgTiempoConfig; \r\n Vector arrConsecutivos = new Vector();\r\n Vector arrFechasCreacion = new Vector();\r\n Vector arrReqRpta = new Vector();\r\n Vector arrTiempoRpta = new Vector();\r\n Vector arrIdsResp = new Vector();\r\n Comunes comun = new Comunes();\r\n Notificacion n = new Notificacion();\r\n Calendar fechaRecibo = null;\r\n Calendar fechaRpta = null;\r\n Calendar fechaActual = null;\r\n \r\n try{\r\n strSQL = \"select g.txtNroDiasAlerta from buzon.buzon_generales g where g.txtCodigo = 'frmGeneral'\";\r\n String[] strDatosGral = GestionSQL.getFila(strSQL, \"Buzon\");\r\n lgTiempoConfig = Integer.parseInt(strDatosGral[0]);\r\n \r\n strSQL = \"select DISTINCT p.txtRadicado, p.dtFechaCreacion, r.txtReqRpta, r.txtTiempoRpta, p.txtNomCargo from buzon_pqrs p INNER JOIN buzon_retroalimentacion r on (p.txtTipoPQRS = r.txtCodigo) where (p.txtIdEstado <> 'AT' and p.txtIdEstado <> 'CPU') ORDER BY CAST(p.txtRadicado AS SIGNED)\";\r\n Vector arrSols = GestionSQL.consultaSQL(strSQL,\"Buzon\",\"ALERTASSOLS\");\r\n \r\n if (arrSols != null){ \r\n for (int i=0;i<arrSols.size();i++){\r\n strTemp = arrSols.get(i).toString().split(\",\");\r\n arrConsecutivos.add(strTemp[0]);\r\n arrFechasCreacion.add(strTemp[1]);\r\n arrReqRpta.add(strTemp[2]);\r\n arrTiempoRpta.add(strTemp[3]); \r\n arrIdsResp.add(strTemp[4]);\r\n } \r\n\r\n //Obtener los feriados.\r\n\r\n Vector arrFechas = new Vector();\r\n strSQL = \"SELECT d.dtFecha from users.users_dias_no_habiles d order by d.dtFecha\";\r\n arrFechas = GestionSQL.consultaSQL(strSQL, \"Users\", \"FECHAS\"); \r\n\r\n for(int i=0;i<arrConsecutivos.size();i++){\r\n strRadicado = arrConsecutivos.get(i).toString(); \r\n strReqRpta = arrReqRpta.get(i).toString();\r\n strIdResp = arrIdsResp.get(i).toString();\r\n lgRestante = 0; \r\n fechaRecibo = null;\r\n fechaRpta = null;\r\n fechaActual = comun.calcularFechaActual();\r\n\r\n if (strReqRpta.equals(\"S\")){ \r\n lgTiempoRpta = Integer.parseInt(arrTiempoRpta.get(i).toString());\r\n fechaRecibo = Calendar.getInstance(); \r\n\r\n strFechaRecibo = arrFechasCreacion.get(i).toString();\r\n strTemp = strFechaRecibo.split(\"-\"); \r\n fechaRecibo.set(Integer.parseInt(strTemp[0]),(Integer.parseInt(strTemp[1])-1),Integer.parseInt(strTemp[2]));\r\n fechaRecibo.set(Calendar.SECOND, 0);\r\n fechaRecibo.set(Calendar.MILLISECOND, 0); \r\n\r\n fechaRpta= Calendar.getInstance();\r\n fechaRpta.set(Calendar.SECOND, 0);\r\n fechaRpta.set(Calendar.MILLISECOND, 0); \r\n fechaRpta = comun.incrementarDiasHabiles(fechaRecibo, lgTiempoRpta, arrFechas); \r\n\r\n lgRestante = (comun.getDiasHabiles(fechaActual, fechaRpta, arrFechas)-1); \r\n\r\n if ((lgRestante <= lgTiempoConfig) && (lgRestante > 0)){ \r\n n.NotificacionSolAVencer(strRadicado, Long.valueOf(lgRestante + 1), strIdResp); \r\n totalSolAlertadas = totalSolAlertadas + 1;\r\n }else{\r\n if (lgRestante<0){\r\n n.NotificacionSolVencidas(strRadicado, fechaRpta, strIdResp);\r\n totalSolVencidas = totalSolVencidas + 1;\r\n } \r\n } \r\n } \r\n }\r\n }\r\n }catch(Exception e){\r\n Log.registroTraza(\"Se generó un error en la tarea SolicitudesAVencerse: \" + e.getMessage());\r\n }\r\n\r\n SimpleDateFormat formato = new SimpleDateFormat(\"hh:mm:ss\");\r\n Log.registroTraza( \"Tarea SolicitudesAVencerse invocada a la hora: \" + formato.format(new Date()) + \". Solicitudes alertadas: \" + totalSolAlertadas + \". Solicitudes vencidas: \" + totalSolVencidas);\r\n\r\n }", "public void run() {\r\n\t\tDate fechaActual = new Date();\r\n\t\ttry {\r\n\t\t\t// Actual\r\n\t\t\tint horaActual = Integer.parseInt(ManipulacionFechas\r\n\t\t\t\t\t.getHora(fechaActual));\r\n\t\t\tint minutosActual = Integer.parseInt(ManipulacionFechas\r\n\t\t\t\t\t.getMinutos(fechaActual));\r\n\r\n\t\t\tint horaInicialRangoEjecucion = Integer\r\n\t\t\t\t\t.parseInt(Util\r\n\t\t\t\t\t\t\t.loadParametersValue(\"HORA_INICIAL_RANGO_EJECUCION_COBRO_CIAT_CASA_CIAT\"));\r\n\t\t\tint minutosInicialRangoEjecucion = Integer\r\n\t\t\t\t\t.parseInt(Util\r\n\t\t\t\t\t\t\t.loadParametersValue(\"MINUTOS_INICIAL_RANGO_EJECUCION_COBRO_CIAT_CASA_CIAT\"));\r\n\r\n\t\t\tint horaFinalRangoEjecucion = Integer\r\n\t\t\t\t\t.parseInt(Util\r\n\t\t\t\t\t\t\t.loadParametersValue(\"HORA_FINAL_RANGO_EJECUCION_COBRO_CIAT_CASA_CIAT\"));\r\n\t\t\tint minutosFinalRangoEjecucion = Integer\r\n\t\t\t\t\t.parseInt(Util\r\n\t\t\t\t\t\t\t.loadParametersValue(\"MINUTOS_FINAL_RANGO_EJECUCION_COBRO_CIAT_CASA_CIAT\"));\r\n\r\n\t\t\t// Tiempo Actual en Minutos\r\n\t\t\tint tiempoActual = (horaActual * 60) + minutosActual;\r\n\r\n\t\t\t// Tiempos de Rango de Ejecucion en Minutos\r\n\t\t\tint rangoInicial = (horaInicialRangoEjecucion * 60)\r\n\t\t\t\t\t+ minutosInicialRangoEjecucion;\r\n\t\t\tint rangoFinal = (horaFinalRangoEjecucion * 60)\r\n\t\t\t\t\t+ minutosFinalRangoEjecucion;\r\n\r\n\t\t\t// Pregunta si la hora actual esta dentro del rango de ejecucion de\r\n\t\t\t// la tarea\r\n\t\t\tif ((tiempoActual >= rangoInicial) && (tiempoActual <= rangoFinal)) {\r\n\t\t\t\tDate start = new Date();\r\n\t\t\t\tlog\r\n\t\t\t\t\t\t.info(\"--- Corriendo proceso automatico Cobro de Ciat Casa Ciat : \"\r\n\t\t\t\t\t\t\t\t+ start + \"----\");\r\n\t\t\t\tnew BillingAccountServiceImpl().CobroCiatCasaCiat();\r\n\r\n\t\t\t\tDate end = new Date();\r\n\t\t\t\tlog\r\n\t\t\t\t\t\t.info(\"--- Termina proceso Envio de notificaciones automaticas Cobro de Ciat Casa Ciat \"\r\n\t\t\t\t\t\t\t\t+ start + \"----\");\r\n\t\t\t\tlog\r\n\t\t\t\t\t\t.info(end.getTime()\r\n\t\t\t\t\t\t\t\t- start.getTime()\r\n\t\t\t\t\t\t\t\t+ \" total milliseconds en realizar tarea automatica Cobro de Ciat Casa Ciat : \");\r\n\r\n\t\t\t}// Fin if\r\n\t\t\telse {\r\n\t\t\t\tlog\r\n\t\t\t\t\t\t.info(\"--- Tarea Automatica de notificacion Cobro de Ciat Casa Ciat en espera... \"\r\n\t\t\t\t\t\t\t\t+ new Date() + \" ----\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog\r\n\t\t\t\t\t.error(\"Error RUN Tarea Automatica de notificacion Cobro de Ciat Casa Ciat: \"\r\n\t\t\t\t\t\t\t+ e.getMessage());\r\n\t\t}\r\n\r\n\t\tfechaActual = null;\r\n\r\n\t}", "public void initialiserCompte() {\n DateTime dt1 = new DateTime(date1).withTimeAtStartOfDay();\n DateTime dt2 = new DateTime(date2).withEarlierOffsetAtOverlap();\n DateTime dtIt = new DateTime(date1).withTimeAtStartOfDay();\n Interval interval = new Interval(dt1, dt2);\n\n\n\n// while (dtIt.isBefore(dt2)) {\n while (interval.contains(dtIt)) {\n compte.put(dtIt.toDate(), 0);\n dtIt = dtIt.plusDays(1);\n }\n }", "public static void checkReservationPossible(Resource resource, ReservationInfo reservationInfo) throws GestionResourceException{\n\t\tif(reservationInfo.getDateStart() == null || reservationInfo.getDateEnd() == null){\n\t\t\tthrow new GestionResourceException(\"le date de debut ou la date de fin est null \", \"1.0\");\n\t\t}\n\t\telse {\n\n\t\t\tDate dateStart=reservationInfo.getDateStart();\n\t\t\tDate dateEnd=reservationInfo.getDateEnd();\n\t\t\tint dureeMax=resource.getDureeMax();\n\n\t\t\tswitch (resource.getTypeDate()) {\n\t\t\tcase HOUR: \n\t\t\t\tint hours=hoursDifference(dateStart, dateEnd,TypeDate.HOUR);\n\t\t\t\tif(hours>dureeMax){\n\t\t\t\t\tthrow new GestionResourceException(\"La duree de reservation est superieure a la duree mas du resource\"\n\t\t\t\t\t\t\t+\" nb: la duree max est :\"+dureeMax+\" heures\", \"1.1\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase DAY :\n\t\t\t\tint days=hoursDifference(dateStart, dateEnd,TypeDate.DAY);\n\t\t\t\tif(days>dureeMax){\n\t\t\t\t\tthrow new GestionResourceException(\"La duree de reservation est superieure a la duree mas du resource\"\n\t\t\t\t\t\t\t+\" nb: la duree max est :\"+dureeMax+\" jours\", \"1.1\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase WEEK:\n\n\t\t\t\tint weeks=hoursDifference(dateStart, dateEnd,TypeDate.WEEK);\n\t\t\t\tif(weeks>dureeMax){\n\t\t\t\t\tthrow new GestionResourceException(\"La duree de reservation est superieure a la duree mas du resource\"\n\t\t\t\t\t\t\t+\" nb: la duree max est :\"+dureeMax+\" semaines\", \"1.1\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}", "private void setUp() {\r\n Calendar calendar1 = Calendar.getInstance();\r\n calendar1.set((endDate.get(Calendar.YEAR)), \r\n (endDate.get(Calendar.MONTH)), (endDate.get(Calendar.DAY_OF_MONTH)));\r\n calendar1.roll(Calendar.DAY_OF_YEAR, -6);\r\n \r\n Calendar calendar2 = Calendar.getInstance();\r\n calendar2.set((endDate.get(Calendar.YEAR)), \r\n (endDate.get(Calendar.MONTH)), (endDate.get(Calendar.DAY_OF_MONTH)));\r\n \r\n acceptedDatesRange[0] = calendar1.get(Calendar.DAY_OF_YEAR);\r\n acceptedDatesRange[1] = calendar2.get(Calendar.DAY_OF_YEAR); \r\n \r\n if(acceptedDatesRange[1] < 7) {\r\n acceptedDatesRange[0] = 1; \r\n }\r\n \r\n //MiscStuff.writeToLog(\"Ranges set \" + calendar1.get\r\n // (Calendar.DAY_OF_YEAR) + \" \" + calendar2.get(Calendar.DAY_OF_YEAR));\r\n }", "public List<ConsultationReservation> getConsultationReservationsByUserToday(InternalUser user) throws SQLException{\n\t\t\n\t\treturn super.manager.getConsultationReservationByUser(user, LocalDate.now(), true, false);\n\t}", "@Override\n\tprotected void setNextSiegeDate()\n\t{\n\t\tif(_siegeDate.getTimeInMillis() < Calendar.getInstance().getTimeInMillis())\n\t\t{\n\t\t\t_siegeDate = Calendar.getInstance();\n\t\t\t// Осада не чаще, чем каждые 4 часа + 1 час на подготовку.\n\t\t\tif(Calendar.getInstance().getTimeInMillis() - getSiegeUnit().getLastSiegeDate() * 1000L > 14400000)\n\t\t\t\t_siegeDate.add(Calendar.HOUR_OF_DAY, 1);\n\t\t\telse\n\t\t\t{\n\t\t\t\t_siegeDate.setTimeInMillis(getSiegeUnit().getLastSiegeDate() * 1000L);\n\t\t\t\t_siegeDate.add(Calendar.HOUR_OF_DAY, 5);\n\t\t\t}\n\t\t\t_database.saveSiegeDate();\n\t\t}\n\t}", "public String[] getStarDate2(){\n\t\tstardate = new String[3];\n\t\t\n\t\tCalendar originaldate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\tCalendar instancedate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\t\t\t\n\t\t//originaldate.set(2008, 8, 8, 0, 0, 0);\n\t\toriginaldate.set(2162, 0, 4, 0, 0, 0);\n\t\t\n\t\t/*instancedate.add(Calendar.HOUR, 7);\n\t\tinstancedate.add(Calendar.MINUTE, 33);\n\t\tinstancedate.add(Calendar.YEAR, 156);\n\t\tinstancedate.add(Calendar.HOUR, -6*24);\n\t\tinstancedate.add(Calendar.MONTH, -3);*/\n\t\t\n\t\t\n\t\t// Get the represented date in milliseconds\n\t\tlong milis1 = originaldate.getTimeInMillis();\n\t\tlong milis2 = instancedate.getTimeInMillis();\n\t\t\n\t\t// Calculate difference in milliseconds\n\t\tlong diff = milis2 - milis1;\n\t\t \n\t\t// Calculate difference in seconds\n\t\tlong diffSeconds = diff / 1000;\n\t\t \n\t\t// Calculate difference in minutes\n\t\t//long diffMinutes = diff / (60 * 1000);\n\t\t\n\t\t// Calculate difference in hours\n\t\t//long diffHours = diff / (60 * 60 * 1000);\n\t\t\n\t\t// Calculate difference in days\n\t\t//long diffDays = diff / (24 * 60 * 60 * 1000);\n\t\t\n\t\t//double dec = -280000 - ((double)diffSeconds / 17280.0f);\n\t\tdouble dec = ((double)diffSeconds / 17280.0f);\n\t\t\t\t\n\t\tint mantel = (int)Math.ceil(dec/10000.0f);\n\t\t\t\t\n\t\tdouble kropp = (dec + (-(mantel-1)*10000.0f));\n\t\t\n\t\tif(kropp >= 10000) mantel += 2; //Fixing rounding error\n\t\t\n\t\tdouble mantelkropp = ((mantel-1) * 10000.0f) - kropp;\n\t\t\n\t\t/*Log.v(TAG, \"Diff: \" + Long.toString(diff));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(dec));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Integer.toString(mantel));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(kropp));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(mantelkropp));*/\n\t\t\n\t\tdec = mantelkropp;\n\t\t\n\t\tDecimalFormat maxDigitsFormatter;\n\t\tif(dec < 0)\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"#000000.0000\");\n\t\telse\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"0000000.0000\");\n \n try {\n\t stardate[0] = \"[\" + (maxDigitsFormatter.format(dec)).substring(0, 3) + \"]\";\n\t stardate[1] = \" 0\" + (maxDigitsFormatter.format(dec)).substring(3, 9);\n\t stardate[2] = \"\" + (maxDigitsFormatter.format(dec)).substring(9, 11);\n } catch(StringIndexOutOfBoundsException sbe) {\n \tif(DEBUG) Log.v(TAG, \"Could not format \" + sbe);\n \tif(DEBUG) Log.v(TAG, maxDigitsFormatter.format(dec));\n \tstardate[2] = \"--\"; \t \n }\n \n Log.v(TAG, \"Stardate: \" + stardate[0] + stardate[1] + stardate[2]);\n return stardate;\n\t\t\n\t}", "public void introducirConsumosHotelFechas(Date fechaInicial, Date fechaFinal,TablaModelo modelo) {\n long tiempo = fechaInicial.getTime();\n java.sql.Date fechaInicialSql = new java.sql.Date(tiempo);\n long tiempo2= fechaFinal.getTime();\n java.sql.Date fechaFinalSQL = new java.sql.Date(tiempo2);\n try {// mira los consumo de unas fechas\n PreparedStatement declaracion;// prepara la orden \n declaracion = conexion.prepareStatement(\"SELECT * FROM CONSUMO_RESTAURANTE WHERE Fecha_Consumo>=? AND Fecha_Consumo<=?\");\n declaracion.setDate(1,fechaInicialSql);\n declaracion.setDate(2,fechaFinalSQL);\n ResultSet resultado = declaracion.executeQuery();\n while (resultado.next()) {// mira los consumo de unas fechas\n Object objeto[] = new Object[7];\n objeto[0] = resultado.getInt(1);\n objeto[1] = resultado.getInt(2);// mira los consumo de unas fechas\n objeto[2] = resultado.getString(3);\n objeto[3] = resultado.getInt(4);\n objeto[4] = resultado.getInt(5);\n objeto[5] = resultado.getDate(6);// mira los consumo de unas fechas\n int total = (Integer)objeto[3]*(Integer)objeto[4];\n objeto[6]= total;\n modelo.addRow(objeto);// mira los consumo de unas fechas\n } // maneja el resultado \n\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }", "public void hora()\n {\n horaTotal = HoraSalida - HoraLlegada;\n\n }", "@Override\n public long minutosOcupados(Integer idEstacion, Date inicio, Date fin) {\n long minutos = 0;\n String sql = \"SELECT eje FROM Recurso rec, Ejecucion eje WHERE rec.idestacion = :idEstacion AND eje.idrecurso = rec.idrecurso AND eje.fechafin >= :inicio AND eje.fechainicio < :fin\";\n List<Ejecucion> ejecuciones = getCurrentSession().createQuery(sql).setParameter(\"idEstacion\", idEstacion).setParameter(\"inicio\", inicio).setParameter(\"fin\", fin).list();\n for (Ejecucion next : ejecuciones) {\n Date inicioEjecucion = next.getFechainicio();\n Date finEjecucion = next.getFechafin();\n if (inicioEjecucion.before(inicio) && finEjecucion.before(fin)) {\n //Comienza en inicio y finaliza en el fin de la ejecucion\n minutos = minutos + Math.abs(finEjecucion.getTime() - inicio.getTime())/60000;\n \n } else if (inicioEjecucion.after(inicio) && finEjecucion.before(fin)) {\n //Comienza en inicio de la ejecucion y finaliza en el fin de la ejecucion\n minutos = minutos + Math.abs(fin.getTime() - inicioEjecucion.getTime())/60000;\n \n }else if (inicioEjecucion.after(inicio) && finEjecucion.after(fin)){\n //Comienza en inicio de la ejecucion y finaliza en el fin\n minutos = minutos + Math.abs(fin.getTime() - inicioEjecucion.getTime())/60000;\n \n } else if (inicioEjecucion.before(inicio) && finEjecucion.after(fin)) {\n //Comienza en inicio y finaliza en el fin\n minutos = minutos + Math.abs(fin.getTime() - inicio.getTime())/60000;\n }\n }\n return minutos;\n }", "public static void main(String[] args) {\n\t\tCalendar now = Calendar.getInstance();\r\n\t\tint hour = now.get(Calendar.HOUR_OF_DAY);\r\n\t\tint minute = now.get(Calendar.MINUTE);\r\n\t\tint month = now.get(Calendar.MONTH + 1);\r\n\t\tint day = now.get(Calendar.DAY_OF_MONTH);\r\n\t\tint year = now.get(Calendar.YEAR);\r\n\r\n\t\tSystem.out.println(now.getTime());\r\n\r\n\t\t// Crear una fecha fija\r\n\t\tCalendar sameDate = new GregorianCalendar(2010, Calendar.FEBRUARY, 22, 23, 11, 44);\r\n\r\n\t\t// mostrar los agradecimientos\r\n\t\tif (hour < 12)\r\n\t\t\tSystem.out.println(\"Buenos días. \\n\");\r\n\t\telse if (hour < 17)\r\n\t\t\tSystem.out.println(\"Buenas tardes. \\n\");\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Buenas noches charAt(\\n)\");\r\n\r\n\t\t// Mostrar minutos\r\n\t\tSystem.out.println(\"It is\");\r\n\t\tif (minute != 0) {\r\n\t\t\tSystem.out.print(\" \" + minute + \" \");\r\n\t\t\tSystem.out.print((minute != 1) ? \"minutes\" : \"minute\");\r\n\t\t\tSystem.out.print(\" past\");\r\n\t\t}\r\n\t\t// Mostrar la hora\r\n\t\tSystem.out.print(\" \");\r\n\t\tSystem.out.print((hour > 12) ? (hour - 12) : hour);\r\n\t\tSystem.out.print(\" o'clock on \\n\");\r\n\r\n\t\t// Mostrar el mes\r\n\r\n\t\tSystem.out.print(\"Estamos en el mes de: \");\r\n\t\tswitch (month) {\r\n\t\tcase 1:\r\n\t\t\tSystem.out.println(\"Enero\");\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tSystem.out.println(\"Febrero\");\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tSystem.out.println(\"Marzo\");\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tSystem.out.println(\"Abril\");\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tSystem.out.println(\"Mayo\");\r\n\t\t\tbreak;\r\n\t\tcase 6:\r\n\t\t\tSystem.out.println(\"Junio\");\r\n\t\t\tbreak;\r\n\t\tcase 7:\r\n\t\t\tSystem.out.println(\"Julio\");\r\n\t\t\tbreak;\r\n\t\tcase 8:\r\n\t\t\tSystem.out.println(\"Agosto\");\r\n\t\t\tbreak;\r\n\t\tcase 9:\r\n\t\t\tSystem.out.println(\"Septiembre\");\r\n\t\t\tbreak;\r\n\t\tcase 10:\r\n\t\t\tSystem.out.println(\"Octubre\");\r\n\t\t\tbreak;\r\n\t\tcase 11:\r\n\t\t\tSystem.out.println(\"Noviembre\");\r\n\t\t\tbreak;\r\n\t\tcase 12:\r\n\t\t\tSystem.out.println(\"Diciembre\");\r\n\r\n\t\t}\r\n\t}", "private void loadScheduleList() {\n\n if (listTbagendamentos != null && !listTbagendamentos.isEmpty()) {\n scheduleAgendamento.clear();\n\n for (Tbagendamento agendamento : listTbagendamentos) {\n DefaultScheduleEvent defaultScheduleEvent = new DefaultScheduleEvent();\n defaultScheduleEvent.setTitle(agendamento.getIdcliente().getNmcliente());\n\n Calendar dtDataInicial = new GregorianCalendar();\n dtDataInicial.setTime(agendamento.getTmdataagendamento());\n\n defaultScheduleEvent.setStartDate(dtDataInicial.getTime());\n\n Calendar dtDataFinal = new GregorianCalendar();\n dtDataFinal.setTime(agendamento.getTmdataagendamento());\n dtDataFinal.set(Calendar.MINUTE, dtDataFinal.get(Calendar.MINUTE) + 30);\n\n defaultScheduleEvent.setEndDate(dtDataFinal.getTime());\n defaultScheduleEvent.setData(agendamento.getIdagendamento());\n scheduleAgendamento.addEvent(defaultScheduleEvent);\n }\n }\n }", "@Override\n public List<LocalTime> getAvailableTimesForServiceAndDate(final com.wellybean.gersgarage.model.Service service, LocalDate date) {\n\n LocalTime garageOpening = LocalTime.of(9,0);\n LocalTime garageClosing = LocalTime.of(17, 0);\n\n // List of all slots set as available\n List<LocalTime> listAvailableTimes = new ArrayList<>();\n for(LocalTime slot = garageOpening; slot.isBefore(garageClosing); slot = slot.plusHours(1)) {\n listAvailableTimes.add(slot);\n }\n\n Optional<List<Booking>> optionalBookingList = bookingService.getAllBookingsForDate(date);\n\n // This removes slots that are occupied by bookings on the same day\n if(optionalBookingList.isPresent()) {\n List<Booking> bookingsList = optionalBookingList.get();\n for(Booking booking : bookingsList) {\n int bookingDurationInHours = booking.getService().getDurationInMinutes() / 60;\n // Loops through all slots used by the booking and removes them from list of available slots\n for(LocalTime bookingTime = booking.getTime();\n bookingTime.isBefore(booking.getTime().plusHours(bookingDurationInHours));\n bookingTime = bookingTime.plusHours(1)) {\n\n listAvailableTimes.remove(bookingTime);\n }\n }\n }\n\n int serviceDurationInHours = service.getDurationInMinutes() / 60;\n\n // To avoid concurrent modification of list\n List<LocalTime> listAvailableTimesCopy = new ArrayList<>(listAvailableTimes);\n\n // This removes slots that are available but that are not enough to finish the service. Example: 09:00 is\n // available but 10:00 is not. For a service that takes two hours, the 09:00 slot should be removed.\n for(LocalTime slot : listAvailableTimesCopy) {\n boolean isSlotAvailable = true;\n // Loops through the next slots within the duration of the service\n for(LocalTime nextSlot = slot.plusHours(1); nextSlot.isBefore(slot.plusHours(serviceDurationInHours)); nextSlot = nextSlot.plusHours(1)) {\n if(!listAvailableTimes.contains(nextSlot)) {\n isSlotAvailable = false;\n break;\n }\n }\n if(!isSlotAvailable) {\n listAvailableTimes.remove(slot);\n }\n }\n\n return listAvailableTimes;\n }", "private Calendar modificarHoraReserva(Date horaInicio, int hora) {\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(horaInicio);\n calendar.set(Calendar.HOUR, hora);\n calendar.set(Calendar.MINUTE, 0);\n calendar.set(Calendar.MINUTE, 0);\n return calendar;\n }", "void Planificar(Reserva unaReserva);", "private void procurarData() {\n if (jDateIni.getDate() != null && jDateFim.getDate() != null) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String data = sdf.format(jDateIni.getDate());\n String data2 = sdf.format(jDateFim.getDate());\n carregaTable(id, data, data2);\n JBreg.setEnabled(false);\n }\n }", "@SuppressWarnings(\"static-access\")\n\tprivate void initData() {\n\t\tstartDate = startDate.now();\n\t\tendDate = endDate.now();\n\t}", "public void instants() {\n\t\tInstant now = Instant.now(); // do something time consuming Instant\n\t\tInstant later = Instant.now();\n\t\tDuration duration = Duration.between(now, later);\n\t\tSystem.out.println(duration.toMillis());\n\n\t\tLocalDate date = LocalDate.of(2015, 5, 25);\n\t\tLocalTime time = LocalTime.of(11, 55, 00);\n\t\tZoneId zone = ZoneId.of(\"US/Eastern\");\n\t\tZonedDateTime zonedDateTime = ZonedDateTime.of(date, time, zone);\n\t\tInstant instant = zonedDateTime.toInstant();\n\n\t\tInstant nextDay = instant.plus(1, ChronoUnit.DAYS);\n\t\tSystem.out.println(nextDay);\n\t\tInstant nextHour = instant.plus(1, ChronoUnit.HOURS);\n\t\tSystem.out.println(nextHour);\n\t\t// Instant nextWeek = instant.plus(1, ChronoUnit.WEEKS); // exception\n\t}", "public static void main(String [] args){//inicio del main\r\n\r\n Scanner sc= new Scanner(System.in); \r\n\r\nSystem.out.println(\"ingrese los segundos \");//mesaje\r\nint num=sc.nextInt();//total de segundos\r\nint hor=num/3600;//total de horas en los segundos\r\nint min=(num-(3600*hor))/60;//total de min en las horas restantes\r\nint seg=num-((hor*3600)+(min*60));//total de segundo sen los miniutos restantes\r\nSystem.out.println(\"Horas: \" + hor + \" Minutos: \" + min + \" Segundos: \" + seg);//salida del tiempo\r\n\r\n}", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "public static void main(String[] args) {\n LocalDate firstDate = citesteDeLaTastatura();\n LocalDate secconddate = citesteDeLaTastatura();\n System.out.println(firstDate);\n System.out.println(secconddate);\n\n Period perioada = Period.between(firstDate,secconddate);\n System.out.println(perioada);\n }", "private void estadoInicial(){\n double referencias[] = new double[sigmas.length];\n for(int i=0;i<sigmas.length;i++){\n referencias[i] = (ppl.limiteSuperiorR(i+1)+ppl.limiteInferiorR(i+1))/2;\n System.out.printf(\"limS:%g, limI:%g, Referencias[%d] = %g\\n\",ppl.limiteSuperiorR(i+1),ppl.limiteInferiorR(i+1),i,referencias[i]);\n }\n\n double Zc = ppl.Z(referencias[0],referencias[1]);\n TActual = Zc*0.2;\n System.out.printf(\"TActual:T%g \\n\",TActual);\n\n estadoMejor = new Estado(\n iteracionActual, \n TActual, \n referencias,\n Zc);\n\n calcularSoluciones(estadoMejor);\n calcularProbabilidadAceptacion(estadoMejor);\n\n historialEstados.add(estadoMejor);\n }", "public static void main(String[] args) {\n\t\tLocalDate hoje = LocalDate.now();\n\t\tSystem.out.println(hoje);\n\t\t\n\t\t//Criando nova data\n\t\tLocalDate olimpiadas = LocalDate.of(2016, Month.JUNE, 5);\n\t\tSystem.out.println(olimpiadas);\n\t\t\n\t\t//Calculando diferenca de anos\n\t\tint anos = olimpiadas.getYear() - hoje.getYear();\n\t\tSystem.out.println(anos);\n\n\t\t//Demonstracao de imutabilidade\n\t\tolimpiadas.plusYears(4);\n\t\tSystem.out.println(olimpiadas);\n\t\t\n\t\tLocalDate proximasOlimpiadas = olimpiadas.plusYears(4);\n\t\tSystem.out.println(proximasOlimpiadas);\n\t\t\n\t\t//Periodo entre data de inicio e fim \n\t\tPeriod periodo = Period.between(hoje, olimpiadas);\n\t\tSystem.out.println(periodo);\n\n\t\t//Formata data \n\t\tDateTimeFormatter formataData = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\n\t\tSystem.out.println(proximasOlimpiadas.format(formataData));\n\t\t\n\t\t//Craindo data e hora\n\t\tLocalDateTime agora = LocalDateTime.now();\n\t\tSystem.out.println(agora);\n\t\t\n\t\t//Formatando data e hora\n\t\t//Obs.: O formatado de data e hora nao pode ser usado para formata data.\n\t\tDateTimeFormatter formataDataComHoras = DateTimeFormatter.ofPattern(\"dd/MM/yyyy hh:mm\");\n\t\tSystem.out.println(agora.format(formataDataComHoras ));\n\t\t\n\t\tLocalTime intervalo = LocalTime.of(15, 30);\n\t\tSystem.out.println(intervalo);\n\t\t\n\t\t \n\t\t\n\t}", "public void menuprecoperiodo(String username) {\n Scanner s=new Scanner(System.in);\n LogTransportadora t=b_dados.getTrasnportadoras().get(username);\n double count=0;\n try {\n ArrayList<Historico> hist = b_dados.buscaHistoricoTransportadora(t.getCodEmpresa());\n System.out.println(\"Indique o ano:\");\n int ano=s.nextInt();\n System.out.println(\"Indique o mês\");\n int mes=s.nextInt();\n System.out.println(\"Indique o dia\");\n int dia=s.nextInt();\n for(Historico h: hist){\n LocalDateTime date=h.getDate();\n if(date.getYear()==ano && date.getMonthValue()==mes && date.getDayOfMonth()==dia){\n count+=h.getKmspercorridos()*t.getPrecokm();\n }\n }\n System.out.println(\"O total fatorado nesse dia foi de \" + count +\"€\");\n }\n catch (TransportadoraNaoExisteException e){\n System.out.println(e.getMessage());\n }\n }", "public ArrayList<Timestamp> generateNonSportSchedule(int faculties[], String course[] ,Date startDate, Date endDate){\r\n \t\r\n \t\r\n \tArrayList<CourseStructure > allCourseStructure = new ArrayList<CourseStructure>();\r\n \tArrayList<CourseStructure > tempCourseStructure = new ArrayList<CourseStructure>();\r\n \tArrayList<Timestamp> allFreeSlot = new ArrayList<Timestamp>();\r\n \t\r\n \t\r\n \t// get all structureCourse based on faculty\r\n \tif(faculties.length>0){\r\n \t\tFacultyCourseManager facultyCourseManager = new FacultyCourseManager();\r\n \t\tallCourseStructure = facultyCourseManager.getCourseByFaculty(faculties);\r\n \t}//end if(faculties.length>0)\r\n \t\r\n \t//get all structureCourse based on course\r\n \tif(course.length>0){\r\n \t\tCourseStructureManager coursestructure = new CourseStructureManager();\r\n \t\ttempCourseStructure = coursestructure.getAllCourseStructureByCourse(course);\r\n \t}//end if(course.length>0)\r\n \t\r\n \t//merge both CourseStructure Arraylist\r\n \tfor(int i =0 ; i<tempCourseStructure.size();i++){\r\n \t\tif(!allCourseStructure.contains(tempCourseStructure.get(i))){\r\n \t\t\tallCourseStructure.add(tempCourseStructure.get(i));\r\n \t\t}//end if(!allCourseStructure.contains(tempCourseStructure.get(i))){\r\n \t}//for(int i =0 ; i<tempCourseStructure.size();i++)\r\n \t\r\n \t\r\n \t\r\n \t /* implement a genetic algorithm\r\n \t * to find the best fit date\r\n \t */\r\n \t//variables\r\n \tArrayList<Timestamp> allSolutions = new ArrayList<Timestamp>();\r\n \tArrayList<Integer> solutionFitness = new ArrayList<Integer>();\r\n \tint totalTime,fitnessValue=0;\r\n \tTimestamp time = new Timestamp(startDate.getYear(), startDate.getMonth(), startDate.getDate(), 8, 0, 0, 0);\r\n \tboolean result;\r\n \t//initialize population\r\n \t/*university start at 8a.m to 8p.m\r\n \t * This makes 12 hr\r\n \t * Total time = (endDate -StartDate) * 12\r\n \t */\r\n \t \r\n \t\r\n \tlong daysBetween = endDate.getTime()- startDate.getTime();\r\n \t\r\n totalTime = (int)( (daysBetween * 12)/ (1000 * 60 * 60 * 24) );\r\n allSolutions.add(time);\r\n Calendar calender = Calendar.getInstance();\r\n \tfor(int i=1;i<totalTime;i++){\r\n \t\tif(time.getHours()>0 && time.getHours()<20){\r\n \t\t\tcalender.setTime(time);\r\n \t\t\t\r\n \t\t\tcalender.add(Calendar.HOUR, 1);\r\n \t\t\tlong tim = calender.getTime().getTime();\r\n \t\t\ttime = new Timestamp(tim);\r\n \t\t\tallSolutions.add(time);\r\n \t\t}//end if(time.getHours()>0 && time.getHours()<8){\r\n \t\telse{\r\n \t\t\tcalender.setTime(time);\r\n \t\t\t\r\n \t\t\tcalender.add(Calendar.HOUR, 12);\r\n \t\t\tlong tim = calender.getTime().getTime();\r\n \t\t\ttime = new Timestamp(tim);\r\n \t\t\tallSolutions.add(time); \t\t\t\r\n \t\t}//end else \t\t \t\t\r\n \t}//end for(int i=1;i<totalTime;i++){\r\n \t\r\n \t\r\n \t//fitness\r\n \t/*\r\n \t * if current timetable slot is free = increase by 1\r\n \t * if module is not in current timetable slot = increase by 1\r\n \t * if module is not a degree = increase by 1\r\n \t * if module is not year 3 = increase by 1 \r\n \t */\r\n \tTimetableManager timetableManager = new TimetableManager();\r\n \t//travel through population\r\n \tfor(int i=0; i<allSolutions.size();i++){\r\n \t\t//travel through course Structure\r\n \r\n \t\tfor(int j=0;j<allCourseStructure.size();j++){\r\n \t\t\t\r\n \t\t\t//check for current timetable slot\r\n \t\tint day = allSolutions.get(i).getDay();\r\n \t\tTime temTime = new Time(allSolutions.get(i).getTime());\r\n \t\t\r\n \t\t//check for course structure timetable slot\r\n \t\tresult = timetableManager.findTimetableByDayTime(temTime, getDays(day), allCourseStructure.get(j).getCourse_structure_id());\r\n \t\tif(!result){\r\n \t\t\tfitnessValue++;\r\n \t\t}//end if(!result) \r\n \t\t\t\r\n \t\t}//end for(int j=0;j<allCourseStructure.size();j++){\r\n \t\t\r\n \t\tsolutionFitness.add(fitnessValue);\r\n \t\tfitnessValue = 0;\r\n \t}//end for (int i=0; i<allSolutions.size();i++){\r\n \t\r\n \tint maxFitness = Collections.max(solutionFitness);\r\n \tfor(int i =0 ; i<allSolutions.size();i++){\r\n \t\tif(solutionFitness.get(i) == maxFitness){\r\n \t\t\tallFreeSlot.add(allSolutions.get(i));\r\n \t\t}\t\r\n \t}\r\n \t\r\n \t\r\n \t\r\n \treturn allFreeSlot; \t\r\n }", "@PostConstruct\n\tprotected void initialize() {\n\t\tzoomMax = 1000L * 60 * 60 * 24 * 30;\n\n\t\t// set initial start / end dates for the axis of the timeline (just for testing)\n\t\tCalendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n\t\tcal.set(2015, Calendar.FEBRUARY, 9, 0, 0, 0);\n\t\tstart = cal.getTime();\n\t\tcal.set(2015, Calendar.MARCH, 10, 0, 0, 0);\n\t\tend = cal.getTime();\n\n\t\t// create timeline model\n\t\tmodel = new TimelineModel();\n\n\t\t// Server-side dates should be in UTC. They will be converted to a local dates in UI according to provided TimeZone.\n\t\t// Submitted local dates in UI are converted back to UTC, so that server receives all dates in UTC again.\n\t\tcal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n\t\tcal.set(2015, Calendar.JANUARY, 2, 0, 0, 0);\n\t\tmodel.add(new TimelineEvent(new Booking(211, RoomCategory.DELUXE, \"(0034) 987-111\", \"One day booking\"), cal.getTime()));\n\n\t\tcal.set(2015, Calendar.JANUARY, 26, 0, 0, 0);\n\t\tDate begin = cal.getTime();\n\t\tcal.set(2015, Calendar.JANUARY, 28, 23, 59, 59);\n\t\tDate end = cal.getTime();\n\t\tmodel.add(new TimelineEvent(new Booking(202, RoomCategory.EXECUTIVE_SUITE, \"(0034) 987-333\", \"Three day booking\"), begin,\n\t\t end));\n\n\t\tcal.set(2015, Calendar.FEBRUARY, 10, 0, 0, 0);\n\t\tbegin = cal.getTime();\n\t\tcal.set(2015, Calendar.FEBRUARY, 15, 23, 59, 59);\n\t\tend = cal.getTime();\n\t\tmodel.add(new TimelineEvent(new Booking(150, RoomCategory.STANDARD, \"(0034) 987-222\", \"Six day booking\"), begin, end));\n\n\t\tcal.set(2015, Calendar.FEBRUARY, 23, 0, 0, 0);\n\t\tbegin = cal.getTime();\n\t\tcal.set(2015, Calendar.FEBRUARY, 27, 23, 59, 59);\n\t\tend = cal.getTime();\n\t\tmodel.add(new TimelineEvent(new Booking(178, RoomCategory.STANDARD, \"(0034) 987-555\", \"Five day booking\"), begin, end));\n\n\t\tcal = Calendar.getInstance();\n\t\tcal.set(2015, Calendar.MARCH, 6, 0, 0, 0);\n\t\tmodel.add(new TimelineEvent(new Booking(101, RoomCategory.SUPERIOR, \"(0034) 987-999\", \"One day booking\"), cal.getTime()));\n\n\t\tcal.set(2015, Calendar.MARCH, 19, 0, 0, 0);\n\t\tbegin = cal.getTime();\n\t\tcal.set(2015, Calendar.MARCH, 22, 23, 59, 59);\n\t\tend = cal.getTime();\n\t\tmodel.add(new TimelineEvent(new Booking(80, RoomCategory.JUNIOR, \"(0034) 987-444\", \"Four day booking\"), begin, end));\n\n\t\tcal.set(2015, Calendar.APRIL, 3, 0, 0, 0);\n\t\tbegin = cal.getTime();\n\t\tcal.set(2015, Calendar.APRIL, 4, 23, 59, 59);\n\t\tend = cal.getTime();\n\t\tmodel.add(new TimelineEvent(new Booking(96, RoomCategory.DELUXE, \"(0034) 987-777\", \"Two day booking\"), begin, end));\n\n\t\tcal.set(2015, Calendar.APRIL, 22, 0, 0, 0);\n\t\tbegin = cal.getTime();\n\t\tcal.set(2015, Calendar.MAY, 1, 23, 59, 59);\n\t\tend = cal.getTime();\n\t\tmodel.add(new TimelineEvent(new Booking(80, RoomCategory.JUNIOR, \"(0034) 987-444\", \"Ten day booking\"), begin, end));\n\t}", "public DefaultScheduleEvent getEventosCalendario(DateTime data, Servico servico) throws NullPointerException {\n\t\tList<ServicoJanelaAtendimento> servicoJanelaAtendimentos = new ArrayList<>();\n\t\tList<SolicitacaoServico> solicitacaoServicos = new ArrayList<>();\n\t\t\n\t\t\n\t\t\n\t\tgetServicoJanelaAtendimentoDAO().beginTransaction();\n\t\tservicoJanelaAtendimentos = getServicoJanelaAtendimentoDAO().getServicoJanelaPorDataJanela(data.toDate(), servico);\n\t\tgetServicoJanelaAtendimentoDAO().closeTransaction();\n\t\t\n\t\tDefaultScheduleEvent defaultScheduleEvent= new DefaultScheduleEvent();\n\t\tdefaultScheduleEvent.setAllDay(true);\n\t\tdefaultScheduleEvent.setData(data.toDate());\n\t\tdefaultScheduleEvent.setStartDate(data.toDate());\n\t\tdefaultScheduleEvent.setEndDate(data.plusHours(20).toDate());\n\t\t\n\t\t\n\t\tif(!servicoJanelaAtendimentos.isEmpty()) {\n\t\t\t\n\t\t\t\n\t\t\tgetSolicitacaoServicoDAO().beginTransaction();\n\t\t\tsolicitacaoServicos = getSolicitacaoServicoDAO().getSolicitacoesPorDataeServico(data.toDate(), servico);\n\t\t\tgetSolicitacaoServicoDAO().closeTransaction();\n\t\t\t\n\t\t\tint janelaServico = 0;\n\t\t\tint janelaSolicitacao = 0;\n\t\t\t\tfor(ServicoJanelaAtendimento servicoJanelaAtendimento: servicoJanelaAtendimentos) {\n\t\t\t\t\tjanelaServico = janelaServico + servicoJanelaAtendimento.getCapacidadePeriodo();\n\t\t\t\t}\n\t\t\t\tjanelaSolicitacao = solicitacaoServicos.size();\n\t\t\tint disponivel = janelaServico-janelaSolicitacao;\n\t\t\tif(disponivel > 0) {\n\t\t\t\tdefaultScheduleEvent.setTitle(\"Disponível\");\n\t\t\t\tdefaultScheduleEvent.setStyleClass(\"green\");\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tdefaultScheduleEvent.setTitle(\"Encaixe\");\n\t\t\t\tdefaultScheduleEvent.setStyleClass(\"red\");\n\t\t\t\t\n\t\t\t}\n\t\t}else {\n\t\tdefaultScheduleEvent.setTitle(\"Não Disponível\");\n\t\tdefaultScheduleEvent.setStyleClass(\"no-color\");\n\t\t}\n\t\t\n\t\treturn defaultScheduleEvent;\n\t}", "public void anazitisiSintagisVaseiHmerominias() {\n\t\tDate firstDt = null, lastDt = null;\n\t\ttmp_2 = 0;\n\t\tif(numOfPrescription != 0)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\" STOIXEIA SYNTAGWN\");\n\t\t\t// Emfanizw oles tis syntages\n\t\t\tfor(int j = 0; j < numOfPrescription; j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"\\n \" + j + \". STOIXEIA SYNTAGHS: \");\n\t\t\t\tprescription[j].print();\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\t// Zitaw apo ton xrhsth to xroniko euros kata to opoio exei graftei sintagh\n\t\t\tfirstDt = sir.readDate(\"DWSTE ARXIKH HMEROMHNIA: \");\n\t\t\tlastDt = sir.readDate(\"DWSTE TELIKH HMEROMHNIA: \");\n\t\t\tSystem.out.println();\n\t\t\tfor(i = 0; i < numOfPrescription; i++)\n\t\t\t{\n\t\t\t\t// An h hmeromhnia eggrafhs ths syntaghs einai anamesa sta xronika oria pou exei dwsei o xrhsths ektypwnetai\n\t\t\t\tif(firstDt.before(prescription[i].getDate()) && (lastDt.after(prescription[i].getDate()))) \n\t\t\t\t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"VRETHIKE SYNTAGH!\");\n\t\t\t\t\tprescription[i].print();\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\ttmp_2++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(tmp_2 == 0)\n\t\t\t{\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"DEN YPARXEI SYNTAGH METAKSY:\" + firstDt + \" KAI: \" + lastDt);\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"DEN YPARXOUN DIATHESIMES SYNTAGES!\");\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void papierkorbAnzeigen() {\n\t\tfor (Datei a:papierkorb) {\n\t\t\ta.anzeigeDateiDetail();\n\t\t}\n\t}", "public static void resetDates() {\n arrivalDate = LocalDate.now();\n departureDate = arrivalDate.plusDays(1);\n }", "public void get_fecha(){\n //Obtenemos la fecha\n Calendar c1 = Calendar.getInstance();\n fecha.setCalendar(c1);\n }", "List<Venta1> consultarVentaPorFecha(Date desde, Date hasta, Persona cliente) throws Exception;", "protected abstract void calcNextDate();", "private void checkReservationValidityAndRemove(){\n\t\t\n\t\tfor (Reservation r: reservationArray){\n\t\t\tif (r.getBookingDateAndTime().get(Calendar.DAY_OF_MONTH)==Calendar.getInstance().get(Calendar.DAY_OF_MONTH)){\n\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.MONTH)==Calendar.getInstance().get(Calendar.MONTH)){\n\t\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.HOUR_OF_DAY)==Calendar.getInstance().get(Calendar.HOUR_OF_DAY)){\n\t\t\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.MINUTE) > 30 + r.getBookingDateAndTime().get(Calendar.MINUTE) ){\n\t\t\t\t\t\t\treservationArray.remove(r);\n\t\t\t\t\t\t\ttablemanager.increaseAvailable();;\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}", "private void incrementeDate() {\n dateSimulation++;\n }", "public Fecha () {\n\t\tthis.ahora = Calendar.getInstance();\n\t\tahora.set(2018, 3, 1, 15, 15, 0);\t \n\t\taño = ahora.get(Calendar.YEAR);\n\t\tmes = ahora.get(Calendar.MONTH) + 1; // 1 (ENERO) y 12 (DICIEMBRE)\n\t\tdia = ahora.get(Calendar.DAY_OF_MONTH);\n\t\thr_12 = ahora.get(Calendar.HOUR);\n\t\thr_24 = ahora.get(Calendar.HOUR_OF_DAY);\n\t\tmin = ahora.get(Calendar.MINUTE);\n\t\tseg = ahora.get(Calendar.SECOND);\n\t\tam_pm = v_am_pm[ahora.get(Calendar.AM_PM)]; //ahora.get(Calendar.AM_PM)=> 0 (AM) y 1 (PM)\n\t\tmes_nombre = v_mes_nombre[ahora.get(Calendar.MONTH)];\n\t\tdia_nombre = v_dia_nombre[ahora.get(Calendar.DAY_OF_WEEK) - 1];\n\n\t}", "public void recomendarTempos() {\n ArrayList iTXCH = new ArrayList(); /// Instancias pre fusion\n ArrayList iTYCH = new ArrayList();\n ArrayList iTZCH = new ArrayList();\n\n ArrayList cenTXCH = new ArrayList(); /// Centroides Tempos tempos ch\n ArrayList cenTYCH = new ArrayList();\n ArrayList cenTZCH = new ArrayList();\n\n ArrayList cenTXDB = new ArrayList(); /// centroide tempos db\n ArrayList cenTYDB = new ArrayList();\n ArrayList cenTZDB = new ArrayList();\n\n ArrayList insTXCH = new ArrayList(); /// Instancias fusion\n ArrayList insTYCH = new ArrayList();\n ArrayList insTZCH = new ArrayList();\n\n ArrayList ppTXCH = new ArrayList(); /// centroide promedio ponderado tempos\n ArrayList ppTYCH = new ArrayList();\n ArrayList ppTZCH = new ArrayList();\n\n ArrayList ppTXDB = new ArrayList(); /// centroide promedio ponderado duracion\n ArrayList ppTYDB = new ArrayList();\n ArrayList ppTZDB = new ArrayList();\n\n ArrayList paTXCH = new ArrayList(); /// centroide promedio aritmetico tempos ch\n ArrayList paTYCH = new ArrayList();\n ArrayList paTZCH = new ArrayList();\n\n ArrayList paTXDB = new ArrayList(); /// centroide promedio artimetico tempos db\n ArrayList paTYDB = new ArrayList();\n ArrayList paTZDB = new ArrayList();\n\n////////////////// TEMPO EN X ////////////////////////////// \n ////////// calinsky - harabaz /////////\n if (txchs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXCH = CExtraer.arrayTempoXCprueba;\n iTXCH = CExtraer.arrayTempoXIprueba;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXCH.setText(cenTXCH.get(iposision).toString());\n }\n\n if (txchs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n ppTXCH = CFusionar.arregloPPTX1;\n\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n\n System.out.println(iposision);\n\n }\n }\n valorTXCH.setText(ppTXCH.get(iposision).toString());\n }\n\n if (txchs == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n paTXCH = CFusionar.arregloPATX1;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXCH.setText(paTXCH.get(iposision).toString());\n\n }\n\n //////////// davies bouldin //////////////\n if (txdbs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXDB = CExtraer.arrayTempoXCprueba;\n iTXCH = CExtraer.arrayTempoXIprueba;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB.setText(cenTXDB.get(iposision).toString());\n }\n\n if (txdbs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n ppTXDB = CFusionar.arregloPPTX1;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB.setText(ppTXDB.get(iposision).toString());\n }\n if (txdbs == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionar.arregloInstanciasTX1;\n paTXDB = CFusionar.arregloPATX1;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXDB.setText(paTXDB.get(iposision).toString());\n\n }\n\n ///////////// TEMPO EN Y //////////// \n //////////// calinsky - harabaz /////////////\n if (tychs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYCH = CExtraer.arrayTempoYCprueba;\n iTYCH = CExtraer.arrayTempoYIprueba;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYCH.setText(cenTYCH.get(iposision).toString());\n }\n\n if (tychs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n ppTYCH = CFusionar.arregloPPTY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH.setText(ppTYCH.get(iposision).toString());\n\n }\n\n if (tychs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n paTYCH = CFusionar.arregloPATY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH.setText(paTYCH.get(iposision).toString());\n }\n /////////// davies - bouldin /////////////\n if (tydbs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYDB = CExtraer.arrayTempoYCprueba;\n iTYCH = CExtraer.arrayTempoYIprueba;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYDB.setText(cenTYDB.get(iposision).toString());\n }\n\n if (tydbs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n ppTYDB = CFusionar.arregloPPTY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB.setText(ppTYDB.get(iposision).toString());\n }\n if (tydbs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionar.arregloInstanciasTY1;\n paTYDB = CFusionar.arregloPATY1;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB.setText(paTYDB.get(iposision).toString());\n }\n\n ///////////// TEMPO EN Z //////////// \n ///////////// calinsky harabaz ///////////////////\n if (tzchs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZCH = CExtraer.arrayTempoZCprueba;\n iTZCH = CExtraer.arrayTempoZIprueba;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZCH.setText(cenTZCH.get(iposision).toString());\n }\n\n if (tzchs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n ppTZCH = CFusionar.arregloPPTZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH.setText(ppTZCH.get(iposision).toString());\n }\n if (tzchs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n paTZCH = CFusionar.arregloPATZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH.setText(paTZCH.get(iposision).toString());\n }\n\n ///////////// davies bouldin /////////////////// \n if (tzdbs == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZDB = CExtraer.arrayTempoZCprueba;\n iTZCH = CExtraer.arrayTempoZIprueba;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZDB.setText(cenTZDB.get(iposision).toString());\n }\n\n if (tzdbs == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n ppTZDB = CFusionar.arregloPPTZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB.setText(ppTZDB.get(iposision).toString());\n }\n //////////\n if (tzdbs == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionar.arregloInstanciasTZ1;\n paTZDB = CFusionar.arregloPATZ1;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB.setText(paTZDB.get(iposision).toString());\n }\n\n }", "PastReservation createPastReservation();", "public void calculateVacationDays(){\n }", "public Long calculateTotalAgingForFirstDay(Integer day, LocalDateTime endDateParam, LocalDateTime startDateParam,\n\t\t\tInteger totalSecondRest, List<KPIServiceHourRest> ticketRests) {\n/*\t\t \n * 9:02-8:29-restAging\n *\t\t 8:29:00,9:10:00,\n *\t\t 8:30:00, 9:00\n *\t\t Istirahat jam 8:30-9:00 \n *\t\t long restAging=0L<\n *\t \n *\t if(startDateParam<restStart && startDateParam<restEnd)\n *\t {\n *\t \t\t8:29<8:30 Y, 8:29<9:00 Y\n *\t \t\trestAging=9:00:00-8:30:00\n *\t \t \t 8:29<11:30 Y, 8:29<1:00:00 Y\n *\t \t\trestAging=9:00:00-8:30:00\n *\n *\t \t\t9:10<8:29 N, 9:10<9:00 N\n *\t \t\tbreak;\n *\t \t\t8:29<11:30 Y, 8:29<1:00 Y\n *\t }\n */\n\t\t Long totalAging=new Long(0);\n\t \t Long totalAgingOnRest=0L;\n\t \t for(KPIServiceHourRest ticketRest:ticketRests){\n\t \t\t if(day==ticketRest.getDay()){\n\t \t\t\t LocalDateTime restStart=LocalDateTime.fromDateFields(ticketRest.getFromTimeRest());\n\t\t LocalDateTime restEnd=LocalDateTime.fromDateFields(ticketRest.getToTimeRest());\n\t\t if(CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restStart.toDateTime()))<=0\n\t\t \t\t && CustomDateUtils.compareTime(new DateTime(startDateParam.toDateTime()), new DateTime(restEnd.toDateTime()))<=0){\n\t\t \t totalAgingOnRest+=secondTotalAgingBetweenDate(restEnd.toDate().getTime(), restStart.toDate().getTime(), 0L);\n\t\t }\n\t \t\t }\n\t \t }\n\t \t totalAging=secondTotalAgingBetweenDate(endDateParam.toDate().getTime(),startDateParam.toDate().getTime(),totalAgingOnRest);\n return totalAging;\n\t}", "private void nastavViews() {\n tv_steps = (TextView) findViewById(R.id.textview1);\n den = (TextView) findViewById(R.id.time1);\n kcalTv = (TextView) findViewById(R.id.kCalTv);\n df = new SimpleDateFormat(\"EEE, d. MMM\");\n df2 = new SimpleDateFormat(\"dd-MMM-yyyy\");\n c = Calendar.getInstance().getTime();\n aktualnyDatum = df.format(c);\n aktualnyDatum2 = df2.format(c);\n }", "public Reserva(int id,Timestamp fechaInicio,Timestamp fechaFin,Recurso recurso,Usuario usuario,String estado,String tipo){\n this.id=id;\n this.fechaInicio=fechaInicio;\n this.fechaFin=fechaFin;\n this.recurso=recurso;\n this.usuario=usuario;\n this.estado=estado;\n this.tipo=tipo;\n }", "public Double getTotalOliDOdeEnvasadoresEntreDates(Long temporadaId, Date dataInici, Date dataFi, Integer idAutorizada) throws InfrastructureException {\r\n\t\tlogger.debug(\"getTotalOliDOdeEnvasadoresEntreDates ini\");\r\n//\t\tCollection listaTrasllat = getEntradaTrasladosEntreDiasoTemporadas(temporadaId, dataInici, dataFi);\r\n\t\tCollection listaTrasllat = null;\r\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\t\tdouble litros = 0;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tString q = \"from Trasllat tdi where tdi.retornatEstablimentOrigen = true \";\r\n\t\t\tif(dataInici != null){\r\n\t\t\t\tString fi = df.format(dataInici);\r\n\t\t\t\tq = q+ \" and tdi.data >= '\"+fi+\"' \";\r\n\t\t\t}\r\n\t\t\tif(dataFi != null){\r\n\t\t\t\tString ff = df.format(dataFi);\r\n\t\t\t\tq = q+ \" and tdi.data <= '\"+ff+\"' \";\r\n\t\t\t}\r\n\t\t\tlistaTrasllat = getHibernateTemplate().find(q);\t\r\n\t\t} catch (HibernateException ex) {\r\n\t\t\tlogger.error(\"getTotalOliDOdeEnvasadoresEntreDates failed\", ex);\r\n\t\t\tthrow new InfrastructureException(ex);\r\n\t\t}\r\n\t\t\r\n\t\t//Para cada uno de lor registro Trasllat separamos los depositos y devolvemos un objeto rasllatDipositCommand\r\n\t\tif (listaTrasllat != null){\r\n\t\t\tfor(Iterator it=listaTrasllat.iterator();it.hasNext();){\r\n\t\t\t\tTrasllat trasllat = (Trasllat)it.next();\r\n\t\t\t\tif(trasllat.getDiposits()!= null){\r\n\t\t\t\t\tfor(Iterator itDip=trasllat.getDiposits().iterator();itDip.hasNext();){\r\n\t\t\t\t\t\tDiposit diposit = (Diposit)itDip.next();\r\n\t\t\t\t\t\tif(idAutorizada!= null && diposit.getPartidaOli() != null && diposit.getPartidaOli().getCategoriaOli() !=null && diposit.getPartidaOli().getCategoriaOli()!= null){\r\n\t\t\t\t\t\t\tif(diposit.getPartidaOli().getCategoriaOli().getId().intValue() == idAutorizada.intValue() && diposit.getVolumActual()!= null){\r\n\t\t\t\t\t\t\t\tlitros+= diposit.getVolumActual().doubleValue();\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tlogger.debug(\"getTotalOliDOdeEnvasadoresEntreDates fin\");\r\n\t\treturn Double.valueOf(String.valueOf(litros));\r\n\t}", "public static void main(String[] args) throws ParseException {\t\t\n\t int mes, ano, diaDaSemana, primeiroDiaDoMes, numeroDeSemana = 1;\n\t Date data;\n\t \n\t //Converter texto em data e data em texto\n\t SimpleDateFormat sdf\t = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t //Prover o calendario\n\t GregorianCalendar gc\t = new GregorianCalendar();\n\t \n\t String mesesCalendario[] = new String[12];\n\t\tString mesesNome[]\t\t = {\"Janeiro\", \"Fevereiro\", \"Marco\", \"Abri\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"};\n\t\tint mesesDia[]\t\t\t = {31,28,31,30,31,30,31,31,30,31,30,31};\n\t\t\n\t\t//Errado? e pra receber apenas o \"dia da semana\" do \"primeiro dia do mes\" na questao\n\t //Recebendo mes e ano\n\t mes = Entrada.Int(\"Digite o mes:\", \"Entrada de dados\");\n\t ano = Entrada.Int(\"Digite o ano:\", \"Entrada de dados\");\n\t \n\t //Errado? e pra ser o dia inicial do mes na questao\n\t // Dia inicial do ano\n data = sdf.parse(\"01/01/\" + ano);\n gc.setTime(data);\n diaDaSemana = gc.get(GregorianCalendar.DAY_OF_WEEK);\n \n //Nao sei se e necessario por causa da questao\n //*Alteracao feita||| Ano bissexto tem +1 dia em fevereiro\n if(ano % 4 == 0) {\n \tmesesDia[1] = 29;\n \tmesesNome[1] = \"Ano Bissexto - Fevereiro\";\n }\n \n \n //Meses \n for(int mesAtual = 0; mesAtual < 12; mesAtual++) {\n\t int diasDoMes\t= 0;\n\t String nomeMesAtual = \"\";\n\n\n\t nomeMesAtual = mesesNome[mesAtual]; \n diasDoMes\t = mesesDia[mesAtual]; \n\n\n mesesCalendario[mesAtual] = \"\\n \" + nomeMesAtual + \" de \" + ano + \"\\n\";\n mesesCalendario[mesAtual] += \"---------------------------------------------------------------------|\\n\";\n mesesCalendario[mesAtual] += \" Dom Seg Ter Qua Qui Sex Sab | Semanas\\n\";\n mesesCalendario[mesAtual] += \"---------------------------------------------------------------------|\\n \";\n\t\n\t \n\t // Primeira semana comeca em\n\t data = sdf.parse( \"01/\" + (mesAtual+1) + \"/\" + ano );\n gc.setTime(data);\n primeiroDiaDoMes = gc.get(GregorianCalendar.DAY_OF_WEEK);\n\t for (int space = 1; space < primeiroDiaDoMes; space++) {\n\t \tmesesCalendario[mesAtual] += \" \";\n\t }\n\t \n\t //Dias\t \n\t for (int diaAtual = 1; diaAtual <= diasDoMes; diaAtual++)\n\t {\n\t \t// Trata espaco do dia\n\t \t\t//Transforma o diaAtuel em String\n\t String diaTratado = Integer.toString(diaAtual);\n\t if (diaTratado.length() == 1)\n\t \tdiaTratado = \" \" + diaAtual + \" \";\n\t else\n\t \tdiaTratado = \" \" + diaAtual + \" \";\n\t \n\t // dia\n\t mesesCalendario[mesAtual] += diaTratado;\n\t \t\n\t \t// Pula Linha no final da semana\n\t data = sdf.parse( diaAtual + \"/\" + (mesAtual+1) + \"/\" + ano );\n\t gc.setTime(data);\n\t diaDaSemana = gc.get(GregorianCalendar.DAY_OF_WEEK);\n\t if (diaDaSemana == 7) {\n\t \tmesesCalendario[mesAtual] += (\"| \" + numeroDeSemana++);\n\t \tmesesCalendario[mesAtual] += \"\\n |\";\n\t \tmesesCalendario[mesAtual] += \"\\n \";\n\t }\n\t }\n\t mesesCalendario[mesAtual] += \"\\n\\n\\n\\n\";\n\t }\n\t \n //Imprime mes desejado\n\t System.out.println(mesesCalendario[mes-1]);\n\n\t}", "public int getSubstanceExpirationDateReps() {\r\n \treturn this.getReps(16);\r\n }", "public List<ReservaEntity> getReservas() {\n LOGGER.log(Level.INFO, \"Inicia proceso de consultar todas las reservas\");\n // Note que, por medio de la inyección de dependencias se llama al método \"findAll()\" que se encuentra en la persistencia.\n List<ReservaEntity> reservas = persistence.findAllReservas();\n LOGGER.log(Level.INFO, \"Termina proceso de consultar todas las reservas\");\n return reservas;\n }", "abstract public void computeSchedule();", "int getSchedulingValue();", "private Integer getStandardStart(int startTime) \n {\n \tif (startTime % 1440 > 960) {\n \t\tstartTime += 1440;\n \t}\n \tint startOfDay = startTime - (startTime % 1440);\n \t//we need a standard variable to indicate the day of week;\n \t//standard day starts at 08:00 = 480 minutes and ends at 16:00 = 960 minutes\n \tcapacityEndTime = startOfDay + 960;\n \treturn startOfDay + 480;\n }", "public Collection<ReservationHistoryDTO> getCurrentReservations() throws ResourceNotFoundException{\n\t\tRegisteredUser currentUser = (RegisteredUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n\t\t\n\t\t\n\t\tRegisteredUser currentUserFromBase = registeredUserRepository.getOne(currentUser.getId());\n\t\t\n\t\tCollection<Reservation> reservations = currentUserFromBase.getReservations();\n\t\t\n\t\tif(reservations==null) {\n\t\t\tthrow new ResourceNotFoundException(\"User \"+currentUserFromBase.getUsername()+\" made non reservation!\");\n\t\t}\n\n\t\tHashSet<ReservationHistoryDTO> reservationsDTO = new HashSet<ReservationHistoryDTO>();\n\t\t\n\t\t\n\t\t\n\t\tfor(Reservation reservation : reservations) {\n\t\t\tif(!reservation.getHasPassed()) {\n\t\t\t\n\t\t\t\tReservationHistoryDTO reservationDTO = new ReservationHistoryDTO();\n\t\t\t\t\n\t\t\t\tFlightReservation flightReservation = reservation.getFlightReservation();\n\t\t\t\tRoomReservation roomReservation = reservation.getRoomReservation();\n\t\t\t\tVehicleReservation vehicleReservation = reservation.getVehicleReservation();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tFlight flight = flightReservation.getSeat().getFlight();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tLong reservationId = reservation.getId();\n\t\t\t\tLong flightId = flight.getId();\n\t\t\t\tString departureName = flight.getDeparture().getName();\n\t\t\t\tString destinationName = flight.getDestination().getName();\n\t\t\t\tDate departureDate = flight.getDepartureDate();\n\t\t\t\tLong airlineId = flight.getAirline().getId();\n\t\t\t\t\n\t\t\t\treservationDTO.setReservationId(reservationId);\n\t\t\t\t\n\t\t\t\treservationDTO.setFlightId(flightId);\n\t\t\t\treservationDTO.setDepartureName(departureName);\n\t\t\t\treservationDTO.setDestinationName(destinationName);\n\t\t\t\treservationDTO.setDepartureDate(departureDate);\n\t\t\t\treservationDTO.setAirlineId(airlineId);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(roomReservation != null) {\n\t\t\t\t\tRoomType roomType = reservation.getRoomReservation().getRoom().getRoomType();\n\t\t\t\t\tif(roomType!= null) {\n\t\t\t\t\t\treservationDTO.setRoomTypeId(roomType.getId());\n\t\t\t\t\t\treservationDTO.setHotelId(roomReservation.getRoom().getHotel().getId());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(vehicleReservation != null) {\n\t\t\t\t\tVehicle vehicle = reservation.getVehicleReservation().getReservedVehicle();\n\t\t\t\t\tif(vehicle != null) {\n\t\t\t\t\t\treservationDTO.setVehicleId(vehicle.getId());\n\t\t\t\t\t\treservationDTO.setRentACarId(vehicle.getBranchOffice().getMainOffice().getId());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\treservationsDTO.add(reservationDTO);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn reservationsDTO;\n\t\t\n\t}", "public void actualiser(){\n try{\n \t\n /* Memo des variables : horaireDepart tableau de string contenant l'heure de depart entree par l'user\n * heure = heure saisie castee en int, minutes = minutes saisie castee en Integer\n * tpsRest = tableau de string contenant la duree du cours en heure entree par l'user\n * minutage = format minutes horaire = format heure, ils servent a formater les deux variables currentTime qui recuperent l'heure en ms\n * tempsrestant = variable calculant le temps restant en minutes, heurerestante = variable calculant le nombre d'heure restantes\n * heureDuree = duree du cours totale en int minutesDuree = duree totale du cours en minute\n * tempsfinal = temps restant reel en prenant en compte la duree du cours\n * angle = temps radian engleu = temps en toDegrees\n */\n String[] horaireDepart = Reader.read(saisie.getText(), this.p, \"\\\\ \");\n \n //on check si le pattern est bon et si l'utilisateur n'est pas un tard\n if(Reader.isHour(horaireDepart)){\n \t\n int heure = Integer.parseInt(horaireDepart[0]);\n int minutes = Integer.parseInt(horaireDepart[2]);\n minutes += (heure*60);\n String[] tpsrest = Reader.read(format.getText(), this.p, \"\\\\ \");\n \n //conversion de la saisie en SimpleDateFormat pour les calculs\n SimpleDateFormat minutage = new SimpleDateFormat (\"mm\");\n SimpleDateFormat Horaire = new SimpleDateFormat (\"HH\");\n \n //recupere l'heure en ms\n Date currentTime_1 = new Date(System.currentTimeMillis());\n Date currentTime_2 = new Date(System.currentTimeMillis());\n \n //cast en int pour les calculs\n int tempsrestant = Integer.parseInt(minutage.format(currentTime_1));\n int heurerestante = Integer.parseInt(Horaire.format(currentTime_2))*60;\n tempsrestant += heurerestante;\n \n //pareil mais pour la duree\n if(Reader.isHour(tpsrest)){\n int heureDuree = Integer.parseInt(tpsrest[0]);\n int minutesDuree = Integer.parseInt(tpsrest[2]);\n minutesDuree += (heureDuree*60);\n tempsrestant -= minutes;\n int tempsfinal = minutesDuree - tempsrestant;\n \n //conversion du temps en angle pour l'afficher \n double angle = ((double)tempsfinal*2/(double)minutesDuree)*Math.PI;\n int engleu = 360 - (int)Math.toDegrees(angle);\n for(int i = 0; i < engleu; i++){\n this.panne.dessineLine(getGraphics(), i);\n }\n \n //conversion du temps en pi radiant pour l'affichage\n if(tempsfinal < minutesDuree){\n tempsfinal *= 2;\n for(int i = minutesDuree; i > 1; i--){\n if(tempsfinal % i == 0 && minutesDuree % i == 0){\n tempsfinal /= i;\n minutesDuree /= i;\n }\n }\n }\n \n //update l'affichage\n this.resultat.setText(tempsfinal + \"/\" + minutesDuree + \"π radiant\");\n this.resultat.update(this.resultat.getGraphics());\n }\n }\n }catch(FormatSaisieException fse){\n this.resultat.setText(fse.errMsg(this.p.toString()));\n }\n }", "public static List<ReserveTime> getUnitReservedTimesBetweenDays(ReserveTimeForm reserveTimeForm)\n\t{\n\t\tConnection conn = DBConnection.getConnection();\n\t\tList<ReserveTime> reserveTimes = new ArrayList<>();\n\t\tString middleQuery = reserveTimeForm.getDayNumbers() == null\n\t\t\t\t|| reserveTimeForm.getDayNumbers().isEmpty()\n\t\t\t\t?\n\t\t\t\t\"\"\n\t\t\t\t:\n\t\t\t\tgetToBeDeletedDayListMiddleQuery(reserveTimeForm.getDayNumbers());\n\t\ttry {\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tString command = \"SELECT\" +\n\t\t\t\t\t\" * FROM\" +\n\t\t\t\t\t\" RESERVETIMES rt , calendar cal\" +\n\t\t\t\t\t\" WHERE\" +\n\t\t\t\t\t\" rt.DAY_ID = cal.ID\" +\n\t\t\t\t\t\" AND\" +\n\t\t\t\t\t\" rt.STATUS = \" +\n\t\t\t\t\tReserveTimeStatus.RESERVED.getValue() +\n\t\t\t\t\t\" AND rt.UNIT_ID = \" +\n\t\t\t\t\treserveTimeForm.getUnitID() +\n\t\t\t\t\t\" AND rt.DAY_ID BETWEEN \" +\n\t\t\t\t\treserveTimeForm.getStartDate() +\n\t\t\t\t\t\" AND \" +\n\t\t\t\t\treserveTimeForm.getEndDate() +\n\t\t\t\t\tmiddleQuery;\n\t\t\tResultSet rs = stmt.executeQuery(command);\n\t\t\tfillReserveTimeList(rs, reserveTimes);\n\t\t}catch(SQLException e) {\n\t\t\tLogger.getLogger(\"Exception\").log(Level.SEVERE, \"Exception \" + e);\n\t\t\treturn null;\n\t\t}finally {\n\t\t\tif(conn != null) {\n\t\t\t\ttry {\n\t\t\t\t\t\tconn.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\tLogger.getLogger(\"Exception\").log(Level.SEVERE, \"Exception \" + e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn reserveTimes;\n\t}", "private void creatBirth(){\n\n for (int i = 0; i < repeatLunar.size() - 1; i++) {\n mLunar = repeatLunar.get(i);\n mLunarDay = mLunar.getLunarDay();\n mLunarMonth = mLunar.getLunarMonth();\n mLunarYear = mLunar.getLunarYear();\n mRepeat = mLunar.getRepeat();\n\n createEvent(getDate(mLunarYear, mLunarMonth, mLunarDay));\n\n\n }\n\n\n\n }", "@Scheduled(fixedDelay = 86400000)\n\tpublic void contabilizarDiarias() {\n\t\t\n\t\t// Obtem apenas os hospedes que estao no hotel (Data de saida como null)\n\t\tList<Hospede> hospedes = hospedeRepository.obterHospedes();\n\t\t\n\t\tfor(Hospede hospede : hospedes) {\n\t\t\t\n\t\t\t// Verifica se houve alguma cobrança do hospede na data atual\n\t\t\tList<Diaria> diarias = diariaRepository.obterDiariasContabilizadas(LocalDate.now(), hospede.getId());\n\t\t\t\n\t\t\t// Se nao houve nenhuma cobrança ainda, sera contabilizado a cobrança da diaria do hospede\n\t\t\tif(diarias.isEmpty()) {\n\t\t\t\t\n\t\t\t\tCheckIn checkIn = checkInRepository.obterCheckIn(hospede.getId());\n\t\t\t\t\n\t\t\t\tLocalDateTime dataAtual = LocalDateTime.now();\n\t\t\t\t\n\t\t\t\tif(dataAtual.getDayOfWeek() == DayOfWeek.SATURDAY || dataAtual.getDayOfWeek() == DayOfWeek.SUNDAY) { // SABADO OU DOMINGO\n\t\t\t\t\t\n\t\t\t\t\tif(checkIn.getAdicionalVeiculo()) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcheckIn.setTotal(checkIn.getTotal() + Constantes.DIARIA_FINAL_SEMANA + Constantes.ADICIONAL_VEICULO_FINAL_SEMANA);\n\t\t\t\t\t\t\n\t\t\t\t\t\thospede.setValorGasto(hospede.getValorGasto() + Constantes.DIARIA_FINAL_SEMANA + Constantes.ADICIONAL_VEICULO_FINAL_SEMANA);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcheckIn.setTotal(checkIn.getTotal() + Constantes.DIARIA_FINAL_SEMANA);\n\t\t\t\t\t\t\n\t\t\t\t\t\thospede.setValorGasto(hospede.getValorGasto() + Constantes.DIARIA_FINAL_SEMANA);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse { // ALGUM DIA DA SEMANA\n\t\t\t\t\t\n\t\t\t\t\tif(checkIn.getAdicionalVeiculo()) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcheckIn.setTotal(checkIn.getTotal() + Constantes.DIARIA_SEMANA + Constantes.ADICIONAL_VEICULO_SEMANA);\n\t\t\t\t\t\t\n\t\t\t\t\t\thospede.setValorGasto(hospede.getValorGasto() + Constantes.DIARIA_SEMANA + Constantes.ADICIONAL_VEICULO_SEMANA);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcheckIn.setTotal(checkIn.getTotal() + Constantes.DIARIA_SEMANA);\n\t\t\t\t\t\t\n\t\t\t\t\t\thospede.setValorGasto(hospede.getValorGasto() + Constantes.DIARIA_SEMANA);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\thospedeRepository.save(hospede);\n\t\t\t\t\n\t\t\t\tcheckInRepository.save(checkIn);\n\t\t\t\t\n\t\t\t\t// REGISTRA QUE O HOSPEDE JA FOI COBRADO NO DIA, EVITA DUPLICIDADE NAS COBRANÇAS\n\t\t\t\tdiariaRepository.save(new Diaria(LocalDate.now(), hospede.getId(), true));\n\t\t\t\t\n\t\t\t\tlog.info(\"DIARIA DO HOSPEDE ID = \" + hospede.getId() + \"FOI CONTABILIZADA!\");\n\t\t\t}\n\t\t}\n\t}", "public void getPropuestasOrdenadas(int confirm) throws ParseException{\n System.out.println(\"\\nSe imprimirán las propuestas de la Sala \"+getNombreSala()+\":\");\n if (propuestas.size() == 0){\n System.out.println(\"No hay reservas para esta Sala\");\n }\n else{\n for (Propuesta propuestaF : propuestas) {\n String nombreReservador = propuestaF.getReservador().getNombreCompleto();\n if (confirm == 0){\n if (propuestaF.isForAllSem()) {\n System.out.println(\"Propuesta por todo el semestre, parte el \"+propuestaF.getFechaPuntualI(0)+\" hasta \"+\n propuestaF.getFechaPuntualF(0)+\". La reserva termina el \"+\n propuestaF.getFechaPuntualI(propuestaF.getFechasPropuestasInicio().size()-1)+\" hasta \"+\n propuestaF.getFechaPuntualF(propuestaF.getFechasPropuestasFinal().size()-1));\n System.out.println(\"Esta reserva fue hecha por:\");\n if (propuestaF.getReservador() instanceof Profesor){\n System.out.println(\"Profesor \"+ nombreReservador);\n }\n else if (propuestaF.getReservador() instanceof Estudiante){\n System.out.println(\"Estudiante \"+ nombreReservador);\n }\n else{\n System.out.println(nombreReservador);\n }\n }\n else{\n int i = 0;\n int j = 0;\n int idPropuesta = 0;\n String fecha = \"01-01-50000\";\n SimpleDateFormat parseF = new SimpleDateFormat(\"dd-MM-yyyy\");\n Date fechaMasReciente = parseF.parse(fecha);\n Date fechaAux;\n Propuesta propActual;\n while(i < propuestas.size()){\n while (j < propuestas.size()){\n propActual = propuestas.get(j);\n fechaAux = propActual.getFechaPuntualI(0);\n if (fechaAux.compareTo(fechaMasReciente) < 0){\n fechaMasReciente = fechaAux;\n }\n j++;\n }\n System.out.println(\"Desde \"+propuestas.get(i).getFechaPuntualF(0)+\" hasta \"+\n propuestas.get(i).getFechaPuntualF(0));\n fecha = \"01-01-2200\";\n fechaMasReciente = parseF.parse(fecha);\n i++;\n }\n }\n }\n else if (confirm == 1){\n if (propuestaF.isForAllSem() && propuestaF.isConfirmada()) {\n System.out.println(\"Propuesta por todo el semestre, parte el \"+propuestaF.getFechaPuntualI(0)+\" hasta \"+\n propuestaF.getFechaPuntualF(0)+\". La reserva termina el \"+\n propuestaF.getFechaPuntualI(propuestaF.getFechasPropuestasInicio().size()-1)+\" hasta \"+\n propuestaF.getFechaPuntualF(propuestaF.getFechasPropuestasFinal().size()-1));\n System.out.println(\"Esta reserva fue hecha por:\");\n if (propuestaF.getReservador() instanceof Profesor){\n System.out.println(\"Profesor \"+ nombreReservador);\n }\n else if (propuestaF.getReservador() instanceof Estudiante){\n System.out.println(\"Estudiante \"+ nombreReservador);\n }\n else{\n System.out.println(nombreReservador);\n }\n }\n else if (propuestaF.isConfirmada()){\n int i = 0;\n int j = 0;\n int idPropuesta = 0;\n String fecha = \"01-01-50000\";\n SimpleDateFormat parseF = new SimpleDateFormat(\"dd-MM-yyyy\");\n Date fechaMasReciente = parseF.parse(fecha);\n Date fechaAux;\n Propuesta propActual;\n while(i < propuestas.size()){\n while (j < propuestas.size()){\n propActual = propuestas.get(j);\n fechaAux = propActual.getFechaPuntualI(0);\n if (fechaAux.compareTo(fechaMasReciente) < 0){\n fechaMasReciente = fechaAux;\n }\n j++;\n }\n System.out.println(\"Desde \"+propuestas.get(i).getFechaPuntualF(0)+\" hasta \"+\n propuestas.get(i).getFechaPuntualF(0));\n fecha = \"01-01-2200\";\n fechaMasReciente = parseF.parse(fecha);\n i++;\n }\n }\n }\n }\n }\n }", "public void limpiar(){\n\t\tfCargaI=new Date();\n\t\tfCargaF=new Date();\n\t\tlistaMarcacion=null;\n\t\tlistaMarcacionPDF=null;\n\t}", "@Scheduled(fixedRate = 19000)\n public void tesk() {\n\t\tDateFormat df = new SimpleDateFormat(\"MM/dd/yyyy\");\n DateFormat tf =new SimpleDateFormat(\"HH:mm\");\n\t\t// Get the date today using Calendar object.\n\t\tDate today = Calendar.getInstance().getTime(); \n\t\t// Using DateFormat format method we can create a string \n\t\t// representation of a date with the defined format.\n\t\tString reportDate = df.format(today);\n\t\tString repo = tf.format(today);\n\t\tSystem.out.println(\"Report Date: \" + reportDate);\n \n\t\t List<Tacher> tacher= tacherservice.findBydatetime(today, repo);\n\t\t\n\t\t if (tacher!=null){\t \n \t\t for(int i=0; i<tacher.size(); i++) {\n \t\t\t Tacher current = tacher.get(i);\n \t\t\t System.out.println(\"Tacher: \" + current.getId()+\" Statut=\"+current.getStatut()); \n \t\t tacherservice.metajourtacher(current.getId());\n \t\t System.out.println(\"Tacher: \" + current.getId()+\" Statut=\"+current.getStatut());\n \t\t } ///// fermeteur de for \n\t\t }//fermeteur de if\n\t}", "public void recomendarTemposEM() {\n ArrayList iTXCH = new ArrayList(); /// Instancias pre fusion\n ArrayList iTYCH = new ArrayList();\n ArrayList iTZCH = new ArrayList();\n\n ArrayList cenTXCH = new ArrayList(); /// Centroides Tempos tempos ch\n ArrayList cenTYCH = new ArrayList();\n ArrayList cenTZCH = new ArrayList();\n\n ArrayList cenTXDB = new ArrayList(); /// centroide tempos db\n ArrayList cenTYDB = new ArrayList();\n ArrayList cenTZDB = new ArrayList();\n\n ArrayList insTXCH = new ArrayList(); /// Instancias fusion\n ArrayList insTYCH = new ArrayList();\n ArrayList insTZCH = new ArrayList();\n\n ArrayList ppTXCH = new ArrayList(); /// centroide promedio ponderado tempos\n ArrayList ppTYCH = new ArrayList();\n ArrayList ppTZCH = new ArrayList();\n\n ArrayList ppTXDB = new ArrayList(); /// centroide promedio ponderado duracion\n ArrayList ppTYDB = new ArrayList();\n ArrayList ppTZDB = new ArrayList();\n\n ArrayList paTXCH = new ArrayList(); /// centroide promedio aritmetico tempos ch\n ArrayList paTYCH = new ArrayList();\n ArrayList paTZCH = new ArrayList();\n\n ArrayList paTXDB = new ArrayList(); /// centroide promedio artimetico tempos db\n ArrayList paTYDB = new ArrayList();\n ArrayList paTZDB = new ArrayList();\n\n////////////////// TEMPO EN X ////////////////////////////// \n ////////// calinsky - harabaz /////////\n if (txchsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXCH = CExtraer.arrayTempoXCpruebaEM;\n iTXCH = CExtraer.arrayTempoXIpruebaEM;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXCH2.setText(cenTXCH.get(iposision).toString());\n }\n\n if (txchsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n ppTXCH = CFusionarEM.arregloPPTX1EM;\n\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n\n System.out.println(iposision);\n\n }\n }\n valorTXCH2.setText(ppTXCH.get(iposision).toString());\n }\n\n if (txchsEM == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n paTXCH = CFusionarEM.arregloPATX1EM;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXCH2.setText(paTXCH.get(iposision).toString());\n\n }\n\n //////////// davies bouldin //////////////\n if (txdbsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTXDB = CExtraer.arrayTempoXCpruebaEM;\n iTXCH = CExtraer.arrayTempoXIpruebaEM;\n res = Double.parseDouble((String) iTXCH.get(0));\n for (int i = 0; i < iTXCH.size(); i++) {\n if (Double.parseDouble((String) iTXCH.get(i)) > res) {\n System.out.println(iTXCH.get(i));\n res = Double.parseDouble((String) iTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB2.setText(cenTXDB.get(iposision).toString());\n }\n\n if (txdbsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n ppTXDB = CFusionarEM.arregloPPTX1EM;\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n System.out.println(insTXCH.get(i));\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTXDB2.setText(ppTXDB.get(iposision).toString());\n }\n if (txdbsEM == \"Fusion PA\") {\n\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTXCH = CFusionarEM.arregloInstanciasTX1EM;\n paTXDB = CFusionarEM.arregloPATX1EM;\n\n res = Double.parseDouble((String) insTXCH.get(0));\n for (int i = 0; i < insTXCH.size(); i++) {\n if (Double.parseDouble((String) insTXCH.get(i)) > res) {\n res = Double.parseDouble((String) insTXCH.get(i));\n iposision = i;\n }\n }\n valorTXDB2.setText(paTXDB.get(iposision).toString());\n\n }\n\n ///////////// TEMPO EN Y //////////// \n //////////// calinsky - harabaz /////////////\n if (tychsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYCH = CExtraer.arrayTempoYCpruebaEM;\n iTYCH = CExtraer.arrayTempoYIpruebaEM;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYCH2.setText(cenTYCH.get(iposision).toString());\n }\n\n if (tychsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n ppTYCH = CFusionarEM.arregloPPTY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH2.setText(ppTYCH.get(iposision).toString());\n\n }\n\n if (tychsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n paTYCH = CFusionarEM.arregloPATY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYCH2.setText(paTYCH.get(iposision).toString());\n }\n /////////// davies - bouldin /////////////\n if (tydbsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTYDB = CExtraer.arrayTempoYCpruebaEM;\n iTYCH = CExtraer.arrayTempoYIpruebaEM;\n res = Double.parseDouble((String) iTYCH.get(0));\n for (int i = 0; i < iTYCH.size(); i++) {\n if (Double.parseDouble((String) iTYCH.get(i)) > res) {\n System.out.println(iTYCH.get(i));\n res = Double.parseDouble((String) iTYCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTYDB2.setText(cenTYDB.get(iposision).toString());\n }\n\n if (tydbsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n ppTYDB = CFusionarEM.arregloPPTY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB2.setText(ppTYDB.get(iposision).toString());\n }\n if (tydbsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTYCH = CFusionarEM.arregloInstanciasTY1EM;\n paTYDB = CFusionarEM.arregloPATY1EM;\n res = Double.parseDouble((String) insTYCH.get(0));\n for (int i = 0; i < insTYCH.size(); i++) {\n if (Double.parseDouble((String) insTYCH.get(i)) > res) {\n res = Double.parseDouble((String) insTYCH.get(i));\n iposision = i;\n }\n }\n valorTYDB2.setText(paTYDB.get(iposision).toString());\n }\n\n ///////////// TEMPO EN Z //////////// \n ///////////// calinsky harabaz ///////////////////\n if (tzchsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZCH = CExtraer.arrayTempoZCpruebaEM;\n iTZCH = CExtraer.arrayTempoZIpruebaEM;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZCH2.setText(cenTZCH.get(iposision).toString());\n }\n\n if (tzchsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n ppTZCH = CFusionarEM.arregloPPTZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH2.setText(ppTZCH.get(iposision).toString());\n }\n if (tzchsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n paTZCH = CFusionarEM.arregloPATZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZCH2.setText(paTZCH.get(iposision).toString());\n }\n\n ///////////// davies bouldin /////////////////// \n if (tzdbsEM == \"Pre Fusion\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n cenTZDB = CExtraer.arrayTempoZCpruebaEM;\n iTZCH = CExtraer.arrayTempoZIpruebaEM;\n res = Double.parseDouble((String) iTZCH.get(0));\n for (int i = 0; i < iTZCH.size(); i++) {\n if (Double.parseDouble((String) iTZCH.get(i)) > res) {\n System.out.println(iTZCH.get(i));\n res = Double.parseDouble((String) iTZCH.get(i));\n iposision = i;\n System.out.println(iposision);\n }\n }\n valorTZDB2.setText(cenTZDB.get(iposision).toString());\n }\n\n if (tzdbsEM == \"Fusion PP\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n ppTZDB = CFusionarEM.arregloPPTZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB2.setText(ppTZDB.get(iposision).toString());\n }\n //////////\n if (tzdbsEM == \"Fusion PA\") {\n double res = 0;\n double cont = 0;\n int iposision = 0;\n\n insTZCH = CFusionarEM.arregloInstanciasTZ1EM;\n paTZDB = CFusionarEM.arregloPATZ1EM;\n res = Double.parseDouble((String) insTZCH.get(0));\n for (int i = 0; i < insTZCH.size(); i++) {\n if (Double.parseDouble((String) insTZCH.get(i)) > res) {\n res = Double.parseDouble((String) insTZCH.get(i));\n iposision = i;\n }\n }\n valorTZDB2.setText(paTZDB.get(iposision).toString());\n }\n\n }", "public void toPunish() {\n\n //// TODO: 24/03/2017 delete the following lines\n// dalDynamic.addRowToTable2(\"23/03/2017\",\"Thursday\",4,walkingLength,deviation)\n\n\n\n int dev,sum=0;\n long id;\n id=dalDynamic.getRecordIdAccordingToRecordName(\"minutesWalkTillEvening\");\n Calendar now = Calendar.getInstance();//today\n Calendar calendar = Calendar.getInstance();\n SimpleDateFormat dateFormat=new SimpleDateFormat(\"dd/MM/yyyy\");\n String date;\n for (int i = 0; i <DAYS_DEVIATION ; i++) {\n date=dateFormat.format(calendar.getTime());\n Log.v(\"Statistic\",\"date \"+date);\n dev = dalDynamic.getDeviationAccordingToeventTypeIdAnddate(id,date);\n sum+=dev;\n calendar.add(Calendar.DATE,-1);//// TODO: -1-i????\n }\n if(sum==DAYS_DEVIATION){\n Intent intent = new Intent(context,BlankActivity.class);\n context.startActivity(intent);\n //todo:punishment\n }\n\n }", "@Override\n public void crearReloj() {\n Manecilla seg;\n seg = new Manecilla(40,60,0,1,null);\n cronometro = new Reloj(seg);\n }", "private Produtos_Adicionar() {\n initComponents();\n \n horaProdutoSpinner.setModel(new SpinnerDateModel());\n JSpinner.DateEditor editor = new JSpinner.DateEditor(horaProdutoSpinner, \"HH:mm\");\n horaProdutoSpinner.setEditor(editor);\n \n custoProdutoSpinner.setModel(new SpinnerNumberModel(0.0, -10000.0, 10000.0, 0.1));\n JSpinner.NumberEditor editorNumber = new JSpinner.NumberEditor(custoProdutoSpinner);\n custoProdutoSpinner.setEditor(editorNumber);\n \n dataProdutoDP.setDate(new Date());\n }", "@Test\r\n\tpublic void venderVariasPiezasReservadas() {\r\n\t\tfor (Pieza pieza : this.listadoDePiezas) {\r\n\t\t\tpieza.reservar();\r\n\t\t\tpieza.vender();\r\n\t\t\tAssert.assertTrue(\"La pieza no ha sido correctamente vendida.\",pieza.isVendida());\r\n\t\t}\r\n\t}", "private static List<FacilityFreeSchedule> generateFacilityFreeSchedules(Facility facility) {\n List<FacilityFreeSchedule> facilityFreeSchedules=new ArrayList<>();\n LocalDateTime now = LocalDateTime.now();\n Map<Integer,List<LocalDateTime>> workingHoursForMonth=workingHoursForFacilityPerWeek(facility, now);\n workingHoursForMonth.keySet().stream().forEach(weekIndex -> {\n List<LocalDateTime> workingHoursPerWeek = workingHoursForMonth.get(weekIndex);\n facilityFreeSchedules.addAll(workingHoursPerWeek.stream()\n .map(dateTime -> generateFacilityFreeSchedule(facility, dateTime, weekIndex))\n .collect(Collectors.toList()));\n });\n return facilityFreeSchedules;\n }", "public List<RealizadaEmpresa> EncEmpPorPeriodo(Cliente c, LocalDate inicio, LocalDate fim){\n List<RealizadaEmpresa> re= new ArrayList<RealizadaEmpresa>(this.clientes.get(c.getEmail()).getRe());\n List<RealizadaEmpresa> aux = new ArrayList<RealizadaEmpresa>();\n for (RealizadaEmpresa a : re){\n if (a.getData().isAfter(inicio) && a.getData().isBefore(fim)) aux.add(a);\n }\n return aux; \n }", "public static void main(String[] args) {\n int horaSalida;\n int minutosSalida;\n int horaLlegada;\n int minutosLlegada;\n //Salida:\n int duracion;\n //condiciones y restricciones: el vuelo puede pasar de medianoche y no dura mas de 24h\n Scanner sc = new Scanner(System.in);\n do {\n System.out.println(\"Ingrese la hora de salida\");\n horaSalida = sc.nextInt();\n System.out.println(\"Ingrese los minutos\");\n minutosSalida = sc.nextInt();\n\n System.out.println(\"Ingrese la hora de llegada\");\n horaLlegada = sc.nextInt();\n System.out.println(\"Ingrese los minutos\");\n minutosLlegada = sc.nextInt();\n if (horaSalida > 24 || horaLlegada > 24 || minutosSalida > 60 || minutosLlegada > 60) {\n System.out.println(\"Los datos no han sido ingresados correctamente, vuelva a intentarlo\");\n }\n } while (horaSalida > 24 || horaLlegada > 24 || minutosSalida > 60 || minutosLlegada > 60);\n\n //Conversion de horas y minutos en solo minutos 19<2\n if (horaSalida > horaLlegada) {//caso 1\n horaLlegada = 24 + horaLlegada;//para poder restarlo a eso las h y m de salida\n }\n if (horaLlegada == horaSalida && (minutosSalida > minutosLlegada || minutosSalida == minutosLlegada)) {//caso 2\n horaLlegada = 24 + horaLlegada;//para poder restarlo a eso las h y m de salida\n }\n duracion = ((horaLlegada * 60) + minutosLlegada) - ((horaSalida * 60) + minutosSalida);\n\n if (duracion >= 1440) {//24*60=1440 si se pasa esto significa que el vuelo dura mas de 24h ex: 3:41 y llego 3:20\n System.out.print(\"El vuelo no puede durar mas de 24 horas \");\n } else {\n System.out.print(\"La duracion del vuelo es \" + duracion + \" minutos o \");\n //CODICIONES PARA EL AFFICHAGE\n if ((duracion / 60) < 10) {\n System.out.print(\"0\");\n }\n System.out.print(duracion / 60 + \"h\");\n\n if ((duracion % 60) < 10) {\n System.out.print(\"0\");\n }\n System.out.print(duracion % 60 + \"m\");\n }\n }", "public static int obterQtdeHorasEntreDatas(Date dataInicial, Date dataFinal) {\r\n\t\tCalendar start = Calendar.getInstance();\r\n\t\tstart.setTime(dataInicial);\r\n\t\t// Date startTime = start.getTime();\r\n\t\tif (!dataInicial.before(dataFinal))\r\n\t\t\treturn 0;\r\n\t\tfor (int i = 1;; ++i) {\r\n\t\t\tstart.add(Calendar.HOUR, 1);\r\n\t\t\tif (start.getTime().after(dataFinal)) {\r\n\t\t\t\tstart.add(Calendar.HOUR, -1);\r\n\t\t\t\treturn (i - 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void reporteIngresosHotel(Date fechaInicial, Date fechaFinal,TablaModelo modeloConsumos, TablaModelo modeloAlojamientos){\n introducirConsumosHotelFechas(fechaInicial, fechaFinal, modeloConsumos);\n introducirPagosALojamientoHotelFechas(fechaInicial, fechaFinal, modeloAlojamientos);\n \n }" ]
[ "0.693388", "0.62206846", "0.6186512", "0.6092534", "0.6000415", "0.5913931", "0.5885763", "0.57746947", "0.5732669", "0.56811285", "0.56622505", "0.5611913", "0.5598388", "0.55606073", "0.5533897", "0.55324876", "0.5507671", "0.55059874", "0.55057913", "0.5461551", "0.54422694", "0.5432948", "0.54288685", "0.5420446", "0.54143924", "0.5410818", "0.5408197", "0.54052234", "0.5400752", "0.53947043", "0.5383288", "0.5378589", "0.53671753", "0.5352649", "0.5348163", "0.533898", "0.5334735", "0.5329545", "0.5327134", "0.5326406", "0.5320643", "0.5299714", "0.52857536", "0.5284406", "0.5282302", "0.5274278", "0.52699685", "0.5261836", "0.52601016", "0.52559984", "0.5253035", "0.5247838", "0.5234815", "0.52303827", "0.5217774", "0.5210791", "0.5210145", "0.52027875", "0.51816565", "0.5180479", "0.517994", "0.5176509", "0.51751995", "0.517333", "0.5173049", "0.51728207", "0.5165574", "0.5160482", "0.51591164", "0.5157554", "0.514201", "0.5137099", "0.513539", "0.51301926", "0.5129876", "0.51242554", "0.5120773", "0.5119885", "0.5113769", "0.5112217", "0.5108925", "0.50972885", "0.5093513", "0.5089281", "0.5089182", "0.50822103", "0.50785255", "0.5076565", "0.5075662", "0.50682986", "0.5068052", "0.5060301", "0.5059386", "0.5047312", "0.5038752", "0.50366676", "0.5035776", "0.5035294", "0.5030021", "0.5025435", "0.50198907" ]
0.0
-1
Devuelve las reservas con motivos nulos
@GetMapping("/motivos/null") List<ReservasEntity> findByMotivoIsNull() { return reservaRepo.findByMotivoIsNull(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void dibujarArregloCamionetas() {\n\n timerCrearEnemigo += Gdx.graphics.getDeltaTime();\n if (timerCrearEnemigo>=TIEMPO_CREA_ENEMIGO) {\n timerCrearEnemigo = 0;\n TIEMPO_CREA_ENEMIGO = tiempoBase + MathUtils.random()*2;\n if (tiempoBase>0) {\n tiempoBase -= 0.01f;\n }\n\n camioneta= new Camioneta(texturaCamioneta,ANCHO,60f);\n arrEnemigosCamioneta.add(camioneta);\n\n\n }\n\n //Si el vehiculo se paso de la pantalla, lo borra\n for (int i = arrEnemigosCamioneta.size-1; i >= 0; i--) {\n Camioneta camioneta1 = arrEnemigosCamioneta.get(i);\n if (camioneta1.sprite.getX() < 0- camioneta1.sprite.getWidth()) {\n arrEnemigosCamioneta.removeIndex(i);\n\n }\n }\n }", "private void mueveObjetos()\n {\n // Mueve las naves Ufo\n for (Ufo ufo : ufos) {\n ufo.moverUfo();\n }\n \n // Cambia el movimiento de los Ufos\n if (cambiaUfos) {\n for (Ufo ufo : ufos) {\n ufo.cambiaMoverUfo();\n }\n cambiaUfos = false;\n }\n\n // Mueve los disparos y los elimina los disparos de la nave Guardian\n if (disparoGuardian.getVisible()) {\n disparoGuardian.moverArriba();\n if (disparoGuardian.getPosicionY() <= 0) {\n disparoGuardian.setVisible(false);\n }\n }\n\n // Dispara, mueve y elimina los disparos de las naves Ufo\n disparaUfo();\n if (disparoUfo.getVisible()) {\n disparoUfo.moverAbajo();\n if (disparoUfo.getPosicionY() >= altoVentana) {\n disparoUfo.setVisible(false);\n }\n }\n\n // Mueve la nave Guardian hacia la izquierda\n if (moverIzquierda) {\n guardian.moverIzquierda();\n }\n // Mueve la nave Guardian hacia la derecha\n if (moverDerecha) {\n guardian.moverDerecha();\n }\n // Hace que la nave Guardian dispare\n if (disparar) {\n disparaGuardian();\n }\n }", "public void moverPlataformas(){\n\t\tfor ( int x=0 ; x < 2; x++){\n\t\t\tquitarPoder(x);\n\t\t\tgame.moverPersonaje(x);\n\t\t}\n\t}", "@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}", "public void backTrack (){\n LinkedList<Integer> v = new LinkedList<> (); //Lista de vecinos.\n boolean mover = false;\n int r = 0;\n while (!mover && v.size () < 4){\n r = rnd.nextInt (4);\n\t\t//Hay un vecino disponible.\n\t\t//Nos podemos mover.\n if (vecinoDisponible (r))\n\t\t mover = true;\n if (!v.contains (r))\n v.add (r);\n\t }\n\t if (mover){\n\t\t//Nos movemos a la siguiente dirección.\n\t\ttumbaMuros (r);\n\t\tmoverLaberinto (r);\n\t }else if (!p.empty ()){\n\t\t//Nos movemos a la celda previa\n\t\t//pues no hay vecnos a los que movernos\n\t\tCelda a = p.pop ();\n\t\tt.posY = a.celdaY;\n\t\tt.posX = a.celdaX; \n\t }\n \n terminado = p.isEmpty();\n\t}", "public void cargarNotas() {\n\n notas.add(null);\n notas.add(null);\n notas.add(null);\n\n int nota, cont = 0;\n for (int i = 0; i <= 2; i++) {\n\n System.out.println(\"Indique nota \" + (i + 1));\n nota = leer.nextInt();\n notas.set(cont, nota);\n cont++;\n\n }\n\n cont = 0;\n\n }", "private void inicializarVariablesControlRonda() {\n\t\ttieneAs = new int[4];\n\t\tfor(int i=0;i<tieneAs.length;i++) {\n\t\t\ttieneAs[i]=0;\n\t\t}\n\t\tidJugadores = new String[3];\n\t\tvalorManos = new int[4];\n\t\t\n\t\tmazo = new Baraja();\n\t\tCarta carta;\n\t\tganador = new ArrayList<String>();\n\t\tapuestasJugadores = new int[3];\n\t\tmanoJugador1 = new ArrayList<Carta>();\n\t\tmanoJugador2 = new ArrayList<Carta>();\n\t\tmanoJugador3 = new ArrayList<Carta>();\n\t\tmanoDealer = new ArrayList<Carta>();\n\t\tparejaNombreGanancia = new ArrayList<Pair<String,Integer>>(); \n\t\t\n\t\t// gestiona las tres manos en un solo objeto para facilitar el manejo del hilo\n\t\tmanosJugadores = new ArrayList<ArrayList<Carta>>(4);\n\t\tmanosJugadores.add(manoJugador1);\n\t\tmanosJugadores.add(manoJugador2);\n\t\tmanosJugadores.add(manoJugador3);\n\t\tmanosJugadores.add(manoDealer);\n\t\t// reparto inicial jugadores 1 y 2\n\t\tfor (int i = 1; i <= 2; i++) {\n\t\t\tcarta = mazo.getCarta();\n\t\t\tmanoJugador1.add(carta);\n\t\t\tcalcularValorMano(carta, 0);\n\t\t\tcarta = mazo.getCarta();\n\t\t\tmanoJugador2.add(carta);\n\t\t\tcalcularValorMano(carta, 1);\n\t\t\tcarta = mazo.getCarta();\n\t\t\tmanoJugador3.add(carta);\n\t\t\tcalcularValorMano(carta, 2);\n\t\t}\n\t\t// Carta inicial Dealer\n\t\tcarta = mazo.getCarta();\n\t\tmanoDealer.add(carta);\n\t\tcalcularValorMano(carta, 3);\n\n\t\t\n\t}", "private void crearElementos() {\n\n\t\tRotonda rotonda1 = new Rotonda(new Posicion(400, 120), \"5 de octubre\");\n\t\tthis.getListaPuntos().add(rotonda1);\n\n\t\tCiudad esquel = new Ciudad(new Posicion(90, 180), \"Esquel\");\n\t\tthis.getListaPuntos().add(esquel);\n\n\t\tCiudad trelew = new Ciudad(new Posicion(450, 200), \"Trelew\");\n\t\tthis.getListaPuntos().add(trelew);\n\n\t\tCiudad comodoro = new Ciudad(new Posicion(550, 400), \"Comodoro\");\n\t\tthis.getListaPuntos().add(comodoro);\n\n\t\tCiudad rioMayo = new Ciudad(new Posicion(350, 430), \"Rio Mayo\");\n\t\tthis.getListaPuntos().add(rioMayo);\n\n\t\t// --------------------------------------------------------\n\n\t\tRutaDeRipio rutaRipio = new RutaDeRipio(230, 230, rotonda1, esquel);\n\t\tthis.getListaRuta().add(rutaRipio);\n\n\t\tRutaPavimentada rutaPavimentada1 = new RutaPavimentada(380, 100, trelew, comodoro);\n\t\tthis.getListaRuta().add(rutaPavimentada1);\n\n\t\tRutaPavimentada rutaPavimentada2 = new RutaPavimentada(800, 120, esquel, comodoro);\n\t\tthis.getListaRuta().add(rutaPavimentada2);\n\n\t\tRutaDeRipio rutaripio3 = new RutaDeRipio(380, 100, trelew, comodoro);\n\t\tthis.getListaRuta().add(rutaripio3);\n\n\t\tRutaEnConstruccion rutaConst1 = new RutaEnConstruccion(180, 70, rioMayo, comodoro);\n\t\tthis.getListaRuta().add(rutaConst1);\n\n\t\tRutaPavimentada rutaPavimentada3 = new RutaPavimentada(600, 110, rioMayo, esquel);\n\t\tthis.getListaRuta().add(rutaPavimentada3);\n\t}", "public void jugarMaquinaSola(int turno) {\n if (suspenderJuego) {\n return;\n }\n CuadroPieza cuadroActual;\n CuadroPieza cuadroDestino;\n CuadroPieza MovDestino = null;\n CuadroPieza MovActual = null;\n for (int x = 0; x < 8; x++) {\n for (int y = 0; y < 8; y++) {\n cuadroActual = tablero[x][y];\n if (cuadroActual.getPieza() != null) {\n if (cuadroActual.getPieza().getColor() == turno) {\n for (int x1 = 0; x1 < 8; x1++) {\n for (int y1 = 0; y1 < 8; y1++) {\n cuadroDestino = tablero[x1][y1];\n if (cuadroDestino.getPieza() != null) {\n if (cuadroActual.getPieza().validarMovimiento(cuadroDestino, this)) {\n if (MovDestino == null) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n } else {\n if (cuadroDestino.getPieza().getPeso() > MovDestino.getPieza().getPeso()) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n }\n if (cuadroDestino.getPieza().getPeso() == MovDestino.getPieza().getPeso()) {\n //Si es el mismo, elijo al azar si moverlo o no\n if (((int) (Math.random() * 3) == 1)) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n }\n }\n }\n }\n\n }\n }\n }\n }\n }\n }\n }\n if (MovActual == null) {\n boolean b = true;\n do {//Si no hay mov recomendado, entonces genero uno al azar\n int x = (int) (Math.random() * 8);\n int y = (int) (Math.random() * 8);\n tablero[x][y].getPieza();\n int x1 = (int) (Math.random() * 8);\n int y1 = (int) (Math.random() * 8);\n\n MovActual = tablero[x][y];\n MovDestino = tablero[x1][y1];\n if (MovActual.getPieza() != null) {\n if (MovActual.getPieza().getColor() == turno) {\n b = !MovActual.getPieza().validarMovimiento(MovDestino, this);\n //Si mueve la pieza, sale del while.\n }\n }\n } while (b);\n }\n if (MovActual.getPieza().MoverPieza(MovDestino, this)) {\n this.setTurno(this.getTurno() * -1);\n if (getRey(this.getTurno()).isInJacke(this)) {\n if (Pieza.isJugadorAhogado(turno, this)) {\n JOptionPane.showMessageDialog(null, \"Hacke Mate!!! - te lo dije xD\");\n if (JOptionPane.showConfirmDialog(null, \"Deseas Empezar una nueva Partida¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n } else {\n JOptionPane.showMessageDialog(null, \"Rey en Hacke - ya t kgste\");\n }\n } else {\n if (Pieza.isJugadorAhogado(turno, this)) {\n JOptionPane.showMessageDialog(null, \"Empate!!!\\nComputadora: Solo por que te ahogaste...!!!\");\n if (JOptionPane.showConfirmDialog(null, \"Deseas Empezar una nueva Partida¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n }\n if (Pieza.getCantMovimientosSinCambios() >= 50) {\n JOptionPane.showMessageDialog(null, \"Empate!!! \\nComputadora: Vaya, han pasado 50 turnos sin comernos jeje!!!\");\n if (JOptionPane.showConfirmDialog(null, \"Otra Partida Amistosa¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n }\n }\n }\n if (this.getTurno() == turnoComputadora) {\n jugarMaquinaSola(this.getTurno());\n }\n }", "public void siguienteNivel(){ \n\t\tnivel++;\n\t\tcontador = 0;\n\t\tcontadorE = 0;\n\t\treiniciar = false;\n\t\t\n\t\tnumDisparos=0; \n\t\tpausa=false;\n\t\tdisparando=false;\n\t\t\n\t\tif(nivel<9){\n\t\t\tasteroides =new Asteroide [(2+(nivel*2)) *(int)Math.pow(astNumDivision,astNumDisparos-1)+1];\n\t\t\tnumAsteroides = 2+(nivel*2);\n\t\t}\n\t\telse{\n\t\t\tasteroides =new Asteroide [12 *(int)Math.pow(astNumDivision,astNumDisparos-1)+1];\n\t\t\tnumAsteroides = 12;\n\t\t}\n\t\t\n\t\tfor(int i=0;i<numAsteroides;i++){\n\t\t\tasteroides[i]=new Asteroide(this, Math.random()*this.getWidth(), Math.random()*this.getHeight(), \n\t\t\t\t\tastRadio,minAstVel, maxAstVel, astNumDisparos, astNumDivision, 1);\n\t\t}\n\t}", "public void alquilarMultimediaAlSocio(){\n lector = new Scanner(System.in);\n int opcion = -1;\n int NIF = 0;\n int pedirElemento;\n String titulo;\n Socio socio;\n\n\n\n NIF = pedirNIF(); // pido el NIF por teclado\n\n if(tienda.exiteSocio(NIF)){ // Si exite, continuo\n socio = tienda.getSocioWithNIF(NIF); // Si exite el socio, busco en la tienda y lo asigno.\n if(!socio.isAlquilando()) { // si el socio no está actualmente alquilando, no continuo\n opcion = pedirElemento(); // Pido el elemento\n\n switch (opcion) {\n case 1:\n tienda.imprimirDatos(tienda.getPeliculas());\n System.out.println(\"Introduce el titulo de la pelicula que quieres: \");\n titulo = lector.nextLine();\n if (tienda.exitePelicula(titulo)) {\n\n tienda.alquilarPeliculaSocio(NIF, titulo);\n System.out.println(\"PELICULA ANYADIDO EN EL MAIN\");\n\n\n } else {\n System.out.println(\"No exite la pelicula \" + titulo + \".\");\n }\n\n\n break;\n case 2:\n tienda.imprimirDatos(tienda.getVideojuegos());\n System.out.println(\"Introduce el titulo del videojuego que quieres: \");\n titulo = lector.nextLine();\n if (tienda.existeVideojuego(titulo)) {\n\n tienda.alquilarVideojuegoSocio(NIF, titulo);\n System.out.println(\"VIDEOJUEGO ANYADIDO EN EL MAIN\");\n\n\n } else {\n System.out.println(\"No exite el videojuego \" + titulo + \".\");\n }\n break;\n default:\n break;\n }\n }else{\n System.out.println(\"El socio \" + socio.getNombre() + \" tiene recargos pendientes.\");\n }\n\n }else{\n System.out.println(\"El socio con NIF \" + NIF + \" no exite.\");\n }\n\n\n\n\n\n\n }", "@Override\n public void movimiento_especial(){\n\n movesp=ataque/2;\n defensa+=5;\n PP= PP-4;\n }", "public void comprobarMov() {\r\n for (int i = 1; i < movimientos.length; i++) {\r\n if (movimientos[i]) {\r\n movimientos[i] = sePuedeMover(i);\r\n }\r\n }\r\n }", "public void creaAziendaAgricola(){\n\t\tCantina nipozzano = creaCantina(\"Nipozzano\");\t\n\t\tBotte[] bottiNipozzano = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiNipozzano.length; i++){\n\t\t\tbottiNipozzano[i] = creaBotte(nipozzano, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\t\t\n\t\tVigna mormoreto = creaVigna(\"Mormoreto\", 330, 25, EsposizioneVigna.sud, \"Terreni ricchi di sabbia, ben drenati. Discreta presenza di calcio. pH neutro o leggermente alcalino\");\n\t\tFilare[] filariMormoreto = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMormoreto.length;i++){\n\t\t\tfilariMormoreto[i] = creaFilare(mormoreto, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\t\n\t\tVigna montesodi = creaVigna(\"Montesodi\", 400, 20, EsposizioneVigna.sud_ovest, \"Arido e sassoso, di alberese, argilloso e calcareo, ben drenato, poco ricco di sostanza organica\");\n\t\tFilare[] filariMontesodi = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMontesodi.length;i++){\n\t\t\tfilariMontesodi[i] = creaFilare(montesodi, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t/*\n\t\t * CANTINA: POMINO - VIGNETO BENEFIZIO\n\t\t */\n\t\t\n\t\tCantina pomino = creaCantina(\"Pomino\");\n\t\tBotte[] bottiPomino = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiPomino.length; i++){\n\t\t\tbottiPomino[i] = creaBotte(pomino, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\n\t\tVigna benefizio = creaVigna(\"Benefizio\", 700, 9, EsposizioneVigna.sud_ovest, \"Terreni ricchi di sabbia, forte presenza di scheletro. Molto drenanti. Ricchi in elementi minerali. PH acido o leggermente acido.\");\n\t\tFilare[] filariBenefizio = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariBenefizio.length;i++){\n\t\t\tfilariBenefizio[i] = creaFilare(benefizio, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(nipozzano);\n\t\taziendaAgricolaDAO.saveLuogo(mormoreto);\n\t\taziendaAgricolaDAO.saveLuogo(montesodi);\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(pomino);\n\t\taziendaAgricolaDAO.saveLuogo(benefizio);\n\t\t\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Giulio d'Afflitto\"));\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Francesco Ermini\"));\n\n\t\t\n\t}", "public void creationPlateau() {\n for (int i = 0; i < 10; i++) {\n int X = rand.nextInt(14);\n int Y = rand.nextInt(14);\n if (plateau[X][Y] == null && espacementMonstre(X,Y,plateau)) {\n int monstreAleatoire = 1 + (int)(Math.random() * ((3 - 1) + 1));\n switch (monstreAleatoire) {\n case 1:\n Personnage monstreD = new Dragonnet(X,Y);\n plateau[X][Y] = monstreD;\n this.monstre.add(monstreD);\n System.out.println(\"Dragonnet ajouté en position : \"+X+\" \"+Y);\n break;\n case 2:\n Personnage monstreL = new Loup(X,Y);\n plateau[X][Y] = monstreL;\n this.monstre.add(monstreL);\n System.out.println(\"Loup ajouté en position : \"+X+\" \"+Y);\n\n break;\n case 3:\n Personnage monstreO = new Orque(X,Y);\n plateau[X][Y] = monstreO;\n this.monstre.add(monstreO);\n System.out.println(\"Orque ajouté en position : \"+X+\" \"+Y);\n break;\n }\n } else {\n i --;\n }\n }\n }", "private void turnos() {\n\t\tfor(int i=0; i<JuegoListener.elementos.size(); i++){\n\t\t\tElemento elemento = JuegoListener.elementos.get(i);\n\t\t\t\n\t\t\telemento.jugar();\n\t\t}\n\t}", "@Override\n public void crearReloj() {\n Manecilla seg;\n seg = new Manecilla(40,60,0,1,null);\n cronometro = new Reloj(seg);\n }", "public void ganarDineroPorAutomoviles() {\n for (Persona p : super.getMundo().getListaDoctores()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaAlbaniles()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaHerreros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n }", "public void RegresarSancion(View view){\n if(posicion >= 1){//Verificamos que no retroceda mas caciones de las que hay\n if(vector_mp[posicion].isPlaying()){//si la cancion se esta reproduciendo\n vector_mp[posicion].stop();//paramos la cancion\n\n //colocamos las canciones y posiciones ya que el metodo stop las vacio\n vector_mp[0] = MediaPlayer.create(this, R.raw.barrio);\n vector_mp[1] = MediaPlayer.create(this, R.raw.desesperado);\n vector_mp[2] = MediaPlayer.create(this, R.raw.encerrado);\n posicion--;//Decrementa una posicion para recorrer el vector hacia atras\n\n //Cambiamos las portadas\n if(posicion == 0){\n iv.setImageResource(R.drawable.portada1);;\n } else if(posicion == 1){\n iv.setImageResource(R.drawable.portada2);\n } else if(posicion == 2){\n iv.setImageResource(R.drawable.portada3);\n }\n\n vector_mp[posicion].start();//Reproduce la cancion a donde llego\n } else{\n posicion--;//Decrementa para recorrer el vector\n\n //Cambiasmos las portadas\n if(posicion == 0){\n iv.setImageResource(R.drawable.portada1);;\n } else if(posicion == 1){\n iv.setImageResource(R.drawable.portada2);\n } else if(posicion == 2){\n iv.setImageResource(R.drawable.portada3);\n }\n }\n\n } else{\n //Si nuestro inidice posicion ya recorrio el vector indicara que no hay mas canciones y asi evitar un desbordamiento de memoria\n Toast.makeText(this, \"No hay mas canciones\", Toast.LENGTH_SHORT).show();\n }\n }", "public void retournerLesPilesParcelles() {\n int compteur = 0;\n //pour chacune des 4 piles , retourner la parcelle au sommet de la pile\n for (JLabel jLabel : pileParcellesGUI) {\n JLabel thumb = jLabel;\n retournerParcelles(thumb, compteur);\n compteur++;\n }\n }", "public void actualizarPantallaJuego(float delta)\r\n {\r\n //recuadroInfoJuego.actualizarTiempo(delta); // Con esto actualizamos el tiempo del HUD\r\n\r\n // Con el siguiente ciclo actualizamos el movimiento o posicion de los monstruos\r\n for (int i=0; i < enemigos.size(); i++)\r\n {\r\n // Metodo encargado de renovar las posiciones dado un diferencial de tiempo\r\n enemigos.get(i).actualizarPosicion(delta);\r\n\r\n // En caso que el enemigo haya muerto entonces\r\n if (enemigos.get(i).haMuerto())\r\n {\r\n // Se lo pasamos al jugador contrario de modo que\r\n try\r\n {\r\n // Le enviamos un mensaje sobre que tipo de enemigo debe generar de manera aleatoria\r\n String aux = \"Transferir enemigo: \" + enemigos.get(i).getTipo() + \"\\n\";\r\n socketCliente.getOutputStream().write(aux.getBytes());\r\n }\r\n catch (Exception e)\r\n {\r\n e.printStackTrace();\r\n }\r\n\r\n // Se suma su valor en puntaje al puntaje general obtenido por el usuario\r\n recuadroInfoJuego.agregarPuntaje(enemigos.get(i).getPuntaje());\r\n\r\n // Luego, se suma uno al numero total de enemigos eliminados por el jugador\r\n recuadroInfoJuego.anotarEnemigo();\r\n\r\n // Y se elimina el monstruo de la lista de enemigos\r\n enemigos.remove(i);\r\n i = i - 1;\r\n }\r\n }\r\n\r\n // Si ya se cumplio el tiempo para generar otro monstruo entonces\r\n if (contaTiempo >= tiempoParaGeneracion)\r\n {\r\n // Agregamos un nuevo enemigo aleatorio en coordenas generadas tambien de manera aleatoria\r\n enemigos.add(new Monstruo(MathUtils.random(0, MainGame.ANCHO_VIRTUAL), MathUtils.random(0, MainGame.ALTO_VIRTUAL), MathUtils.random(1,5), true));\r\n\r\n // Y reseteamos el contador de tiempo\r\n contaTiempo = 0;\r\n }\r\n\r\n // O si se detecto que me pasaron un monstruo entonces\r\n if (enemigoTransferido != -1)\r\n {\r\n // Genero el tipo de monstruo especificado en coordenadas aleatorias\r\n enemigos.add(new Monstruo(MathUtils.random(0, MainGame.ANCHO_VIRTUAL), MathUtils.random(0, MainGame.ALTO_VIRTUAL), enemigoTransferido, true));\r\n\r\n // Y reinicio el dectector de monstruos tranferidos\r\n enemigoTransferido = -1;\r\n }\r\n\r\n contaTiempo = contaTiempo + delta; // Por ultimo se cuenta el tiempo\r\n }", "private void actualizaPuntuacion() {\n if(cambiosFondo <= 10){\n puntos+= 1*0.03f;\n }\n if(cambiosFondo > 10 && cambiosFondo <= 20){\n puntos+= 1*0.04f;\n }\n if(cambiosFondo > 20 && cambiosFondo <= 30){\n puntos+= 1*0.05f;\n }\n if(cambiosFondo > 30 && cambiosFondo <= 40){\n puntos+= 1*0.07f;\n }\n if(cambiosFondo > 40 && cambiosFondo <= 50){\n puntos+= 1*0.1f;\n }\n if(cambiosFondo > 50) {\n puntos += 1 * 0.25f;\n }\n }", "public void inicializarListaMascotas()\n {\n //creamos un arreglo de objetos y le cargamos datos\n mascotas = new ArrayList<>();\n mascotas.add(new Mascota(R.drawable.elefante,\"Elefantin\",0));\n mascotas.add(new Mascota(R.drawable.conejo,\"Conejo\",0));\n mascotas.add(new Mascota(R.drawable.tortuga,\"Tortuga\",0));\n mascotas.add(new Mascota(R.drawable.caballo,\"Caballo\",0));\n mascotas.add(new Mascota(R.drawable.rana,\"Rana\",0));\n }", "public void creoVehiculo() {\n\t\t\n\t\tAuto a= new Auto(false, 0);\n\t\ta.encender();\n\t\ta.setPatente(\"saraza\");\n\t\ta.setCantPuertas(123);\n\t\ta.setBaul(true);\n\t\t\n\t\tSystem.out.println(a);\n\t\t\n\t\tMoto m= new Moto();\n\t\tm.encender();\n\t\tm.frenar();\n\t\tm.setManubrio(true);\n\t\tm.setVelMax(543);\n\t\tm.setPatente(\"zas 241\");\n\t\tVehiculo a1= new Auto(true, 0);\n\t\ta1.setPatente(\"asd 423\");\n\t\t((Auto)a1).setBaul(true);\n\t\t((Auto)a1).setCantPuertas(15);\n\t\tif (a1 instanceof Auto) {\n\t\t\tAuto autito= (Auto) a1;\n\t\t\tautito.setBaul(true);\n\t\t\tautito.setCantPuertas(531);\n\t\t\t\n\t\t}\n\t\tif (a1 instanceof Moto) {\n\t\t\tMoto motito=(Moto) a1;\n\t\t\tmotito.setManubrio(false);\n\t\t\tmotito.setVelMax(15313);\n\t\t\t\n\t\t\t\n\t\t}\n\t\tif (a1 instanceof Camion) {\n\t\t\tCamion camioncito=(Camion) a1;\n\t\t\tcamioncito.setAcoplado(false);\n\t\t\tcamioncito.setPatente(\"ge\");\n\t\t\t\n\t\t\t\n\t\t}\n\t\tVehiculo a2= new Moto();\n\t\tSystem.out.println(a2);\n\t\ta1.frenar();\n\t\t\n\t\tArrayList<Vehiculo>listaVehiculo= new ArrayList<Vehiculo>();\n\t\tlistaVehiculo.add(new Auto(true, 53));\n\t\tlistaVehiculo.add(new Moto());\n\t\tlistaVehiculo.add(new Camion());\n\t\tfor (Vehiculo vehiculo : listaVehiculo) {\n\t\t\tSystem.out.println(\"clase:\" +vehiculo.getClass().getSimpleName());\n\t\t\tvehiculo.encender();\n\t\t\tvehiculo.frenar();\n\t\t\tSystem.out.println(\"=======================================\");\n\t\t\t\n\t\t}\n\t}", "public void limpiarPuntos() {\n \tpuntos.clear();\n }", "public void AumentarVictorias() {\r\n\t\tthis.victorias_actuales++;\r\n\t\tif (this.victorias_actuales >= 9) {\r\n\t\t\tthis.TituloNobiliario = 3;\r\n\t\t} else if (this.victorias_actuales >= 6) {\r\n\t\t\tthis.TituloNobiliario = 2;\r\n\t\t} else if (this.victorias_actuales >= 3) {\r\n\t\t\tthis.TituloNobiliario = 1;\r\n\t\t} else {\r\n\t\t\tthis.TituloNobiliario = 0;\r\n\t\t}\r\n\t}", "public void generaNumeros() {\n\n\n int number =0;\n int numeroSeleccionado=gameMemoriaUno.getNumberaleatorio();\n //se agrega numero a las lista de numeros\n\n if(numeroSeleccionado == -1){\n llamaResultado(super.getActividad(), tFinal, tInicio, Num3_5_1Activity.class,gameMemoriaUno.getNumeros(),gameMemoriaUno.getAciertosTotales(),gameMemoriaUno.getFallosTotales(),gameMemoriaUno.getNumEcxluidosList(),gameMemoriaUno.getNumeroPregunta());\n\n }else {\n\n\n gameMemoriaUno.addNumerosSet(numeroSeleccionado);\n for (int i = 1; i < 6; i++) {\n //obtiene numeros del costalito menos el numero seleccionado\n number = gameMemoriaUno.getNumeroArreglo();\n //agrego numeros\n gameMemoriaUno.addNumerosSet(number);\n }\n\n Iterator<Integer> iter = gameMemoriaUno.getNumerosSet().iterator();\n\n int contadorNumeros=0;\n while (iter.hasNext()) {\n int valor=iter.next().intValue();\n lista.add(valor);\n if(gameMemoriaUno.getDificultad()==contadorNumeros){\n gameMemoriaUno.setNumerosElejidos(new int[valor]);\n }\n\n contadorNumeros+=1;\n }\n Collections.shuffle(lista, new Random());\n Collections.shuffle(lista, new Random());\n\n\n\n }\n\n\n }", "public void mostraMesasVoto() {\n\t\tint check = 0;\n\t\tint tries = 0;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\trmiserver.printMesasVoto(this.idConsola);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\tcheck = 1;\n\t\t\t} catch (RemoteException e1) {\n\t\t\t\t// Tratamento da Excepcao da chamada RMI addCandidatos\n\t\t\t\tif(tries == 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(6000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries > 0 && tries < 24) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries >= 24) {\n\t\t\t\t\tSystem.out.println(\"Impossivel realizar a operacao devido a falha tecnica (Servidores RMI desligados).\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}while(check==0);\n\t\tcheck = 0;\n\t}", "public void iniciarNovaPartida(Integer posicao);", "public void vincular() {\n\n\t\ttry {\n\t\t\tList<Veiculo> veiculos = Deserializador.deserializar(\"conteudo/veiculos\", Veiculo.class);\n\t\t\tList<Motorista> motoristas = Deserializador.deserializar(\"conteudo/motoristas\", Motorista.class);\n\n\t\t\tScanner entrada = new Scanner(System.in);\n\t\t\tMotorista motorista = null;\n\t\t\tVeiculo veiculo = null;\n\t\t\tSystem.out.println(\"Digite o numero da CNH do motorista que deseja vincular.\");\n\t\t\tint cnh = entrada.nextInt();\n\t\t\tif (motoristas != null) {\n\t\t\t\tif (veiculos != null) {\n\t\t\t\t\tfor (Motorista motor : motoristas) {\n\t\t\t\t\t\tif (cnh == motor.getNumero_Carteira()) {\n\t\t\t\t\t\t\tSystem.out.println(\"Motorista encontrado: \" + motor.getNome());\n\t\t\t\t\t\t\tmotorista = motor;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (motorista == null) {\n\t\t\t\t\t\tSystem.out.println(\"Motorista nao encontrado!\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (motorista.getVeiculo() == null) {\n\t\t\t\t\t\t\tSystem.out.println(\"Motorista selecionado com sucesso.\");\n\n\t\t\t\t\t\t\tSystem.out.println(\"Digite a placa do veiculo que deseja vincular ao motorista \"\n\t\t\t\t\t\t\t\t\t+ motorista.getNome());\n\t\t\t\t\t\t\tString placa = entrada.next();\n\t\t\t\t\t\t\tfor (Veiculo veic : veiculos) {\n\t\t\t\t\t\t\t\tif (veic.getPlaca().equals(placa)) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Veiculo encontrado.\");\n\t\t\t\t\t\t\t\t\tveiculo = veic;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (veiculo == null) {\n\t\t\t\t\t\t\t\tSystem.out.println(\"Veiculo nao encontrado!\");\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// RN004\n\t\t\t\t\t\t\t\tif (veiculo.getMotorista() == null) {\n\t\t\t\t\t\t\t\t\t// RN001\n\t\t\t\t\t\t\t\t\tif (Character.toLowerCase(motorista.getCategoria_Habilitacao()) == 'c') {\n\t\t\t\t\t\t\t\t\t\tveiculo.setMotorista(motorista);\n\t\t\t\t\t\t\t\t\t\tmotorista.setVeiculo(veiculo);\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Motorista registrado com sucesso.\");\n\n\t\t\t\t\t\t\t\t\t} else if (veiculo.getCarga() == 1\n\t\t\t\t\t\t\t\t\t\t\t&& Character.toLowerCase(motorista.getCategoria_Habilitacao()) == 'b') {\n\t\t\t\t\t\t\t\t\t\tveiculo.setMotorista(motorista);\n\t\t\t\t\t\t\t\t\t\tmotorista.setVeiculo(veiculo);\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Motorista registrado com sucesso.\");\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Tipo da CNH do motorista invalida.\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"O veiculo desejado ja esta vinculado a um motorista.\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSystem.out.println(\"Motorista ja esta vinculado a um veiculo.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"A lista de veiculos esta vazia.\");\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"A lista de motoristas esta vazia.\");\n\t\t\t}\n\n\t\t\tSerializador s = new Serializador();\n\t\t\ts.serializar(\"conteudo/motoristas\", motoristas);\n\t\t\ts.serializar(\"conteudo/veiculos\", veiculos);\n\t\t} catch (Exception ex) {\n\t\t\tSystem.err.println(\"Falha ao serializar ou deserializar! - \" + ex.toString());\n\t\t}\n\t}", "public void afegirPosicio() {\n\t\tfor(int i=0; i<cal.length; ++i){\n\t\t\tcal[i] = new Dia(false);\n\t\t\tfor(int j=0; j<3; ++j) cal[i].getTorns()[j].setPosicio(i);\n\t\t}\n\t}", "private void moverJogadorDaVez(int dado1, int dado2) throws Exception {\n // System.out.println(\"moverJogadorDaVez\" + dado1 + \" , \" + dado2);\n\n print(\"\\ttirou nos dados: \" + dado1 + \" , \" + dado2);\n int valorDados = dado1 + dado2;\n\n int jogador = this.jogadorAtual();\n\n boolean ValoresIguais = false;\n\n\n //preciso saber se o jogador vai passar pela posição 40, o que significa\n //ganhar dinheiro\n this.completouVolta(jogador, valorDados);\n\n if (dado1 == dado2) {\n ValoresIguais = true;\n } else {\n ValoresIguais = false;\n }\n\n //movendo à posição\n this.moverJogadorAPosicao(jogador, valorDados, ValoresIguais);\n this.print(\"\\tAtual dinheiro antes de ver a compra:\" + this.listaJogadores.get(jogador).getDinheiro());\n this.print(\"\\tVai até a posição \" + this.posicoes[jogador]);\n\n //vendo se caiu na prisao\n if (this.posicoes[this.jogadorAtual()] == 30 && this.prisao == true) {\n adicionaNaPrisao(listaJogadores.get(jogadorAtual()));\n DeslocarJogador(jogador, 10);\n listaJogadores.get(jogadorAtual()).adicionarComandoPay();\n }\n\n\n\n Lugar lugar = this.tabuleiro.get(this.posicoes[jogador] - 1);//busca em -1, pois eh um vetor\n\n\n if (this.isCompraAutomatica()) {\n this.realizarCompra(jogador, lugar);\n }\n\n if (!this.posicaoCompravel(this.posicoes[jogador])) {\n this.print(\"\\t\" + lugar.getNome() + \" não está à venda!\");\n\n\n String nomeDono = (String) Donos.get(this.posicoes[jogador]);\n //não cobrar aluguel de si mesmo\n if (!nomeDono.equals(this.listaJogadores.get(this.jogadorAtual()).getNome())) {\n\n if (this.isUmJogador(nomeDono)) {\n Jogador possivelDono = this.getJogadorByName(nomeDono);\n\n if (this.isPosicaoFerrovia(this.posicoes[jogador])) {\n this.print(\"\\tO dono eh \" + possivelDono.getNome());\n if (!lugar.estaHipotecada()) {\n this.pagarFerrovia(possivelDono.getId(), jogador, 25, lugar.getNome());\n }\n } else {\n\n this.print(\"\\tO dono eh \" + possivelDono.getNome());\n int valorAluguel = 0;\n if (this.posicoes[this.jogadorAtual()] != 12 && this.posicoes[this.jogadorAtual()] != 28) {\n valorAluguel = this.tabuleiro.getLugarPrecoAluguel(this.posicoes[jogador]);\n\n } else {\n if (possivelDono.getQuantidadeCompanhias() == 1) {\n valorAluguel = 4 * valorDados;\n\n }\n if (possivelDono.getQuantidadeCompanhias() == 2) {\n valorAluguel = 10 * valorDados;\n\n }\n }\n if (!lugar.estaHipotecada()) {\n this.pagarAluguel(possivelDono.getId(), jogador, valorAluguel, lugar.getNome());\n }\n\n }\n\n }\n }\n\n }\n\n\n this.pagarEventuaisTaxas(jogador);\n\n if ((this.posicoes[this.jogadorAtual()] == 2 || this.posicoes[jogadorAtual()] == 17 || this.posicoes[jogadorAtual()] == 33) && cards == true) {\n realizaProcessamentoCartaoChest();\n }\n\n if ((this.posicoes[this.jogadorAtual()] == 7 || this.posicoes[jogadorAtual()] == 22 || this.posicoes[jogadorAtual()] == 36) && cards == true) {\n realizaProcessamentoCartaoChance();\n }\n\n\n\n\n this.print(\"\\tAtual dinheiro depois:\" + this.listaJogadores.get(jogador).getDinheiro());\n\n\n\n }", "public void rellenarTerreno() {\n Random rnd = new Random();\r\n int restante = V;\r\n int[][] aux = terreno;\r\n do {\r\n for (int i = 0; i < Filas; i++) {\r\n for (int j = 0; j < Columnas; j++) {\r\n if (restante > max) {\r\n int peso = rnd.nextInt(max);\r\n if (aux[i][j] + peso <= max) {\r\n aux[i][j] += peso;\r\n restante -= peso;\r\n }\r\n } else {\r\n if (aux[i][j] + restante <= max) {\r\n aux[i][j] += restante;\r\n restante = 0;\r\n }\r\n }\r\n }\r\n }\r\n } while (restante != 0);\r\n }", "public void prepareObjetivos(){\n\t\tfor( int x= 0 ; x < game.getAmountObjetivos();x++){\n\t\t\tObjetivo o = game.getObjetivo(x);\n\t\t\timage = o.getImage();\n\t\t\ttemporal = image.getImage().getScaledInstance(o.getAncho(), o.getAlto(), Image.SCALE_SMOOTH);\n\t\t\to.setImage(new ImageIcon(temporal));\n\t\t}\n\t\t\n\t}", "public Sesiones() {\n\t\tentradasVendidas = 0;\n\t}", "static int [] GerarAleatorio()\n {\n Random gerar = new Random();\n int [] Aleatorio = new int [pergu]; // Cria um Vetor com o tamanho de quantidade de perguntas\n \n \n int pos1, pos2, auxilio; \n \n for (int i = 0; i < Aleatorio.length; i++) \n {\n Aleatorio[i] = i ; // preenche o vetor\n }\n \n for (int i = 0; i < 1000; i++) //Quantidade de vezes que as perguntas serão embaralhadas \n {\n pos1 = gerar.nextInt(Aleatorio.length);\n pos2 = gerar.nextInt(Aleatorio.length);\n //troca \n auxilio = Aleatorio[pos1]; //guarda o valor da posição 1\n \n Aleatorio [pos1] = Aleatorio[pos2]; //troca o valor de 1 para 2\n Aleatorio[pos2] = auxilio; //troca o valor de 2 para o valor que estava na 1\n }\n \n \n return Aleatorio; \n }", "private void esvaziaMensageiro() {\n\t\tMensageiro.arquivo=null;\n\t\tMensageiro.lingua = linguas.indexOf(lingua);\n\t\tMensageiro.linguas=linguas;\n\t\tMensageiro.nomeArquivo=null;\n\t}", "public void transcribir() \r\n\t{\r\n\t\tpalabras = new ArrayList<List<CruciCasillas>>();\r\n\t\tmanejadorArchivos = new CruciSerializacion();\r\n\t\tint contador = 0;\r\n\t\t\r\n\t\tmanejadorArchivos.leer(\"src/Archivos/crucigrama.txt\");\r\n\t\t\r\n\t\tfor(int x = 0;x<manejadorArchivos.getPalabras().size();x++){\r\n\t\t\t\r\n\t\t\tcontador++;\r\n\t\t\t\r\n\t\t\tif (contador == 4) {\r\n\t\t\t\r\n\t\t\t\tList<CruciCasillas> generico = new ArrayList<CruciCasillas>();\r\n\t\t\t\t\r\n\t\t\t\tfor(int y = 0; y < manejadorArchivos.getPalabras().get(x).length();y++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\tgenerico.add(new CruciCasillas(manejadorArchivos.getPalabras().get(x).charAt(y)));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (y == (manejadorArchivos.getPalabras().get(x).length() - 1)) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tpalabras.add(generico);\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}\r\n\t\t\t\tcontador = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t}", "public void prepareSorpresas(){\n\t\tfor( int x= 0 ; x < game.getAmountSorpresas();x++){\n\t\t\tSorpresa s = game.getSorpresa(x);\n\t\t\timage = s.getImage();\n\t\t\ttemporal = image.getImage().getScaledInstance(s.getAncho(), s.getAlto(), Image.SCALE_SMOOTH);\n\t\t\ts.setImage(new ImageIcon(temporal));\n\t\t}\n\t}", "public void mostrarVideojuegosNumeradosPorOrdenDeRegistro()\n {\n int posicActual = 0;\n while (posicActual < listaDeVideojuegos.size()) {\n System.out.println((posicActual+1) + \". \" + listaDeVideojuegos.get(posicActual).getDatosVideojuego());\n posicActual++;\n }\n }", "public void aumentarMinas(){\n\r\n if(espM==false){\r\n minascerca++;\r\n }\r\n }", "public static void atacar(){\n int aleatorio; //variables locales a utilizar\n Random numeroAleatorio = new Random(); //declarando variables tipo random para aleatoriedad\n int ataqueJugador;\n //acciones de la funcion atacar sobre vida del enemigo\n aleatorio = (numeroAleatorio.nextInt(20-10+1)+10);\n ataqueJugador= ((nivel+1)*10)+aleatorio;\n puntosDeVidaEnemigo= puntosDeVidaEnemigo-ataqueJugador;\n \n }", "public long reserva_de_entradas(int identificador_evento, Date fechaevento, Horario[] listahorarios ) throws ParseException {\n fgen.info (\"Identificador del evento\" + identificador_evento);\n fgen.info (\"Fecha del evento\" + fechaevento);\n ArrayList<Horario> horariosReserva = new ArrayList<Horario>();\n for (int i = 0; i < listahorarios.length; i++) {\n \n Horario horario = listahorarios[i];\n fgen.info (\"Horario : \" + horario.getHorario().toString()); \n horariosReserva.add(horario);\n List<Disponibilidad> listadisponibles = listahorarios[i].disponibilidades;\n for (int j = 0; j < listadisponibles.size() ; j++) { \n fgen.info (\" Disponibilidad - Cantidad: \" + listadisponibles.get(j).getCantidad());\n fgen.info (\" Disponibilidad - Precio: \" + listadisponibles.get(j).getPrecio());\n fgen.info (\" Disponibilidad - Sector: \" + listadisponibles.get(j).getSector());\n } \n \n \n } \n //Inicializo o tomo lo que esta en memoria de la lista de reservas\n ListaReservas reservas= new ListaReservas(); \n // busco el evento y que la lista de horarios sea en la que quiero reservar\n ListaEventos eventos = new ListaEventos();\n Calendar c = Calendar.getInstance();\n c.setTime(fechaevento);\n Evento e = eventos.buscarEvento(identificador_evento, c);\n List<Horario> horariosRetornar = new ArrayList<Horario>();\n if(e != null)\n {\n horariosRetornar = e.getHorarios();\n } \n \n if (horariosRetornar != null)\n {\n for (int i = 0; i < horariosRetornar.size(); i++) {\n for (int j = 0; j < listahorarios.length; j++) {\n Date fechaE = horariosRetornar.get(i).getHorario().getTime(); \n Date fechaEventoDate = listahorarios[j].hora.getTime(); \n if(fechaE.equals(fechaEventoDate)) \n { for (int k = 0; k < horariosRetornar.get(i).disponibilidades.size(); k++) {\n for (int l = 0; l < listahorarios[j].disponibilidades.size(); l++) {\n Disponibilidad d= horariosRetornar.get(i).disponibilidades.get(k);\n Disponibilidad r= listahorarios[j].disponibilidades.get(l);\n if (d.cantidad >= r.cantidad && d.sector.equalsIgnoreCase(r.sector) && d.precio==r.precio)\n {\n d.setCantidad(d.cantidad-r.cantidad);\n //Reserva reserv= new Reserva();\n //reservas.contador_Id= reservas.contador_Id +1;\n //reserv.idReserva= reservas.contador_Id;\n //reserv.Estado=1;\n //reserv.idEvento = identificador_evento;\n //reserv.horarios.add(listahorarios[j]);\n //reservas.listaReserva.add(reserv);\n //return reserv.idReserva;\n }\n else if(d.cantidad < r.cantidad && d.sector.equalsIgnoreCase(r.sector) && d.precio==r.precio)\n {\n //Si hay alguna solicitud de de reserva que no se pueda cumplir. Re reorna 0.\n //TODO: Hay que volver para atras las cantidades modificadas.\n return 0;\n }\n \n }\n \n }\n }\n }\n }\n Reserva reserv= new Reserva();\n reservas.contador_Id= reservas.contador_Id +1;\n reserv.idReserva= reservas.contador_Id;\n reserv.Estado=1;\n reserv.idEvento = identificador_evento;\n reserv.horarios = horariosReserva;\n reserv.fechaEvento = c;\n reservas.listaReserva.add(reserv);\n return reserv.idReserva;\n }\n \n return 0;\n }", "public void run() {\r\n\t\tint miCiclo = cicloRR;\r\n\t\tint misRafagas = rafagasRR;\r\n\t\t\r\n\t\tfloat indicePenalizacion = (float) 0.00;\r\n\t\tfloat penalizacion = (float) 0.00;\r\n\t\tfloat indicePenalizacionPorProceso =(float) 0.00;\r\n\t\t\r\n\t\t//Como vamos a reducir el valor del quantum antes del principio de ciclo\r\n\t\t//Sumamos 1 al quantum original, así compensamos esa reducción en el primer\r\n\t\t//ciclo de ejecución y realizamos un ciclo de quantum completo\r\n\t\tint miQuantum = quantumRR + 1;\r\n\t\t\r\n\t\tfor (miCiclo = 0; miCiclo < misRafagas; miCiclo++) {\r\n\t\t\t//Compruebo si algún elemento coincide su llegada con el ciclo\r\n\t\t\t//Si coincide, lo añado a la cola\r\n\t\t\tfor (int i = 0; i<miListaRR.size(); i++) {\r\n\t\t\t\tif(miListaRR.get(i).getLlegada() == cicloRR) {\r\n\t\t\t\t\tcolaProcesosRR.add(miListaRR.get(i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t//Sumamos 1 al ciclo\r\n\t\t\tcicloRR++;\r\n\t\t\t\t\r\n\t\t\t//Restamos 1 al quantum restante\r\n\t\t\tmiQuantum--;\r\n\t\t\t//Si el quantum es 0, lo reiniciamos y enviamos el 1er elemento de la cola al final\r\n\t\t\tif (miQuantum == 0) {\r\n\t\t\t\tmiQuantum = quantumRR;\r\n\t\t\t\tcolaProcesosRR.add(colaProcesosRR.peek());\r\n\t\t\t\tcolaProcesosRR.poll();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Restamos 1 a la rafaga pendiente\r\n\t\t\tcolaProcesosRR.peek().setRafaga(colaProcesosRR.peek().getRafaga()-1);\r\n\t\t\t\t\r\n\t\t\t//Escribimos la línea con la información del proceso\r\n\t\t\t//Si al proceso le quedan 0 ráfagas, ha terminado, así que lo sacamos de la cola\r\n\t\t\tif (colaProcesosRR.peek().getRafaga() == 0) {\r\n\r\n\t\t\t\tSystem.out.println(\t\"Ciclo \" + cicloRR + \r\n\t\t\t\t\t\t\t\t\t\". Proceso \" + colaProcesosRR.peek().getNombre() + \r\n\t\t\t\t\t\t\t\t\t\". Ráfagas pendientes: \" + colaProcesosRR.peek().getRafaga() +\r\n\t\t\t\t\t\t\t\t\t\" FIN DEL PROCESO \" + colaProcesosRR.peek().getNombre()); \r\n\t\t\t\tcolaProcesosRR.peek().setSalida(cicloRR);\r\n\t\t\t\tcolaProcesosRR.poll();\r\n\t\t\t\tmiQuantum = quantumRR+1;\r\n\t\t\t}\t\t\t\t\r\n\t\t\t//Si le quedan ráfagas pendientes, mostramos la información y volvemos al principio\r\n\t\t\telse {\r\n\t\t\t\tSystem.out.println(\t\"Ciclo \" + cicloRR + \r\n\t\t\t\t\t\t\t\t\t\". Proceso \" + colaProcesosRR.peek().getNombre() + \r\n\t\t\t\t\t\t\t\t\t\". Ráfagas pendientes: \" + colaProcesosRR.peek().getRafaga());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\" + \"Índices de penalización:\" + \"\\n\");\r\n\t\t\r\n\t\t//Para cada proceso, calculamos la penalización y la vamos añadiendo a un total\r\n\t\tfor (int i = 0; i<miListaRR.size() ; i++) {\r\n\t\t\tpenalizacion = (float) (miListaRR.get(i).getSalida()-miListaRR.get(i).getLlegada()) / miListaRR.get(i).getRafagaInicial();\r\n\t\t\tindicePenalizacionPorProceso = penalizacion / miListaRR.size();\r\n\t\t\tindicePenalizacion = indicePenalizacion + indicePenalizacionPorProceso;\r\n\t\t\tSystem.out.println(\"Índice de penalización del proceso \" + miListaRR.get(i).getNombre() + \": \" + penalizacion);\r\n\t\t}\r\n\t\t\r\n\t\t//Finalmente, mostramos la penalización total\r\n System.out.println(\"\\n\" + \"Índice de Penalización total: \" + indicePenalizacion);\r\n \r\n\t}", "private void llenarVacios(int inicial){\n\t\tint[] vecinos = obtenerVecinos(inicial);\n\t\t\n\t\t//Saber cuales vecinos no tienen bombas\n\t\tvacios.clear();\n\t\tvacios.add(inicial);\n\t\tfor(int b = 0; b<Constantes.FILAS*Constantes.COLUMNAS; b++){\n\t\t\tvecinos = obtenerVecinos(vacios.get(b));\n\t\t\tfor(int i =0; i<vecinos.length;i++){\n\t\t\t\tif(vecinos[i] != -1 && LayerBotones.botones[vecinos[i]].getCantBombas() == 0){\n\t\t\t\t\tvacios.add(vecinos[i]);\n\t\t\t\t\tLayerBotones.botones[vecinos[i]].setDescubierto(true);\n\t\t\t\t}else if (vecinos[i] != -1){\n\t\t\t\t\taDespejar.add(vecinos[i]);\n\t\t\t\t\tLayerBotones.botones[vecinos[i]].setDescubierto(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(int i =0; i<vacios.size();i++){\n\t\t\tLayerBotones.botones[vacios.get(i)].setIcon(numeros[0]);\n\t\t\t//LayerBotones.botones[8].ponerIcono();\n\t\t\t\n\t\t}\n\t\tfor(int i =0; i<aDespejar.size();i++){\n\t\t\tLayerBotones.botones[aDespejar.get(i)].ponerIcono();\n\t\t\t//LayerBotones.botones[8].ponerIcono();\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void generTirarDados() {\n\r\n\t}", "Polo(ArrayList<Integer> valoresConfig)\n {\n flagsDesastres = new ArrayList();\n for (int d = 0; d < numCatastrofes; d++) //< Modificar al añadir desastres\n {\n flagsDesastres.add(false);\n }\n dia = 1;\n animales = new ArrayList();\n extintos = new ArrayList();\n for (int i = 0; i < 6; i++) //ID 0 reservado para el krill, no son objetos, pero si objetivos de comida\n {\n animales.add(new ArrayList());\n extintos.add(false);\n }\n SerVivo.IniciaCantidad();\n int randNum = Utilidades.rand(valoresConfig.get(0), valoresConfig.get(1));\n krill = randNum;\n randNum = Utilidades.rand(valoresConfig.get(2), valoresConfig.get(3));\n for (int i = 0; i < randNum; i++) {\n animales.get(1).add(new Pez(0, dia, 0));\n }\n randNum = Utilidades.rand(valoresConfig.get(4), valoresConfig.get(5));\n for (int i = 0; i < randNum; i++) {\n animales.get(2).add(new Foca(0, dia));\n }\n randNum = Utilidades.rand(valoresConfig.get(8), valoresConfig.get(9));\n for (int i = 0; i < randNum; i++) {\n animales.get(3).add(new Oso(0, dia));\n }\n randNum = Utilidades.rand(valoresConfig.get(6), valoresConfig.get(7));\n for (int i = 0; i < randNum; i++) {\n animales.get(4).add(new Morsa(0, dia));\n }\n\n randNum = Utilidades.rand(valoresConfig.get(10), valoresConfig.get(11));\n for (int i = 0; i < randNum; i++) {\n animales.get(5).add(new Esquimal(0, dia));\n }\n temperatura = valoresConfig.get(12);\n\n for (int i = 1; i < 6; i++) {\n animales.set(i, Utilidades.RadixSortIMC(animales.get(i)));\n }\n System.out.println(krill + \",\" + animales.get(1).size() + \",\" + animales.get(2).size() + \",\" + animales.get(3).size() + \",\" + animales.get(4).size() + \",\" + animales.get(5).size());\n }", "public void disparoDireccional(int tipo) {\n float x = super.getSprite().getPosicion().getX() + 48 - 58;\n float y = super.getSprite().getPosicion().getY() + 52 - 72;\n switch(tipo) {\n case 1: \n crearProyectilG(x, y, -1, -1);\n crearProyectilG(x, y, 0, -1); \n crearProyectilG(x, y, 1, -1);\n break;\n case 2:\n crearProyectilG(x, y, -1, -1);\n crearProyectilG(x, y, 0, -1); \n crearProyectilG(x, y, -1, 0);\n break;\n case 3: \n crearProyectilG(x, y, -1, -1);\n crearProyectilG(x, y, -1, 0);\n crearProyectilG(x, y, -1, 1); \n break;\n case 4:\n crearProyectilG(x, y, -1, 0); \n crearProyectilG(x, y, -1, 1);\n crearProyectilG(x, y, 0, 1);\n break;\n case 5:\n crearProyectilG(x, y, -1, 1); \n crearProyectilG(x, y, 0, 1);\n crearProyectilG(x, y, 1, 1);\n break;\n case 6:\n crearProyectilG(x, y, 0, 1); \n crearProyectilG(x, y, 1, 1);\n crearProyectilG(x, y, 1, 0);\n break;\n case 7:\n crearProyectilG(x, y, 1, -1); \n crearProyectilG(x, y, 1, 0);\n crearProyectilG(x, y, 1, 1);\n break;\n case 8:\n crearProyectilG(x, y, 0, -1); \n crearProyectilG(x, y, 1, -1);\n crearProyectilG(x, y, 1, 0);\n break;\n }\n }", "public static void main(String[] args) {\n int numeros[] = {2, 3, 4, 2, 4, 5, 6, 2, 1, 2};\n //Creamos segundo arreglo con iguall tamaño que el arreglo nùmeros\n int cuadrados[] = new int[numeros.length];\n //Arreglo para almacenar el proceso de la operación\n String procesos[] = new String[numeros.length];\n //Creamos ciclo de repeticiòn para recorrer arreglo \n for (int indice = 0; indice < numeros.length; indice++) {\n int cuadrado = numeros[indice] * numeros[indice];\n //Almacenamos el proceso de la opreaciòn en el arreglo cuadrados\n cuadrados[indice] = cuadrado;\n \n //Almacenar resultado en el arreglo procesos\n procesos[indice] = numeros[indice] + \"x\" + numeros[indice];\n }\n //Ciclo de repetición para mostrar arreglos\n String print_numeros = \"numeros - \";\n String print_cuadrados = \"cuadrados - \";\n String print_procesos = \"procesoss - \";\n for (int indice = 0; indice < numeros.length; indice++) {\n print_numeros = print_numeros + numeros[indice] + \", \";\n print_cuadrados = print_cuadrados + cuadrados[indice] + \", \";\n print_procesos = print_procesos + procesos[indice] + \", \";\n\n }\n System.out.println(print_numeros);\n System.out.println(print_cuadrados);\n System.out.println(print_procesos);\n \n //suma solo numeros pares\n int acumulador_pares=0;\n for (int indice = 0; indice < 10; indice++) {\n boolean par= detectar_par(numeros[indice]);\n if (par == true) {\n acumulador_pares = acumulador_pares + numeros[indice];\n \n }\n }\n System.out.println(\"La suma de los nùmeros pares es: \"+acumulador_pares);\n \n }", "public void UnDia()\n {\n int i = 0;\n for (i = 0; i < 6; i++) {\n for (int j = animales.get(i).size() - 1; j >= 0; j--) {\n\n if (!procesoComer(i, j)) {\n animales.get(i).get(j).destruir();\n animales.get(i).remove(j);\n } else {\n if (animales.get(i).size() > 0 && j < animales.get(i).size()) {\n\n if (animales.get(i).get(j).reproducirse()) {\n ProcesoReproducirse(i, j);\n }\n if (j < animales.get(i).size()) {\n if (animales.get(i).get(j).morir()) {\n animales.get(i).get(j).destruir();\n animales.get(i).remove(j);\n }\n }\n }\n }\n\n }\n }\n if (krill == 0) {\n Utilidades.MostrarExtincion(0, dia);\n }\n modificarKrill();\n modificarTemperatura();\n ejecutarDesastres();\n for (i = 1; i < animales.size(); i++) {\n if (animales.get(i).size() == 0 && !extintos.get(i)) {\n extintos.set(i, true);\n Utilidades.MostrarExtincion(i, dia);\n }\n }\n dia++;\n System.out.println(dia + \":\" + krill + \",\" + animales.get(1).size() + \",\" + animales.get(2).size() + \",\" + animales.get(3).size() + \",\" + animales.get(4).size() + \",\" + animales.get(5).size());\n }", "public void reinicio() {\n iNumBloques = 54; // se reinicia la cantidad de bloques\n iNivel = 1; // vuelve al nivel 1\n iScore = 0; // se reinicia el score\n iVidas = 3; // se reinicia la cantidad de vidas\n // La direccion del proyectil sera para arriba\n bDireccionY = false;\n // la direccion del proyectil sera al contrario de donde iba\n bDireccionX = !bDireccionX;\n // Se reposiciona el proyectil\n objProyectil.reposiciona((objBarra.getX() + objBarra.getAncho() / 2\n - (objProyectil.getAncho() / 2)), (objBarra.getY()\n - objProyectil.getAlto()));\n // Se reincia la velocidad del proyectil\n objProyectil.setVelocidad(5);\n // Se reposiciona la barra\n objBarra.reposiciona(((getWidth() / 2)\n - (objProyectil.getAncho() / 2)), (getHeight()\n - objBarra.getAlto()));\n // se limpia la lista de bloques\n lnkBloques.clear();\n // se vuelve a llenar y se acomoda\n try {\n acomodaBloques();\n } catch (IOException ioeError) {\n System.out.println(\"Hubo un error al cargar el juego: \"\n + ioeError.toString());\n }\n }", "private void aumentarPuntos() {\r\n this.puntos++;\r\n this.form.AumentarPuntos(this.puntos);\r\n }", "private void creaModuloMem() {\n /* variabili e costanti locali di lavoro */\n ArrayList<Campo> campi = new ArrayList<Campo>();\n ModuloRisultati modulo;\n Campo campo;\n\n try { // prova ad eseguire il codice\n\n campo = CampoFactory.intero(Campi.Ris.codicePiatto.getNome());\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.nomePiatto.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"piatto\");\n campo.setToolTipLista(\"nome del piatto\");\n campo.decora()\n .etichetta(\"nome del piatto\"); // le etichette servono per il dialogo ricerca\n campo.setLarghezza(250);\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.categoria.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"categoria\");\n campo.setToolTipLista(\"categoria del piatto\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteVolte.getNome());\n campo.setVisibileVistaDefault();\n campo.setLarghezza(80);\n campo.setTitoloColonna(\"quante volte\");\n campo.setToolTipLista(\n \"quante volte questo piatto è stato offerto nel periodo analizzato\");\n campo.decora().etichetta(\"quante volte\");\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quantiCoperti.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"coperti\");\n campo.setToolTipLista(\"numero di coperti che avrebbero potuto ordinare\");\n campo.decora().etichetta(\"n. coperti\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteComande.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"comande\");\n campo.setToolTipLista(\"numero di comande effettive\");\n campo.decora().etichetta(\"n. comande\");\n campo.setLarghezza(80);\n campo.setTotalizzabile(true);\n campi.add(campo);\n\n campo = CampoFactory.percentuale(Campi.Ris.gradimento.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"gradimento\");\n campo.setToolTipLista(\n \"percentuale di gradimento (è il 100% se tutti i coperti potenziali lo hanno ordinato)\");\n campo.decora().etichetta(\"% gradimento\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n modulo = new ModuloRisultati(campi);\n setModuloRisultati(modulo);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }", "private void prepare()\n {\n addObject(new TempoLimite(), 432, 207);\n addObject(new NumeroVidas(), 395, 278);\n\n Cliqueparajogar clique = new Cliqueparajogar();\n addObject(clique, getWidth()/2, getHeight()/2);\n\n Som som = new Som();\n addObject(som, getWidth() - 37, getHeight()-57);\n \n umMin ummin = new umMin();\n addObject(ummin,630,206);\n\n doisMin doismin = new doisMin();\n addObject(doismin,670,206);\n \n tresMin tresmin = new tresMin();\n addObject(tresmin,710,206);\n \n quatroMin quatromin = new quatroMin();\n addObject(quatromin,750,206);\n \n cincoMin cincomin = new cincoMin();\n addObject(cincomin,790,206);\n \n umaVida umavida = new umaVida();\n addObject(umavida,630,280);\n \n duasVidas duasvidas = new duasVidas();\n addObject(duasvidas,670,280);\n \n tresVidas tresvidas = new tresVidas();\n addObject(tresvidas,710,280);\n \n quatroVidas quatrovidas = new quatroVidas();\n addObject(quatrovidas,750,280);\n \n cincoVidas cincovidas = new cincoVidas();\n addObject(cincovidas,790,280);\n \n voltaratras voltar = new voltaratras();\n addObject(voltar, getWidth() -37, 428);\n }", "private void BajarPiezaAlInstante() {\n int newY = posicionY;\r\n while (newY > 0) {\r\n if (!Mover(piezaActual, posicionX, newY - 1)) {\r\n break;\r\n }\r\n --newY;\r\n }\r\n BajarPieza1posicion();\r\n }", "private synchronized void actualizarAsteroides(){\n\t\tfor(int i=0;i<numAsteroides;i++){\n\t\t\t\n\t\t\tasteroides[i].mover(this.getWidth(), this.getHeight());\n\t\t\n\t\t\ttry{\n\t\t\t\n\t\t\t\tif(asteroides[i].naveColision(nave) && nave!=null){\n\t\t\t\t\tanadirPuntos(asteroides[i].getPuntuacion());\n\t\t\t\t\tif(asteroides[i].getNumDisparos()>1 && nave!=null){\n\t\t\t\t\t\tfor(int k=0;k<asteroides[i].getNumDivision(); k++){\n\t\t\t\t\t\t\tañadirAsteroide(asteroides[i].crearDivisionAsteroide(minAstVel,maxAstVel));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\teliminarAsteroide(i);\n\t\t\t\t\ti--;\n\t\t\t\t\t\n\t\t\t\t\tquitarVida();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(enemigo.isVivo()==true && asteroides[i].enemigoColision(enemigo) && enemigo.isVivo() && nave!=null){\n\t\t\t\t\tif(asteroides[i].getNumDisparos()>1 && nave!=null){\n\t\t\t\t\t\tfor(int k=0;k<asteroides[i].getNumDivision(); k++){\n\t\t\t\t\t\t\tañadirAsteroide(asteroides[i].crearDivisionAsteroide(minAstVel,maxAstVel));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\teliminarAsteroide(i);\n\t\t\t\t\tenemigo.setVivo(false);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor(int j=0;j<numDisparos;j++){\n\t\t\t\t\tif(asteroides[i].disparoColision(disparos[j]) && nave!=null){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(disparos[j]!=null){\n\t\t\t\t\t\t\teliminarDisparos(j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanadirPuntos(asteroides[i].getPuntuacion());\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(asteroides[i].getNumDisparos()>1 && nave!=null){\n\t\t\t\t\t\t\tfor(int k=0;k<asteroides[i].getNumDivision(); k++){\n\t\t\t\t\t\t\t\tañadirAsteroide(asteroides[i].crearDivisionAsteroide(minAstVel,maxAstVel));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\teliminarAsteroide(i);\n\t\t\t\t\t\tj=numDisparos; \n\t\t\t\t\t\t\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor(int j=0;j<numDisparosE;j++){\n\t\t\t\t\tif(asteroides[i].disparoColision(disparosE[j]) && !enemigo.isVivo()){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(disparosE[j]!=null && nave!=null){\n\t\t\t\t\t\t\teliminarDisparosE(j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(asteroides[i].getNumDisparos()>1 && nave!=null){\n\t\t\t\t\t\t\tfor(int k=0;k<asteroides[i].getNumDivision(); k++){\n\t\t\t\t\t\t\t\tañadirAsteroide(asteroides[i].crearDivisionAsteroide(minAstVel,maxAstVel));\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\teliminarAsteroide(i);\n\t\t\t\t\t\tj=numDisparosE;\n\t\t\t\t\t\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e) {}\n\t\t}\n\t}", "private void cruzarGenesMonopunto(Cromosoma padre, Cromosoma madre) {\n\t\t//obtenemos el punto de cruce\n\t\tint longCromosoma = this.poblacion[0].getLongitudCrom();\n\t\tint puntoCruce = (int) (Math.random() * longCromosoma) + 1;\n\t\t\n\t\tboolean[] infoPadre = padre.getCromosoma();\n\t\tboolean[] infoMadre = madre.getCromosoma();\n\t\tboolean aux;\n\t\tfor(int i = puntoCruce; i < longCromosoma; i++) {\n\t\t\t\n\t\t\taux = infoPadre[i];\n\t\t\tinfoPadre[i] = infoMadre[i];\n\t\t\tinfoMadre[i] = aux;\n\t\t\t\n\t\t}\n\t\tpadre.setCromosoma(infoPadre);\n\t\tmadre.setCromosoma(infoMadre);\n\t\t\n\t}", "public static void CrearListaDeOleadasPorNivel(LinkedList<LinkedList<Enemigo>> Enemigos, int NumeroDeNivel, LinkedList<LinkedList<Posicion>> ListaDeEstelas, double Velocidad) {\n\t\tRandom aleatorio = new Random();\n\t\tint oleada = 1;\n\n\t\t// Genera un numero Random de enemigos para cada nivel de 12 a 17\n\t\tInteger numeroDeEnemigosPorNivel = (12 + aleatorio.nextInt(6));\n\n\t\t// Adentro de este loop se agregan todos los enemigos a la lista Enemigos\n\t\twhile (numeroDeEnemigosPorNivel > 0) {\n\t\t\toleada++;\n\t\t\t// oleadaEnemigos es una oleada\n\t\t\tLinkedList<Enemigo> oleadaEnemigos = new LinkedList<Enemigo>();\n\n\t\t\t// Genera Un numero Random de enemigos para cada oleada de 0 a 4\n\t\t\tint numeroDeEnemigosPorOleada = (aleatorio.nextInt(5));\n\t\t\tfor (int i = numeroDeEnemigosPorOleada; i != 0; i--) {\n\n\t\t\t\t/* Genera Un numero Random de enemigos para cada oleada de 0 a 4 */\n\t\t\t\tMisilBalistico MB = new MisilBalistico(Velocidad);\n\t\t\t\tMB.determinarDesplazamiento(Velocidad);\n\t\t\t\tListaDeEstelas.add(MB.getEstela().getListaDeEstelas());\n\t\t\t\toleadaEnemigos.add(MB);\n\t\t\t\tnumeroDeEnemigosPorNivel--;\n\t\t\t}\n\n\t\t\t// En todos los niveles se van a agregar los Misil Cruceros Inteligentes y los\n\t\t\t// Misil cruceros apartir de la oleada 4\n\t\t\tif ((oleada == 4)){\n\t\t\t\tif (VectorDeMisilesCrucerosPorNivel[NumeroDeNivel]) {\n\t\t\t\t\tMisilCruceroInteligente MCI = new MisilCruceroInteligente(Velocidad);\n\t\t\t\t\toleadaEnemigos.add(MCI);\n\t\t\t\t} else {\n\t\t\t\t\tMisilCrucero MC = new MisilCrucero(Velocidad);\n\t\t\t\t\toleadaEnemigos.add(MC);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Se agregan a la oleada de enemigos 2 bombarderos por nivel, siendo\n\t\t\t * aleatoriamente seleccionado si es un Satelite o un Avion utilizando un random\n\t\t\t * que devuelva 0 o 1 para determinar que bombardero sera el que se agregue a la\n\t\t\t * oleada\n\t\t\t */\n\n\t\t\tif ((oleada == 3) || (oleada == 7)) {\n\t\t\t\tint numeroDeBombarderosPorOleada = (aleatorio.nextInt(2));\n\t\t\t\tif (numeroDeBombarderosPorOleada == 1) {\n\t\t\t\t\tAvion A = new Avion();\n\t\t\t\t\toleadaEnemigos.add(A);\n\t\t\t\t} else {\n\t\t\t\t\tSatelite S = new Satelite();\n\t\t\t\t\toleadaEnemigos.add(S);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Agrego la oleada a la lista de oleadas\n\t\t\tEnemigos.add(oleadaEnemigos);\n\t\t}\n\n\t}", "private void adicionaMusicasVaziasCD () {\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tfaixasCD.add(i, \"\");\n\t\t}\n\t}", "public void move() {\r\n\t\tif(torretas.size() == 0){\r\n\t\t\tagregarExplosiones();\r\n\t\t}\r\n\t\tif(System.currentTimeMillis() - init > delay && !control[0])\r\n\t\t\tif(puedeMoverse()){\r\n\t\t\t\tif(random){\r\n\t\t\t\t\tint select = -1;\r\n\t\t\t\t\tboolean move = false;\r\n\t\t\t\t\twhile(!move){\r\n\t\t\t\t\t\tselect = rn.nextInt(4);\r\n\t\t\t\t\t\tif(select == 0 || select == 3){\r\n\t\t\t\t\t\t\tmove = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(select == 2 && hayTorretas(x + defaultWidth/2 + 190, x+defaultWidth)){\r\n\t\t\t\t\t\t\tmove = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(select == 1 && hayTorretas(x, x+defaultWidth/2 - 190)){\r\n\t\t\t\t\t\t\tmove = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\r\n\t\t\t\t\tint auxX = x;\r\n\t\t\t\t\tint auxY = y;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(select == 0){\r\n\t\t\t\t\t\tmoves[0] = moves[1] = true;\r\n\t\t\t\t\t\tx = -237;\r\n\t\t\t\t\t\ty = -defaultHeight;\r\n\t\t\t\t\t\tvelocidad = 4;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(select == 1){\r\n\t\t\t\t\t\tmoves[2] = moves[3] = true;\r\n\t\t\t\t\t\tx = 800;\r\n\t\t\t\t\t\ty = 0;\r\n\t\t\t\t\t\tvelocidad = 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(select == 2){\r\n\t\t\t\t\t\tmoves[4] = moves[5] = true;\r\n\t\t\t\t\t\tx = - defaultWidth;\r\n\t\t\t\t\t\ty = 0;\r\n\t\t\t\t\t\tvelocidad = 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(select == 3){\r\n\t\t\t\t\t\tmoves[6] = moves[7] = true;\r\n\t\t\t\t\t\tx = -237;\r\n\t\t\t\t\t\ty = 800;\r\n\t\t\t\t\t\tvelocidad = 5;\r\n\t\t\t\t\t\treproductor.addSound(alarm, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactualizarTorretas(x-auxX, y-auxY);\r\n\t\t\t\t\t\r\n\t\t\t\t\trandom = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de arriba a abajo\r\n\t\t\t\tif(!moves[2] && !moves[3] && !moves[4] && !moves[5] && !moves[6] && !moves[7])\r\n\t\t\t\tif(moves[0] && y + defaultHeight < 500){\r\n\t\t\t\t\ty +=velocidad;\r\n\t\t\t\t\tactualizarTorretas(0, +velocidad);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[0] = false;\r\n\t\t\t\t\tif(y + defaultHeight > -100 && moves[1]){\r\n\t\t\t\t\t\ty-=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(0, -velocidad);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tmoves[1] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de derecha a izquierda\r\n\t\t\t\tif(!moves[0] && !moves[1] && !moves[4] && !moves[5] && !moves[6] && !moves[7])\r\n\t\t\t\tif(moves[2] && x > 250){\t\r\n\t\t\t\t\tx-=velocidad;\r\n\t\t\t\t\tactualizarTorretas(-velocidad,0);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[2] = false;\r\n\t\t\t\t\tif(x < 900 && moves[3]){\r\n\t\t\t\t\t\tx+=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(velocidad,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tmoves[3] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de izquierda a derecha\r\n\t\t\t\tif(!moves[0] && !moves[1] && !moves[2] && !moves[3] && !moves[6] && !moves[7])\r\n\t\t\t\tif(moves[4] && x + defaultWidth < 550){\r\n\t\t\t\t\t\r\n\t\t\t\t\tx+=velocidad;\r\n\t\t\t\t\tactualizarTorretas(velocidad,0);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[4] = false;\r\n\t\t\t\t\tif(x + defaultWidth > -100 && moves[5]){\r\n\t\t\t\t\t\tx-=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(-velocidad,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tmoves[5] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//movimiento de abajo a arriba\r\n\t\t\t\tif(!moves[0] && !moves[1] && !moves[2] && !moves[3] && !moves[4] && !moves[5])\r\n\t\t\t\tif(moves[6] && y > 250){\r\n\t\t\t\t\ty-=velocidad;\r\n\t\t\t\t\tactualizarTorretas(0,-velocidad);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tmoves[6] = false;\r\n\t\t\t\t\tif(y < 700 && moves[7]){\r\n\t\t\t\t\t\ty+=velocidad;\r\n\t\t\t\t\t\tactualizarTorretas(0,velocidad);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tmoves[7] = false;\r\n\t\t\t\t\t\trandom = true;\r\n\t\t\t\t\t\tinit = System.currentTimeMillis();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tsetMove();\r\n\t}", "private void initVistas() {\n // La actividad responderá al pulsar el botón.\n Button btnSolicitar = (Button) this.findViewById(R.id.btnSolicitar);\n btnSolicitar.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View v) {\n solicitarDatos();\n }\n });\n lblDatos = (TextView) this.findViewById(R.id.lblDatos);\n }", "private void agregarBloquesPredeterminados(){\n ImageView imagenBloqueMoverDerecha = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueMoverDerecha.jpeg\"));\n ImageView imagenMoverIzquierda = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueMoverIzquierda.jpeg\"));\n ImageView imagenMoverArriba = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueMoverArriba.jpeg\"));\n ImageView imagenMoverAbajo = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueMoverAbajo.jpeg\"));\n ImageView imagenBajarLapiz = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueBajarLapiz.jpg\"));\n ImageView imagenLevantarLapiz = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueLevantarLapiz.jpg\"));\n ImageView imagenRepetir2 = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueRepetir2.jpeg\"));\n ImageView imagenRepetir3 = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueRepetir3.jpeg\"));\n ImageView imagenInvertir = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueInvertir.png\"));\n\n //creo contenedores para los bloques de seccion bloque\n VBox contenedorBloqueMoverDerecha = new VBox();\n VBox contenedorBloqueMoverIzquierda = new VBox();\n VBox contenedorBloqueMoverArriba = new VBox();\n VBox contenedorBloqueMoverAbajo = new VBox();\n VBox contenedorBloqueLevantarLapiz = new VBox();\n VBox contenedorBloqueBajarLapiz = new VBox();\n VBox contenedorBloqueRepetir2 = new VBox();\n VBox contenedorBloqueRepetir3 = new VBox();\n VBox contenedorBloqueInvertir = new VBox();\n\n\n //creo los bloques de seccion bloque y los agrego a sus respectivos contenedores\n contenedorBloqueMoverDerecha.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenBloqueMoverDerecha), contenedorBloqueMoverDerecha, tablero, \"MoverDerecha\", false));\n contenedorBloqueMoverIzquierda.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenMoverIzquierda), contenedorBloqueMoverIzquierda, tablero, \"MoverIzquierda\", false));\n contenedorBloqueMoverArriba.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenMoverArriba), contenedorBloqueMoverArriba, tablero, \"MoverArriba\", false));\n contenedorBloqueMoverAbajo.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenMoverAbajo), contenedorBloqueMoverAbajo, tablero, \"MoverAbajo\", false));\n contenedorBloqueLevantarLapiz.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenLevantarLapiz), contenedorBloqueLevantarLapiz, tablero, \"LevantarLapiz\", false));\n contenedorBloqueBajarLapiz.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenBajarLapiz), contenedorBloqueBajarLapiz, tablero, \"BajarLapiz\", false));\n contenedorBloqueRepetir2.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenRepetir2), contenedorBloqueRepetir2, tablero, \"RepetirDoble\", true));\n contenedorBloqueRepetir3.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenRepetir3), contenedorBloqueRepetir3, tablero, \"RepetirTriple\", true));\n contenedorBloqueInvertir.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenInvertir), contenedorBloqueInvertir, tablero, \"Invertir\", true));\n\n //agrego de manera ordenada los contenedores de bloques de seccion bloque\n this.getChildren().add(contenedorBloqueMoverDerecha);\n this.getChildren().add(contenedorBloqueMoverIzquierda);\n this.getChildren().add(contenedorBloqueMoverArriba);\n this.getChildren().add(contenedorBloqueMoverAbajo);\n this.getChildren().add(contenedorBloqueLevantarLapiz);\n this.getChildren().add(contenedorBloqueBajarLapiz);\n this.getChildren().add(contenedorBloqueRepetir2);\n this.getChildren().add(contenedorBloqueRepetir3);\n this.getChildren().add(contenedorBloqueInvertir);\n }", "public static void dormir(){\n System.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n int restoDeMana; //variables locales a utilizar\n int restoDeVida;\n if(oro>=30){ //condicion de oro para recuperar vida y mana\n restoDeMana=10-puntosDeMana;\n puntosDeMana=puntosDeMana+restoDeMana;\n restoDeVida=150-puntosDeVida;\n puntosDeVida=puntosDeVida+restoDeVida;\n //descotando oro al jugador\n oro=oro-30;\n System.out.println(\"\\nrecuperacion satisfactoria\");\n }\n else{\n System.out.println(\"no cuentas con 'Oro' para recuperarte\");\n }\n }", "public void SiguienteCancion(View view){\n //Verificamos si nuestro indice esta en la posicion 0\n if(posicion < vector_mp.length -1){//-1 evita el desbordamiento de memoria\n // Si nuestro indice es menor al ancho de nuestro vector, permite que nuestro indice siga recorriendo el vector\n //Verifica que nuestro vector en tal posicion este reprodcuiendo una cancion\n if(vector_mp[posicion].isPlaying()){\n //Detiene la pista que se esta reproduciendo para poder reproducir la siguiente\n vector_mp[posicion].stop();\n //Ayudamos a nuestro indice a recorrer el vector\n posicion++;\n //La siguiente posicion/cancion debe empezar a reproducirse\n vector_mp[posicion].start();\n\n //cambio de portada\n if(posicion == 0){\n iv.setImageResource(R.drawable.portada1);;\n } else if(posicion == 1){\n iv.setImageResource(R.drawable.portada2);\n } else if(posicion == 2){\n iv.setImageResource(R.drawable.portada3);\n }\n\n } else {\n //Solo incrementa la posicion ya que al no estar reproduciendo no tiene caso detener\n posicion++;\n\n //cambio de portada\n if(posicion == 0){\n iv.setImageResource(R.drawable.portada1);;\n } else if(posicion == 1){\n iv.setImageResource(R.drawable.portada2);\n } else if(posicion == 2){\n iv.setImageResource(R.drawable.portada3);\n }\n\n }\n\n } else{\n //Si nuestro inidice posicion ya recorrio el vector indicara que no hay mas canciones y asi evitar un desbordamiento de memoria\n Toast.makeText(this, \"No hay mas canciones\", Toast.LENGTH_SHORT).show();\n }\n }", "public void carroPulando() {\n\t\tpulos++;\n\t\tpulo = (int) (PULO_MAXIMO/10);\n\t\tdistanciaCorrida += pulo;\n\t\tif (distanciaCorrida > distanciaTotalCorrida) {\n\t\t\tdistanciaCorrida = distanciaTotalCorrida;\n\t\t}\n\t}", "private void mostrarRota() {\n int cont = 1;\n int contMelhorRota = 1;\n int recompensa = 0;\n int distanciaTotal = 0;\n List<Rota> calculaMR;\n\n System.out.println(\"\\n=================== =================== ========== #Entregas do dia# ========== =================== ===================\");\n for (RotasEntrega re : rotas) {\n Rota r = re.getRotaMenor();\n\n System.out\n .print(\"\\n\\n=================== =================== A \" + cont + \"º possível rota a ser realizada é de 'A' até '\" + r.getDestino() + \"' =================== ===================\");\n\n\n boolean isTrue = false;\n if (r.getRecompensa() == 1) {\n isTrue = true;\n }\n\n System.out.println(\"\\n\\nA possivel rota é: \" + printRoute(r));\n System.out.println(\n \"Com a chegada estimada de \" + r.getDistancia() + \" unidades de tempo no destino \" + \"'\"\n + r.getDestino() + \"'\" + \" e o valor para esta entrega será de \" + (isTrue ?\n r.getRecompensa() + \" real\" : r.getRecompensa() + \" reais\") + \".\");\n\n\n distanciaTotal += r.getDistancia();\n cont++;\n }\n\n calculaMR = calculaMelhorEntraga(distanciaTotal);\n System.out.println(\"\\n#############################################################################################################################\");\n\n for(Rota reS : calculaMR)\n {\n System.out\n .print(\"\\n\\n=================== =================== A \" + contMelhorRota + \"º rota a ser realizada é de 'A' até '\" + reS.getDestino() + \"' =================== ===================\");\n\n\n boolean isTrue = false;\n if (reS.getRecompensa() == 1) {\n isTrue = true;\n }\n\n System.out.println(\"\\n\\nA melhor rota é: \" + printRoute(reS));\n System.out.println(\n \"Com a chegada estimada de \" + reS.getDistancia() + \" unidades de tempo no destino \" + \"'\"\n + reS.getDestino() + \"'\" + \" e o valor para esta entrega será de \" + (isTrue ?\n reS.getRecompensa() + \" real\" : reS.getRecompensa() + \" reais\") + \".\");\n\n recompensa += reS.getRecompensa();\n contMelhorRota ++;\n }\n\n System.out.println(\"\\n\\nO lucro total do dia: \" + recompensa + \".\");\n }", "private void verificarMuerte() {\n if(vidas==0){\n if(estadoJuego==EstadoJuego.JUGANDO){\n estadoJuego=EstadoJuego.PIERDE;\n //Crear escena Pausa\n if(escenaMuerte==null){\n escenaMuerte=new EscenaMuerte(vistaHUD,batch);\n }\n Gdx.input.setInputProcessor(escenaMuerte);\n efectoGameOver.play();\n if(music){\n musicaFondo.pause();\n }\n }\n guardarPuntos();\n }\n }", "public void provocarEvolucion(Tribu tribuJugador, Tribu tribuDerrotada){\r\n System.out.println(\"\\n\");\r\n System.out.println(\"-------------------Fase de evolución ----------------------\");\r\n int indiceAtributo;\r\n int indiceAtributo2;\r\n double golpeViejo = determinarGolpe(tribuJugador);\r\n for(int i = 1; i <= 10 ; i++){\r\n System.out.println(\"Iteración número: \" + i);\r\n indiceAtributo = (int)(Math.random() * 8);\r\n indiceAtributo2 = (int)(Math.random() * 8);\r\n String nombreAtributo1 = determinarNombrePosicion(indiceAtributo);\r\n String nombreAtributo2 = determinarNombrePosicion(indiceAtributo2);\r\n if((tribuJugador.getArray()[indiceAtributo] < tribuDerrotada.getArray()[indiceAtributo] \r\n && (tribuJugador.getArray()[indiceAtributo2] < tribuDerrotada.getArray()[indiceAtributo2]))){\r\n System.out.println(\"Se cambió el atributo \" + nombreAtributo1 + \" de la tribu del jugador porque\"\r\n + \" el valor era \" + tribuJugador.getArray()[indiceAtributo] + \" y el de la tribu enemeiga era de \"\r\n + tribuDerrotada.getArray()[indiceAtributo] + \" esto permite hacer más fuerte la tribu del jugador.\");\r\n \r\n tribuJugador.getArray()[indiceAtributo] = tribuDerrotada.getArray()[indiceAtributo];\r\n \r\n System.out.println(\"Se cambió el atributo \" + nombreAtributo2 + \" de la tribu del jugador porque\"\r\n + \" el valor era \" + tribuJugador.getArray()[indiceAtributo2] + \" y el de la tribu enemeiga era de \"\r\n + tribuDerrotada.getArray()[indiceAtributo2] + \" esto permite hacer más fuerte la tribu del jugador.\");\r\n \r\n tribuJugador.getArray()[indiceAtributo2] = tribuDerrotada.getArray()[indiceAtributo2];\r\n }\r\n }\r\n double golpeNuevo = determinarGolpe(tribuJugador);\r\n if(golpeNuevo > golpeViejo){\r\n tribus.replace(tribuJugador.getNombre(), determinarGolpe(tribuJugador));\r\n System.out.println(\"\\nTribu evolucionada\");\r\n imprimirAtributos(tribuJugador);\r\n System.out.println(\"\\n\");\r\n System.out.println(tribus);\r\n }\r\n else{\r\n System.out.println(\"\\nTribu sin evolucionar\");\r\n System.out.println(\"La tribu no evolucionó porque no se encontraron atributos\"\r\n + \" que permitiesen crecer su golpe\");\r\n imprimirAtributos(tribuJugador);\r\n System.out.println(\"\\n\");\r\n System.out.println(tribus);\r\n }\r\n }", "public void aumentarAciertos() {\r\n this.aciertos += 1;\r\n this.intentos += 1; \r\n }", "private void BajarPieza1posicion() {\n for (int i = 0; i < 4; ++i) {\r\n int x = posicionX + piezaActual.x(i);\r\n int y = posicionY - piezaActual.y(i);\r\n piezas[(y * anchoTablero) + x] = piezaActual.getPieza();\r\n }\r\n\r\n BorrarLineas();\r\n\r\n if (!finalizoQuitarFilas) {\r\n nuevaPieza();\r\n }\r\n }", "private void moverCamionetas() {\n for (Camioneta cam : arrEnemigosCamioneta) {\n cam.render(batch);\n\n cam.moverIzquierda();\n }\n }", "public static void curar(){\n int aleatorio; //variables locales a utilizar\n Random numeroAleatorio = new Random(); //declarando variables tipo random para aleatoriedad\n int curador;\n //condicion de puntos de mana para ejecutar la curacion del jugador\n if(puntosDeMana>=1){\n //acciones de la funcion curar en el jugador\n aleatorio = (numeroAleatorio.nextInt(25-15+1)+15);\n curador= ((nivel+1)*5)+aleatorio;\n puntosDeVida= puntosDeVida+curador;\n puntosDeMana=puntosDeMana-1;\n }\n else{//imprimiendo el mensaje de curacion fallada\n System.out.println(\"no cuentas con Puntos De mana (MP) para curarte\");\n }\n }", "public void initPlateau() {\r\n\t\t// On place les obstacles\r\n\t\tint epaisseur = 20;\r\n\t\tint delta = 50;\r\n\t\tint espace = 150;\r\n\t\tobstacles.add(new Obstacle(0,0,width,epaisseur));\r\n\t\tobstacles.add(new Obstacle(0,height - epaisseur,width,epaisseur));\r\n\t\tobstacles.add(new Obstacle(0,0,epaisseur,height));\r\n\t\tobstacles.add(new Obstacle(width - epaisseur,0,epaisseur,height));\r\n\t\t\r\n\t\tobstacles.add(new Obstacle(0,100,width-espace,epaisseur));\r\n\t\tobstacles.add(new Obstacle(espace,200,width-espace,epaisseur));\r\n\t\tobstacles.add(new Obstacle(0,300,width-espace,epaisseur));\r\n\t\tobstacles.add(new Obstacle(espace,400,width-espace,epaisseur));\r\n\t\t\r\n\t\t// On place les objectifs\r\n\t\t\r\n\t\tobjectifs.add(new Objectif(400,50));\r\n\t\tobjectifs.add(new Objectif(150,50));\r\n\t\tobjectifs.add(new Objectif(300,50));\r\n\t\tobjectifs.add(new Objectif(50,50));\r\n\t\tobjectifs.add(new Objectif(400,50));\r\n\t\tobjectifs.add(new Objectif(600,50));\r\n\t\tobjectifs.add(new Objectif(700,70));\r\n\t\tobjectifs.add(new Objectif(730,100));\r\n\t\tobjectifs.add(new Objectif(730,130));\r\n\t\tobjectifs.add(new Objectif(100,150));\r\n\t\tobjectifs.add(new Objectif(200,150));\r\n\t\tobjectifs.add(new Objectif(400,150));\r\n\t\tobjectifs.add(new Objectif(500,150));\r\n\t\tobjectifs.add(new Objectif(600,150));\r\n\t\tobjectifs.add(new Objectif(700,150));\r\n\t\tobjectifs.add(new Objectif(70,200));\r\n\t\tobjectifs.add(new Objectif(100,250));\r\n\t\tobjectifs.add(new Objectif(500,250));\r\n\t\tobjectifs.add(new Objectif(300,250));\r\n\t\tobjectifs.add(new Objectif(600,250));\r\n\t\tobjectifs.add(new Objectif(700,270));\r\n\t\tobjectifs.add(new Objectif(730,300));\r\n\t\tobjectifs.add(new Objectif(730,330));\r\n\t\tobjectifs.add(new Objectif(100,350));\r\n\t\tobjectifs.add(new Objectif(200,350));\r\n\t\tobjectifs.add(new Objectif(700,350));\r\n\t\tobjectifs.add(new Objectif(500,350));\r\n\t\tobjectifs.add(new Objectif(300,350));\r\n\t\tobjectifs.add(new Objectif(100,350));\r\n\t\tobjectifs.add(new Objectif(70,400));\r\n\t\tobjectifs.add(new Objectif(100,450));\r\n\t\tobjectifs.add(new Objectif(500,450));\r\n\t\tobjectifs.add(new Objectif(300,450));\r\n\t\tobjectifs.add(new Objectif(600,450));\r\n\t\t\r\n\t}", "public void crearPeliculaNueva(){\n //Atributos de pelicula\n String titulo;\n String autor;\n Multimedia.FORMATO formato;\n GregorianCalendar anyo;\n double duracion = 0;\n String actorPrincipal;\n String actrizPrincipal;\n\n boolean validado = false;\n\n\n titulo = pedirString( \"titulo\"); // Pido el titulo\n autor = pedirString(\"autor\"); // Pido el autor\n formato = pedirFormato(); // Pido el formato\n anyo = pedirAnyo(); // Pido el anyo\n\n do{\n System.out.println(\"Introduce la duracion:\");\n try {\n duracion = Double.parseDouble(lector.nextLine());\n validado = true;\n\n if(duracion <= 0){\n validado = false;\n System.out.println(\"la duracion no puede ser un numero negativo\");\n }\n }catch (NumberFormatException nfe){\n System.out.println(\"Por favor, introduce un numero.\");\n }\n\n }while(!validado);\n validado = false;\n\n // Pido el actor\n do {\n System.out.println(\"Actor: \");\n actorPrincipal = lector.nextLine();\n validado = titulo.length() > 2;\n if(!validado) {\n System.out.println(\"El actor debe tener almenos 2 caracteres\");\n Lib.pausa();\n }\n } while (!validado);\n\n validado = false;\n\n // Pido la actriz\n do {\n System.out.println(\"Actriz: \");\n actrizPrincipal = lector.nextLine();\n validado = titulo.length() > 2;\n if(!validado) {\n System.out.println(\"La actriz debe tener almenos 2 caracteres\");\n Lib.pausa();\n }\n } while (!validado);\n\n\n // Finalmente creo la pelicula y lo anyado a las peliculas de la tienda.\n tienda.getPeliculas().add(new Pelicula(titulo, autor, formato, anyo, duracion, actorPrincipal, actrizPrincipal));\n System.out.println(\"Pelicula creado con exito\");\n Lib.pausa();\n\n }", "public void actualiza() {\n //Si el indice de bloque a mover no es -1(no hay que mover bloque)...\n if(bAvanzaBloque) {\n for (Object objeBloque : lnkBloques) {\n Objeto objBloque = (Objeto) objeBloque;\n //Mueves los bloques que hay que mover\n if(objBloque.getVelocidad()!=0) {\n objBloque.abajo();\n }\n }\n }\n //Si la direccion X es true(el proyectil va a la derecha)\n if (bDireccionX) {\n objProyectil.derecha();\n } //Si es false (va ala izquierda)\n else {\n objProyectil.izquierda();\n }\n\n //Si la direccion Y es true(el proyectil va hacia arriba)\n if (!bDireccionY) {\n objProyectil.arriba();\n } //Si es false (va hacia abajo)\n else {\n objProyectil.abajo();\n }\n\n if (iNumBloques == 0) { // Si se acaban los bloques\n iNumBloques = 54; // Se reinicia la variable de los bloques\n iNivel++; // Aumenta el nivel\n // Se reposiciona el proyectil\n objProyectil.reposiciona((objBarra.getX() + objBarra.getAncho() / 2\n - (objProyectil.getAncho() / 2)), (objBarra.getY()\n - objProyectil.getAlto()));\n // Se aumenta la velocidad del proyectil\n objProyectil.setVelocidad(objProyectil.getVelocidad() + 3);\n // Se reposiciona la barra\n objBarra.reposiciona(((getWidth() / 2)\n - (objProyectil.getAncho() / 2)), (getHeight()\n - objBarra.getAlto()));\n // se limpia la lista de bloques\n lnkBloques.clear();\n // se vuelve a llenar y se acomoda\n try {\n acomodaBloques();\n } catch (IOException ioeError) {\n System.out.println(\"Hubo un error al cargar el juego: \"\n + ioeError.toString());\n }\n // se mueve hacia arriba el proyectil\n bDireccionY = false;\n bDireccionX = true;\n }\n\n if (iVidas == 0) {\n bPerdio = true;\n }\n /*if (iVidas == 0) {\n bPerdio = true;\n bPausado = true;\n iNumBloques = 54; // se reinicia la cantidad de bloques\n iNivel = 1; // vuelve al nivel 1\n // La direccion del proyectil sera para arrib\n bDireccionY = false;\n // La direccion que nos interesa es: false: Izq. true: Dererecha\n bDireccionX = true;\n // Se reposiciona el proyectil\n objProyectil.reposiciona((objBarra.getX() + objBarra.getAncho() / 2\n - (objProyectil.getAncho() / 2)), (objBarra.getY()\n - objProyectil.getAlto()));\n // Se reincia la velocidad del proyectil\n objProyectil.setVelocidad(5);\n // Se reposiciona la barra\n objBarra.reposiciona(((getWidth() / 2) \n - (objProyectil.getAncho() / 2)), (getHeight() \n - objBarra.getAlto()));\n // se limpia la lista de bloques\n lnkBloques.clear();\n // se vuelve a llenar y se acomoda\n try {\n acomodaBloques();\n } catch (IOException ioeError) {\n System.out.println(\"Hubo un error al cargar el juego: \"\n + ioeError.toString());\n }\n }\n \n if (!bPerdio) {\n iVidas = 3; // se reinicia la cantidad de vidas\n iScore = 0; // se reincia el score\n }*/\n }", "public void inicialAleatorio() {\n //aqui adiciona naquele vetor que de auxilio\n alocacao.add(Estados.ELETRICISTAS);\n alocacao.add(Estados.ELETRICISTAS2);\n alocacao.add(Estados.QUALIDADE);\n alocacao.add(Estados.QUALIDADE2);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL2);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL3);\n alocacao.add(Estados.PLANEJAMENTO);\n\n //biblioteca que sorteia aleatoriamente os departamentos\n Collections.shuffle(alocacao);\n\n for (int i = 0; i < 4; i++) {\n matrix[1][i] = alocacao.get(i);\n\n }\n\n for (int i = 0; i < 4; i++) {\n matrix[3][i] = alocacao.get(i + 4);\n }\n\n }", "public void solicitarDatos() {\n Scanner scanner = new Scanner(System.in);\n Terreno terreno = new Terreno();\n Vivienda vivienda = new Vivienda();\n\n //preguntamos datos:\n System.out.println(\"Metros cuadrados: \");\n Integer m2 = scanner.nextInt();\n\n System.out.println(\"Precio: \");\n Double precio = scanner.nextDouble();\n\n System.out.println(\"Nombre del pueblo: \");\n String nombrePueblo = scanner.next();\n\n System.out.println(\"ID: \");\n Integer id = scanner.nextInt();\n\n //escogemos opción:\n\n System.out.println(\"Estás creando un Terreno(t) o una Vivienda(v)?: \");\n String opcion = scanner.next();\n //controlamos que la opción introducida sea válida y el precio mayor que 0 en ambos casos:\n //(si el precio es menor a 0, directamente no se crea el objeto a la hora de añadir)\n if (opcion.equals(\"t\") && precio > 0) {\n terreno.solicitarDatos(m2, precio, nombrePueblo, id);\n } else if (opcion.equals(\"v\") && precio > 0) {\n vivienda.solicitarDatos(m2, precio, nombrePueblo, id);\n } else {\n System.out.println(\"El precio es menor a 0 o no has introducido una opción correcta\");\n }\n }", "public void crearGloboVerde(int tiempo){ \n GloboVerde globov = new GloboVerde();\n globoslista.add(globov);\n double posicionx = generarPosicionX();\n globov.fijarPosicion(posicionx);\n \n gpane.getChildren().addAll(globov);\n MoverGlobo mv = new MoverGlobo(globov,tiempo);\n mov= new Thread(mv);\n mov.start(); \n }", "public void venceuRodada () {\n this.pontuacaoPartida++;\n }", "private void inicializarJuego() {\n\t\tList<VerboIrregular> lista = utilService.getVerbosIrregulares(faciles, normales, dificiles);\n\n\t\trealmService.cambiarMostrarRespuestasVerbosIrregulares(lista, false);\n\n\t\tverbosIrregularesDesordenadas.clear();\n\n\t\tfor (VerboIrregular x : lista) {\n\t\t\tverbosIrregularesDesordenadas.add(x);\n\t\t}\n\n\t\tCollections.shuffle(verbosIrregularesDesordenadas);\n\t\t// --------------------------------------------------------------\n\n\t\t//------- Esto es por si el usuario quita una palabra problematica y se resetea el juego\n\t\tif (cantidadItems > verbosIrregularesDesordenadas.size()) {\n\t\t\tcantidadItems = verbosIrregularesDesordenadas.size();\n\t\t}\n\t\t// ---------------------------------------------------------------------------------\n\n\t\tverbosIrregularesDesordenadas = verbosIrregularesDesordenadas.subList(0, cantidadItems);\n\n\t\tindice = 0;\n\t\tsetearTitulo();\n\n\t\tbtRestart.setVisibility(View.INVISIBLE);\n\t\tivCongratulations.setVisibility(View.INVISIBLE);\n\t\tmbNext.setVisibility(View.VISIBLE);\n\t\tbtPrevious.setVisibility(View.INVISIBLE);\n\t\ttvJuegoCantidadPalabras.setVisibility(View.VISIBLE);\n\t\tbtMostrarRespuestaJuego.setVisibility(View.VISIBLE);\n\t\ttvInfinitivo.setVisibility(View.VISIBLE);\n\t\tbtDificultad.setVisibility(View.VISIBLE);\n\t\tlyRespuestaJuego.setVisibility(View.INVISIBLE);\n\t\tbtVolver.setVisibility(View.INVISIBLE);\n\n\t\tsetearTextoArribaYColorDeBoton();\n\t}", "@Override\r\n public void run() {\r\n while (true) {\r\n try {\r\n moverOveja();\r\n if(horaDeComer==false){\r\n moverLobo();\r\n }\r\n\r\n if (contador == 20) {\r\n // cuando contador == 20 quiere decir que ha parado 20 veces por un tiempo de 50 milisegundos\r\n //lo cual es un segundo (20*50 = 1000 milisegundos), asi que aumenta en un segundo la variable segundosEjecucion\r\n segundosEjecucion++;\r\n contador = 0; // se reinicia el contador\r\n\r\n System.out.println(\"segundo: \" + segundosEjecucion);\r\n textoSegundos.setText(\"segundo: \" + segundosEjecucion);\r\n \r\n /////////////////////////////////////////////////////////////////////////\r\n if(segundosEjecucion % tiempoLobosAlimento == 0 && horaDeComer == false){ // cada X segundos un lobo busca comida, sin embargo un lobo no va a buscar antes que otro termine\r\n horaDeComer = true; \r\n loboAleatorio = r.nextInt(5); // se selecciona el lobo aleatorio\r\n ovejaObjetivo = ovejaMasCercana(loboAleatorio); // se encuentra la oveja mas cercana al lobo\r\n }\r\n \r\n if(horaDeComer){\r\n moverLovoHastaOvejaObjetivo(); // movimiento del lobo en busca de comida\r\n }\r\n \r\n //////////////////////////////////////////////////////////////////////////\r\n\r\n if (segundosEjecucion % tiempoPasto == 0) {//cada X segundos agrega pasto (en este caso 3 segundos)\r\n\r\n //si la cantidad de pasto alcanza el máximo permitido dejará de producirse \r\n if (elPasto.size() <= maxCantidadPasto) {\r\n agregarPasto();\r\n System.out.println(\"cantPasto: \" + elPasto.size());\r\n }\r\n }\r\n }\r\n\r\n contador++;\r\n Thread.sleep(10); //se detien por 50 milisegundos, \r\n\r\n repaint();\r\n } catch (InterruptedException e) {\r\n }\r\n }\r\n }", "private void Mueve() {\n\t\tpaleta1.Mueve_paletas();\n\t\tpaleta2.Mueve_paletas();\n\t\tpelota.Mueve_pelota();\n\t}", "public void avvio_gioco(){\n\n punti = 3;\n //Posizione iniziale della x\n for (short i = 0; i < punti; i++) {\n x[i] = 150 - i*10;\n y[i] = 150;\n }\n posiziona_bersaglio();\n\n //Attivazione del timer\n timer = new Timer(RITARDO, this);\n timer.start();\n }", "private static void eligeJugadores() {\r\n\t\tint eleccion;\r\n\t\tdo {\r\n\t\t\tSystem.out.print(\"Elige el numero de jugadores [2,6]: \");\r\n\t\t\teleccion = Teclado.leerInt();\r\n\t\t} while (eleccion < 2 || eleccion > 6);\r\n\t\tnJugadores = eleccion;\r\n\t\tjugadores = new JugadorM[nJugadores];\r\n\t\tjugadores[0] = new JugadorM(\"Jugador\", true);\r\n\t\tfor (int i = 1; i < jugadores.length; i++)\r\n\t\t\tjugadores[i] = new JugadorM(\"Maquina\" + i, false);\r\n\t}", "public Cobra()\r\n {\r\n super();\r\n corpo = new ArrayList<CorpoCobra>();\r\n\r\n porCrescer = 0;\r\n ovosComidos = 0;\r\n vidas = 3;\r\n tonta = 0;\r\n }", "void createWires() {\n this.splitBoard(new Posn(0, 0), this.height, this.width);\n int counter = 0;\n for (int i = 0; i < this.width; i++) {\n for (int j = 0; j < this.height; j++) {\n nodes.set(counter, this.board.get(i).get(j));\n counter++;\n }\n }\n }", "private void verificarColisiones() {\n if(inmunidadRamiro){\n tiempoInmunidadRamiro += Gdx.graphics.getDeltaTime();\n }\n if(tiempoInmunidadRamiro>=6f){//despues de 0.6 seg, vuelve a ser vulnerable\n inmunidadRamiro=false;\n tiempoInmunidadRamiro=0f;\n ramiro.setEstadoItem(Ramiro.EstadoItem.NORMAL);\n musicaRayo.stop();\n if(music){\n musicaFondo.play();\n }\n\n }\n\n if (inmunidad){//Para evitar bugs, Ramiro puede tomar damage cada cierto tiempo...\n //Se activa cada vez que toma damage\n tiempoInmunidad+=Gdx.graphics.getDeltaTime();\n }\n if(tiempoInmunidad>=0.6f){//despues de 0.6 seg, vuelve a ser vulnerable\n inmunidad=false;\n tiempoInmunidad=0f;\n }\n if (inmunidadItem){\n tiempoInmunidadItem+=Gdx.graphics.getDeltaTime();\n }\n if(tiempoInmunidadItem>=0.6f){\n inmunidadItem=false;\n tiempoInmunidadItem=0f;\n\n }\n //Verificar colisiones de Item Corazon.\n for (int i=arrCorazonesItem.size-1; i>=0; i--) {\n Corazon cora = arrCorazonesItem.get(i);\n\n if(ramiro.sprite.getBoundingRectangle().overlaps(cora.sprite.getBoundingRectangle())){//Colision de Item\n if(inmunidadItem!=true){// asi se evita bugs.\n\n arrCorazonesItem.removeIndex(i);\n agregarCorazon();\n inmunidadItem=true;\n }\n\n }\n\n }\n //Verifica colisiones Rayo emprendedor\n for (int i=arrRayoEmprendedor.size-1; i>=0; i--) {\n RayoEmprendedor rayo= arrRayoEmprendedor.get(i);\n\n if(ramiro.sprite.getBoundingRectangle().overlaps(rayo.sprite.getBoundingRectangle())){//Colision de Item\n if(inmunidadItem!=true){// asi se evita bugs.\n\n arrRayoEmprendedor.removeIndex(i);\n inmunidadRamiro();\n\n }\n\n }\n\n }\n //coalisiones de las tareas\n for (int i=arrTarea.size-1; i>=0; i--) {\n Tarea tarea = arrTarea.get(i);\n\n if(ramiro.sprite.getBoundingRectangle().overlaps(tarea.sprite.getBoundingRectangle())){//Colision de Item\n if(inmunidadItem!=true){// asi se evita bugs.\n agregarPuntos();\n arrTarea.removeIndex(i);\n inmunidadItem=true;\n }\n\n }\n\n }\n\n\n //Verifica colisiones de camioneta\n if(estadoMapa==EstadoMapa.RURAL || estadoMapa==EstadoMapa.RURALURBANO){\n for (int i=arrEnemigosCamioneta.size-1; i>=0; i--) {\n Camioneta camioneta = arrEnemigosCamioneta.get(i);\n\n // Gdx.app.log(\"Width\",\"width\"+vehiculo.sprite.getBoundingRectangle().width);\n if(ramiro.sprite.getBoundingRectangle().overlaps(camioneta.sprite.getBoundingRectangle())){//Colision de camioneta\n //Ramiro se vuelve inmune 0.6 seg\n\n if(inmunidad!=true){//Si no ha tomado damage, entoces se vuelve inmune, asi se evita bugs.\n if(vidas>0){//Mientras te queden vidas en el arreglo\n quitarCorazones();//Se resta una vida\n }\n inmunidad=true;\n }\n\n }\n\n }\n\n for (int i=arrEnemigoAve.size-1; i>=0; i--) {\n Ave ave = arrEnemigoAve.get(i);\n\n // Gdx.app.log(\"Width\",\"width\"+vehiculo.sprite.getBoundingRectangle().width);\n if(ramiro.sprite.getBoundingRectangle().overlaps(ave.sprite.getBoundingRectangle())){//Colision de camioneta\n //Ramiro se vuelve inmune 0.6 seg\n\n if(inmunidad!=true){//Si no ha tomado damage, entoces se vuelve inmune, asi se evita bugs.\n if(vidas>0){//Mientras te queden vidas en el arreglo\n quitarCorazones();//Se resta una vida\n }\n inmunidad=true;\n }\n\n }\n\n }\n }\n\n //Verifica colisiones de carro de Lujo\n if(estadoMapa==EstadoMapa.URBANO || estadoMapa == EstadoMapa.URBANOUNIVERSIDAD){\n for (int i=arrEnemigosAuto.size-1; i>=0; i--) {\n Auto cocheLujo = arrEnemigosAuto.get(i);\n\n // Gdx.app.log(\"Width\",\"width\"+vehiculo.sprite.getBoundingRectangle().width);\n if(ramiro.sprite.getBoundingRectangle().overlaps(cocheLujo.sprite.getBoundingRectangle())){//Colision de camioneta\n //Ramiro se vuelve inmune 0.6 seg\n\n if(inmunidad!=true){//Si no ha tomado damage, entoces se vuelve inmune, asi se evita bugs.\n if(vidas>0){//Mientras te queden vidas en el arreglo\n quitarCorazones();//Se resta una vida\n }\n inmunidad=true;\n }\n\n }\n\n }\n\n for (int i=arrEnemigoAve.size-1; i>=0; i--) {\n Ave ave = arrEnemigoAve.get(i);\n\n // Gdx.app.log(\"Width\",\"width\"+vehiculo.sprite.getBoundingRectangle().width);\n if(ramiro.sprite.getBoundingRectangle().overlaps(ave.sprite.getBoundingRectangle())){//Colision de camioneta\n //Ramiro se vuelve inmune 0.6 seg\n\n if(inmunidad!=true){//Si no ha tomado damage, entoces se vuelve inmune, asi se evita bugs.\n if(vidas>0){//Mientras te queden vidas en el arreglo\n quitarCorazones();//Se resta una vida\n }\n inmunidad=true;\n }\n\n }\n\n }\n }\n\n //Verifica colisiones de carrito de golf\n if(estadoMapa==EstadoMapa.UNIVERSIDAD){\n for (int i=arrEnemigosCarritoGolf.size-1; i>=0; i--) {\n AutoGolf carritoGolf = arrEnemigosCarritoGolf.get(i);\n\n // Gdx.app.log(\"Width\",\"width\"+vehiculo.sprite.getBoundingRectangle().width);\n if(ramiro.sprite.getBoundingRectangle().overlaps(carritoGolf.sprite.getBoundingRectangle())){//Colision de camioneta\n //Ramiro se vuelve inmune 0.6 seg\n\n if(inmunidad!=true){//Si no ha tomado damage, entoces se vuelve inmune, asi se evita bugs.\n if(vidas>0){//Mientras te queden vidas en el arreglo\n quitarCorazones();//Se resta una vida\n }\n inmunidad=true;\n }\n\n }\n\n }\n }\n\n //Verifica colisiones de las lamparas\n if(estadoMapa==EstadoMapa.SALONES){\n for (int i=arrEnemigoLampara.size-1; i>=0; i--) {\n Lampara lampara = arrEnemigoLampara.get(i);\n\n // Gdx.app.log(\"Width\",\"width\"+vehiculo.sprite.getBoundingRectangle().width);\n if(ramiro.sprite.getBoundingRectangle().overlaps(lampara.sprite.getBoundingRectangle())){//Colision de camioneta\n //Ramiro se vuelve inmune 0.6 seg\n\n if(inmunidad!=true){//Si no ha tomado damage, entoces se vuelve inmune, asi se evita bugs.\n if(vidas>0){//Mientras te queden vidas en el arreglo\n quitarCorazones();//Se resta una vida\n }\n inmunidad=true;\n }\n\n }\n\n }\n //Verifica colisiones de las sillas\n for (int i=arrEnemigoSilla.size-1; i>=0; i--) {\n Silla silla = arrEnemigoSilla.get(i);\n\n // Gdx.app.log(\"Width\",\"width\"+vehiculo.sprite.getBoundingRectangle().width);\n if(ramiro.sprite.getBoundingRectangle().overlaps(silla.sprite.getBoundingRectangle())){//Colision de camioneta\n //Ramiro se vuelve inmune 0.6 seg\n\n if(inmunidad!=true){//Si no ha tomado damage, entoces se vuelve inmune, asi se evita bugs.\n if(vidas>0){//Mientras te queden vidas en el arreglo\n quitarCorazones();//Se resta una vida\n }\n inmunidad=true;\n }\n\n }\n\n }\n }\n\n\n\n\n }", "public void inativarMovimentacoes() {\n\n\t\ttry {\n\n\t\t\tif (((auxMovimentacao.getDataMovimentacao())\n\t\t\t\t\t.before(permitirCadastrarMovimentacao(movimentacao.getAlunoTurma()).getDataMovimentacao()))\n\t\t\t\t\t|| (auxMovimentacao.getDataMovimentacao()).equals(\n\t\t\t\t\t\t\tpermitirCadastrarMovimentacao(movimentacao.getAlunoTurma()).getDataMovimentacao())\n\t\t\t\t\t) {\n\t\t\t\tExibirMensagem.exibirMensagem(Mensagem.MOVIMENTACOES_ANTERIORES);\n\t\t\t} else {\n\n\t\t\t\tDate dataFinal = auxMovimentacao.getDataMovimentacao();\n\t\t\t\tCalendar calendarData = Calendar.getInstance();\n\t\t\t\tcalendarData.setTime(dataFinal);\n\t\t\t\tcalendarData.add(Calendar.DATE, -1);\n\t\t\t\tDate dataInicial = calendarData.getTime();\n\n\t\t\t\tMovimentacao mov = new Movimentacao();\n\t\t\t\tmov = (Movimentacao) movimentacaoAlunoDAO.listarTodos(Movimentacao.class,\n\t\t\t\t\t\t\" a.dataMovimentacao = (select max(b.dataMovimentacao) \"\n\t\t\t\t\t\t\t\t+ \" from Movimentacao b where b.alunoTurma = a.alunoTurma) \"\n\t\t\t\t\t\t\t\t+ \" and a.status is true and a.alunoTurma.status = true and dataMovimentacaoFim = null and a.alunoTurma = \"\n\t\t\t\t\t\t\t\t+ movimentacao.getAlunoTurma().getId())\n\t\t\t\t\t\t.get(0);\n\n\t\t\t\tmov.setControle(false);\n\t\t\t\tmov.setDataMovimentacaoFim(dataInicial);\n\t\t\t\tmovimentacaoService.inserirAlterar(mov);\n\n\t\t\t\tAlunoTurma aluno = new AlunoTurma();\n\t\t\t\taluno = daoAlunoTurma.buscarPorId(AlunoTurma.class, movimentacao.getAlunoTurma().getId());\n\t\t\t\taluno.setControle(0);\n\t\t\t\t\n\n\t\t\t\tauxMovimentacao.setAlunoTurma(movimentacao.getAlunoTurma());\n\t\t\t\tauxMovimentacao.setStatus(true);\n\t\t\t\tauxMovimentacao.setControle(false);\n\n\t\t\t\tmovimentacaoService.inserirAlterar(auxMovimentacao);\n\t\t\t\t\n\t\t\t\tif(auxMovimentacao.getSituacao()==5){\n//\t\t\t\t\t\n//\t\t\t\t\tCurso cursoAluno = new Curso();\n//\t\t\t\t\tcursoAluno = daoCurso.buscarPorId(Curso.class, auxMovimentacao.getAlunoTurma().getTurma().getCurso().getId());\n\t\t\t\t\t\n\t\t\t\t\taluno.setSituacao(5);\n\t\t\t\t\taluno.setLiberado(false);\n\t\t\t\t\talunoTurmaService.inserirAlterar(aluno);\n\t\t\t\t\t\n\t\t\t\t\t//liberar para responder o questionário\n\t\t\t\t\tAluno alunoResponde = new Aluno(); \n\t\t\t\t\talunoResponde = daoAluno.buscarPorId(Aluno.class, aluno.getAluno().getId());\n\t\t\t\t\t \n\t\t\t\t // email.setCursos(auxMovimentacao.getAlunoTurma().getTurma().getCurso());\n\t\t\t\t\t//email.setTurma(auxMovimentacao.getAlunoTurma().getTurma());\n\t\t\t\t\temail.setEnviado(false);\n\t\t\t\t\temail.setStatus(true);\n\t\t\t\t\temail.setAlunoTurma(auxMovimentacao.getAlunoTurma());\n\t\t\t\t\t\n\t\t\t\t\t//email.setAluno(alunoResponde);\n\t\t\t\t\temailService.inserirAlterar(email);\n\t\t\t\t\t//enviar o email para responder \n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\taluno.setSituacao(0);\n\t\t\t\t\talunoTurmaService.inserirAlterar(aluno);\n\t\t\t\t}\n\t\t\t\taluno = new AlunoTurma();\n\t\t\t\temail = new Email();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tFecharDialog.fecharDialogAlunoCursoEditar();\n\t\t\t\tFecharDialog.fecharDialogAlunoEditarCurso();\n\t\t\t\tFecharDialog.fecharDialogAlunoTrancamento();\n\t\t\t\talterar(movimentacao);\n\n\t\t\t\tExibirMensagem.exibirMensagem(Mensagem.SUCESSO);\n\t\t\t\tauxMovimentacao = new Movimentacao();\n\n\t\t\t\talunoTurmaService.update(\" AlunoTurma set permiteCadastroCertificado = 2 where id = \"\n\t\t\t\t\t\t+ movimentacao.getAlunoTurma().getId());\n\n\t\t\t\n\t\t\t\tcriarNovoObjetoAluno();\n\t\t\t\tatualizarListas();\n\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tExibirMensagem.exibirMensagem(Mensagem.ERRO);\n\t\t}\n\n\t}", "public void automovil(){\r\n System.out.println(\"Ingrese placa: \");\r\n placa = leer.next();\r\n System.out.println(\"Ingrese marca: \");\r\n marca = leer.next();\r\n \r\n Automovil auto = new Automovil(placa, marca, 10000);\r\n controlador.llenarVehiculo(auto);\r\n {\r\n }\r\n }", "private void obtenerGastosDiariosMes() {\n\t\t// Obtenemos las fechas actuales inicial y final\n\t\tCalendar calendar = Calendar.getInstance();\n calendar.setTime(new Date());\n int diaFinalMes = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);\n\n\t\tList<Movimiento> movimientos = this.movimientoService.obtenerMovimientosFechaUsuario(idUsuario, LocalDate.of(LocalDate.now().getYear(),LocalDate.now().getMonthValue(),1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDate.of(LocalDate.now().getYear(),LocalDate.now().getMonthValue(), diaFinalMes));\n\t\tList<Double> listaGastos = new ArrayList<Double>();\n\t\tList<String> listaFechas = new ArrayList<String>();\n\t\t\n\t\tDate fechaUtilizadaActual = null;\n\t\tdouble gastoDiario = 0;\n\t\t\n\t\tfor (Iterator iterator = movimientos.iterator(); iterator.hasNext();) {\n\t\t\tMovimiento movimiento = (Movimiento) iterator.next();\n\t\t\tif(fechaUtilizadaActual == null) { //Comprobamos si se acaba de entrar en el bucle para inicializar la fecha del movimiento\n\t\t\t\tfechaUtilizadaActual = movimiento.getFecha();\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Si hemos cambiado de fecha del movimiento se procede a guardar los datos recogidos\n\t\t\tif(!fechaUtilizadaActual.equals(movimiento.getFecha())) {\n\t\t\t\tlistaGastos.add(gastoDiario);\n\t\t\t\tlistaFechas.add(fechaUtilizadaActual.getDate()+\"/\"+Utils.getMonthForInt(fechaUtilizadaActual.getMonth()).substring(0, 3));\n\t\t\t\tgastoDiario = 0; // Reiniciamos el contador del gasto\n\t\t\t\tfechaUtilizadaActual = movimiento.getFecha(); // Almacenemos la fecha del nuevo gasto\n\t\t\t}\n\t\t\t\n\t\t\t// Si el movimiento que se ha realizado es un gasto lo sumamos al contador de gasto\n\t\t\tif(movimiento.getTipo().equals(TipoMovimiento.GASTO)) {\n\t\t\t\tgastoDiario += movimiento.getCantidad();\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Comprobamos si es el ultimo item del iterador y almacenamos sus datos\n\t\t\tif(!iterator.hasNext()) {\n\t\t\t\tlistaGastos.add(gastoDiario);\n\t\t\t\tlistaFechas.add(fechaUtilizadaActual.getDate()+\"/\"+Utils.getMonthForInt(fechaUtilizadaActual.getMonth()).substring(0, 3));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tthis.listadoGastosDiariosDiagrama = new Double[listaGastos.size()];\n\t\tthis.listadoGastosDiariosDiagrama = listaGastos.toArray(this.listadoGastosDiariosDiagrama);\n\t\tthis.fechasDiagrama = new String[listaFechas.size()];\n\t\tthis.fechasDiagrama = listaFechas.toArray(this.fechasDiagrama);\n\t\t\n\t}", "public void mostrarReservas() {\n\t\tint numReserva=1;\r\n\t\tfor(Reserva reserva:reservas) {\r\n\t\t\tSystem.out.println(numReserva+\" \"+reserva.toString());\r\n\t\t\tnumReserva++;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "private void cargarNotasEnfermeria() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"admision_seleccionada\", admision_seleccionada);\r\n\t\tparametros.put(\"rol_medico\", \"S\");\r\n\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\"/pages/notas_enfermeria.zul\", \"NOTAS DE ENFERMERIA\",\r\n\t\t\t\tparametros);\r\n\t}", "private Pares(){\n\t\t\tprimero=null;\n\t\t\tsegundo=null;\n\t\t\tdistancia=0;\n\t\t}", "private void setupEscenario2( )\n {\n String todasMarcadas, casillasSinMarca;\n String[] marcadas, noMarcadas;\n int casilla;\n // Prepara el tablero\n triqui = new Triqui( );\n\n // Primer jugador\n\n marcaJugador1 = \"X\";\n todasMarcadas = \"1,2,3,4\";\n marcadas = todasMarcadas.split( \",\" );\n casillasJugador1 = new ArrayList( );\n\n for( int i = 0; i < marcadas.length; i++ )\n {\n casilla = Integer.parseInt( marcadas[ i ] );\n triqui.marcarCasilla( casilla, marcaJugador1 );\n casillasJugador1.add( new Integer( casilla ) );\n }\n\n // Segundo jugador\n\n marcaJugador2 = \"O\";\n todasMarcadas = \"5,6,7,8\";\n marcadas = todasMarcadas.split( \",\" );\n casillasJugador2 = new ArrayList( );\n\n for( int i = 0; i < marcadas.length; i++ )\n {\n casilla = Integer.parseInt( marcadas[ i ] );\n triqui.marcarCasilla( casilla, marcaJugador2 );\n casillasJugador2.add( new Integer( casilla ) );\n }\n\n // Casillas sin marcar\n\n casillasSinMarca = \"9\";\n noMarcadas = casillasSinMarca.split( \",\" );\n casillasSinMarcar = new ArrayList( );\n\n for( int i = 0; i < noMarcadas.length; i++ )\n {\n casilla = Integer.parseInt( noMarcadas[ i ] );\n casillasSinMarcar.add( new Integer( casilla ) );\n }\n }", "public void insertar(){\n /*este for lo que hace es que se va a repetir\n dependiendo el tamaņo de la variable \"tamano\"\n */\n for (int i = 0; i < tamano; i++) {\n //Este metodo lo que hace es generar numeros aleatorios del 1 al 100\n vectorpila[i]=(int) (Math.random() *100+1);\n //Aqui aumenta el valor de cima\n cima++;\n }\n System.out.println(\"Pila llena\");\n }", "public void cartgarTareasConRepeticionDespuesDe(TareaModel model,int unid_medi,String cant_tiempo,String tomas)\n {\n Date fecha = convertirStringEnFecha(model.getFecha_aviso(),model.getHora_aviso());\n Calendar calendar = Calendar.getInstance();\n\n if(fecha != null)\n {\n calendar.setTime(fecha);\n calcularCantidadDeRepeticionesHorasMin(unid_medi,calendar,cant_tiempo,tomas,model);\n }\n }", "private synchronized void actualizarEnemigo(){\n\t\tcontadorE++;\n\t\tenemigo.mover(this.getWidth(), this.getHeight());\n\t\t\n\t\ttry{\n\t\t\tif(contadorE==100){\n\t\t\t\tenemigo.setAngulo(Math.random()*(2 * Math.PI));\n\t\t\t\tdisparosE[numDisparosE]=enemigo.dispara();\n\t\t\t\tnumDisparosE++;\n\t\t\t\tcontadorE=0;\n\t\t\t}\n\t\t\t\n\t\t\tfor(int i=0;i<numDisparosE;i++){\n\t\t\t\t disparosE[i].mover(this.getWidth(), this.getHeight());\n\t\t\t\t \n\t\t\t\t if(disparosE[i].getVidaDisparo()<=0){\n\t\t\t\t\t eliminarDisparosE(i); \n\t\t\t\t\t i--; \n\t\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t\tif(enemigo.naveColisionE(nave)){\n\t\t\t\tanadirPuntos(enemigo.getPuntuacion());\n\t\t\t\tquitarVida();\n\t\t\t}\n\t\t\t\n\t\t\tfor(int j=0;j<numDisparos;j++){\n\t\t\t\tif(enemigo.disparoColisionE(disparos[j])){\n\t\t\t\t\t\n\t\t\t\t\tif(disparos[j]!=null){\n\t\t\t\t\t\teliminarDisparos(j);\n\t\t\t\t\t}\n\t\t\t\t\tanadirPuntos(enemigo.getPuntuacion());\n\t\t\t\t\tenemigo.setVivo(false);\n\t\t\t\t\tj=numDisparos;\n\t\t\t\t\n\t\t\t\t\tj--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int j=0;j<numDisparosE;j++){\n\t\t\t\tif(nave.recibirDisparo(disparosE[j])){\n\t\t\t\t\tif(disparos[j]!=null){\n\t\t\t\t\t\teliminarDisparos(j);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tj=numDisparosE; \n\t\t\t\t\tj--;\n\t\t\t\t\n\t\t\t\t\tquitarVida();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e) {}\n\t}", "@Override\n public void cantidad_Ataque(){\n ataque=5+2*nivel+aumentoT;\n }", "public void somaVezes(){\n qtVezes++;\n }", "private void moverJogadorAPosicao(int jogador, int valorDados, boolean iguais) {\n int tentativasDeSairDaPrisao = this.listaJogadores.get(jogadorAtual()).getTentativasSairDaPrisao();\n //Analisando se o cara esta preso, se a prisao ta ativada e se o cara tentou um numero de vezes menos que tres\n //ou se a funcao prisao esta falsa\n //ou se o jogador nao esta preso\n if ((JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && iguais && this.prisao == true && tentativasDeSairDaPrisao <= 2) || this.prisao == false || (!JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && this.prisao == true)) {\n if (JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && iguais && this.prisao == true && tentativasDeSairDaPrisao < 2);\n {\n this.sairdaPrisao(this.listaJogadores.get(jogadorAtual()));\n this.listaJogadores.get(jogadorAtual()).setTentativasSairDaPrisao(0);\n }\n this.posicoes[jogador] = (this.posicoes[jogador] + valorDados);\n if (posicoes[jogador] > 40) {\n posicoes[jogador] = posicoes[jogador] - 40;\n }\n }\n\n //analisando se o jogador esta preso e lanca numeros diferentes nos dados\n if (JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && !iguais && this.prisao == true) {\n //analisa se estourou as tentativas\n //se estourou\n if (this.listaJogadores.get(jogadorAtual()).getTentativasSairDaPrisao() == 2) {\n this.sairdaPrisao(this.listaJogadores.get(jogadorAtual()));\n this.listaJogadores.get(jogadorAtual()).retirarDinheiro(50);\n this.listaJogadores.get(jogadorAtual()).setTentativasSairDaPrisao(0);\n this.posicoes[jogador] = (this.posicoes[jogador] + valorDados);\n if (posicoes[jogador] > 40) {\n posicoes[jogador] = posicoes[jogador] - 40;\n }\n\n } //se nao estourou\n else if (this.listaJogadores.get(jogadorAtual()).getTentativasSairDaPrisao() < 2) {\n this.listaJogadores.get(jogadorAtual()).addTentativasSairDaPrisao();\n }\n\n\n }\n\n\n }", "void recorridoCero(){\n \n for(int i=0;i<8;i++)\n\t\t\tfor(int j=0;j<8;j++)\n\t\t\t\t{\n\t\t\t\t\t//marcar con cero todas las posiciones\n\t\t\t\t\trecorrido[i][j]=0;\n\t\t\t\t}\n }" ]
[ "0.631799", "0.62278104", "0.62169814", "0.61534137", "0.60624623", "0.6022929", "0.5933793", "0.5912118", "0.58820564", "0.587177", "0.58611476", "0.5858021", "0.58525544", "0.58484334", "0.58481926", "0.58362025", "0.582724", "0.58000934", "0.5794183", "0.5791404", "0.57617307", "0.5740186", "0.571965", "0.5714472", "0.57120794", "0.5698647", "0.56978136", "0.56954986", "0.56951475", "0.56912017", "0.56860214", "0.5681676", "0.5678709", "0.5673437", "0.5671305", "0.5667296", "0.5610255", "0.5609634", "0.55873", "0.5585176", "0.5584268", "0.55717146", "0.5569865", "0.5569657", "0.55687153", "0.5567579", "0.55499226", "0.55461913", "0.5545106", "0.5543806", "0.5543488", "0.5541203", "0.5537892", "0.55150485", "0.55130947", "0.55089164", "0.5490017", "0.5489836", "0.54885554", "0.54883814", "0.54841787", "0.5481961", "0.5481", "0.54769146", "0.54764456", "0.54668045", "0.5466234", "0.546495", "0.54543877", "0.54527545", "0.54486614", "0.54460543", "0.5442792", "0.5438138", "0.54327816", "0.5428992", "0.5423956", "0.54220575", "0.54210126", "0.54207337", "0.5419649", "0.5416642", "0.5415955", "0.54108447", "0.539632", "0.53938246", "0.53926784", "0.53918904", "0.5386841", "0.537602", "0.5369708", "0.53613806", "0.5351321", "0.5350638", "0.53488636", "0.534852", "0.53433484", "0.53398913", "0.5333279", "0.5329574", "0.53291786" ]
0.0
-1
Devuelve las reservas que han sido aceptadas (true)
@GetMapping("/aceptada") List<ReservasEntity> findByAceptadaTrue() { return reservaRepo.findByAceptadaTrue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isReserved(){\n\t\treturn reserved;\n\t}", "boolean isReserved();", "@Override\n\tpublic boolean isReserveResults() {\n\t\treturn model.isReserveResults();\n\t}", "private boolean noVacancy() {\r\n\t\t\treturn removed = false;\r\n\t\t}", "@Test\r\n\tpublic void venderVariasPiezasReservadas() {\r\n\t\tfor (Pieza pieza : this.listadoDePiezas) {\r\n\t\t\tpieza.reservar();\r\n\t\t\tpieza.vender();\r\n\t\t\tAssert.assertTrue(\"La pieza no ha sido correctamente vendida.\",pieza.isVendida());\r\n\t\t}\r\n\t}", "public boolean isReserved() {\n return reserved;\n }", "public boolean guardar()\r\n\t{\r\n\t\treturn false;\r\n\t}", "@Override\r\n\t\tpublic boolean isStuff(Reservation reservation) {\n\t\t\treturn false;\r\n\t\t}", "public boolean avanti();", "@Override\n\tpublic boolean reserve() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean puedoAtacar(ElementoSoldado a) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean paie() {\n\t\treturn false;\n\t}", "public boolean reserve(int reservation) {\n int index = reservation - this.loRange;\n if (this.freeSet.get(index)) { // FREE\n this.freeSet.clear(index);\n return true;\n } else {\n return false;\n }\n }", "public void ReservaEfetivadas () {\n Date hoje = new Date ();\n for (int z = 0; z < vecReserva.size(); z++) {\n if (((int) ((((entReserva)vecReserva.elementAt(z)).getDatain().getTime() - (hoje.getTime())) / 86400000L)) == 0){// Reserva será relaizada hj\n if (((entReserva)vecReserva.elementAt(z)).getPagamento().getSituacao() == 0){//Cliente fez todo o pagamento e o quarto será\n vecReservaEfetivadas.add(vecReserva.elementAt(z));\n }\n \n }\n }\n }", "public void activeRegraJogadaDupla() {\n this.RegraJogadaDupla = true;\n }", "public boolean verificaTrasicaoVazia(){\n\n //verifica se dentro das transicoes tem alguma saindo com valor vazio;\n for (int i = 0; i < this.transicoes.size(); i++) {\n if(this.transicoes.get(i).simbolo.equals(Automato_Servico.valorVazio)){\n return true;\n }\n }\n return false;\n }", "public void activarAceptar() {\n aceptar = false;\n }", "public boolean tienePrepaga() {\r\n\t\treturn obraSocial != null;\r\n\t}", "public static boolean addressWaiting(){\n boolean addressedSomething = false;\n removeSet = new HashSet<>();\n for(Instruction i : waitingList){\n if(request(i)){\n //System.out.println(\"Task \" + i.taskNumber + \" had its request completed off the waiting List\" );\n\n removeSet.add(i);\n addressedSomething = true;\n }else{\n //System.out.println(\"Task \" + i.taskNumber + \" could not be completed, remains on waiting list\" );\n }\n }\n\n return addressedSomething;\n }", "protected boolean asEaten() {\n return false;\n }", "public void cadenaEsAceptada() {\n\t\tfor (int i = 0; i < conjuntoF.size(); i++) {\n\t\t\tif (estadoActual.equals(conjuntoF.get(i))) {\n\t\t\t\tSystem.out.println(\"Cadena aceptada!\");\n\t\t\t\tbreak;\n\t\t\t} else\n\t\t\t\tSystem.out.println(\"Cadena no aceptada\");\n\t\t}\n\t}", "boolean isAccepting();", "public boolean esCompuesto() {\n\t\treturn !this.atributos.isEmpty();\n\t}", "public static boolean addressWaitingBanker(){\n boolean addressedSomething = false;\n removeSet = new HashSet<>();\n for(Instruction i : waitingList){\n\n if(bankerRequest(i)){\n //System.out.println(\"Task \" + i.taskNumber + \" had its request completed off the waiting List\" );\n removeSet.add(i);\n addressedSomething = true;\n }else{\n //System.out.println(\"Task \" + i.taskNumber + \" could not be completed, remains on waiting list\" );\n }\n }\n\n return addressedSomething;\n }", "@Override public boolean hasNext() {\n return !pila.esVacia();\n }", "protected boolean colaVacia() {\r\n return ini == -1;\r\n }", "@Override\n\tpublic boolean puedoPasar(ElementoSoldado a) {\n\t\treturn false;\n\t}", "public boolean isVacant() {\r\n\treturn !isOccupied() || !isAvailable();\r\n }", "@Override\n\tpublic boolean getReserveResults() {\n\t\treturn model.getReserveResults();\n\t}", "public static boolean addressNonWaiting(){\n boolean addressedSomething = false;\n for(int i = 0 ; i < taskPointers.length; i ++){\n int pointerIndex = taskPointers[i];\n Task currTask = taskList.get(i);\n\n if(currTask.terminateTime == - 1 && (currTask.isAborted == false) && Collections.disjoint(waitingList, currTask.instructionList)){\n // see if we can allocate resources\n\n\n Instruction currInstruction = currTask.instructionList.get(pointerIndex);\n Type instructionType = currInstruction.instructionType;\n int resourceType = currInstruction.resourceType;\n\n if(instructionType == Type.initiate){\n currTask.startTime = time;\n addressedSomething = true;\n //System.out.println(\"Task \" + currTask.taskNumber + \" was initiated\");\n }else if(instructionType == Type.request){\n if(request(currInstruction)){\n addressedSomething = true;\n //System.out.println(\"Task \" + currTask.taskNumber + \" had its request completed\");\n }else{\n //System.out.println(\"Task \" + currTask.taskNumber + \" could not be completed\");\n }\n }// when it is time to add the waitingInstructions what you should do is something along the lines of\n else if(instructionType == Type.compute){\n int numberCycles = currInstruction.numberCycles;\n if(currTask.computeTime == 0){\n currTask.computeTime = currInstruction.numberCycles;\n }\n currTask.computeTime -= 1;\n\n //System.out.println(\"Task \" + currTask.taskNumber + \" computes \" + (currInstruction.numberCycles - currTask.computeTime));\n\n addressedSomething = true;\n }else if(instructionType == Type.release){\n int amountReleased = currInstruction.resourceAmount;\n release(resourceType, amountReleased, currTask);\n //System.out.println(\"Task \" + currTask.taskNumber + \" released its resources\");\n addressedSomething = true;\n }else{ // if its terminate\n currTask.terminateTime = time;\n // System.out.println(\"Task \" + currTask.taskNumber + \" terminates at time t = \" + time);\n terminatedCount ++;\n releaseAll(currTask);\n addressedSomething = true;\n }\n if(currTask.computeTime == 0){\n taskPointers[i] ++;\n }\n }\n\n }\n return addressedSomething;\n }", "private boolean Verific() {\n\r\n\treturn true;\r\n\t}", "@Override\n\tpublic boolean puedoPasar(ElementoPiedra a) {\n\t\treturn false;\n\t}", "boolean sprawdz_przegrana(){\n for(int i=0;i<figura_jakas.getWspolzedne_figorki().size();i++)\n if(sprawdz_kolizje_z_innymi_klockami(0))\n return true;\n return false;\n }", "public boolean souvislost(){\n\t\t\n\t\tif(pole.size() != pocetVrcholu){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "public static boolean addressNonWaitingBanker(){\n boolean addressedSomething = false;\n for(int i = 0 ; i < taskPointers.length; i ++){\n int pointerIndex = taskPointers[i];\n Task currTask = taskList.get(i);\n\n if(currTask.terminateTime == - 1 && (currTask.isAborted == false) && Collections.disjoint(waitingList, currTask.instructionList)){\n\n Instruction currInstruction = currTask.instructionList.get(pointerIndex);\n Type instructionType = currInstruction.instructionType;\n int resourceType = currInstruction.resourceType;\n\n if(instructionType == Type.initiate){\n if(currInstruction.claim > maxResourceArr[currInstruction.resourceType]){\n System.out.println(\"Banker aborts task \" + currTask.taskNumber+ \" before run begins: claim for resource \" + (resourceType + 1)+ \" (\" + currInstruction.claim + \") \" + \" exceeds number of units present \" + \" (\" + maxResourceArr[currInstruction.resourceType] + \") \");\n currTask.isAborted = true;\n terminatedCount += 1;\n }else{\n currTask.startTime = time;\n addressedSomething = true;\n }\n\n }else if(instructionType == Type.request){\n if(bankerRequest(currInstruction)){\n addressedSomething = true;\n }else{\n // System.out.println(\"Task \" + currTask.taskNumber + \" could not be completed\");\n }\n }// when it is time to add the waitingInstructions what you should do is something along the lines of\n else if(instructionType == Type.compute){\n int numberCycles = currInstruction.numberCycles;\n if(currTask.computeTime == 0){\n currTask.computeTime = currInstruction.numberCycles;\n }\n currTask.computeTime -= 1;\n\n //System.out.println(\"Task \" + currTask.taskNumber + \" computes \" + (currInstruction.numberCycles - currTask.computeTime));\n\n addressedSomething = true;\n }else if(instructionType == Type.release){\n int amountReleased = currInstruction.resourceAmount;\n release(resourceType, amountReleased, currTask);\n //System.out.println(\"Task \" + currTask.taskNumber + \" released its resources\");\n addressedSomething = true;\n }else{ // if its terminate\n currTask.terminateTime = time;\n //System.out.println(\"Task \" + currTask.taskNumber + \" terminates at time t = \" + time);\n terminatedCount ++;\n releaseAll(currTask);\n addressedSomething = true;\n }\n if(currTask.computeTime == 0){\n taskPointers[i] ++;\n }\n }\n\n }\n return addressedSomething;\n }", "@Override public boolean hasNext() {\n return !pila.esVacio();\n }", "@Override\n public boolean esVacio(){\n return(super.esVacio());\n }", "@Override\n\tpublic boolean vender(String placa) {\n\t\treturn false;\n\t}", "private void isAbleToBuild() throws RemoteException {\n int gebouwdeGebouwen = speler.getGebouwdeGebouwen();\n int bouwLimiet = speler.getKarakter().getBouwLimiet();\n if (gebouwdeGebouwen >= bouwLimiet) {\n bouwbutton.setDisable(true); // Disable button\n }\n }", "public boolean action_allowed(){\r\n\t\treturn action_holds.size()==0;\r\n\t}", "public boolean unreserve(Reservation res){\n //remove from internal lists\n listR.remove(res);\n //set that to null\n res = null;\n\n //return true if res is null\n if(res == null){\n return true;\n }\n return false;\n }", "private boolean validacionesSolicitarReserva(int indice, int CodEmp, int CodLoc, int CodCot, boolean isSol){\n boolean blnRes=true;\n try{\n if(!validaItemsServicio(CodEmp, CodLoc, CodCot)){\n blnRes=false;\n MensajeInf(\"La cotizacion contiene Items de Servicio o Transporte, los cuales no deben ser reservados.\");\n }\n\n if(!validaFechasMAX(indice, tblDat.getValueAt(indice,INT_TBL_DAT_STR_TIP_RES_INV).toString(),isSol)){\n blnRes=false;\n MensajeInf(\"La Fecha solicitada es mayor a la permitida, revise la Fecha y vuelva a intentarlo\");\n }\n \n if(!validaTerminalesLSSegunEmpresaLocal(CodEmp,CodLoc,CodCot)){\n blnRes=false;\n MensajeInf(\"No puede solicitar reserva de codigos L/S en este local, debe reservarlo por el local que puede ser facturado\");\n }\n \n if(!validaFechasPrimerDiaLaboral(indice,isSol,CodEmp,CodLoc)){\n blnRes=false;\n MensajeInf(\"La Fecha solicitada, no corresponde al primer dia laboral registrado\");\n } \n \n if(tblDat.getValueAt(indice,INT_TBL_DAT_STR_TIP_RES_INV).toString().equals(\"R\")){\n if(!validaTerminalesLReservaLocal(CodEmp,CodLoc,CodCot)){\n blnRes=false;\n MensajeInf(\"No puede solicitar Reserva en Empresa de Codigos L \");\n }\n }\n }\n catch(Exception e){\n objUti.mostrarMsgErr_F1(null, e);\n blnRes=false;\n }\n return blnRes;\n }", "private void ingresarReserva() throws Exception {\r\n\t\tif (mngRes.existeReservaPeriodo(getSitio().getId())) {\r\n\t\t\tif (mayorEdad) {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(), null);\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t} else {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(),\r\n\t\t\t\t\t\tgetDniRepresentante() + \";\" + getNombreRepresentante());\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t}\r\n\t\t\tMensaje.crearMensajeINFO(\"Reserva realizada correctamente, no olvide descargar su contrato.\");\r\n\t\t} else {\r\n\t\t\tMensaje.crearMensajeWARN(\"El sitio seleccionado ya esta copado, favor eliga otro.\");\r\n\t\t}\r\n\t}", "public boolean isSetReservations() {\n return this.reservations != null;\n }", "public void planted(){\r\n\t\tenable = false; \r\n\t\tcount = 0; \r\n\t}", "protected boolean allBoatsArePlaced() {\n for(BoatDrawing boat : boatMap.values()) {\n if (!boat.isPlaced()) {\n return false;\n }\n }\n logMsg(\"click now on 'valider' button to begin game\");\n return true;\n }", "public boolean isPossibleToTake() {\n if (storage == 0) {\n return false;\n } else {\n return true;\n }\n }", "protected boolean isDiscarded()\n {\n return m_cUnits == -1;\n }", "protected abstract boolean setServos();", "@Override\n\tpublic boolean semelhante(Assemelhavel obj, int profundidade) {\n\t\treturn false;\n\t}", "public boolean estaVacia() {\n if (pieza == null)\n return true;\n else\n return false;\n }", "@Override\n\tpublic boolean paie() {\n\n\t\treturn true;\n\t}", "public static void verificaEleicoesPassadas() {\n\t\tint count;\n\t\t\n\t\tint check = 0;\n\t\tint tries = 0;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tcount = rmiserver.moveEleicoesPassadas();\n\t\t\t\tSystem.out.println(\"Removidas \"+count+\" eleicoes!\\n\");\n\t\t\t\tcheck = 1;\n\t\t\t} catch (RemoteException e1) {\n\t\t\t\t// Tratamento da Excepcao da chamada RMI addCandidatos\n\t\t\t\tif(tries == 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(6000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries > 0 && tries < 24) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries >= 24) {\n\t\t\t\t\tSystem.out.println(\"Impossivel realizar a operacao devido a falha tecnica (Servidores RMI desligados).\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}while(check==0);\n\t\tcheck = 0;\n\t\t\n\t}", "public boolean PilaVacia()\n {\n if(tope == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "private boolean isAllowed(ProcessInstance instance) {\r\n return true; // xoxox\r\n }", "public boolean completed(){\n return !activeAttackers() && !attackersLeft();\n }", "public void setReserved(boolean reserved) {\n this.reserved = reserved;\n }", "@Override\n\tpublic boolean puedoPasar(ElementoAgua a) {\n\t\treturn false;\n\t}", "public boolean isSeatAllReserved() {\n return airplane.isFull();\n }", "@Override\n\tpublic boolean puedoPasar(ElementoFuego a) {\n\t\treturn false;\n\t}", "public boolean isAktiv() {\n\t\treturn false;\n\t}", "public boolean isComplete() {\n\t\tboolean complete = false;\n\t\tcomplete = !(hasInstInQueue());\n\n\t\tfor (int i = 0; i < MemReservationTomasulo.length && complete; i++) {\n\t\t\tcomplete = !MemReservationTomasulo[i].isBusy();\n\t\t}\n\n\t\tfor (int i = 0; i < alu_rsTomasulo.length && complete; i++) {\n\t\t\tcomplete = !alu_rsTomasulo[i].isBusy();\n\t\t}\n\n\t\treturn complete;\n\t}", "@Override\n public boolean esArbolVacio() {\n return NodoBinario.esNodoVacio(raiz);\n }", "@Override\n\tpublic boolean puedoAtacar(ElementoPiedra a) {\n\t\treturn true;\n\t}", "private void checkReservationValidityAndRemove(){\n\t\t\n\t\tfor (Reservation r: reservationArray){\n\t\t\tif (r.getBookingDateAndTime().get(Calendar.DAY_OF_MONTH)==Calendar.getInstance().get(Calendar.DAY_OF_MONTH)){\n\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.MONTH)==Calendar.getInstance().get(Calendar.MONTH)){\n\t\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.HOUR_OF_DAY)==Calendar.getInstance().get(Calendar.HOUR_OF_DAY)){\n\t\t\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.MINUTE) > 30 + r.getBookingDateAndTime().get(Calendar.MINUTE) ){\n\t\t\t\t\t\t\treservationArray.remove(r);\n\t\t\t\t\t\t\ttablemanager.increaseAvailable();;\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}", "public synchronized boolean canWatch() {\n\t\t//boolean to keep track of theater vacancy \n\t\tboolean enterStatus;\n\t\t//when the movie is in session or the theater is full we can't enter\n\t\tif(Clock.isInSession ||Driver.currentVisitors == 8) { \n\t\t\tenterStatus = false;\n\t\t}else {\n\t\t\tenterStatus = true;\n\t\t}\n\t\treturn enterStatus;\n\t}", "private boolean pistaReservada(List<ReservaEntity> reservaEntities, int idPista) {\n\n for (ReservaEntity reservaEntity : reservaEntities) {\n if (idPista == reservaEntity.getIdPista()) {\n return true;\n }\n }\n return false;\n }", "public abstract boolean teReproduces();", "private Boolean isReserved(final String username) {\n return usernameReservations.containsKey(username.toLowerCase());\n }", "public boolean estaVacio(){\n\t\treturn raiz==null;\n\t}", "@Override\n\tpublic boolean isRented() {\n\t\treturn false;\n\t}", "public boolean allDestroyed()\n {\n\n \tcalculateTotalHitsRequired();\n \tint hits = 0;\n \tfor (int row = 0; row < NUM_ROWS; row++){\n \t\tfor(int col = 0; col < NUM_COLS; col++){\n \t\t\tif(grid[row][col] == HIT)\n \t\t\t\thits++;\n \t\t}\n \t}\n \tif(hits == totalHitsRequired)\n \t\treturn true;\n\n return false;\n }", "boolean isInvoiced();", "private boolean checkGap() { //Checks if any gap due to previously deleted resv\n\t\tif (numOfReservation == 0)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn !(rList.get(rList.size()-1).getResvNo() == numOfReservation);\n\t}", "@Override\r\n\tpublic boolean canTakeItems() {\n\t\treturn false;\r\n\t}", "public Boolean getAllowReserved() {\n\t\treturn allowReserved;\n\t}", "public boolean canAttackWithItem() {\n/* 253 */ return false;\n/* */ }", "public boolean isDisponible() {\n if (tipo == CAMINO) return true;\n else return false;\n }", "public void pausarDisparos() {\n\t\tpausarDisparo = !pausarDisparo;\n\t}", "public boolean PilaVacia() {\r\n return UltimoValorIngresado == null;\r\n }", "private Boolean precond() {\r\n\t\tcalculoCantidadSacar(grupoPuestosController.getIdConcursoPuestoAgr());\r\n\t\t/**\r\n\t\t * fin incidencia 0001649\r\n\t\t */\r\n\t\tBoolean respuesta = validacionesIteracion();\r\n\t\treturn respuesta;\r\n\t}", "@Override\r\n public boolean accept() {\n return canEat();\r\n }", "private boolean canUndo() {\n return !frozen && !past.isEmpty();\n }", "public boolean bookable() {\n for (Flight flight : itinerary) {\n if (flight.getNumSeats() <= 0) {\n return false;\n }\n }\n return true;\n }", "public Boolean gorbiernoConPrestamos() {\n if (super.getMundo().getGobierno().getPrestamos().size() > 0)\n return true;\n return false;\n }", "boolean isManipulated();", "@Override\n\tpublic boolean approveIt() {\n\t\treturn false;\n\t}", "private void verificarMuerte() {\n if(vidas==0){\n if(estadoJuego==EstadoJuego.JUGANDO){\n estadoJuego=EstadoJuego.PIERDE;\n //Crear escena Pausa\n if(escenaMuerte==null){\n escenaMuerte=new EscenaMuerte(vistaHUD,batch);\n }\n Gdx.input.setInputProcessor(escenaMuerte);\n efectoGameOver.play();\n if(music){\n musicaFondo.pause();\n }\n }\n guardarPuntos();\n }\n }", "public boolean completed(){\n int count = 0;\n for(int Y=0; Y<size; Y++){\n for(int X=0; X<size; X++){\n if(tiles[X][Y] instanceof EindVeld){\n EindVeld tmp = (EindVeld)tiles[X][Y];\n if(tmp.hasDoos())\n count++;\n }\n }\n }\n \n if(eindVelden == count){\n System.out.println(\"DOOLHOF COMPLEET !!!\");\n return true;\n }else{\n return false;\n }\n }", "public boolean vacio(){\n if (stack != null){\n return false;\n }\n return true;\n }", "public boolean canAttackWithItem() {\n/* 215 */ return false;\n/* */ }", "boolean isSetSpokes();", "boolean doFilter() { return false; }", "@Override\n public void scanActuatorsParked() {\n }", "public boolean placementDone() {return placedShips == 4;}", "private boolean validaCompra() {\n\n List<Purchase> purchasesList = billingClient.queryPurchases(INAPP).getPurchasesList();\n if (purchasesList != null && !purchasesList.isEmpty()) {\n for (Purchase purchase : purchasesList) {\n if (purchase.getSku().equals(skuId)) {\n return true;\n }\n }\n }\n return false;\n\n }", "public boolean verifyNoInactives() {\n\t\treturn !btnInactives.isEnabled();\n\n\t}", "public synchronized void pistesOccupee() {\n\t\tSystem.out.println(Thread.currentThread().getName() + \"[PisteDeDanse][les pistes sont occupée]\");\n\t\tthis.pisteLibre = false;\n\t\tnotify();\n\t}", "public final boolean aox() {\n return false;\n }", "public boolean isUnused() {\n return this.binderySlotNumber == -9234;\n }", "private boolean checkMultiplePlaneEdit(){\r\n\t\tboolean flag=false;\r\n\t\tfor(UiAirplaneModel model:uiAirplaneModel.getAirplaneList()){\r\n\t\t\tif(model.isInputDisplayItem()){\r\n\t\t\t\tflag=true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn flag;\r\n\t}" ]
[ "0.5976391", "0.5971003", "0.5948886", "0.5921321", "0.5912351", "0.582696", "0.5784981", "0.5744561", "0.57401454", "0.5732193", "0.57122535", "0.5692742", "0.5660351", "0.5658711", "0.56270236", "0.5626651", "0.56261605", "0.5619954", "0.56143594", "0.55932283", "0.5568182", "0.5566789", "0.55586755", "0.55494756", "0.55352926", "0.55295783", "0.55280757", "0.55225396", "0.549768", "0.54869485", "0.5474726", "0.5467387", "0.5463576", "0.54622686", "0.5457756", "0.54537535", "0.544771", "0.5439843", "0.54358846", "0.543392", "0.54235965", "0.54169", "0.5416306", "0.541573", "0.54119724", "0.54093385", "0.5409275", "0.5406497", "0.5403227", "0.53971434", "0.53908014", "0.5384492", "0.53748155", "0.5373617", "0.53707093", "0.53692746", "0.5366177", "0.53642213", "0.5345952", "0.5327207", "0.5321879", "0.53210855", "0.53160524", "0.53118366", "0.5305533", "0.5302377", "0.529971", "0.52980435", "0.5291937", "0.5289429", "0.5289333", "0.52885", "0.52866375", "0.52841485", "0.5283737", "0.5280975", "0.527827", "0.5277057", "0.5273876", "0.52731025", "0.52730304", "0.5268933", "0.5262565", "0.52610165", "0.52528423", "0.52484787", "0.5246812", "0.52466476", "0.52450633", "0.52418876", "0.52361876", "0.5235232", "0.522893", "0.5228747", "0.5223435", "0.522001", "0.52170444", "0.52152604", "0.5207523", "0.52061486", "0.5206118" ]
0.0
-1
Devuelve las reservas con fechas posteriores a la que se inserta
@GetMapping("/fechas/{fecha}") List<ReservasEntity> findByFechaGreaterThan(@PathVariable("fecha") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date fecha) { return reservaRepo.findByFechaGreaterThan(fecha); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void BajarPieza1posicion() {\n for (int i = 0; i < 4; ++i) {\r\n int x = posicionX + piezaActual.x(i);\r\n int y = posicionY - piezaActual.y(i);\r\n piezas[(y * anchoTablero) + x] = piezaActual.getPieza();\r\n }\r\n\r\n BorrarLineas();\r\n\r\n if (!finalizoQuitarFilas) {\r\n nuevaPieza();\r\n }\r\n }", "public void insercionMasiva() {\r\n\t\tif (!precondInsert())\r\n\t\t\treturn;\r\n\t\tUploadItem fileItem = seleccionUtilFormController.crearUploadItem(\r\n\t\t\t\tfName, uFile.length, cType, uFile);\r\n\t\ttry {\r\n\t\t\tlLineasArch = FileUtils.readLines(fileItem.getFile(), \"ISO-8859-1\");\r\n\t\t} catch (IOException e) {\r\n\t\t\tstatusMessages.add(Severity.INFO, \"Error al subir el archivo\");\r\n\t\t}\r\n\r\n\t\tStringBuilder cadenaSalida = new StringBuilder();\r\n\t\tString estado = \"EXITO\";\r\n\t\tcantidadLineas = 0;\r\n\t\t//Ciclo para contar la cantdad de adjudicados o seleccionados que se reciben\r\n\t\tfor (String linea : lLineasArch) {\r\n\t\t\tcantidadLineas++;\r\n\t\t\tif(cantidadLineas > 1){\r\n\t\t\t\tseleccionados++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Condicion para verificar si la cantidad de seleccionados es mayor a la cantidad de vacancias (en cuyo caso se procede a abortar el proceso e imprimir\r\n\t\t//un mensaje de error) o verificar si esta es menor (se imprime el mensaje pero se continua)\r\n\t\t\r\n\t\tif(seleccionados > concursoPuestoAgrNuevo.getCantidadPuestos()){\r\n\t\t\testado = \"FRACASO\";\r\n\t\t\tcadenaSalida.append(estado + \" - CANTIDAD DE AJUDICADOS ES SUPERIOR A LA CANTIDAD DE PUESTOS VACANTES PARA EL GRUPO\");\r\n\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t}\r\n\t\telse if(seleccionados < concursoPuestoAgrNuevo.getCantidadPuestos()){\r\n\t\t\tcadenaSalida.append(\"ADVERTENCIA - CANTIDAD DE ADJUDICADOS ES INFERIOR A LA CANTIDAD DE PUESTOS VACANTES PARA EL GRUPO\");\r\n\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t}\r\n\t\tseleccionados = 0;\r\n\t\t\r\n\t\tif(!estado.equals(\"FRACASO\")){\r\n\r\n\t\tcantidadLineas = 0;\r\n\t\tfor (String linea : lLineasArch) {\r\n\r\n\t\t\tcantidadLineas++;\r\n\t\t\testado = \"EXITO\";\r\n\t\t\tString observacion = \"\";\r\n\t\t\tFilaPostulante fp = new FilaPostulante(linea);\r\n\t\t\tList<Persona> lista = null;\r\n\t\t\tif (cantidadLineas > 1 && fp != null && fp.valido) {\r\n\t\t\t\t//Verifica si la persona leida en el registro del archivo CSV existe en la Tabla Persona\r\n\t\t\t\tString sqlPersona = \"select * from general.persona where persona.documento_identidad = '\"+fp.getDocumento()+ \"'\";\r\n\t\t\t\tQuery q1 = em.createNativeQuery(sqlPersona, Persona.class);\r\n\t\t\t\tPersona personaLocal = new Persona();\r\n\t\t\t\tint banderaEncontroPersonas = 0;\r\n\t\t\t\t//Si existe, se almacena el registro de la tabla\r\n\t\t\t\tif(!q1.getResultList().isEmpty()){\r\n\t\t\t\t\tlista = q1.getResultList();\r\n\t\t\t\t\tif (compararNomApe(lista.get(0).getNombres(), removeCadenasEspeciales(fp.getNombres()))\r\n\t\t\t\t\t\t\t&& compararNomApe(lista.get(0).getApellidos(), removeCadenasEspeciales(fp.getApellidos())) ) {\r\n\t\t\t\t\t\t\tbanderaEncontroPersonas = 1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\t\t\tobservacion += \" PERSONA NO REGISTRADA EN LA BASE DE DATOS LOCAL\";\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\tobservacion += \" PERSONA NO REGITRADA EN LA BASE DE DATOS LOCAL\";\r\n\t\t\t\t}\r\n\t\t\t\t//Verificamos que la persona figure en la lista corta como seleccionado\r\n\t\t\t\tif(!estado.equals(\"FRACASO\")){\r\n\t\t\t\t\tint banderaExisteEnListaCorta = 0;\t\t\t\t\t\r\n\t\t\t\t\tint i=0;\r\n\t\t\t\t\tif (banderaEncontroPersonas == 1) {\r\n\t\t\t\t\t\twhile(i<lista.size()){\r\n\t\t\t\t\t\t\tpersonaLocal = (Persona) lista.get(i);\r\n\t\t\t\t\t\t\tQuery p = em.createQuery(\"select E from EvalReferencialPostulante E \"\r\n\t\t\t\t\t\t\t\t\t+ \"where E.postulacion.personaPostulante.persona.idPersona =:id_persona and E.concursoPuestoAgr.idConcursoPuestoAgr =:id_concurso_puesto_agr and E.listaCorta=:esta_en_lista_corta\");\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"id_persona\", personaLocal.getIdPersona());\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"id_concurso_puesto_agr\", this.idConcursoPuestoAgr);\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"esta_en_lista_corta\", true);\r\n\t\t\t\t\t\t\tList<EvalReferencialPostulante> listaEvalRefPost = p.getResultList();\r\n\t\t\t\t\t\t\tif (!listaEvalRefPost.isEmpty()) {\r\n\t\t\t\t\t\t\t\tbanderaExisteEnListaCorta = 1;\r\n\t\t\t\t\t\t\t\ti = lista.size();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (banderaExisteEnListaCorta == 0) {\r\n\t\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\t\tobservacion += \" NO SELECCIONADO/ELEGIBLE EN LISTA CORTA\";\r\n\t\t\t\t\t} else if (banderaExisteEnListaCorta == 1){\r\n\t\t\t\t\t\tobservacion += \" SELECCIONADO/ELEGIBLE EN LISTA CORTA\";\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tQuery p = em.createQuery(\"select E from EvalReferencialPostulante E \"\r\n\t\t\t\t\t\t\t\t+ \"where E.postulacion.personaPostulante.persona.idPersona =:id_persona and E.concursoPuestoAgr.idConcursoPuestoAgr =:id_concurso_puesto_agr and E.listaCorta=:esta_en_lista_corta\");\r\n\t\t\t\t\t\t\t\tp.setParameter(\"id_persona\", personaLocal.getIdPersona());\r\n\t\t\t\t\t\t\t\tp.setParameter(\"id_concurso_puesto_agr\", this.idConcursoPuestoAgr);\r\n\t\t\t\t\t\t\t\tp.setParameter(\"esta_en_lista_corta\", true);\r\n\t\t\t\t\t\tEvalReferencialPostulante auxEvalReferencialPostulante = (EvalReferencialPostulante) p.getResultList().get(0);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Validaciones para actualizaciones\r\n\t\t\t\t\t\t//Bandera indicadora de actualizaciones hechas\r\n\t\t\t\t\t\tint bandera = 0;\r\n\t\t\t\t\t\tif(auxEvalReferencialPostulante.getSelAdjudicado() == null){\r\n\t\t\t\t\t\t\testado = \"EXITO\";\r\n\t\t\t\t\t\t\tauxEvalReferencialPostulante.setSelAdjudicado(true);;\r\n\t\t\t\t\t\t\tbandera = 1;\r\n\t\t\t\t\t\t\tem.merge(auxEvalReferencialPostulante);\r\n\t\t\t\t\t\t\tem.flush();\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\tagregarEstadoMotivo(linea, estado, observacion, cadenaSalida);\r\n\t\t\t}\r\n\t\t\tif (cantidadLineas > 1 && !fp.valido) {\r\n\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\tcadenaSalida\r\n\t\t\t\t\t\t.append(estado\r\n\t\t\t\t\t\t\t\t+ \" - ARCHIVO INGRESADO CON MENOS CAMPOS DE LOS NECESARIOS. DATOS INCORRECTOS EN ALGUNA COLUMNA.\");\r\n\t\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t\t}\r\n\r\n\t\t\t// FIN FOR\r\n\t\t}\r\n\t\t//FIN IF\r\n\t\t}\r\n\t\tif (lLineasArch.isEmpty()) {\r\n\t\t\tstatusMessages.add(Severity.INFO, \"Archivo inválido\");\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tSimpleDateFormat sdf2 = new SimpleDateFormat(\"dd_MM_yyyy_HH_mm_ss\");\r\n\t\t\tString nArchivo = sdf2.format(new Date()) + \"_\" + fName;\r\n\t\t\tString direccion = System.getProperty(\"jboss.home.dir\") + System.getProperty(\"file.separator\") + \"temp\" + System.getProperty(\"file.separator\");\r\n\t\t\tFile archSalida = new File(direccion + nArchivo);\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tFileUtils\r\n\t\t\t\t\t\t.writeStringToFile(archSalida, cadenaSalida.toString());\r\n\t\t\t\tif (archSalida.length() > 0) {\r\n\t\t\t\t\tstatusMessages.add(Severity.INFO, \"Insercion Exitosa\");\r\n\t\t\t\t}\r\n\t\t\t\tJasperReportUtils.respondFile(archSalida, nArchivo, false,\r\n\t\t\t\t\t\t\"application/vnd.ms-excel\");\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tstatusMessages.add(Severity.ERROR, \"IOException\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void ReservaEfetivadas () {\n Date hoje = new Date ();\n for (int z = 0; z < vecReserva.size(); z++) {\n if (((int) ((((entReserva)vecReserva.elementAt(z)).getDatain().getTime() - (hoje.getTime())) / 86400000L)) == 0){// Reserva será relaizada hj\n if (((entReserva)vecReserva.elementAt(z)).getPagamento().getSituacao() == 0){//Cliente fez todo o pagamento e o quarto será\n vecReservaEfetivadas.add(vecReserva.elementAt(z));\n }\n \n }\n }\n }", "private void prepare()\n {\n addObject(new TempoLimite(), 432, 207);\n addObject(new NumeroVidas(), 395, 278);\n\n Cliqueparajogar clique = new Cliqueparajogar();\n addObject(clique, getWidth()/2, getHeight()/2);\n\n Som som = new Som();\n addObject(som, getWidth() - 37, getHeight()-57);\n \n umMin ummin = new umMin();\n addObject(ummin,630,206);\n\n doisMin doismin = new doisMin();\n addObject(doismin,670,206);\n \n tresMin tresmin = new tresMin();\n addObject(tresmin,710,206);\n \n quatroMin quatromin = new quatroMin();\n addObject(quatromin,750,206);\n \n cincoMin cincomin = new cincoMin();\n addObject(cincomin,790,206);\n \n umaVida umavida = new umaVida();\n addObject(umavida,630,280);\n \n duasVidas duasvidas = new duasVidas();\n addObject(duasvidas,670,280);\n \n tresVidas tresvidas = new tresVidas();\n addObject(tresvidas,710,280);\n \n quatroVidas quatrovidas = new quatroVidas();\n addObject(quatrovidas,750,280);\n \n cincoVidas cincovidas = new cincoVidas();\n addObject(cincovidas,790,280);\n \n voltaratras voltar = new voltaratras();\n addObject(voltar, getWidth() -37, 428);\n }", "private void inicializarConexoesDaSegundaCamada() {\n conexoesSegundaCamada = new double[numeroNeuroniosPrimeiraCamada + 1];\n for (int i = 0; i < conexoesSegundaCamada.length; i++) {\n conexoesSegundaCamada[i] = Math.random();\n //conexoesSegundaCamada[i] = 1.0;\n }\n }", "public void createDespesaDetalhe(ArrayList<PagamentoDespesasDetalhe> listaDespesasInseridas, int idDespesa) throws Exception {\n\r\n for(int i=0; i < listaDespesasInseridas.size(); i++){\r\n \r\n open(); //abre conexão com o banco de dados\r\n\r\n //define comando para o banco de dados\r\n stmt = con.prepareStatement(\"INSERT INTO pagamentoDespesasDetalhe(valor, dataPagamento, status, idDespesas, idFormaPagamento) VALUES (?,?,?,?,?)\");\r\n\r\n //atribui os valores das marcações do comando acima \r\n stmt.setFloat(1, listaDespesasInseridas.get(i).getValor());\r\n stmt.setString(2, listaDespesasInseridas.get(i).getDataPagamento());\r\n stmt.setInt(3, listaDespesasInseridas.get(i).getStatus());\r\n stmt.setInt(4, idDespesa);\r\n stmt.setInt(5, listaDespesasInseridas.get(i).getIdFormaPagamento());\r\n\r\n stmt.execute();//executa insert no banco de dados\r\n\r\n close();//fecha conexão com o banco de dados\r\n \r\n } \r\n\r\n }", "public void prepareSorpresas(){\n\t\tfor( int x= 0 ; x < game.getAmountSorpresas();x++){\n\t\t\tSorpresa s = game.getSorpresa(x);\n\t\t\timage = s.getImage();\n\t\t\ttemporal = image.getImage().getScaledInstance(s.getAncho(), s.getAlto(), Image.SCALE_SMOOTH);\n\t\t\ts.setImage(new ImageIcon(temporal));\n\t\t}\n\t}", "private void ActualizaPosicionesFondos() {\n xFondo-=10; //Es el cursor de la posición\n xFondoBase-=10; //Aqui se puede implementar metodo de modificacion de velocidad de fondo.\n xFondoApoyo-=10;\n if (xFondo == -texturaFondoBase.getWidth()){\n xFondoBase = xFondoApoyo+texturaFondoApoyo.getWidth();\n cambiosFondo++;\n }\n if (xFondo == -(texturaFondoApoyo.getWidth()+texturaFondoBase.getWidth())) {\n xFondoApoyo = xFondoBase+texturaFondoBase.getWidth();\n cambiosFondo++;\n }\n }", "public void prepareObjetivos(){\n\t\tfor( int x= 0 ; x < game.getAmountObjetivos();x++){\n\t\t\tObjetivo o = game.getObjetivo(x);\n\t\t\timage = o.getImage();\n\t\t\ttemporal = image.getImage().getScaledInstance(o.getAncho(), o.getAlto(), Image.SCALE_SMOOTH);\n\t\t\to.setImage(new ImageIcon(temporal));\n\t\t}\n\t\t\n\t}", "private void dibujarArregloCamionetas() {\n\n timerCrearEnemigo += Gdx.graphics.getDeltaTime();\n if (timerCrearEnemigo>=TIEMPO_CREA_ENEMIGO) {\n timerCrearEnemigo = 0;\n TIEMPO_CREA_ENEMIGO = tiempoBase + MathUtils.random()*2;\n if (tiempoBase>0) {\n tiempoBase -= 0.01f;\n }\n\n camioneta= new Camioneta(texturaCamioneta,ANCHO,60f);\n arrEnemigosCamioneta.add(camioneta);\n\n\n }\n\n //Si el vehiculo se paso de la pantalla, lo borra\n for (int i = arrEnemigosCamioneta.size-1; i >= 0; i--) {\n Camioneta camioneta1 = arrEnemigosCamioneta.get(i);\n if (camioneta1.sprite.getX() < 0- camioneta1.sprite.getWidth()) {\n arrEnemigosCamioneta.removeIndex(i);\n\n }\n }\n }", "public void insertar(int rafaga, int tiempo) {\n\t\tif (rafaga <= 0 || tiempo < 0) {\n\t\t\treturn;\n\t\t}\n\t\tProceso nuevo = new Proceso();\n\t\tnuevo.id = String.valueOf((char) this.caracter);\n\t\tthis.caracter++;\n\t\tnuevo.rafaga = rafaga;\n\t\tnuevo.tllegada = tiempo;\n\t\tnuevo.IdCola = this.IdCola;\n\t\tnuevo.NombreCola = this.NombreCola;\n\t\tnuevo.ColaProviene = this.NombreCola;\n\t\tif (raiz.sig == raiz) {\n\t\t\traiz.sig = nuevo;\n\t\t\tcabeza = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\tnuevo.padre = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t} else {\n\t\t\tProceso aux = raiz.padre;\n\t\t\taux.sig = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t\tnuevo.padre = aux;\n\t\t}\n\t\tthis.numProcesos++;\n\t\tthis.rafagaTotal += rafaga;\n\t\tthis.Ordenamiento();\n\t}", "private void insertData() \n {\n for(int i = 0; i < 2; i++){\n RazaEntity razaEntity = factory.manufacturePojo(RazaEntity.class);\n em.persist(razaEntity);\n razaData.add(razaEntity);\n }\n for (int i = 0; i < 3; i++) {\n EspecieEntity especieEntity = factory.manufacturePojo(EspecieEntity.class);\n if(i == 0)\n {\n especieEntity.setRazas(razaData);\n }\n em.persist(especieEntity);\n especieData.add(especieEntity);\n }\n }", "void insertar_cabeceraMatriz(Nodo_B nuevo){\n \n if(this.primero == null){\n this.primero = nuevo;\n this.ultimo = nuevo;\n \n this.size++;\n }else{\n \n if(nuevo.getValor() < this.primero.getValor()){\n nuevo.siguiente = this.primero;\n this.primero.anterior = nuevo;\n this.primero = nuevo;\n this.size++;\n }else if(nuevo.getValor() > this.ultimo.getValor()){\n this.ultimo.siguiente = nuevo;\n nuevo.anterior = this.ultimo;\n this.ultimo = nuevo;\n this.size++;\n }else{\n Nodo_B pivote = this.primero;\n \n while(pivote != null){\n if(nuevo.getValor() < pivote.getValor()){\n nuevo.siguiente = pivote;\n nuevo.anterior = pivote.anterior;\n pivote.anterior.siguiente = nuevo;\n pivote.anterior = nuevo;\n this.size++;\n break;\n }else if(nuevo.getValor() == pivote.getValor()){\n System.out.print(\"ya hay un valor con este codigo registrado\");\n break;\n }else{\n pivote = pivote.siguiente;\n }\n }\n }\n }\n // JOptionPane.showMessageDialog(null, \"salio del metodo insertar cabecera con el pais :\"+nuevo.nombreDestino);\n }", "@Override\n public void registrarPropiedad(Propiedad nuevaPropiedad, String pIdAgente) {\n int numFinca = nuevaPropiedad.getNumFinca();\n String modalidad = nuevaPropiedad.getModalidad();\n double area = nuevaPropiedad.getAreaTerreno();\n double metro = nuevaPropiedad.getValorMetroCuadrado();\n double fiscal = nuevaPropiedad.getValorFiscal();\n String provincia = nuevaPropiedad.getProvincia();\n String canton = nuevaPropiedad.getCanton();\n String distrito = nuevaPropiedad.getDistrito();\n String dirExacta = nuevaPropiedad.getDirExacta();\n String estado = nuevaPropiedad.getEstado();\n String tipo = nuevaPropiedad.getTipo();\n System.out.println(nuevaPropiedad.getFotografias().size());\n double precio = nuevaPropiedad.getPrecio();\n try {\n bdPropiedad.manipulationQuery(\"INSERT INTO PROPIEDAD (ID_PROPIEDAD, ID_AGENTE, MODALIDAD, \"\n + \"AREA_TERRENO, VALOR_METRO, VALOR_FISCAL, PROVINCIA, CANTON, DISTRITO, DIREXACTA, TIPO, \"\n + \"ESTADO, PRECIO) VALUES (\" + numFinca + \", '\" + pIdAgente + \"' , '\" + modalidad + \"',\" + \n area + \",\" + metro + \",\" + fiscal + \", '\" + provincia + \"' , '\" + canton + \"' , '\" + distrito \n + \"' , '\" + dirExacta + \"' , '\" + tipo + \"' , '\" + estado + \"', \" + precio + \")\");\n bdPropiedad.insertarFotografias(nuevaPropiedad);\n } catch (SQLException ex) {\n Logger.getLogger(Propiedad.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void insertData() \n {\n for (int i = 0; i < 3; i++) {\n TarjetaPrepagoEntity entity = factory.manufacturePojo(TarjetaPrepagoEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n for(int i = 0; i < 3; i++)\n {\n PagoEntity pagos = factory.manufacturePojo(PagoEntity.class);\n em.persist(pagos);\n pagosData.add(pagos);\n\n }\n \n data.get(2).setSaldo(0.0);\n data.get(2).setPuntos(0.0);\n \n double valor = (Math.random()+1) *100;\n data.get(0).setSaldo(valor);\n data.get(0).setPuntos(valor); \n data.get(1).setSaldo(valor);\n data.get(1).setPuntos(valor);\n \n }", "private void aumentaCapacidade(){\n\t\tif(this.tamanho == this.elementos.length){\n\t\t\tObject[] elementosNovos = new Object[this.elementos.length*2];\n\t\t\tfor(int i =0; i<this.elementos.length;i++){\n\t\t\t\telementosNovos[i]=this.elementos[i];\n\t\t\t}\n\t\t\tthis.elementos=elementosNovos;\n\t\t}\n\t}", "public void agregarFruta(){\n\t\tcontenidos[14][17] = new Fruta();\n\t}", "private void insertData() {\n compra = factory.manufacturePojo(CompraVentaEntity.class);\n compra.setId(1L);\n compra.setQuejasReclamos(new ArrayList<>());\n em.persist(compra);\n\n for (int i = 0; i < 3; i++) {\n QuejasReclamosEntity entity = factory.manufacturePojo(QuejasReclamosEntity.class);\n entity.setCompraVenta(compra);\n em.persist(entity);\n data.add(entity);\n compra.getQuejasReclamos().add(entity);\n }\n }", "@Override\n\tpublic void newFactura(int numerofactura, VOCliente cliente, ArrayList<VOGuia> listaGuias, Calendar fecha) {\n\t\t\n\t\tDBConnection con = null;\n\t\tPreparedStatement pstm = null;\n\t\t\n\t\tjava.sql.Date fechaSQL = new java.sql.Date(fecha.getTimeInMillis());\n\t\tVOGuia guia;\n\t\t\n\t\tBigDecimal totalGuias = new BigDecimal(0);\n\t\tBigDecimal totalNeto = new BigDecimal(0);\n\t\tBigDecimal IVA = new BigDecimal(0.19);\n\t\tBigDecimal factor = new BigDecimal(1.19);\n\t\tBigDecimal totalIVA = new BigDecimal(0);\n\t\tBigDecimal totalFactura = new BigDecimal(0);\n\n\t\ttry {\n\t\t\tcon = new DBConnection(\"root\",\"walkirias84\");\n\t\t\tpstm = con.getConnection().prepareStatement(\n\t\t\t\t\t\"INSERT INTO factura\"+\n\t\t\t\t\t\" (facnumero,cliente_cliid,facfecha,facneto,faciva,factotal)\"+\n\t\t\t\t\t\" VALUES (?,?,?,?,?,?)\");\n\t\t\t\n\t\t\t/*\n\t\t\t * Total Guias\n\t\t\t */\n\t\t\tint numeroGuias = listaGuias.size();\n\t\t\t\n\t\t\t//DEBUG\n\t\t\tSystem.out.println(\"DAOFAC numero guias: \"+numeroGuias);\n\t\t\t\n\t\t\tIterator<VOGuia> iter = listaGuias.iterator();\n\t\t\twhile(iter.hasNext()){\n\t\t\t\tguia = iter.next();\n\t\t\t\ttotalGuias = totalGuias.add(guia.getTotal());\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"DAOFAC precio guia: \"+guia.getTotal().toString());\n\t\t\t\tSystem.out.println(\"DAOFAC total guias en: \"+totalGuias.toString()+\", guia: \"+guia.getNumero());\n\t\t\t}\n\n\t\t\t//DEBUG\n\t\t\tSystem.out.println(\"DAOFAC total guias final: \"+totalGuias.toString());\n\t\t\t\n\t\t\tMathContext mc_8 = new MathContext(8,RoundingMode.HALF_UP);\n\n\t\t\t/*\n\t\t\t * Total Guias Neto\n\t\t\t */\n\t\t\t//totalNeto = totalGuias.divide(factor);\n\t\t\ttotalNeto = totalGuias.divide(factor, mc_8); // EL RESULTADO ES MUY GRANDE!!!\n\n\t\t\t/*\n\t\t\t * Total IVA\n\t\t\t */\n\t\t\ttotalIVA = totalNeto.multiply(IVA, mc_8);\n\t\t\t\n\t\t\t/*\n\t\t\t * Total Factura\n\t\t\t */\n\t\t\ttotalFactura = totalGuias;\n\t\t\t\n\t\t\tSystem.out.println(\"Numero de guias a facturar: \"+numeroGuias);\n\t\t\tSystem.out.println(\"valores factura: \");\n\t\t\tSystem.out.println(\"total neto: \"+totalNeto.setScale(0,BigDecimal.ROUND_HALF_UP).toString());\n\t\t\tSystem.out.println(\"total iva: \"+totalIVA.setScale(0,BigDecimal.ROUND_HALF_UP).toString());\n\t\t\tSystem.out.println(\"total factura: \"+totalFactura.setScale(0,BigDecimal.ROUND_HALF_UP).toString());\n\t\t\t\n\t\t\tpstm.setInt(1, numerofactura);\n\t\t\tpstm.setString(2, cliente.getId());\n\t\t\tpstm.setDate(3, fechaSQL);\n\t\t\tpstm.setBigDecimal(4, totalNeto.setScale(0,BigDecimal.ROUND_HALF_UP));\n\t\t\tpstm.setBigDecimal(5, totalIVA.setScale(0,BigDecimal.ROUND_HALF_UP));\n\t\t\tpstm.setBigDecimal(6, totalFactura.setScale(0,BigDecimal.ROUND_HALF_UP));\n\t\t\t\n\t\t\tint result = pstm.executeUpdate();\n\t\t\tSystem.out.println(\"result: \"+result);\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(e);\n\t\t} finally {\n\t if (pstm != null) try { pstm.close(); } catch (SQLException logOrIgnore) {}\n\t if (con != null) try { con.getConnection().close(); } catch (SQLException logOrIgnore) {}\n\t }\n\t}", "private void agregarBloquesPredeterminados(){\n ImageView imagenBloqueMoverDerecha = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueMoverDerecha.jpeg\"));\n ImageView imagenMoverIzquierda = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueMoverIzquierda.jpeg\"));\n ImageView imagenMoverArriba = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueMoverArriba.jpeg\"));\n ImageView imagenMoverAbajo = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueMoverAbajo.jpeg\"));\n ImageView imagenBajarLapiz = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueBajarLapiz.jpg\"));\n ImageView imagenLevantarLapiz = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueLevantarLapiz.jpg\"));\n ImageView imagenRepetir2 = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueRepetir2.jpeg\"));\n ImageView imagenRepetir3 = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueRepetir3.jpeg\"));\n ImageView imagenInvertir = new ImageView(new Image(\"file:src/main/java/com/vista/imagenes/bloqueImagenes/bloqueInvertir.png\"));\n\n //creo contenedores para los bloques de seccion bloque\n VBox contenedorBloqueMoverDerecha = new VBox();\n VBox contenedorBloqueMoverIzquierda = new VBox();\n VBox contenedorBloqueMoverArriba = new VBox();\n VBox contenedorBloqueMoverAbajo = new VBox();\n VBox contenedorBloqueLevantarLapiz = new VBox();\n VBox contenedorBloqueBajarLapiz = new VBox();\n VBox contenedorBloqueRepetir2 = new VBox();\n VBox contenedorBloqueRepetir3 = new VBox();\n VBox contenedorBloqueInvertir = new VBox();\n\n\n //creo los bloques de seccion bloque y los agrego a sus respectivos contenedores\n contenedorBloqueMoverDerecha.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenBloqueMoverDerecha), contenedorBloqueMoverDerecha, tablero, \"MoverDerecha\", false));\n contenedorBloqueMoverIzquierda.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenMoverIzquierda), contenedorBloqueMoverIzquierda, tablero, \"MoverIzquierda\", false));\n contenedorBloqueMoverArriba.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenMoverArriba), contenedorBloqueMoverArriba, tablero, \"MoverArriba\", false));\n contenedorBloqueMoverAbajo.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenMoverAbajo), contenedorBloqueMoverAbajo, tablero, \"MoverAbajo\", false));\n contenedorBloqueLevantarLapiz.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenLevantarLapiz), contenedorBloqueLevantarLapiz, tablero, \"LevantarLapiz\", false));\n contenedorBloqueBajarLapiz.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenBajarLapiz), contenedorBloqueBajarLapiz, tablero, \"BajarLapiz\", false));\n contenedorBloqueRepetir2.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenRepetir2), contenedorBloqueRepetir2, tablero, \"RepetirDoble\", true));\n contenedorBloqueRepetir3.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenRepetir3), contenedorBloqueRepetir3, tablero, \"RepetirTriple\", true));\n contenedorBloqueInvertir.getChildren().add(new VistaBloqueDisponible(new Contenido(imagenInvertir), contenedorBloqueInvertir, tablero, \"Invertir\", true));\n\n //agrego de manera ordenada los contenedores de bloques de seccion bloque\n this.getChildren().add(contenedorBloqueMoverDerecha);\n this.getChildren().add(contenedorBloqueMoverIzquierda);\n this.getChildren().add(contenedorBloqueMoverArriba);\n this.getChildren().add(contenedorBloqueMoverAbajo);\n this.getChildren().add(contenedorBloqueLevantarLapiz);\n this.getChildren().add(contenedorBloqueBajarLapiz);\n this.getChildren().add(contenedorBloqueRepetir2);\n this.getChildren().add(contenedorBloqueRepetir3);\n this.getChildren().add(contenedorBloqueInvertir);\n }", "private void insertData() {\n for (int i = 0; i < 3; i++) {\n PodamFactory factory = new PodamFactoryImpl();\n VisitaEntity entity = factory.manufacturePojo(VisitaEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n }", "public void insertSugerencias (Resumen r){\r\n\t\tSugerencia sugAux = null;\r\n\t\tfor (int i=0;i<r.getSugerencias().length;i++) {\r\n\t\t\tfor (int j=0;j<r.leerDia(i).size();j++) {\r\n\t\t\t\tsugAux = r.leerDia(i).get(j);\r\n\t\t\t\tsugerencias.add(sugAux);\r\n\t\t\t\tinsertCache(sugAux, \"Sugerencia\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void movF(){\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\t * fallos , la f3 de la cara 4 pasa a la c0 de cara 2\r\n\t\t * la columna 0 de cara dos pasa a fila 1 cara 5\r\n\t\t * columna 3 de cara 0 para a fila 0 cara 4\r\n\t\t * fila 0 cara 5 pasa a columna 3 cara 0\r\n\t\t */\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tint aux[][] = new int[1][3];\r\n\t\tint aux2[][] = new int[3][1];\r\n\t\tint aux3[][] = new int[1][3];\r\n\t\tint aux4[][] = new int[3][1];\r\n\t\t\r\n\t\tint aux5[][]= new int [1][3];\r\n\t\tint aux6[][]= new int [1][3];\r\n\t\tint aux7[][]= new int [1][3];\r\n\t\t\r\n\t\t//copiamos en un aux la primera fila de zona 5\r\n\t\taux=cloneF(5,0);\r\n\t\taux2=cloneC(0,2);\r\n\t\taux3=cloneF(4,2); //bloque 4 fila 2\r\n\t\taux4=cloneC(2,0);//bloque 2 col 0\r\n\t\t\r\n\t\taux5=cloneF(1,0);\r\n\t\taux6=cloneF(1,1);\r\n\t\taux7=cloneF(1,2);\r\n\t\t\r\n\t\t\r\n\t\tthis.copiaEnColumnaUnaFila(aux, 0, 2);//copiamos en bl0 col2\r\n\t\tthis.copiaEnFilaUnaColumnaReverse(aux2, 4, 2);\r\n\t\t\r\n\t\tthis.copiaEnColumnaUnaFila(aux3, 2, 0);//copiamos en bl0 la col0\r\n\t\tthis.copiaEnFilaUnaColumnaReverse(aux4, 5, 0);\r\n\t\t\r\n\t\tthis.copiaEnColumnaUnaFila(aux5, 1, 2);\r\n\t\tthis.copiaEnColumnaUnaFila(aux6, 1, 1);\r\n\t\tthis.copiaEnColumnaUnaFila(aux7, 1, 0);\r\n\t\t\r\n\t\t\r\n\t}", "public void insertar2(){\n for (int i = 0; i < tamano; i++) {\n vectorpila2[i]=(int) (Math.random() *100+1);\n \n cima++;\n }\n }", "public void insertarcola(){\n Cola_banco nuevo=new Cola_banco();// se declara nuestro metodo que contendra la cola\r\n System.out.println(\"ingrese el nombre que contendra la cola: \");// se pide el mensaje desde el teclado\r\n nuevo.nombre=teclado.next();// se ingresa nuestro datos por consola yse almacena en la variable nombre\r\n if (primero==null){// se usa una condicional para indicar si primer dato ingresado es igual al null\r\n primero=nuevo;// se indica que el primer dato ingresado pasa a ser nuestro dato\r\n primero.siguiente=null;// se indica que el el dato ingresado vaya al apuntador siguente y que guarde al null\r\n ultimo=nuevo;// se indica que el ultimo dato ingresado pase como nuevo en la cabeza de nuestro cola\r\n }else{// se usa la condicon sino se cumple la primera\r\n ultimo.siguiente=nuevo;//se indica que ultimo dato ingresado apunte hacia siguente si es que hay un nuevo dato ingresado y que vaya aser el nuevo dato de la cola\r\n nuevo.siguiente=null;// se indica que el nuevo dato ingresado vaya y apunete hacia siguente y quees igual al null\r\n ultimo=nuevo;// se indica que el ultimo dato ingresado pase como nuevo dato\r\n }\r\n System.out.println(\"\\n dato ingresado correctamente\");// se imprime enl mensaje que el dato ha sido ingresado correctamente\r\n}", "private void insertData() {\n\n cliente = factory.manufacturePojo(ClienteEntity.class);\n em.persist(cliente);\n for (int i = 0; i < 3; i++) {\n FormaPagoEntity formaPagoEntity = factory.manufacturePojo(FormaPagoEntity.class);\n formaPagoEntity.setCliente(cliente);\n em.persist(formaPagoEntity);\n data.add(formaPagoEntity);\n }\n }", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ViajeroEntity entity = factory.manufacturePojo(ViajeroEntity.class);\n\n em.persist(entity);\n data.add(entity);\n }\n }", "public void addDicas(){\n\t\tMetaDica metaDicaOac = new MetaDica(oac, \"user1\", \"Não falte as aulas, toda aula tem ponto extra!\");\n\t\tmetaDicaOac.setConcordancias(5);\n\t\tdao.persist(metaDicaOac);\n\n\t\tdicaExerciciosOac = new DicaConselho(\"Os exercicios extras valem muitos pontos, nao deixe de fazer\");\n\t\tdicaExerciciosOac.setTema(temaOacExercicios);\n\t\ttemaOacExercicios.setDisciplina(oac);\n\t\tdicaExerciciosOac.setUser(\"user5\");\n\t\tdicaExerciciosOac.addUsuarioQueVotou(\"user1\");\n\t\tdicaExerciciosOac.addUsuarioQueVotou(\"user2\");\n\n\t\t//adiciona pontos a dica\n\t\tfor (int i = 0; i < 20;i++){\n\t\t\tdicaExerciciosOac.incrementaConcordancias();\n\t\t}\n\t\tfor (int i = 0; i < 5;i++){\n\t\t\tdicaExerciciosOac.incrementaDiscordancias();\n\t\t}\n\n\t\t//adiciona pontos a dica\n\t\tfor (int i = 0; i < 5;i++){\n\t\t\tdicaExerciciosOac.incrementaConcordancias();\n\t\t}\n\t\tfor (int i = 0; i < 25;i++){\n\t\t\tdicaExerciciosOac.incrementaDiscordancias();\n\t\t}\n\t\tdao.persist(dicaExerciciosOac);\n\n\t\tdicaRevisaoIcOac = new DicaAssunto(\"Antes das aulas faça uma boa revisao de IC\");\n\t\ttemaOacRevisaoIC.setDisciplina(oac);\n\t\tdicaRevisaoIcOac.setTema(temaOacRevisaoIC);\n\t\tdicaRevisaoIcOac.setUser(\"user4\");\n\t\tdicaRevisaoIcOac.addUsuarioQueVotou(\"user5\");\n\t\tdicaRevisaoIcOac.addUsuarioQueVotou(\"user1\");\n\t\tdicaRevisaoIcOac.incrementaConcordancias();\n\t\tdicaRevisaoIcOac.incrementaConcordancias();\n\n\t\t//cria meta dica em si\n\t\tMetaDica metaDicaSi1 = new MetaDica(si1, \"user2\", \"Seja autodidata! Procure por cursos online\");\n\t\tdao.persist(metaDicaSi1);\n\n\t\tdicaLabSi = new DicaConselho(\"Faça todo os labs, não deixe acumular\");\n\t\ttemaMinitestesSi.setDisciplina(si1);\n\t\tdicaLabSi.setTema(temaMinitestesSi);\n\t\tdicaLabSi.setUser(\"user1\");\n\t\tdicaLabSi.addUsuarioQueVotou(\"user2\");\n\t\tdicaLabSi.addUsuarioQueVotou(\"user3\");\n\t\tdicaLabSi.incrementaConcordancias();\n\t\tdicaLabSi.incrementaConcordancias();\n\t\tdao.persist(dicaLabSi);\n\n\t\tdicaPlaySi = new DicaConselho(\"Comece a configurar o Play no primeiro dia de aula, pois dá muuuito trabalho\");\n\t\ttemaPlaySi.setDisciplina(si1);\n\t\tdicaPlaySi.setTema(temaPlaySi);\n\t\tdicaPlaySi.setUser(\"user2\");\n\t\tdicaPlaySi.addUsuarioQueVotou(\"user5\");\n\t\tdicaPlaySi.addUsuarioQueVotou(\"user4\");\n\t\tdicaPlaySi.incrementaConcordancias();\n\t\tdicaPlaySi.incrementaConcordancias();\n\t\tdao.persist(dicaPlaySi);\n\n\t\tdicaMaterialSi = new DicaMaterial(\"http://www.wthreex.com/rup/process/workflow/ana_desi/co_swarch.htm\");\n\t\ttemaMaterialSi.setDisciplina(si1);\n\t\tdicaMaterialSi.setTema(temaMaterialSi);\n\t\tdicaMaterialSi.setUser(\"user2\");\n\t\tdicaMaterialSi.addUsuarioQueVotou(\"user5\");\n\t\tdicaMaterialSi.addUsuarioQueVotou(\"user4\");\n\t\tdicaMaterialSi.incrementaConcordancias();\n\t\tdicaMaterialSi.incrementaConcordancias();\n\t\tdao.persist(dicaMaterialSi);\n\n\n\t\t//cria meta dica logica\n\t\tMetaDica metaDicaLogica = new MetaDica(logica, \"user3\", \"Copie para o seu caderno tudo que o professor copiar no quadro, TUDO!\");\n\t\tdao.persist(metaDicaLogica);\n\n\t\tdicaListasLogica = new DicaConselho(\"Faça todas as listas possíveis\");\n\t\ttemaListasLogica.setDisciplina(logica);\n\t\tdicaListasLogica.setTema(temaListasLogica);\n\t\tdicaListasLogica.setTema(temaListasLogica);\n\t\tdicaListasLogica.setUser(\"user6\");\n\t\tdicaListasLogica.addUsuarioQueVotou(\"user3\");\n\t\tdicaListasLogica.addUsuarioQueVotou(\"user5\");\n\t\tdicaListasLogica.incrementaConcordancias();\n\t\tdicaListasLogica.incrementaConcordancias();\n\t\tdao.persist(dicaListasLogica);\n\n\t\tdicaProjetoLogica = new DicaAssunto(\"Peça ajuda ao monitor responsável por seu grupo, começe o projeto assim que for lançado!\");\n\t\ttemaProjetoLogica.setDisciplina(logica);\n\t\tdicaProjetoLogica.setTema(temaProjetoLogica);\n\t\tdicaProjetoLogica.setTema(temaProjetoLogica);\n\t\tdicaProjetoLogica.setUser(\"user4\");\n\t\tdicaProjetoLogica.addUsuarioQueVotou(\"user1\");\n\t\tdicaProjetoLogica.addUsuarioQueVotou(\"user2\");\n\t\tdicaProjetoLogica.incrementaConcordancias();\n\t\tdicaProjetoLogica.incrementaConcordancias();\n\t\tdao.persist(dicaProjetoLogica);\n\n\t\tdao.flush();\n\n\t}", "public void insertarCargo() {\n ContentValues values = new ContentValues();\n for (int i = 0; i <= 3; i++) {\n values.put(\"NOMBRE_CARGO\", \"nombre \" + i);\n values.put(\"DESCRIPCION_CARGO\", \"Descripcion \" + i);\n db.insert(\"CARGO\", null, values);\n }\n }", "public void creaAziendaAgricola(){\n\t\tCantina nipozzano = creaCantina(\"Nipozzano\");\t\n\t\tBotte[] bottiNipozzano = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiNipozzano.length; i++){\n\t\t\tbottiNipozzano[i] = creaBotte(nipozzano, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\t\t\n\t\tVigna mormoreto = creaVigna(\"Mormoreto\", 330, 25, EsposizioneVigna.sud, \"Terreni ricchi di sabbia, ben drenati. Discreta presenza di calcio. pH neutro o leggermente alcalino\");\n\t\tFilare[] filariMormoreto = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMormoreto.length;i++){\n\t\t\tfilariMormoreto[i] = creaFilare(mormoreto, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\t\n\t\tVigna montesodi = creaVigna(\"Montesodi\", 400, 20, EsposizioneVigna.sud_ovest, \"Arido e sassoso, di alberese, argilloso e calcareo, ben drenato, poco ricco di sostanza organica\");\n\t\tFilare[] filariMontesodi = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMontesodi.length;i++){\n\t\t\tfilariMontesodi[i] = creaFilare(montesodi, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t/*\n\t\t * CANTINA: POMINO - VIGNETO BENEFIZIO\n\t\t */\n\t\t\n\t\tCantina pomino = creaCantina(\"Pomino\");\n\t\tBotte[] bottiPomino = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiPomino.length; i++){\n\t\t\tbottiPomino[i] = creaBotte(pomino, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\n\t\tVigna benefizio = creaVigna(\"Benefizio\", 700, 9, EsposizioneVigna.sud_ovest, \"Terreni ricchi di sabbia, forte presenza di scheletro. Molto drenanti. Ricchi in elementi minerali. PH acido o leggermente acido.\");\n\t\tFilare[] filariBenefizio = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariBenefizio.length;i++){\n\t\t\tfilariBenefizio[i] = creaFilare(benefizio, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(nipozzano);\n\t\taziendaAgricolaDAO.saveLuogo(mormoreto);\n\t\taziendaAgricolaDAO.saveLuogo(montesodi);\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(pomino);\n\t\taziendaAgricolaDAO.saveLuogo(benefizio);\n\t\t\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Giulio d'Afflitto\"));\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Francesco Ermini\"));\n\n\t\t\n\t}", "private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n MonitoriaEntity entity = factory.manufacturePojo(MonitoriaEntity.class);\r\n\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n VueltasConDemoraEnOficinaEntity entity = factory.manufacturePojo(VueltasConDemoraEnOficinaEntity.class);\n \n em.persist(entity);\n data.add(entity);\n }\n }", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ServicioEntity entity = factory.manufacturePojo(ServicioEntity.class);\n em.persist(entity);\n dataServicio.add(entity);\n }\n for (int i = 0; i < 3; i++) {\n QuejaEntity entity = factory.manufacturePojo(QuejaEntity.class);\n if (i == 0) {\n entity.setServicio(dataServicio.get(0));\n }\n em.persist(entity);\n data.add(entity);\n }\n }", "private void insertar(ArrayList<Estado> hijos) {\r\n\t\tfor (Estado p : hijos) { // Añado hijos a nodos abiertos\r\n\t\t\tabiertos.add(p);\r\n\t\t\tif (abiertos.size() > estados_abiertos)\r\n\t\t\t\testados_abiertos = abiertos.size(); // Variable para contar el numero maximo de estados abiertos\r\n\t\t}\r\n\t}", "private void InicializaGrafo() {\n\t\t\n\t\tnumeroVertices = ruas.length + 1;\n\t\tgrafo = new Grafo(numeroVertices);\n\t\t\n\t\tfor (int i = 0; i < numeroVertices - 1; i++) {\n\t\t\t\n\t\t\tint u = ruas[i];\n\t\t\tint v = (i + 1);\n\t\t\t\n\t\t\tgrafo.AdicionaAresta(u, v);\n\t\t\t\n\t\t} // Fim for int i = 0\n\t\t\n\t}", "public void iniciarValores(){\r\n //Numero de campos da linha, do arquivo de saida filtrado\r\n this.NUM_CAMPOS = 106;\r\n this.ID = 0; //numero da ficha\r\n this.NUM_ARQUIVOS = 2070;\r\n\r\n this.MIN_INDICE = 1; //indice do cadastro inicial\r\n this.MAX_INDICE = 90; //indice do cadastro final\r\n this.NUM_INDICES = 90; //quantidade de cadastros lidos em cada arquivo\r\n }", "public void generTirarDados() {\n\r\n\t}", "public void preparePersonajes(){\n\t\tfor( int x= 0 ; x < game.getAmountPersonajes();x++){\n\t\t\tPersonaje p = game.getPersonaje(x);\n\t\t\timage = p.getImage();\n\t\t\ttemporal = image.getImage().getScaledInstance(p.getAncho(), p.getAlto(), Image.SCALE_SMOOTH);\n\t\t\tp.setImage(new ImageIcon(temporal));\n\t\t}\n\t}", "private void crearElementos() {\n\n\t\tRotonda rotonda1 = new Rotonda(new Posicion(400, 120), \"5 de octubre\");\n\t\tthis.getListaPuntos().add(rotonda1);\n\n\t\tCiudad esquel = new Ciudad(new Posicion(90, 180), \"Esquel\");\n\t\tthis.getListaPuntos().add(esquel);\n\n\t\tCiudad trelew = new Ciudad(new Posicion(450, 200), \"Trelew\");\n\t\tthis.getListaPuntos().add(trelew);\n\n\t\tCiudad comodoro = new Ciudad(new Posicion(550, 400), \"Comodoro\");\n\t\tthis.getListaPuntos().add(comodoro);\n\n\t\tCiudad rioMayo = new Ciudad(new Posicion(350, 430), \"Rio Mayo\");\n\t\tthis.getListaPuntos().add(rioMayo);\n\n\t\t// --------------------------------------------------------\n\n\t\tRutaDeRipio rutaRipio = new RutaDeRipio(230, 230, rotonda1, esquel);\n\t\tthis.getListaRuta().add(rutaRipio);\n\n\t\tRutaPavimentada rutaPavimentada1 = new RutaPavimentada(380, 100, trelew, comodoro);\n\t\tthis.getListaRuta().add(rutaPavimentada1);\n\n\t\tRutaPavimentada rutaPavimentada2 = new RutaPavimentada(800, 120, esquel, comodoro);\n\t\tthis.getListaRuta().add(rutaPavimentada2);\n\n\t\tRutaDeRipio rutaripio3 = new RutaDeRipio(380, 100, trelew, comodoro);\n\t\tthis.getListaRuta().add(rutaripio3);\n\n\t\tRutaEnConstruccion rutaConst1 = new RutaEnConstruccion(180, 70, rioMayo, comodoro);\n\t\tthis.getListaRuta().add(rutaConst1);\n\n\t\tRutaPavimentada rutaPavimentada3 = new RutaPavimentada(600, 110, rioMayo, esquel);\n\t\tthis.getListaRuta().add(rutaPavimentada3);\n\t}", "@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}", "private void insertData() {\r\n \r\n TeatroEntity teatro = factory.manufacturePojo(TeatroEntity.class);\r\n em.persist(teatro);\r\n FuncionEntity funcion = factory.manufacturePojo(FuncionEntity.class);\r\n List<FuncionEntity> lista = new ArrayList();\r\n lista.add(funcion);\r\n em.persist(funcion);\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n sala.setFuncion(lista);\r\n em.persist(sala);\r\n data.add(sala);\r\n }\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n em.persist(sala);\r\n sfdata.add(sala);\r\n }\r\n \r\n }", "private void inicializarPartida(int nivel) {\r\n\t\tif(nivel == PRINCIPIANTE) {\r\n\t\t\tcasillas = new Casilla [FILAS_PRINCIPIANTE] [COLUMNAS_PRINCIPIANTE];\r\n\t\t\tcantidadMinas = CANTIDAD_MINAS_PRINCIPANTE;\r\n\t\t\t\r\n\t\t}\r\n\t\tif(nivel == INTERMEDIO) {\r\n\t\t\tcasillas = new Casilla [FILAS_INTERMEDIO] [COLUMNAS_INTERMEDIO];\r\n\t\t\tcantidadMinas = CANTIDAD_MINAS_INTERMEDIO;\r\n\t\t}\r\n\t\tif(nivel == EXPERTO) {\r\n\t\t\tcasillas = new Casilla [FILAS_EXPERTO] [COLUMNAS_EXPERTO] ;\r\n\t\t\tcantidadMinas = CANTIDAD_MINAS_EXPERTO;\r\n\t\t\t\r\n\t\t}\r\n\t}", "private void inserts() {\n DBPeer.fetchTableRows();\n DBPeer.fetchTableIndexes();\n \n Map<Number160, Data> tabRows = DBPeer.getTabRows();\n\t\tMap<Number160, Data> tabIndexes = DBPeer.getTabIndexes();\n\t\t\n String tabName = null;\n Number160 tabKey = null;\n FreeBlocksHandler freeBlocks = null;\n Map<String, IndexHandler> indexHandlers = new HashMap<>();\n TableRows tr = null;\n TableIndexes ti = null;\n \n logger.trace(\"INSERT-WHOLE\", \"BEGIN\", Statement.experiment);\n \n for (Insert ins: inserts) {\n \n if (tabName == null) {\n \ttabName = ins.getTabName();\n \ttabKey = Number160.createHash(tabName);\n \tfreeBlocks = new FreeBlocksHandler(tabName);\n \ttry {\n \t\t\t\ttr = (TableRows) tabRows.get(tabKey).getObject();\n \t\t\t\tti = (TableIndexes) tabIndexes.get(tabKey).getObject();\n \t\t\t} catch (ClassNotFoundException | IOException e) {\n \t\t\t\tlogger.error(\"Data error\", e);\n \t\t\t}\n \tfor (String index: ti.getIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \tfor (String index: ti.getUnivocalIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n } else if (!tabName.equals(ins.getTabName())) {\n \t\t\ttry {\n \t\t\t\ttabRows.put(tabKey, new Data(tr));\n \t\t\ttabIndexes.put(tabKey, new Data(ti));\n \t\t\ttabName = ins.getTabName();\n \ttabKey = Number160.createHash(tabName);\n \t\t\t\ttr = (TableRows) tabRows.get(tabKey).getObject();\n \t\t\t\tti = (TableIndexes) tabIndexes.get(tabKey).getObject();\n \t\t\t\tfreeBlocks.update();\n \tfreeBlocks = new FreeBlocksHandler(tabName);\n \tindexHandlers.clear();\n \tfor (String index: ti.getIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \tfor (String index: ti.getUnivocalIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \t\t\t} catch (ClassNotFoundException | IOException e) {\n \t\t\t\tlogger.error(\"Data error\", e);\n \t\t\t}\n } \n \n ins.init(freeBlocks, indexHandlers, tr, ti);\n \n }\n \n boolean done = false;\n while (!done) {\n \tint countTrue = 0;\n \tfor (Insert ins: inserts) {\n \t\tif (ins.getDone()) {\n \t\t\tcountTrue++;\n \t\t}\n \t}\n \tif (countTrue == inserts.size()) {\n \t\tdone = true;\n \t}\n }\n \n freeBlocks.update();\n\n try {\n\t\t\ttabRows.put(tabKey, new Data(tr));\n\t\t\ttabIndexes.put(tabKey, new Data(ti));\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Data error\", e);\n\t\t}\n \n DBPeer.updateTableRows();\n DBPeer.updateTableIndexes();\n \n logger.trace(\"INSERT-WHOLE\", \"END\", Statement.experiment);\n }", "private void criaBlocos() {\n\t\tif (fase == 1) {\n\t\t\tfor (int i = 0; i < blocoArray; i++) {\n\t\t\t\tint x = (i % 10) * 25 + 2;\n\t\t\t\t\n\t\t\t\tlinhaUm[i] = new Bloco(Color.GRAY);\n\t\t\t\tlinhaUm[i].setPosition(new Point(x, 27));\n\t\t\t\tlinhaDois[i] = new Bloco(Color.RED);\n\t\t\t\tlinhaDois[i].setPosition(new Point(x, 36));\n\t\t\t\tlinhaTres[i] = new Bloco(Color.BLUE);\n\t\t\t\tlinhaTres[i].setPosition(new Point(x, 45));\n\t\t\t\tlinhaQuatro[i] = new Bloco(Color.YELLOW);\n\t\t\t\tlinhaQuatro[i].setPosition(new Point(x, 54));\n\t\t\t\tlinhaCinco[i] = new Bloco(Color.MAGENTA);\n\t\t\t\tlinhaCinco[i].setPosition(new Point(x, 63));\n\t\t\t\tlinhaSeis[i] = new Bloco(Color.GREEN);\n\t\t\t\tlinhaSeis[i].setPosition(new Point(x, 72));\n\n\t\t\t}\n\t\t} else if (fase == 2) {\n\t\t\tint y = 8;\n\t\t\tfor (int i = 0; i < blocoArray; i++) {\n\t\t\t\ty += 9;\n\t\t\t\t\n\t\t\t\tlinhaUm[i] = new Bloco(Color.GRAY);\n\t\t\t\tlinhaUm[i].setPosition(new Point(2, y));\n\t\t\t\tlinhaDois[i] = new Bloco(Color.RED);\n\t\t\t\tlinhaDois[i].setPosition(new Point(46, y));\n\t\t\t\tlinhaTres[i] = new Bloco(Color.BLUE);\n\t\t\t\tlinhaTres[i].setPosition(new Point(92, y));\n\t\t\t\tlinhaQuatro[i] = new Bloco(Color.YELLOW);\n\t\t\t\tlinhaQuatro[i].setPosition(new Point(138, y));\n\t\t\t\tlinhaCinco[i] = new Bloco(Color.MAGENTA);\n\t\t\t\tlinhaCinco[i].setPosition(new Point(184, y));\n\t\t\t\tlinhaSeis[i] = new Bloco(Color.GREEN);\n\t\t\t\tlinhaSeis[i].setPosition(new Point(230, y));\n\t\t\t}\n\t\t}else{\n\t\t\tint contFalPon = 0;\n\t\t\tfor (int i = 0; i < blocoArray; i++) {\n\t\t\t\tint x = (i % 10) * 25 + 2;\n\t\t\t\t\n\t\t\t\tlinhaUm[i] = new Bloco(Color.RED);\n\t\t\t\tif(i >= 2 && i <= 7){\n\t\t\t\t\tlinhaUm[i].setPosition(new Point(x, 20));\n\t\t\t\t}else{linhaUm[i].naoDesenha(); contFalPon++;}\n\t\t\t\t\n\t\t\t\tlinhaDois[i] = new Bloco(Color.RED);\n\t\t\t\tif(i >= 2 && i <= 7){\n\t\t\t\t\tlinhaDois[i].setPosition(new Point(x, 29));\n\t\t\t\t}else{linhaDois[i].naoDesenha(); contFalPon++;}\n\t\t\t\t\n\t\t\t\tif(i == 3 || i == 6){\n\t\t\t\t\tlinhaTres[i] = new Bloco(Color.BLACK);\n\t\t\t\t}else{linhaTres[i] = new Bloco(Color.RED);}\n\t\t\t\tif(i >= 1 && i <= 8){\n\t\t\t\t\tlinhaTres[i].setPosition(new Point(x, 38));\n\t\t\t\t}else{linhaTres[i].naoDesenha(); contFalPon++;}\n\t\t\t\t\n\t\t\t\tif(i == 3 || i == 6){\n\t\t\t\t\tlinhaQuatro[i] = new Bloco(Color.BLACK);\n\t\t\t\t}else{linhaQuatro[i] = new Bloco(Color.RED);}\n\t\t\t\tif(i >= 1 && i <= 8){\n\t\t\t\t\tlinhaQuatro[i].setPosition(new Point(x, 47));\n\t\t\t\t}else{linhaQuatro[i].naoDesenha(); contFalPon++;}\n\t\t\t\t\n\t\t\t\tlinhaCinco[i] = new Bloco(Color.RED);\n\t\t\t\tlinhaCinco[i].setPosition(new Point(x, 56));\n\t\t\t\tlinhaSeis[i] = new Bloco(Color.RED);\n\t\t\t\tlinhaSeis[i].setPosition(new Point(x, 65));\n\n\t\t\t}\n\t\t\tmudaFase -= contFalPon * 100;\n\t\t}//fecha else para formar a fase 3\n\n\t}", "private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n UsuarioEntity entity = factory.manufacturePojo(UsuarioEntity.class);\r\n em.persist(entity);\r\n dataUsuario.add(entity);\r\n }\r\n for (int i = 0; i < 3; i++) {\r\n CarritoDeComprasEntity entity = factory.manufacturePojo(CarritoDeComprasEntity.class);\r\n if (i == 0 ){\r\n entity.setUsuario(dataUsuario.get(0));\r\n }\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }", "public void introducirConsumosClienteFechas(Date fechaInicial, Date fechaFinal,TablaModelo modelo,String dpiCliente) {\n long tiempo = fechaInicial.getTime();\n java.sql.Date fechaInicialSql = new java.sql.Date(tiempo);\n long tiempo2= fechaFinal.getTime();\n java.sql.Date fechaFinalSQL = new java.sql.Date(tiempo2);\n try {// mira los consumo de unas fechas\n PreparedStatement declaracion;// prepara la orden \n declaracion = conexion.prepareStatement(\"SELECT CONSUMO_RESTAURANTE.Id_Consumo,CONSUMO_RESTAURANTE.Id_Alojamiento,CONSUMO_RESTAURANTE.Nombre_Comida,CONSUMO_RESTAURANTE.Precio_Comida,CONSUMO_RESTAURANTE.Cantidad,CONSUMO_RESTAURANTE.Fecha_Consumo FROM CONSUMO_RESTAURANTE JOIN ALOJAMIENTO JOIN RESERVACION WHERE RESERVACION.Id=ALOJAMIENTO.Id_Reservacion AND ALOJAMIENTO.Id=CONSUMO_RESTAURANTE.Id_Alojamiento AND RESERVACION.Dpi_Cliente=? AND Fecha_Consumo>=? AND Fecha_Consumo<=?\");\n declaracion.setString(1, dpiCliente);\n declaracion.setDate(2,fechaInicialSql);\n declaracion.setDate(3,fechaFinalSQL);\n ResultSet resultado = declaracion.executeQuery();\n while (resultado.next()) {// mira los consumo de unas fechas\n Object objeto[] = new Object[7];\n objeto[0] = resultado.getInt(1);\n objeto[1] = resultado.getInt(2);\n objeto[2] = resultado.getString(3);\n objeto[3] = resultado.getInt(4);// mira los consumo de unas fechas\n objeto[4] = resultado.getInt(5);\n objeto[5] = resultado.getDate(6);\n int total = (Integer)objeto[3]*(Integer)objeto[4];\n objeto[6]= total;// mira los consumo de unas fechas\n modelo.addRow(objeto);\n } // maneja el resultado \n\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }", "@Override\n public void movimiento_especial(){\n\n movesp=ataque/2;\n defensa+=5;\n PP= PP-4;\n }", "public void loadReserva() {\r\n\t\tif(listaReservas.size() != 0) {\r\n\r\n\t\t}else {\r\n\t\t\tfor(int i = 0; i < 8; i++) {\r\n\t\t\t\tReservaDAO aux = new ReservaDAO();\r\n\t\t\t\taux.load_reserva(i+1);\r\n\t\t\t\tif(aux.getTitulo() != null) {\r\n\t\t\t\t\tlistaReservas.add(aux);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void insertarPlanDieta(int id_plan_de_dieta, int caloria_max_diarias, Date fecha_Inicio, Date Fecha_fin, int n_comidas_diarias,int id_paciente,int id_nutricionista);", "public void CadastrarPassageiro(Connection con, List<Bilhetes> temporaria) {\n\t\t\n\t\ttry {\n\t\t\n\t\t\tstmt = con.prepareStatement(\"Select cpf from passageiro where cpf = ?\");\n\t\t\t\n\t\t\tstmt.setString(1, temporaria.get(0).getBilhete().get(0).getCpf() );\n\t\t\tstmt.execute();\n\t\t\t\n\t\t\trs=stmt.getResultSet();\n\t\t\t\n\t\t\tif(rs.next())\n\t\t\t{\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(null, \"ERRO: CPF JA CADASTRADO\", \"Erro CADASTRO\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tstmt = con.prepareStatement(\n\t\t\t\t\t\" insert into BILHETES (Destino,Origem,Hpartida, Hembarque,Poltrona) values(?,?,?,?,NULL)\");\n\n\t\t\tstmt.setString(1, temporaria.get(0).getDestino());\n\t\t\tstmt.setString(2, temporaria.get(0).getOrigem());\n\t\t\tstmt.setString(3, temporaria.get(0).getHora_partida());\n\t\t\tstmt.setString(4, temporaria.get(0).getHora_embarque());\n\n\t\t\tstmt.execute();\n\n\t\t\tstmt = con.prepareStatement(\"select IDBILHETE FROM BILHETES WHERE poltrona is null \");\n\n\t\t\tstmt.execute();\n\n\t\t\trs = stmt.getResultSet();\n\n\t\t\twhile (rs.next()) {\n\t\t\t\tint idbilhete = rs.getInt(1);\n\t\t\t\ttemporaria.get(0).setIdbilhete(idbilhete);\n\t\t\t}\n\n\t\t\tstmt = con.prepareStatement(\"insert into Passageiro(nome,cpf,ID_BILHETE) values(?,?,?)\");\n\n\t\t\tstmt.setString(1, temporaria.get(0).getBilhete().get(0).getNome());\n\t\t\tstmt.setString(2, temporaria.get(0).getBilhete().get(0).getCpf());\n\t\t\tstmt.setInt(3, temporaria.get(0).getIdbilhete());\n\n\t\t\tstmt.execute();\n\n\t\t\t// VOLTANDO A CADEIRA PARA 0, PARA EVITAR ERRO NOS PROXIMOS USUARIOS CADASTRADOS\n\t\t\tstmt = con.prepareStatement(\"UPDATE BILHETES SET POLTRONA = 0 WHERE POLTRONA IS NULL\");\n\n\t\t\tstmt.execute();\n\n\t\t\t// Teste\n\n\t\t\tString nome = temporaria.get(0).getBilhete().get(0).getNome();\n\t\t\tString cpf = temporaria.get(0).getBilhete().get(0).getCpf();\n\n\t\t\tString destino = temporaria.get(0).getDestino();\n\t\t\tString Origem = temporaria.get(0).getOrigem();\n\n\t\t\tString hora_EMBARQUE = temporaria.get(0).getHora_embarque();\n\n\t\t\tString horasaida = temporaria.get(0).getHora_partida();\n\n\t\t\t// Instanciando valores\n\t\t\tBilhetes passagem = new Bilhetes(temporaria.get(0).getIdbilhete(), Origem, destino, hora_EMBARQUE,\n\t\t\t\t\thorasaida, null, 0);\n\n\t\t\tpassagem.adicionar(new Passageiro(nome, cpf));\n\n\t\t\tpassageiro.add(passagem);\n\n\t\t\t// Fim do teste antes do filme\n\n\t\t\tJOptionPane.showMessageDialog(null, \"Passageiro Cadastrado Com sucesso\");\n\n\t\t\tJOptionPane.showMessageDialog(null,\"CODIGO LOCALIZADOR DO BILHETE: \" + temporaria.get(0).getIdbilhete(),\" NÃO PERCA\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\n\t\n\t\t\t\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tJOptionPane.showMessageDialog(null, \"ERRO: CPF JA CADASTRADO\", \"Erro CADASTRO\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\n\n\t\t}\n\n\t}", "protected void creationAppr(Connection con) {\n try {\n PreparedStatement pst = con.prepareStatement(\"SELECT identifiant, transitionIdentifier, fixIdentifiant, icaoCodeFix, secCodeFix, subCodeFix, aeroportIdentifiant, icaoCode, sequenceNumber FROM procedure where typeProcedure like 'APPR' ORDER BY aeroportIdentifiant, identifiant, transitionIdentifier ,sequenceNumber asc\");\n ResultSet rs = pst.executeQuery();\n rs.next();\n String runwayIdentifiant = rs.getString(1);\n String transitionIdentifier = rs.getString(2);\n String aeroport = rs.getString(7);\n String icaoCode = rs.getString(8);\n String premierPoint = null;\n if (transitionIdentifier.equals(\"\")) {\n premierPoint = rs.getString(3);\n } else {\n premierPoint = transitionIdentifier;\n }\n\n String sequenceNumber = rs.getString(9);\n List<LatitudeLongitude> couple = new ArrayList<>();\n do {\n System.out.println(\"Premier point\" + premierPoint);\n\n if (!transitionIdentifier.equals(rs.getString(2)) && !sequenceNumber.equals(rs.getString(9))) {\n System.out.println(\"Ajout bdd de \" + premierPoint);\n // ajout en bdd du precedent\n PreparedStatement ajoutSid = con.prepareStatement(\"INSERT INTO appr (runwayIdentifiant, typeApproche, aeroportIdentifiant, icaoCode, premierPoint ,balises) VALUES (?,CAST(? AS typeAppr),?,?,?,?)\");\n ajoutSid.setString(1, runwayIdentifiant);\n ajoutSid.setString(2, runwayIdentifiant.substring(0, 1));\n ajoutSid.setString(3, aeroport);\n ajoutSid.setString(4, icaoCode);\n ajoutSid.setString(5, premierPoint);\n\n\n String[][] tab = new String[couple.size()][2];\n for (int i = 0; i < couple.size(); i++) {\n tab[i][0] = couple.get(i).getLatitude();\n tab[i][1] = couple.get(i).getLongitude();\n }\n\n Array arraySql = con.createArrayOf(\"text\", tab);\n ajoutSid.setArray(6, arraySql);\n ajoutSid.executeUpdate();\n couple.clear();\n\n // on update l'identifiant ds la boucle\n runwayIdentifiant = rs.getString(1);\n transitionIdentifier = rs.getString(2);\n aeroport = rs.getString(7);\n icaoCode = rs.getString(8);\n if (transitionIdentifier.equals(\"\")) {\n premierPoint = rs.getString(3);\n } else {\n premierPoint = transitionIdentifier;\n }\n }\n\n ResultSet rsBalise = null;\n if (!rs.getString(3).equals(\"\")) {\n if (rs.getString(5).equals(\"D\") && rs.getString(6).equals(\"B\")) {\n //NDB\n PreparedStatement pstBalise = con.prepareStatement(\"SELECT latitude, longitude FROM ndb where identifiant like ? and icaoCode like ?\");\n pstBalise.setString(1, rs.getString(3));\n pstBalise.setString(2, rs.getString(4));\n rsBalise = pstBalise.executeQuery();\n if (rsBalise.next()) {\n couple.add(new LatitudeLongitude(rsBalise.getString(1), rsBalise.getString(2)));\n System.out.println(\"NDB\" + rs.getString(2));\n }\n rsBalise.close();\n pstBalise.close();\n\n } else if (rs.getString(5).equals(\"E\") && rs.getString(6).equals(\"A\")) {\n //waypoint en route\n PreparedStatement pstBalise = con.prepareStatement(\"SELECT latitude, longitude FROM waypoint where identifiant like ? and icaoCode like ? and aeroport like 'ENRT'\");\n pstBalise.setString(1, rs.getString(3));\n pstBalise.setString(2, rs.getString(4));\n rsBalise = pstBalise.executeQuery();\n\n if (rsBalise.next()) {\n couple.add(new LatitudeLongitude(rsBalise.getString(1), rsBalise.getString(2)));\n System.out.println(\"WayPoint\" + rs.getString(2));\n }\n rsBalise.close();\n pstBalise.close();\n\n } else if (rs.getString(5).equals(\"P\") && rs.getString(6).equals(\"C\")) {\n //waypoint terminaux\n PreparedStatement pstBalise = con.prepareStatement(\"SELECT latitude, longitude FROM waypoint where identifiant like ? and icaoCode like ? and aeroport like ?\");\n pstBalise.setString(1, rs.getString(3));\n pstBalise.setString(2, rs.getString(4));\n pstBalise.setString(3, rs.getString(7));\n rsBalise = pstBalise.executeQuery();\n\n if (rsBalise.next()) {\n couple.add(new LatitudeLongitude(rsBalise.getString(1), rsBalise.getString(2)));\n System.out.println(\"WayPoint\" + rs.getString(2));\n }\n rsBalise.close();\n pstBalise.close();\n } else if (rs.getString(5).equals(\"D\") && rs.getString(6).equals(\"\")) {\n //VHF\n PreparedStatement pstBalise = con.prepareStatement(\"(SELECT latitude, longitude from vor where identifiant=? and icaoCode=?)UNION(SELECT latitude,longitude from vorDme where identifiant=? and icaoCode=?)UNION(SELECT latitude,longitude from dme where identifiant=? and icaoCode=?)UNION(SELECT latitude,longitude from tacan where identifiant=? and icaoCode=?)UNION(SELECT latitude,longitude from ilsdme where identifiant=? and icaoCode=?)\");\n pstBalise.setString(1, rs.getString(3));\n pstBalise.setString(2, rs.getString(4));\n pstBalise.setString(3, rs.getString(3));\n pstBalise.setString(4, rs.getString(4));\n pstBalise.setString(5, rs.getString(3));\n pstBalise.setString(6, rs.getString(4));\n pstBalise.setString(7, rs.getString(3));\n pstBalise.setString(8, rs.getString(4));\n pstBalise.setString(9, rs.getString(3));\n pstBalise.setString(10, rs.getString(4));\n rsBalise = pstBalise.executeQuery();\n if (rsBalise.next()) {\n couple.add(new LatitudeLongitude(rsBalise.getString(1), rsBalise.getString(2)));\n System.out.println(\"VHF\" + rs.getString(2));\n }\n rsBalise.close();\n pstBalise.close();\n\n\n }\n\n } else {\n System.out.println(\"fix identifier vide\");\n }\n sequenceNumber = rs.getString(9);\n System.out.println(\"FIN\");\n } while (rs.next());\n\n PreparedStatement ajoutSid = con.prepareStatement(\"INSERT INTO appr (runwayIdentifiant, typeApproche, aeroportIdentifiant, icaoCode, premierPoint ,balises) VALUES (?,CAST(? AS typeAppr),?,?,?,?)\");\n ajoutSid.setString(1, runwayIdentifiant);\n ajoutSid.setString(2, runwayIdentifiant.substring(0, 1));\n ajoutSid.setString(3, aeroport);\n ajoutSid.setString(4, icaoCode);\n ajoutSid.setString(5, premierPoint);\n\n String[][] tab = new String[couple.size()][2];\n for (int i = 0; i < couple.size(); i++) {\n tab[i][0] = couple.get(i).getLatitude();\n tab[i][1] = couple.get(i).getLongitude();\n }\n\n Array arraySql = con.createArrayOf(\"text\", tab);\n ajoutSid.setArray(6, arraySql);\n ajoutSid.executeUpdate();\n couple.clear();\n\n rs.close();\n pst.close();\n\n\n } catch (SQLException ex) {\n Logger.getLogger(Approche.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n\n }", "private void insertData() {\n \n for (int i = 0; i < 3; i++) {\n ClienteEntity editorial = factory.manufacturePojo(ClienteEntity.class);\n em.persist(editorial);\n ClienteData.add(editorial);\n }\n \n for (int i = 0; i < 3; i++) {\n ContratoPaseoEntity paseo = factory.manufacturePojo(ContratoPaseoEntity.class);\n em.persist(paseo);\n contratoPaseoData.add(paseo);\n }\n \n for (int i = 0; i < 3; i++) {\n ContratoHotelEntity editorial = factory.manufacturePojo(ContratoHotelEntity.class);\n em.persist(editorial);\n contratoHotelData.add(editorial);\n }\n \n for (int i = 0; i < 3; i++) {\n PerroEntity perro = factory.manufacturePojo(PerroEntity.class);\n //perro.setCliente(ClienteData.get(0));\n //perro.setEstadias((List<ContratoHotelEntity>) contratoHotelData.get(0));\n //perro.setPaseos((List<ContratoPaseoEntity>) contratoPaseoData.get(0));\n em.persist(perro);\n Perrodata.add(perro);\n }\n\n }", "private void initValues() {\n this.closeConnection();\n this.agregarRol = false;\n rutRoles = null; rutRoles = new Vector(); rutRoles.clear();\n deudasContribuyente = null; deudasContribuyente = new Vector(); deudasContribuyente.clear();\n rutRolesConsultados = null; rutRolesConsultados = new HashMap(); rutRolesConsultados.clear();\n param = null; param = new HashMap(); param.clear();\n\n demandasContribuyente = null; demandasContribuyente = new Vector(); demandasContribuyente.clear();\n demandaSeleccionada=null; demandaSeleccionada= new Long(-1);\n\n\n this.conveniosMasivo = null;\n\n porcentajeCuotaContado = null; porcentajeCuotaContado = new Long(0);\n porcentajeCondonacion = null; porcentajeCondonacion = new Long(0);\n pagoContado = null; pagoContado = new Long(0);\n numeroCuotas = null; numeroCuotas = new Long(0);\n totalPagar = null; totalPagar = new Long(0);\n totalPagarConCondonacion = null; totalPagarConCondonacion = new Long(0);\n arregloDeudas=\"\";\n tipoPago=1;\n estadoCobranza=\"T\";\n codigoPropuesta = new Long(0);\n codigoFuncionario = new Long(0);\n idTesoreria = new Long(0);\n liquidada = false;\n }", "public static void instanciarCreencias() {\n\t\tfor(int i =0; i < GestorPartida.getContJugadores(); i++) {\n\t\t\t\n\t\t\tGestorPartida.jugadores[i].setCreencias(new Creencias(GestorPartida.jugadores, GestorPartida.objetoJugador, GestorPartida.objetoSala, i)); \n\t\t}\n\t}", "public void insertar(){\n /*este for lo que hace es que se va a repetir\n dependiendo el tamaņo de la variable \"tamano\"\n */\n for (int i = 0; i < tamano; i++) {\n //Este metodo lo que hace es generar numeros aleatorios del 1 al 100\n vectorpila[i]=(int) (Math.random() *100+1);\n //Aqui aumenta el valor de cima\n cima++;\n }\n System.out.println(\"Pila llena\");\n }", "public boolean crearRegistro(int codigoCiclo, int codigoPlan, int codigoObjetivo, String descripcion, String justificacion, double valorMeta, double valorMinimo, double valorMaximo, String tipoMedicion, String estado, String fuenteDato, String aplicaEn, String unidadMedida, String tipoGrafica, String mes01, String mes02, String mes03, String mes04, String mes05, String mes06, String mes07, String mes08, String mes09, String mes10, String mes11, String mes12, Collection arrResponsables, Collection arrRecursos, String usuarioInsercion) {\n/* 664 */ int elSiguiente = siguienteRegistro(codigoCiclo, codigoPlan);\n/* 665 */ if (elSiguiente == 0) {\n/* 666 */ return false;\n/* */ }\n/* */ \n/* */ try {\n/* 670 */ String s = \"insert into cal_plan_metas (codigo_ciclo,codigo_plan,codigo_meta,codigo_objetivo,descripcion,justificacion,valor_meta,valor_minimo,valor_maximo,tipo_medicion,estado,fuente_dato,aplica_en,unidad_medida,tipo_grafica,mes01,mes02,mes03,mes04,mes05,mes06,mes07,mes08,mes09,mes10,mes11,mes12,fecha_insercion,usuario_insercion) values (\" + codigoCiclo + \",\" + \"\" + codigoPlan + \",\" + \"\" + elSiguiente + \",\" + \"\" + codigoObjetivo + \",\" + \"'\" + descripcion + \"',\" + \"'\" + justificacion + \"',\" + \"\" + valorMeta + \",\" + \"\" + valorMinimo + \",\" + \"\" + valorMaximo + \",\" + \"'\" + tipoMedicion + \"',\" + \"'\" + estado + \"',\" + \"'\" + fuenteDato + \"',\" + \"'\" + aplicaEn + \"',\" + \"'\" + unidadMedida + \"',\" + \"'\" + tipoGrafica + \"',\" + \"'\" + mes01 + \"',\" + \"'\" + mes02 + \"',\" + \"'\" + mes03 + \"',\" + \"'\" + mes04 + \"',\" + \"'\" + mes05 + \"',\" + \"'\" + mes06 + \"',\" + \"'\" + mes07 + \"',\" + \"'\" + mes08 + \"',\" + \"'\" + mes09 + \"',\" + \"'\" + mes10 + \"',\" + \"'\" + mes11 + \"',\" + \"'\" + mes12 + \"',\" + \"\" + Utilidades.getFechaBD() + \",\" + \"'\" + usuarioInsercion + \"'\" + \")\";\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 731 */ boolean rta = this.dat.executeUpdate(s);\n/* */ \n/* */ \n/* 734 */ if (rta) {\n/* */ \n/* 736 */ s = \"delete from cal_plan_recursos_meta where codigo_ciclo=\" + codigoCiclo + \" and codigo_plan=\" + codigoPlan + \" and codigo_meta=\" + elSiguiente;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 742 */ this.dat.executeUpdate(s);\n/* 743 */ Iterator iterator = arrRecursos.iterator();\n/* 744 */ while (iterator.hasNext()) {\n/* 745 */ Integer codigo = (Integer)iterator.next();\n/* 746 */ crearRecurso(codigoCiclo, codigoPlan, elSiguiente, codigo.intValue(), \"A\", usuarioInsercion);\n/* */ } \n/* 748 */ s = \"delete from cal_plan_responsables_meta where codigo_ciclo=\" + codigoCiclo + \" and codigo_plan=\" + codigoPlan + \" and codigo_meta=\" + elSiguiente + this.dat.executeUpdate(s);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 756 */ Iterator iterator2 = arrResponsables.iterator();\n/* 757 */ while (iterator2.hasNext()) {\n/* 758 */ Integer codigo = (Integer)iterator2.next();\n/* 759 */ crearResponsable(codigoCiclo, codigoPlan, elSiguiente, codigo.intValue(), \"A\", usuarioInsercion);\n/* */ } \n/* */ } \n/* */ \n/* 763 */ return rta;\n/* */ }\n/* 765 */ catch (Exception e) {\n/* 766 */ e.printStackTrace();\n/* 767 */ Utilidades.writeError(\"%CalMetasDAO:crearRegistro \", e);\n/* */ \n/* 769 */ return false;\n/* */ } \n/* */ }", "public void inicializar() {\n\t\tarestas.forEach(aresta -> {\n\t\t\taresta.getOrigin().atribuirPesoInicial();\n\t\t\taresta.getTarget().atribuirPesoInicial();\n\t\t});\n\t}", "public void inserer(T val) {\r\n\r\n\t\tif (this.estVide() == true) {\r\n\r\n\t\t\tCellule<T> cel = new Cellule<T>(val);\r\n\t\t\tthis.tete = cel;\r\n\t\t\tthis.queue = cel;\r\n\t\t}\r\n\r\n\t\telse {\r\n\r\n\t\t\t// attention on insere a gauche\r\n\r\n\t\t\tCellule<T> anciennequeue = this.queue;\r\n\t\t\tCellule<T> nouvellequeue = new Cellule<T>(val);\r\n\t\t\tanciennequeue.setSuivant(nouvellequeue);\r\n\t\t\tthis.queue = nouvellequeue;\r\n\t\t}\r\n\t}", "public void insertarCelulaEnArrays(int fila, int columna) {\r\n\t\t\t\t\t\r\n\t\tboolean celulaColocada = false;\r\n\t\tint contador = 0;\r\n\t\t\t\r\n\t\twhile((!celulaColocada) && (contador < numeroDeCelulasEnSuperficie)) {\r\n\t\t\t\t\t\t\r\n\t\t\t// Comparar la fila.\r\n\t\t\tif(fila < filasDeCelulas[contador]) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t// Desplazamos a la derecha.\r\n\t\t\t\tdesplazarALaDerecha(contador, numeroDeCelulasEnSuperficie);\r\n\t\t\t\t\t\t\r\n\t\t\t\t// Insertamos el nuevo en la posicion contador(el hueco que ha quedado al desplazar lo otro a la derecha).\r\n\t\t\t\tcelulaColocada = anadirPosFilaYColumnaDeLaCelulaAlArrayDeCelulas(fila, columna, contador);\r\n\t\t\t}\r\n\t\t\telse if(fila == filasDeCelulas[contador]) {\r\n\t\t\t\t// Si son iguales comparamos las columnas.\r\n\t\t\t\tif(columna < columnasDeCelulas[contador]) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t// Desplazamos a la derecha.\r\n\t\t\t\t\tdesplazarALaDerecha(contador, numeroDeCelulasEnSuperficie);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t// Insertamos el nuevo en la posicion contador(el hueco que ha quedado al desplazar lo otro a la derecha).\r\n\t\t\t\t\tcelulaColocada = anadirPosFilaYColumnaDeLaCelulaAlArrayDeCelulas(fila, columna, contador);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t// Actualizamos el contador.\r\n\t\t\tcontador++;\r\n\t\t\t\t\t\t\r\n\t\t}\r\n\r\n\t\tif(!celulaColocada) {\r\n\t\t\tcelulaColocada = anadirPosFilaYColumnaDeLaCelulaAlArrayDeCelulas(fila, columna, contador);\r\n\t\t}\r\n\t\t\t\r\n\t\t// Hay una celula mas.\r\n\t\tnumeroDeCelulasEnSuperficie++;\r\n\t}", "public int asignacionMemoriaFlotante(float value){\n memoriaFlotante[flotanteActual] = value;\n flotanteActual++;\n return inicioMem + tamMem + flotanteActual - 1;\n }", "public double alugar(Cliente cliente, Usuario usuario, Date dataAluguel, List<Filme> filmes) \n throws AluguelPendenteException, QuantidadeFilimesException, ClassificacaoIndicativaException, Exception{\n if(filmes.size() > 3){\n throw new QuantidadeFilimesException();\n }\n \n if(this.buscarAluguelPendente(cliente) != null){\n throw new AluguelPendenteException();\n }\n \n //Salvando o aluguel para depois salvar os filmes para esse aluguel\n Double valor = 0D;\n for(Filme filme : filmes){\n //Verificando idade do cliente. Passa o filme para a exceção para que saiba qual está fora da idade\n if(filme.getClassificacao() > cliente.getIdade()){\n throw new ClassificacaoIndicativaException(filme);\n }\n valor += filme.getPreco();\n }\n StringBuilder sql = new StringBuilder();\n sql.append(\" INSERT INTO aluguel(id, data_aluguel, cliente_id, valor, operador_id) \");\n sql.append(\" VALUES (?, ?, ?, ?, ?)\");\n \n Connection connection = ConexaoUtil.getConnection();\n Long idAluguel = this.obterNovoId(connection);\n PreparedStatement preparedStatement = connection.prepareStatement(sql.toString());\n preparedStatement.setLong(1, idAluguel);\n preparedStatement.setTimestamp(2, new Timestamp(dataAluguel.getTime()));\n preparedStatement.setLong(3, cliente.getId());\n preparedStatement.setDouble(4, valor);\n preparedStatement.setLong(5, 0);\n preparedStatement.execute();\n \n sql.setLength(0);\n \n sql.append(\" INSERT INTO aluguel_filme (aluguel_id, filme_id) VALUES (?, ?)\");\n preparedStatement = connection.prepareStatement(sql.toString());\n for(Filme filme : filmes){\n preparedStatement.setLong(1, idAluguel);\n preparedStatement.setLong(2, filme.getId());\n preparedStatement.addBatch();\n }\n preparedStatement.executeBatch();\n preparedStatement.close();\n connection.close();\n \n Aluguel aluguelSalvo = new Aluguel(idAluguel, dataAluguel,filmes, cliente, valor, usuario);\n double preco=0;\n for(Filme filme :filmes){\n preco += filme.getPreco();\n }\n return preco;\n }", "public void afegirPosicio() {\n\t\tfor(int i=0; i<cal.length; ++i){\n\t\t\tcal[i] = new Dia(false);\n\t\t\tfor(int j=0; j<3; ++j) cal[i].getTorns()[j].setPosicio(i);\n\t\t}\n\t}", "boolean insertar(Nodo_B nuevo){\n if(this.primero == null){\n this.primero = nuevo;\n this.ultimo = nuevo;\n size ++;\n return true;\n }else{\n if(this.primero == this.ultimo){ // -------------------------solo hay un nodo \n if(nuevo.valor < this.primero.valor){\n nuevo.siguiente = this.primero;\n this.primero.anterior = nuevo;\n this.primero.izq = nuevo.der; // -----cambia los punteros a las paginas\n this.primero = nuevo;\n size++; \n return true;\n }else if(nuevo.valor > this.ultimo.valor){\n this.ultimo.siguiente = nuevo;\n nuevo.anterior = this.ultimo;\n this.ultimo.der = nuevo.izq; //------ cambia los punteros a las paginas \n this.ultimo = nuevo;\n size++; \n return true;\n }else{\n System.out.println (\"ya hay un destino con ese codigo registrado\");\n return false;\n }\n }else{ // ---------------------------------------------------hay mas de un nodo\n if(nuevo.valor < this.primero.valor){\n nuevo.siguiente = this.primero;\n this.primero.anterior = nuevo;\n this.primero.izq = nuevo.der; // -----cambia los punteros a las paginas\n this.primero = nuevo;\n size++; \n return true;\n }else if(nuevo.valor > this.ultimo.valor){\n this.ultimo.siguiente = nuevo;\n nuevo.anterior = this.ultimo;\n this.ultimo.der = nuevo.izq; //------ cambia los punteros a las paginas \n this.ultimo = nuevo;\n size++; \n return true;\n }else{\n Nodo_B pivote = this.primero;\n while(pivote != null){\n if(nuevo.valor < pivote.valor){\n nuevo.siguiente = pivote;\n nuevo.anterior = pivote.anterior;\n //--------------------------- cambia los punteros a las paginas\n pivote.izq = nuevo.der;\n pivote.anterior.der = nuevo.izq;\n //-----------------------------------------------------------\n pivote.anterior.siguiente = nuevo;\n pivote.anterior = nuevo;\n size++;\n return true;\n }else if(nuevo.valor == pivote.valor){\n System.out.println (\"ya hay un destino con ese codigo registrado\");\n return false;\n }else{\n pivote = pivote.siguiente;\n }\n }\n }\n }\n }\n return false;\n }", "public long reserva_de_entradas(int identificador_evento, Date fechaevento, Horario[] listahorarios ) throws ParseException {\n fgen.info (\"Identificador del evento\" + identificador_evento);\n fgen.info (\"Fecha del evento\" + fechaevento);\n ArrayList<Horario> horariosReserva = new ArrayList<Horario>();\n for (int i = 0; i < listahorarios.length; i++) {\n \n Horario horario = listahorarios[i];\n fgen.info (\"Horario : \" + horario.getHorario().toString()); \n horariosReserva.add(horario);\n List<Disponibilidad> listadisponibles = listahorarios[i].disponibilidades;\n for (int j = 0; j < listadisponibles.size() ; j++) { \n fgen.info (\" Disponibilidad - Cantidad: \" + listadisponibles.get(j).getCantidad());\n fgen.info (\" Disponibilidad - Precio: \" + listadisponibles.get(j).getPrecio());\n fgen.info (\" Disponibilidad - Sector: \" + listadisponibles.get(j).getSector());\n } \n \n \n } \n //Inicializo o tomo lo que esta en memoria de la lista de reservas\n ListaReservas reservas= new ListaReservas(); \n // busco el evento y que la lista de horarios sea en la que quiero reservar\n ListaEventos eventos = new ListaEventos();\n Calendar c = Calendar.getInstance();\n c.setTime(fechaevento);\n Evento e = eventos.buscarEvento(identificador_evento, c);\n List<Horario> horariosRetornar = new ArrayList<Horario>();\n if(e != null)\n {\n horariosRetornar = e.getHorarios();\n } \n \n if (horariosRetornar != null)\n {\n for (int i = 0; i < horariosRetornar.size(); i++) {\n for (int j = 0; j < listahorarios.length; j++) {\n Date fechaE = horariosRetornar.get(i).getHorario().getTime(); \n Date fechaEventoDate = listahorarios[j].hora.getTime(); \n if(fechaE.equals(fechaEventoDate)) \n { for (int k = 0; k < horariosRetornar.get(i).disponibilidades.size(); k++) {\n for (int l = 0; l < listahorarios[j].disponibilidades.size(); l++) {\n Disponibilidad d= horariosRetornar.get(i).disponibilidades.get(k);\n Disponibilidad r= listahorarios[j].disponibilidades.get(l);\n if (d.cantidad >= r.cantidad && d.sector.equalsIgnoreCase(r.sector) && d.precio==r.precio)\n {\n d.setCantidad(d.cantidad-r.cantidad);\n //Reserva reserv= new Reserva();\n //reservas.contador_Id= reservas.contador_Id +1;\n //reserv.idReserva= reservas.contador_Id;\n //reserv.Estado=1;\n //reserv.idEvento = identificador_evento;\n //reserv.horarios.add(listahorarios[j]);\n //reservas.listaReserva.add(reserv);\n //return reserv.idReserva;\n }\n else if(d.cantidad < r.cantidad && d.sector.equalsIgnoreCase(r.sector) && d.precio==r.precio)\n {\n //Si hay alguna solicitud de de reserva que no se pueda cumplir. Re reorna 0.\n //TODO: Hay que volver para atras las cantidades modificadas.\n return 0;\n }\n \n }\n \n }\n }\n }\n }\n Reserva reserv= new Reserva();\n reservas.contador_Id= reservas.contador_Id +1;\n reserv.idReserva= reservas.contador_Id;\n reserv.Estado=1;\n reserv.idEvento = identificador_evento;\n reserv.horarios = horariosReserva;\n reserv.fechaEvento = c;\n reservas.listaReserva.add(reserv);\n return reserv.idReserva;\n }\n \n return 0;\n }", "public void insertarAlimento (int id_alimento, String nombre, String estado, float caloria, float proteinas,float grasas, float hidratos_de_carbono, float H20, float NE, float vitamina_a, float vitamina_B1, float vitamina_B2, float vitamina_C, float Niac, float sodio, float potasio, float calcio, float magnesio, float cobre, float hierro, float fosforo, float azufre, float cloro, float Fen, float Ileu, float Leu, float Lis, float Met, float Tre, float Tri, float Val, float Acid, float AlCAL);", "public RespuestaBD crearRegistro(int codigoFlujo, int secuencia, int servicioInicio, int accion, int codigoEstado, int servicioDestino, String nombreProcedimiento, String correoDestino, String enviar, String mismoProveedor, String mismoCliente, String estado, int caracteristica, int caracteristicaValor, int caracteristicaCorreo, String metodoSeleccionProveedor, String indCorreoCliente, String indHermana, String indHermanaCerrada, String indfuncionario, String usuarioInsercion) {\n/* 342 */ RespuestaBD rta = new RespuestaBD();\n/* */ \n/* 344 */ int elSiguiente = siguienteRegistro(codigoFlujo);\n/* 345 */ if (elSiguiente == 0) {\n/* 346 */ rta.setMensaje(\"Generando secuencia\");\n/* 347 */ return rta;\n/* */ } \n/* */ \n/* */ try {\n/* 351 */ String s = \"insert into wkf_detalle(codigo_flujo,secuencia,servicio_inicio,accion,codigo_estado,servicio_destino,nombre_procedimiento,correo_destino,enviar_solicitud,ind_mismo_proveedor,ind_mismo_cliente,estado,caracteristica,valor_caracteristica,caracteristica_correo,metodo_seleccion_proveedor,ind_correo_clientes,enviar_hermana,enviar_si_hermana_cerrada,ind_cliente_inicial,usuario_insercion,fecha_insercion) values (\" + codigoFlujo + \",\" + \"\" + elSiguiente + \",\" + \"\" + servicioInicio + \",\" + \"\" + accion + \",\" + \"\" + codigoEstado + \",\" + \"\" + ((servicioDestino == 0) ? \"null\" : Integer.valueOf(servicioDestino)) + \",\" + \"'\" + nombreProcedimiento + \"',\" + \"'\" + correoDestino + \"',\" + \"'\" + enviar + \"',\" + \"'\" + mismoProveedor + \"',\" + \"'\" + mismoCliente + \"',\" + \"'\" + estado + \"',\" + ((caracteristica == 0) ? \"null\" : (\"\" + caracteristica)) + \",\" + ((caracteristicaValor == 0) ? \"null\" : (\"\" + caracteristicaValor)) + \",\" + ((caracteristicaCorreo == 0) ? \"null\" : (\"\" + caracteristicaCorreo)) + \",\" + ((metodoSeleccionProveedor.length() == 0) ? \"null\" : (\"'\" + metodoSeleccionProveedor + \"'\")) + \",\" + ((indCorreoCliente.length() == 0) ? \"null\" : (\"'\" + indCorreoCliente + \"'\")) + \",\" + ((indHermana.length() == 0) ? \"null\" : (\"'\" + indHermana + \"'\")) + \",\" + ((indHermanaCerrada.length() == 0) ? \"null\" : (\"'\" + indHermanaCerrada + \"'\")) + \",\" + ((indfuncionario.length() == 0) ? \"null\" : (\"'\" + indfuncionario + \"'\")) + \",\" + \"'\" + usuarioInsercion + \"',\" + \"\" + Utilidades.getFechaBD() + \"\" + \")\";\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 398 */ rta = this.dat.executeUpdate2(s);\n/* 399 */ rta.setSecuencia(elSiguiente);\n/* */ }\n/* 401 */ catch (Exception e) {\n/* 402 */ e.printStackTrace();\n/* 403 */ Utilidades.writeError(\"%FlujoDetalleDAO:crearRegistro \", e);\n/* 404 */ rta.setMensaje(e.getMessage());\n/* */ } \n/* 406 */ return rta;\n/* */ }", "private void dibujarPuntos() {\r\n for (int x = 0; x < 6; x++) {\r\n for (int y = 0; y < 6; y++) {\r\n panelTablero[x][y].add(obtenerIcono(partida.getTablero()\r\n .getTablero()[x][y].getColor()));\r\n }\r\n }\r\n }", "public static void crearTicket(int codigoSupermercado, ArrayList <LineaCompra> lineasTicket, String nif ) throws SQLException{\n double precioTotal=0;\n for(int i=0;i<lineasTicket.size();i++){\n precioTotal+=lineasTicket.get(i).getPrecio_linea();\n }\n Ticket t1=new Ticket(codigoSupermercado, precioTotal, lineasTicket);\n LocalDate fecha=t1.getFechaCompra();\n LocalTime hora=t1.getHoraCompra();\n DateTimeFormatter formatoFecha=DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\n DateTimeFormatter formatoHora=DateTimeFormatter.ofPattern(\"HH:mm\");\n try(PreparedStatement query=Herramientas.getConexion().prepareStatement(\"INSERT INTO ticket VALUES(?,?,?,?,?,?)\")){\n query.setInt(1, t1.getCodigo());\n query.setString(2, nif);\n query.setInt(3, t1.getCodigoSupermercado());\n query.setString(4, fecha.format(formatoFecha));\n query.setString(5, hora.format(formatoHora));\n query.setDouble(6, t1.getPrecioTotal());\n query.executeUpdate();\n for(int i=0;i<lineasTicket.size();i++){\n try(PreparedStatement query2=Herramientas.getConexion().prepareStatement(\"INSERT INTO linea_ticket VALUES(?,?,?,?,?)\")){\n query2.setInt(1, t1.getCodigo());\n query2.setInt(2, lineasTicket.get(i).getCodigo_producto());\n query2.setInt(3, lineasTicket.get(i).getCantidad());\n query2.setDouble(4, lineasTicket.get(i).getPrecio_linea());\n try (PreparedStatement query3 = Herramientas.getConexion().prepareStatement(\"SELECT nombre_producto FROM producto WHERE codigo_producto=?\")) {\n query3.setInt(1, lineasTicket.get(i).getCodigo_producto());\n try (ResultSet resultado = query3.executeQuery()) {\n resultado.next();\n query2.setString(5, resultado.getString(1));\n }\n }\n query2.executeUpdate();\n }\n }\n }\n }", "public void guardarfuncionarios() throws SQLException\n\t{\n\t\tSystem.out.println(\"Guardando funcionarios \");\n\t\t PreparedStatement pstmt = null;\n\t\t \n\n\t\t try {\n\t\t \n\t\t \t\n\t\t \n\n\t\t String query = \"INSERT INTO funcionarios( legajo, fecha_ingreso, titular, departamento, telefono, activo) \" + \n\t\t \t\t \t\t\" VALUES (?, ?, ?, ?, ?, ?)\";\n\n\t\t pstmt = (PreparedStatement) conPostgres.prepareStatement(query); // create a statement\n\t\t pstmt.setInt(1, Integer.parseInt(this.txtLegajo.getText())); // set input parameter 1\n\t\t String [] datosFecha = this.txtFechaIngreso.getText().split(\"-\");\n\t\t System.out.println(\"Fechas \" + this.txtFechaIngreso.getText());\n\t\t String startDate= datosFecha[2] + \"-\" + datosFecha[1] + \"-\" + datosFecha[0];\n\t\t //java.sql.Date theDate = new java.sql.Date(Integer.parseInt(startDate.substring(6, 10))- 1900, Integer.parseInt(startDate.substring(3, 5))-1,Integer.parseInt(startDate.substring(0, 2)));\n\t\t java.sql.Date theDate = java.sql.Date.valueOf(startDate);\n\t\t pstmt.setDate(2,theDate); // set input parameter 2\n\t\t pstmt.setString(3, this.txtTitular.getText()); // set input parameter 3\n\t\t pstmt.setString(4, this.txtDepartamento.getText()); // set input parameter 3\n\t\t pstmt.setString(5, this.txtTelefono.getText()); // set input parameter 3\n\t\t pstmt.setString(6, this.listaActivo.getSelectedItem().toString()); // set input parameter 3\t\t \n\t\t pstmt.executeUpdate(); // execute insert statement\n\t\t } catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t } finally {\n\t\t pstmt.close();\n\t\t //conn.close();\n\t\t }\t\t\n\t}", "public void insereDadosMySQL(String tabela, String colunas, boolean matricula, boolean data, boolean brasao2) throws IOException {\n status = true;\n ByteArrayOutputStream bytesImg = new ByteArrayOutputStream();\n ImageIO.write((BufferedImage) imagemRedimensionada, extensao, bytesImg);\n bytesImg.flush();\n byte[] logo = bytesImg.toByteArray();\n bytesImg.close();\n /**\n * Transforma a imagem do logotipo e brasao em um array de bytes para enviar ao banco de dados\n */\n byte[] brasao = null;\n if (brasao2) {\n ByteArrayOutputStream bytesImg2 = new ByteArrayOutputStream();\n ImageIO.write((BufferedImage) imagemRedimensionada2, extensao2, bytesImg2);\n bytesImg2.flush();\n brasao = bytesImg2.toByteArray();\n bytesImg2.close();\n }\n\n String[] aux = colunas.split(\",\");\n String values = \"?\";\n for (int i = 0; i < aux.length - 1; i++) {\n values += \",?\";\n }\n try {\n PreparedStatement p = conexao.prepareStatement(\"INSERT INTO \" + tabela + \"(\" + colunas + \") VALUES (\" + values + \")\");\n // System.out.println(\"INSERT INTO \" + tabela + \"(\" + colunas + \") VALUES (\" + values + \")\");\n p.setString(1, dadosTitulo);\n p.setString(2, dados);\n p.setString(3, dados2);\n p.setString(4, dados3);\n if (matricula) {\n p.setString(5, this.matricula.getText());\n if (data) {\n p.setDate(6, new java.sql.Date(dataProva.getDate().getTime()));\n p.setString(7, arquivo.getName());\n p.setBytes(8, logo);\n if (brasao2) {\n p.setString(9, arquivo2.getName());\n p.setBytes(10, brasao);\n }\n } else {\n p.setDate(6, new java.sql.Date(dataRecebimento.getDate().getTime()));\n p.setDate(7, new java.sql.Date(dataEntrega.getDate().getTime()));\n p.setString(8, arquivo.getName());\n p.setBytes(9, logo);\n if (brasao2) {\n p.setString(10, arquivo2.getName());\n p.setBytes(11, brasao);\n }\n }\n } else {\n if (data) {\n p.setDate(5, new java.sql.Date(dataProva.getDate().getTime()));\n p.setString(6, arquivo.getName());\n p.setBytes(7, logo);\n if (brasao2) {\n p.setString(8, arquivo2.getName());\n p.setBytes(9, brasao);\n }\n } else {\n p.setDate(5, new java.sql.Date(dataRecebimento.getDate().getTime()));\n p.setDate(6, new java.sql.Date(dataEntrega.getDate().getTime()));\n p.setString(7, arquivo.getName());\n p.setBytes(8, logo);\n if (brasao != null) {\n p.setString(9, arquivo2.getName());\n p.setBytes(10, brasao);\n }\n }\n }\n p.executeUpdate();\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n // System.out.println(\"catch 2\");\n }\n }", "public void processInsertar() {\n }", "private void enviaPct(int[] dados) {\n ByteBuffer byteBuffer = ByteBuffer.allocate(dados.length * 4);\n IntBuffer intBuffer = byteBuffer.asIntBuffer();\n intBuffer.put(dados);\n\n byte[] buffer = byteBuffer.array();\n\n try {\n //System.out.println(\"Semaforo: \"+sem.availablePermits());\n sem.acquire();\n //System.out.println(\"Semaforo: \"+sem.availablePermits());\n\n InetAddress address = InetAddress.getByName(\"localhost\");\n try (DatagramSocket datagramSocket = new DatagramSocket(portaLocalEnvio)) {\n DatagramPacket packet = new DatagramPacket(\n buffer, buffer.length, address, portaDestino);\n\n datagramSocket.send(packet);\n }\n\n System.out.println(\"Envio feito.\");\n } catch (SocketException ex) {\n Logger.getLogger(EnviaDados.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException | InterruptedException ex) {\n Logger.getLogger(EnviaDados.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private static void pruebas() {\n\t\tResultadosDaoImpl resultadosDao = new ResultadosDaoImpl();\r\n\t\tPartidosDaoImpl partidosDao = new PartidosDaoImpl();\r\n\t\tEquiposDaoImpl equiposDao = new EquiposDaoImpl();\r\n\t\tJornadasDaoImpl jornadasDao = new JornadasDaoImpl();\r\n\t\tEstadisticasDaoImpl estadisticasDao = new EstadisticasDaoImpl();\r\n\t\t\r\n//\t\tLong goles = resultadosDao.getGolesTotalesCasa();\r\n\t\t\r\n\t\tEquipos equipoC = equiposDao.getEquipoById(7);\r\n\t\tEquipos equipoF = equiposDao.getEquipoById(6);\r\n\t\tJornadas jornada = jornadasDao.nextJornada();\r\n//\t\t\r\n//\t\tpartidosDao.getPartidosCasa(equipo,jornada);\r\n\t\t\r\n//\t\tLong goles = resultadosDao.getGolesFavorCasa(equipo);\r\n\t\t\r\n//\t\tLong goles = resultadosDao.getGolesContraFuera(equipo);\r\n//\t\tdouble phiVM = staticsC.getValorMercado() / (estadisticasDao.getValorMercadoMedio());\r\n\t\t\r\n\t\tEstadisticas staticsC = estadisticasDao.getStatics(equipoC);\r\n\t\tEstadisticas staticsF = estadisticasDao.getStatics(equipoF);\r\n\t\t\r\n\t\tDouble phiF = PlayMethods.analizeStaticsFuera(staticsF,staticsC,jornada);\r\n\t\tDouble phiC = PlayMethods.analizeStaticsCasa(staticsC,staticsF,jornada);\r\n\t\t\r\n\t\t\r\n\t}", "public void reinicio() {\n iNumBloques = 54; // se reinicia la cantidad de bloques\n iNivel = 1; // vuelve al nivel 1\n iScore = 0; // se reinicia el score\n iVidas = 3; // se reinicia la cantidad de vidas\n // La direccion del proyectil sera para arriba\n bDireccionY = false;\n // la direccion del proyectil sera al contrario de donde iba\n bDireccionX = !bDireccionX;\n // Se reposiciona el proyectil\n objProyectil.reposiciona((objBarra.getX() + objBarra.getAncho() / 2\n - (objProyectil.getAncho() / 2)), (objBarra.getY()\n - objProyectil.getAlto()));\n // Se reincia la velocidad del proyectil\n objProyectil.setVelocidad(5);\n // Se reposiciona la barra\n objBarra.reposiciona(((getWidth() / 2)\n - (objProyectil.getAncho() / 2)), (getHeight()\n - objBarra.getAlto()));\n // se limpia la lista de bloques\n lnkBloques.clear();\n // se vuelve a llenar y se acomoda\n try {\n acomodaBloques();\n } catch (IOException ioeError) {\n System.out.println(\"Hubo un error al cargar el juego: \"\n + ioeError.toString());\n }\n }", "public int grabarFacturaCompleta(Factura fac) {\n\t\tArrayList<String> listaSQLs = new ArrayList<>();\r\n\t\tint respuesta = -1;\r\n\t\tString sql = \"\";\r\n\t\tif (fac.getId()==0) {\r\n\t\t\tsql += \"INSERT INTO facturas SET \" +\r\n\t\t\t\t\t\"facturas.clienteId = \" + fac.getClienteId() + \", \" +\r\n\t\t\t\t\t\"facturas.nombreCliente = \" + fac.getNombreCliente() + \", \" +\r\n\t\t\t\t\t\"facturas.numero = \" + fac.getNumero() + \", \" +\r\n\t\t\t\t\t\"facturas.fecha = '\" + Utilidades.fechaToSQL(fac.getFecha()) + \"', \" +\r\n\t\t\t\t\t\"facturas.porcDescuento = \" + fac.getPorcDescuento() + \", \" +\r\n\t\t\t\t\t\"facturas.porcRecargoEquivalencia = \" + fac.getPorcRecargoEquivalencia() + \", \" +\r\n\t\t\t\t\t\"facturas.impTotal = \" + fac.getImpTotal() + \", \" +\r\n\t\t\t\t\t\"facturas.impRecargo = \" + fac.getImpRecargo() + \", \" +\r\n\t\t\t\t\t\"facturas.impIva = \" + fac.getImpIva() + \", \" +\r\n\t\t\t\t\t\"facturas.dirCorreo = '\" + fac.getDirCorreo() + \"', \" +\r\n\t\t\t\t\t\"facturas.dirFactura = '\" + fac.getDirFactura() + \"', \" +\r\n\t\t\t\t\t\"facturas.dirEnvio = '\" + fac.getDirEnvio() + \"', \" +\r\n\t\t\t\t\t\"facturas.cobrada = \" + fac.isCobrada()\r\n\t\t\t\t\t;\r\n\t\t} else {\r\n\t\t\tsql = \"UPDATE facturas SET \" +\r\n\t\t\t\t\t\"facturas.clienteId = \" + fac.getClienteId() + \", \" +\r\n\t\t\t\t\t\"facturas.nombreCliente = \" + fac.getNombreCliente() + \", \" +\r\n\t\t\t\t\t\"facturas.numero = \" + fac.getNumero() + \", \" +\r\n\t\t\t\t\t\"facturas.fecha = '\" + Utilidades.fechaToSQL(fac.getFecha()) + \"', \" +\r\n\t\t\t\t\t\"facturas.porcDescuento = \" + fac.getPorcDescuento() + \", \" +\r\n\t\t\t\t\t\"facturas.porcRecargoEquivalencia = \" + fac.getPorcRecargoEquivalencia() + \", \" +\r\n\t\t\t\t\t\"facturas.impTotal = \" + fac.getImpTotal() + \", \" +\r\n\t\t\t\t\t\"facturas.impRecargo = \" + fac.getImpRecargo() + \", \" +\r\n\t\t\t\t\t\"facturas.impIva = \" + fac.getImpIva() + \", \" +\r\n\t\t\t\t\t\"facturas.dirCorreo = '\" + fac.getDirCorreo() + \"', \" +\r\n\t\t\t\t\t\"facturas.dirFactura = '\" + fac.getDirFactura() + \"', \" +\r\n\t\t\t\t\t\"facturas.dirEnvio = '\" + fac.getDirEnvio() + \"', \" +\r\n\t\t\t\t\t\"facturas.cobrada = \" + fac.isCobrada() + \" \" +\r\n\t\t\t\t\t\"WHERE facturas.id = \" + fac.getId()\r\n\t\t\t\t\t;\r\n\t\t}\r\n\t\t//Preparo la lista de SLQ de los detalles\r\n\t\tfor (FacturaDetalle fd : fac.getDetalles()) {\r\n\t\t\tlistaSQLs.add(new FacturasDetallesBDD().generaSQL(fd));\r\n\t\t}\r\n\t\tSystem.out.println(listaSQLs);\r\n\t\t// CREO UNA CONEXION\r\n\t\tConnection c = new Conexion().getConection();\r\n\t\t// SI LA CONEXION ES VALIDA\r\n\t\tif (c!=null) {\r\n\t\t\t// INTENTA REALIZAR EL SQL\r\n\t\t\ttry {\r\n\t\t\t\t// Crea un ESTAMENTO (comando de ejecucion de un sql)\r\n\t\t\t\tStatement comando = c.createStatement();\r\n\t\t\t\t\r\n\t\t\t\tcomando.execute(sql);\r\n//\t\t\t\tcomando.execute(sql,Statement.RETURN_GENERATED_KEYS);\r\n//\t\t\t\t// COMPRUEBA si estamos en un Insert o en un Update\r\n//\t\t\t\tif (fac.getId() != 0){\r\n//\t\t\t\t\t// ES UN UPDATE\r\n//\t\t\t\t\trespuesta = comando.getUpdateCount()>0?0:-1;\r\n//\t\t\t\t} else {\r\n//\t\t\t\t\t// VAMOS A DEVOLVER EL ID GENERADO, pero el EXECUTE devuelve un RESULTSET\r\n//\t\t\t\t\tResultSet resultados = comando.getGeneratedKeys();\r\n//\t\t\t\t\t// Si el conjunto de resultados no es nulo, y coge el proximo elemento (el primero)\r\n//\t\t\t\t\tif (resultados!=null && resultados.next()) {\r\n//\t\t\t\t\t\trespuesta = resultados.getInt(1);\r\n//\t\t\t\t\t}\r\n//\t\t\t\t}\r\n\t\t\t\t//Vamos a generar un execute para cada Detalle de la lista;\r\n\t\t\t\tfor (String sqlDetalle : listaSQLs) {\r\n\t\t\t\t\tcomando.execute(sqlDetalle);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//CERRAMOS LA CONEXION\r\n\t\ttry {\r\n\t\t\tc.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn respuesta;\r\n\t}", "public void introducirConsumosHotelFechas(Date fechaInicial, Date fechaFinal,TablaModelo modelo) {\n long tiempo = fechaInicial.getTime();\n java.sql.Date fechaInicialSql = new java.sql.Date(tiempo);\n long tiempo2= fechaFinal.getTime();\n java.sql.Date fechaFinalSQL = new java.sql.Date(tiempo2);\n try {// mira los consumo de unas fechas\n PreparedStatement declaracion;// prepara la orden \n declaracion = conexion.prepareStatement(\"SELECT * FROM CONSUMO_RESTAURANTE WHERE Fecha_Consumo>=? AND Fecha_Consumo<=?\");\n declaracion.setDate(1,fechaInicialSql);\n declaracion.setDate(2,fechaFinalSQL);\n ResultSet resultado = declaracion.executeQuery();\n while (resultado.next()) {// mira los consumo de unas fechas\n Object objeto[] = new Object[7];\n objeto[0] = resultado.getInt(1);\n objeto[1] = resultado.getInt(2);// mira los consumo de unas fechas\n objeto[2] = resultado.getString(3);\n objeto[3] = resultado.getInt(4);\n objeto[4] = resultado.getInt(5);\n objeto[5] = resultado.getDate(6);// mira los consumo de unas fechas\n int total = (Integer)objeto[3]*(Integer)objeto[4];\n objeto[6]= total;\n modelo.addRow(objeto);// mira los consumo de unas fechas\n } // maneja el resultado \n\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }", "public void InsertarDatosDetalleReserva(String codhab, String codhue) throws Exception {\n try {\n String q = \"INSERT INTO DetalleReserva(Habitacion_idHab,Huesped_idHSP,Reserva_idReserva)\"\n + \"VALUES ('\" + codhab + \"', '\" + codhue + \"' , (SELECT IDRESERVA FROM RESERVA ORDER BY IDRESERVA DESC LIMIT 1))\";\n\n PreparedStatement pstm = this.getCon().prepareStatement(q);\n pstm.execute();\n pstm.close();\n } catch (SQLException e) {\n System.err.println(e.getMessage());\n }\n\n }", "public void generarNumeroFacura(){\n try{\n FacturaDao facturaDao = new FacturaDaoImp();\n //Comprobamos si hay registros en la tabla Factura de la BD\n this.numeroFactura = facturaDao.numeroRegistrosFactura();\n \n //Si no hay registros hacemos el numero de factura igual a 1\n if(numeroFactura <= 0 || numeroFactura == null){\n numeroFactura = Long.valueOf(\"1\");\n this.factura.setNumeroFactura(this.numeroFactura.intValue());\n this.factura.setTotalVenta(new BigDecimal(0));\n }else{\n //Recuperamos el ultimo registro que existe en la tabla Factura\n Factura factura = facturaDao.getMaxNumeroFactura();\n //Le pasamos a la variable local el numero de factura incrementado en 1\n this.numeroFactura = Long.valueOf(factura.getNumeroFactura() + 1);\n this.factura.setNumeroFactura(this.numeroFactura.intValue());\n this.factura.setTotalVenta(new BigDecimal(0));\n }\n \n \n }catch(Exception e){\n e.printStackTrace();\n }\n \n }", "private void salvarVenda(String nomeCliente, double precoFinal, double desconto ,String mesAnoAt,String dataCompra,String formaDePagamento) {\n\n\t\tFirebaseAuth autenticacion = configFireBase.getFireBaseAutenticacao();\n\n\t\tString idUsuario = Base64Custom.codificarBase64(autenticacion.getCurrentUser().getEmail());\n\t\tDatabaseReference VendaRef=mDatabase.child(\"vendas\");\n\n\n\t\tvenda.setIdVenda(VendaRef.push().getKey());\n\t\tvenda.setNomeCliente(nomeCliente);\n\t\tvenda.setValorTotal(precoFinal);\n\t\tvenda.setMesAno(mesAnoAt);\n\t\tvenda.setDesconto(desconto);\n\t\tvenda.setDataCompra(dataCompra);\n\t\tvenda.setLista(ListagemDeProdutosParaCompras.produtosSelecionados);\n\t\tvenda.setFormaDePagamento(formaDePagamento);\n\n\t\tmDatabase.child(\"armazenamento\").child(idUsuario).child(\"vendas\").child(venda.getIdVenda()).setValue(venda).addOnCompleteListener(new OnCompleteListener<Void>() {\n\n\t\t\t@Override\n\t\t\tpublic void onComplete(@NonNull Task<Void> task) {\n\n\t\t\t}\n\n\t\t});\n\n\t\tToast.makeText(CadastrarVendaActivity.this, \"Venda Realizada\", Toast.LENGTH_SHORT).show();\n\t\tstartActivity(new Intent(getApplicationContext(), ListagemDeVendasRealizadas.class));\n\t\tvenda.subtrairVendas();\n\n\t\tthis.finish();\n\t}", "com.bagnet.nettracer.ws.core.pojo.xsd.WSScanPoints insertNewScans(int i);", "public void actualizacionMemoriaFlotante(float value, int direccion){\n memoriaFlotante[direccion-inicioMem-tamMem] = value;\n }", "private void insertData() {\n\n for (int i = 0; i < 3; i++) {\n ProveedorEntity proveedor = factory.manufacturePojo(ProveedorEntity.class);\n BonoEntity entity = factory.manufacturePojo(BonoEntity.class);\n int noOfDays = 8;\n Date dateOfOrder = new Date();\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n Date date = calendar.getTime();\n entity.setExpira(date);\n noOfDays = 1;\n calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n date = calendar.getTime();\n entity.setAplicaDesde(date);\n entity.setProveedor(proveedor);\n em.persist(entity);\n ArrayList lista=new ArrayList<>();\n lista.add(entity);\n proveedor.setBonos(lista);\n em.persist(proveedor);\n pData.add(proveedor);\n data.add(entity); \n }\n }", "public void crearDepartamento(String nombredep, String num, int nvJefe, int horIn, int minIn, int horCi, int minCi) {\r\n\t\t// TODO Auto-generated method stub by carlos Sánchez\r\n\t\t//Agustin deberia devolverme algo q me indique si hay un fallo alcrearlo cual es\r\n\t\t//hazlo como mas facil te sea.Yo no se cuantos distintos puede haber.\r\n\t\r\n\t//para añadir el Dpto en la BBDD no se necesita el Nombre del Jefe\r\n\t//pero si su numero de vendedor (por eso lo he puesto como int) que forma parte de la PK \r\n\t\t\r\n\t\tint n= Integer.parseInt(num);\r\n\t\tString horaapertura=aplicacion.utilidades.Util.horaminutosAString(horIn, minIn);\r\n\t\tString horacierre=aplicacion.utilidades.Util.horaminutosAString(horCi, minCi);\r\n\t\tTime thI= Time.valueOf(horaapertura);\r\n\t\tTime thC=Time.valueOf(horacierre);\r\n\t\tthis.controlador.insertDepartamentoPruebas(nombredep, nvJefe,thI,thC); //tabla DEPARTAMENTO\r\n\t\tthis.controlador.insertNumerosDepartamento(n, nombredep); //tabla NumerosDEPARTAMENTOs\r\n\t\tthis.controlador.insertDepartamentoUsuario(nvJefe, nombredep); //tabla DepartamentoUsuario\r\n\r\n\t\t//insertamos en la cache\r\n\t\t//Departamento d=new Departamento(nombredep,Integer.parseInt(num),getEmpleado(nvJefe),null,null);\r\n\t\t//departamentosJefe.add(d);\r\n\t\t/*ArrayList<Object> aux=new ArrayList<Object>();\r\n\t\taux.add(nombredep);\r\n\t\taux.add(n);\r\n\t\taux.add(nvJefe);\r\n\t\tinsertCache(aux,\"crearDepartamento\");*///no quitar el parseInt\r\n\t}", "public void addPrimero(Object obj) {\n if (cabeza == null) { //Si la cabeza es nula, entoces se creará un nuevo nodo donde le pasaremos el valor de obj\n cabeza = new Nodo(obj);\n } else { //Si no es nula, signifa que el valor que se ingrese, pasara a ser la nueva cabeza\n Nodo temp = cabeza; //Metemos la cabeza en un nodo temporal\n Nodo nuevo = new Nodo(obj); //Creamos un nuevo nodo, que no está enlazado\n nuevo.enlazarSiguiente(temp); //Y el nuevo nodo lo enlazamos a el nodo Temp, que contenia el valor anterior de la otra cabeza\n cabeza = nuevo; //Y ahora le decimos que la cabeza sera nuevo\n }\n size++; //Cada vez que agreguemos un nuevo nodo el tamaño de nuestra lista tendra que aumentar\n }", "public static void actualizarCreencias(int id) {\n\t\tint j =0;\t\t\n\t\t//Actualizamos las creecias del jugador \n\t\tint i =0;\n\t\tfor(j =0; j < GestorPartida.getContJugadores();j++) {\n\t\t\t\n\t\t\t\n\t\t\tif(GestorPartida.getJugadores()[j].getId() != id) {\n\t\t\t\t//Filtramos que los jugadores que vayan a actualizar sus creencias sean los de la sala del jugador que acaba de realizar una accion, excepto las suyas propias\t\t\t\n\t\t\t\tif(GestorPartida.getJugadores()[j].getSala().equalsIgnoreCase(GestorPartida.getJugadores()[id].getSala()) && GestorPartida.getJugadores()[j].getId() != id) {\n\t\t\t\t\t//Actualizamos la sala por si el jugador se acaba de mover\n\t\t\t\t\tGestorPartida.getJugadores()[id].getCreencias().setSalaPersona(GestorPartida.getJugadores()[j].getSala(), i);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tfor(j = 0; j < GestorPartida.getContObjetosJugador();j++) {\n\t\t\t//Comprobamos que el jugador coincida con un poseedor de un objeto\n\t\t\tif(GestorPartida.getObjetoJugador()[j].getJugador().getSala().equalsIgnoreCase(GestorPartida.getJugadores()[id].getSala())) {\n\t\t\t\tfor(int x =0; GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x]!=null ; x++) {\n\t\t\t\t\t//Cogemos la posicion del objeto donde esta el objeto dentro de las creencias\n\t\t\t\t\tif(GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x].equalsIgnoreCase(GestorPartida.getObjetoJugador()[j].getNombreObjeto())) {\n\t\t\t\t\t\tGestorPartida.getJugadores()[id].getCreencias().setLugarObjeto(GestorPartida.getObjetoJugador()[j].getJugador().getNombre(), x);\n\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\tfor(j = 0; j < GestorPartida.getContObjetosSala();j++) {\n\t\t\t//Comprobamos si hay objetos en la sala del jugador\n\t\t\tif(GestorPartida.getObjetoSala()[j].getSala().getNombre().equalsIgnoreCase(GestorPartida.getJugadores()[id].getSala())) {\n\t\t\t\tfor(int x =0; GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x]!=null ; x++) {\n\t\t\t\t\t//Cogemos la posicion del objeto donde esta el objeto dentro de las creencias\n\t\t\t\t\tif(GestorPartida.getJugadores()[id].getCreencias().getNombreObjeto()[x].equalsIgnoreCase(GestorPartida.getObjetoSala()[j].getNombreObjeto())) {\n\t\t\t\t\t\tGestorPartida.getJugadores()[id].getCreencias().setLugarObjeto(GestorPartida.getObjetoSala()[j].getSala().getNombre(), x);\n\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\t\n\t\t\n\t}", "private void iniciaReferencia(int qtdLinha){\n referenciaFrequencia = new int[qtdConjunto][];\n referenciaTempo = new int[qtdConjunto][];\n for (int i = 0; i < referenciaFrequencia.length; i++) {\n \treferenciaFrequencia[i] = new int[qtdLinha];\n \treferenciaTempo[i] = new int[qtdLinha];\n for (int j = 0; j < referenciaFrequencia[i].length; j++) {\n\t\t\t\treferenciaFrequencia[i][j] = 0;\n\t\t\t\treferenciaTempo[i][j] = 0;\n\t\t\t}\n }\n }", "void executaInstrucoes (){\n\n /* Executa uma instrução da memoria */\n for (opReg.getPC() ; opReg.getPC() < 0x0fff; opReg.setPC(opReg.getPC()+4)) { //verificar se esta contando de 4 em 4\n\n /* Salva as instruções de 4 bytes (32 bits) em uma string\n * a partir do endereço do PC */ \n String instrucao = null;\n instrucao = separaDados.separaInstrucao(instrucao, opReg.getPC(), memoria.memory);\n decodifica.separaInstrucao(instrucao, opReg.getPC(), opReg, memoria, sc);\n }\n sc.close();\n }", "private void remplirPrestaraireData() {\n\t}", "private synchronized void resize() {\n tableSize = 2 * tableSize;\n tableSize = nextPrime(tableSize);\n FlightDetails[] old = HT;\n\n HT = new FlightDetails[tableSize];\n count.set(0);\n\n for (FlightDetails oldFlightDetails : old) {\n if (oldFlightDetails != null) {\n FlightDetails flightDetails = oldFlightDetails;\n put(flightDetails);\n\n while (flightDetails.getNext() != null) {\n flightDetails = flightDetails.getNext();\n put(flightDetails);\n }\n }\n }\n }", "public void darCoordenadasIniciales() \r\n\t{\t\r\n\t\tint coordenadasX = 0;\r\n\t\tint coordenadasY = 1;\r\n\t\tint orientacion = 2;\r\n\t\t\r\n\t\tfor (int x = 0; x<palabras.size();x++) \r\n\t\t{\r\n\t\t\tpalabras.get(x).get(0).setX(Integer.parseInt(manejadorArchivos.getPalabras().get(coordenadasX)));\r\n\t\t\tpalabras.get(x).get(0).setY(Integer.parseInt(manejadorArchivos.getPalabras().get(coordenadasY)));\r\n\t\t\tpalabras.get(x).get(0).setOrientacion(manejadorArchivos.getPalabras().get(orientacion));\r\n\t\t\t\r\n\t\t\t coordenadasX = coordenadasX +4;\r\n\t\t\t coordenadasY = coordenadasY + 4;\r\n\t\t\t orientacion = orientacion + 4;\r\n\t\t}\r\n\t}", "private void ingresarReserva() throws Exception {\r\n\t\tif (mngRes.existeReservaPeriodo(getSitio().getId())) {\r\n\t\t\tif (mayorEdad) {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(), null);\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t} else {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(),\r\n\t\t\t\t\t\tgetDniRepresentante() + \";\" + getNombreRepresentante());\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t}\r\n\t\t\tMensaje.crearMensajeINFO(\"Reserva realizada correctamente, no olvide descargar su contrato.\");\r\n\t\t} else {\r\n\t\t\tMensaje.crearMensajeWARN(\"El sitio seleccionado ya esta copado, favor eliga otro.\");\r\n\t\t}\r\n\t}", "public void creationPlateau() {\n for (int i = 0; i < 10; i++) {\n int X = rand.nextInt(14);\n int Y = rand.nextInt(14);\n if (plateau[X][Y] == null && espacementMonstre(X,Y,plateau)) {\n int monstreAleatoire = 1 + (int)(Math.random() * ((3 - 1) + 1));\n switch (monstreAleatoire) {\n case 1:\n Personnage monstreD = new Dragonnet(X,Y);\n plateau[X][Y] = monstreD;\n this.monstre.add(monstreD);\n System.out.println(\"Dragonnet ajouté en position : \"+X+\" \"+Y);\n break;\n case 2:\n Personnage monstreL = new Loup(X,Y);\n plateau[X][Y] = monstreL;\n this.monstre.add(monstreL);\n System.out.println(\"Loup ajouté en position : \"+X+\" \"+Y);\n\n break;\n case 3:\n Personnage monstreO = new Orque(X,Y);\n plateau[X][Y] = monstreO;\n this.monstre.add(monstreO);\n System.out.println(\"Orque ajouté en position : \"+X+\" \"+Y);\n break;\n }\n } else {\n i --;\n }\n }\n }", "private void esperarPaquetes() throws SQLException {\n\n while (true) {//iterar infinitamente\n try {\n //esrtablecer el paquete\n byte datos[] = new byte[100];\n DatagramPacket recibirPaquete\n = new DatagramPacket(datos, datos.length);\n\n socket.receive(recibirPaquete);//espera al paquete\n if (recibirPaquete.getLength() != 0) {\n JOptionPane.showMessageDialog(this, \"Solicitud de Registro\");\n\n Conexion obj = new Conexion();\n conn = obj.Conexion();\n\n //***** DECLARACION DE LAS CLASES.\n Clientes_DTO cliente_dto = new Clientes_DTO();\n Movimientos_DTO movimiento_dto = new Movimientos_DTO();\n Bancos_DTO banco_dto = new Bancos_DTO();\n CuentasDTO cuentasDTO = new CuentasDTO();\n Usuario user = new Usuario();\n Seguros_DTO seguros_dto = new Seguros_DTO();\n Usuarios_DTO usuariosDTO = new Usuarios_DTO();\n Empresa_DTO dtoE = new Empresa_DTO();\n //*****\n\n String cad = (new String(recibirPaquete.getData(), 0, recibirPaquete.getLength()));\n String[] variables;\n variables = cad.split(\" \");\n\n switch (variables[0]) {\n case \"NewCliente\":\n cliente_dto.setNombre(variables[1]);\n cliente_dto.setAp_Paterno(variables[2]);\n cliente_dto.setAp_Materno(variables[3]);\n cliente_dto.setSexo(variables[4]);\n cliente_dto.setDireccion(variables[5]);\n cliente_dto.setEmail(variables[6]);\n cliente_dto.setTelefono(variables[7]);\n cliente_dto.setPais(variables[8]);\n cliente_dto.setTipo_cuenta(variables[9]);\n cliente_dto.Insert(cliente_dto, conn);\n JOptionPane.showMessageDialog(null, \"Cliente Agregado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n break;\n case \"EditCliente\":\n cliente_dto.setId_clientes(variables[1]);\n cliente_dto.setNombre(variables[2]);\n cliente_dto.setAp_Paterno(variables[3]);\n cliente_dto.setAp_Materno(variables[4]);\n cliente_dto.setSexo(variables[5]);\n cliente_dto.setDireccion(variables[6]);\n cliente_dto.setEmail(variables[7]);\n cliente_dto.setTelefono(variables[8]);\n cliente_dto.setPais(variables[9]);\n cliente_dto.setTipo_cuenta(variables[10]);\n cliente_dto.Edit(cliente_dto, conn);\n JOptionPane.showMessageDialog(null, \"Cliente Editado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n break;\n case \"DeleteCliente\":\n cliente_dto.setId_clientes(variables[1]);\n cliente_dto.Delete(cliente_dto, conn);\n JOptionPane.showMessageDialog(null, \"Cliente Eliminado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n break;\n case \"SearchCliente\":\n cliente_dto.setId_clientes(variables[1]);\n cliente_dto.Search(cliente_dto, conn);\n mensaje = cliente_dto.getId_clientes() + \" \" + cliente_dto.getNombre() + \" \" + cliente_dto.getAp_Paterno() + \" \" + cliente_dto.getAp_Materno() + \" \" + cliente_dto.getSexo() + \" \" + cliente_dto.getDireccion() + \" \" + cliente_dto.getTelefono() + \" \" + cliente_dto.getEmail() + \" \" + cliente_dto.getPais() + \" \" + cliente_dto.getTipo_cuenta() + \" \";\n break;\n case \"NewMovimiento\":\n Date now = new Date(System.currentTimeMillis());\n movimiento_dto.setTipo_movimiento(variables[1]);\n movimiento_dto.setFecha_movimiento(String.valueOf(now));\n movimiento_dto.setSaldo(Double.parseDouble(variables[8]));\n movimiento_dto.setN_cuenta(variables[9]);\n movimiento_dto.setCuenta_destino(variables[10]);\n movimiento_dto.Insert(movimiento_dto, conn);\n JOptionPane.showMessageDialog(null, \"Movimiento Agreado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n break;\n\n case \"EditMovimiento\":\n Date now1 = new Date(System.currentTimeMillis());\n movimiento_dto.setId_movimiento(variables[1]);\n movimiento_dto.setTipo_movimiento(variables[2]);\n movimiento_dto.setFecha_movimiento(String.valueOf(now1));\n movimiento_dto.setSaldo(Double.parseDouble(variables[9]));\n movimiento_dto.setN_cuenta(variables[10]);\n movimiento_dto.setCuenta_destino(variables[11]);\n\n movimiento_dto.Edit(movimiento_dto, conn);\n JOptionPane.showMessageDialog(null, \"Movimiento Editado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n\n break;\n case \"DeleteMovimiento\":\n\n movimiento_dto.setId_movimiento(variables[1]);\n movimiento_dto.Delete(movimiento_dto, conn);\n JOptionPane.showMessageDialog(null, \"Movimiento Eliminado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n\n break;\n case \"SearchMovimiento\":\n\n movimiento_dto.setId_movimiento(variables[1]);\n movimiento_dto.Search(movimiento_dto, conn);\n mensaje = movimiento_dto.getId_movimiento() + \" \" + movimiento_dto.getTipo_movimiento() + \" \" + movimiento_dto.getFecha_movimiento() + \" \" + movimiento_dto.getSaldo() + \" \" + movimiento_dto.getN_cuenta() + \" \" + movimiento_dto.getCuenta_destino() + \" \";\n break;\n\n case \"NewBanco\":\n banco_dto.setTelefono(variables[1]);\n banco_dto.setDireccion(variables[2]);\n banco_dto.setSucursal(variables[3]);\n banco_dto.setId_cliente(variables[4]);\n banco_dto.Insert(banco_dto, conn);\n JOptionPane.showMessageDialog(null, \"Banco Agregado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n break;\n case \"EditBanco\":\n banco_dto.setId_banco(variables[1]);\n banco_dto.setTelefono(variables[2]);\n banco_dto.setDireccion(variables[3]);\n banco_dto.setSucursal(variables[4]);\n banco_dto.setId_cliente(variables[5]);\n banco_dto.Edit(banco_dto, conn);\n JOptionPane.showMessageDialog(null, \"Banco Editado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n break;\n case \"DeleteBanco\":\n banco_dto.setId_banco(variables[1]);\n banco_dto.Delete(banco_dto, conn);\n JOptionPane.showMessageDialog(null, \"Banco Eliminado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n break;\n case \"SearchBanco\":\n banco_dto.setId_banco(variables[1]);\n banco_dto.Search(banco_dto, conn);\n mensaje = banco_dto.getId_banco() + \" \" + banco_dto.getTelefono() + \" \" + banco_dto.getDireccion() + \" \" + banco_dto.getSucursal() + \" \" + banco_dto.getId_cliente() + \" \";\n break;\n\n case \"NewCuenta\":\n\n JOptionPane.showMessageDialog(this, variables[2]);\n cuentasDTO.setIdCliente(Integer.parseInt(variables[1]));\n cuentasDTO.setIdUsuario(Integer.parseInt(variables[2]));\n cuentasDTO.setNoDeCuenta(Integer.parseInt(variables[3]));\n cuentasDTO.setTipoCuenta(variables[4]);\n cuentasDTO.setFechaApertura(variables[5]);\n cuentasDTO.setSaldoApertura(Double.parseDouble(variables[6]));\n\n cuentasDTO.insert(cuentasDTO, conn);\n break;\n\n case \"SearchCuenta\":\n\n cuentasDTO.setNoDeCuenta(Integer.parseInt(variables[1]));\n cuentasDTO = cuentasDTO.search(cuentasDTO, conn);\n\n mensaje = String.valueOf(cuentasDTO.getIdCliente()) + \" \" + String.valueOf(cuentasDTO.getIdUsuario()) + \" \" + String.valueOf(cuentasDTO.getNoDeCuenta()) + \" \" + cuentasDTO.getFechaApertura() + \" \" + cuentasDTO.getTipoCuenta() + \" \" + String.valueOf(cuentasDTO.getSaldoApertura()) + \" \";\n break;\n\n case \"NewUser\":\n user.SetNombre(variables[1]);\n user.setPerfil(variables[2]);\n user.SetPassword(variables[3]);\n user.setA_paterno(variables[4]);\n user.setA_materno(variables[5]);\n user.setTelefono(variables[6]);\n user.setEmail(variables[7]);\n user.setDomicilio(variables[8]);\n\n user.Insert(conn);\n\n JOptionPane.showMessageDialog(null, \"Usuario Agregado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n\n break;\n case \"NewSure\":\n seguros_dto.setEmpresa(variables[1]);\n seguros_dto.setTipo_seguro(variables[2]);\n seguros_dto.setMonto(variables[3]);\n seguros_dto.setCuenta(variables[4]);\n\n seguros_dto.Insert(seguros_dto, conn);\n JOptionPane.showMessageDialog(null, \"Seguro Agregado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n\n break;\n case \"EditSure\":\n seguros_dto.setId_seguro(variables[1]);\n seguros_dto.setEmpresa(variables[2]);\n seguros_dto.setTipo_seguro(variables[3]);\n seguros_dto.setMonto(variables[4]);\n seguros_dto.setCuenta(variables[5]);\n\n seguros_dto.Edit(seguros_dto, conn);\n JOptionPane.showMessageDialog(null, \"Seguro Editado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n\n break;\n case \"DeleteSure\":\n seguros_dto.setId_seguro(variables[1]);\n\n seguros_dto.Delete(seguros_dto, conn);\n JOptionPane.showMessageDialog(null, \"Banco Eliminado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n\n break;\n case \"SearchSure\":\n seguros_dto.setId_seguro(variables[1]);\n\n seguros_dto.Search(seguros_dto, conn);\n mensaje = seguros_dto.getId_seguro() + \" \" + seguros_dto.getEmpresa() + \" \" + seguros_dto.getTipo_seguro() + \" \" + seguros_dto.getMonto() + \" \" + seguros_dto.getCuenta() + \" \";\n\n break;\n\n case \"NuevoUsuario\":\n\n usuariosDTO.setNombre(variables[1]);\n usuariosDTO.setA_paterno(variables[2]);\n usuariosDTO.setA_materno(variables[3]);\n usuariosDTO.setTelefono(variables[4]);\n usuariosDTO.setEmail(variables[5]);\n usuariosDTO.setDomicilio(variables[6]);\n\n usuariosDTO.Insert(usuariosDTO, conn);\n\n JOptionPane.showMessageDialog(this, \"Usuario agregado\");\n\n break;\n\n case \"NuevoUsuarioEditar\":\n\n usuariosDTO.setId_usuarios(variables[1]);\n usuariosDTO.setNombre(variables[2]);\n usuariosDTO.setA_paterno(variables[3]);\n usuariosDTO.setA_materno(variables[4]);\n usuariosDTO.setTelefono(variables[5]);\n usuariosDTO.setEmail(variables[6]);\n usuariosDTO.setDomicilio(variables[7]);\n\n usuariosDTO.Edit(usuariosDTO, conn);\n\n JOptionPane.showMessageDialog(this, \"Usuario Editado\");\n\n break;\n\n case \"DeleteUsuario_1\":\n\n usuariosDTO.setId_usuarios(variables[1]);\n\n usuariosDTO.Delete(usuariosDTO, conn);\n\n JOptionPane.showMessageDialog(null, \"Usuario Eliminado con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n\n break;\n\n case \"SearcUsuario_1\":\n usuariosDTO.setId_usuarios(variables[1]);\n\n usuariosDTO.Search(usuariosDTO, conn);\n\n mensaje = usuariosDTO.getId_usuarios() + \" \" + usuariosDTO.getNombre() + \" \" + usuariosDTO.getA_paterno() + \" \" + usuariosDTO.getA_materno() + \" \" + usuariosDTO.getTelefono() + \" \" + usuariosDTO.getEmail() + \" \" + usuariosDTO.getDomicilio() + \" \";\n\n break;\n\n case \"NewEmpresa\":\n dtoE.setFecha_apertura(variables[1]);\n dtoE.setMonto(variables[2]);\n dtoE.setPlazo(variables[3]);\n dtoE.setTaza(variables[4]);\n dtoE.setRepresentante(variables[5]);\n dtoE.setId_banco(variables[6]);\n dtoE.setTipo_cuenta(variables[7]);\n dtoE.Insert(dtoE, conn);\n JOptionPane.showMessageDialog(null, \"Empresa Agregada con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n break;\n\n case \"SearchEmpresa\":\n dtoE.setId_empresa(variables[1]);\n dtoE.Search(dtoE, conn);\n mensaje = dtoE.getId_empresa() + \" \" + dtoE.getFecha_apertura() + \" \" + dtoE.getMonto() + \" \" + dtoE.getPlazo() + \" \" + dtoE.getTaza() + \" \" + dtoE.getRepresentante() + \" \" + dtoE.getId_banco() + \" \" + dtoE.getTipo_cuenta() + \" \";\n break;\n case \"EditEmpresa\":\n dtoE.setId_empresa(variables[1]);\n dtoE.setFecha_apertura(variables[2]);\n dtoE.setMonto(variables[3]);\n dtoE.setPlazo(variables[4]);\n dtoE.setTaza(variables[5]);\n dtoE.setRepresentante(variables[6]);\n dtoE.setId_banco(variables[7]);\n dtoE.setTipo_cuenta(variables[8]);\n\n dtoE.Edit(dtoE, conn);\n JOptionPane.showMessageDialog(null, \"Empresa Editada con Exito\", \"Exito!\", JOptionPane.INFORMATION_MESSAGE);\n break;\n\n default:\n break;\n }\n\n }\n //mostrar la informacion del paquete recibido\n mostrarMensaje(\"\\nRegistro Ingresado:\"\n + \"\\nDel host:\" + recibirPaquete.getPort()\n + \"\\nInformacion almacenada:\\n\\t\" + new String(recibirPaquete.getData(),\n 0, recibirPaquete.getLength()) + datos);\n\n enviarPaqueteACliente(recibirPaquete);//envida paquete al cliente\n\n } //procesar los problemas que pu edan ocurrir al manipular el paquete\n catch (IOException excepcionES) {\n mostrarMensaje(excepcionES.toString() + \"\\n\");\n excepcionES.printStackTrace();\n }\n\n }//fin de intruccion while\n\n }", "private void creaModuloMem() {\n /* variabili e costanti locali di lavoro */\n ArrayList<Campo> campi = new ArrayList<Campo>();\n ModuloRisultati modulo;\n Campo campo;\n\n try { // prova ad eseguire il codice\n\n campo = CampoFactory.intero(Campi.Ris.codicePiatto.getNome());\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.nomePiatto.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"piatto\");\n campo.setToolTipLista(\"nome del piatto\");\n campo.decora()\n .etichetta(\"nome del piatto\"); // le etichette servono per il dialogo ricerca\n campo.setLarghezza(250);\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.categoria.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"categoria\");\n campo.setToolTipLista(\"categoria del piatto\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteVolte.getNome());\n campo.setVisibileVistaDefault();\n campo.setLarghezza(80);\n campo.setTitoloColonna(\"quante volte\");\n campo.setToolTipLista(\n \"quante volte questo piatto è stato offerto nel periodo analizzato\");\n campo.decora().etichetta(\"quante volte\");\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quantiCoperti.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"coperti\");\n campo.setToolTipLista(\"numero di coperti che avrebbero potuto ordinare\");\n campo.decora().etichetta(\"n. coperti\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteComande.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"comande\");\n campo.setToolTipLista(\"numero di comande effettive\");\n campo.decora().etichetta(\"n. comande\");\n campo.setLarghezza(80);\n campo.setTotalizzabile(true);\n campi.add(campo);\n\n campo = CampoFactory.percentuale(Campi.Ris.gradimento.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"gradimento\");\n campo.setToolTipLista(\n \"percentuale di gradimento (è il 100% se tutti i coperti potenziali lo hanno ordinato)\");\n campo.decora().etichetta(\"% gradimento\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n modulo = new ModuloRisultati(campi);\n setModuloRisultati(modulo);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }", "private void cargarFichaLepra_convivientes() {\r\n\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\tparameters.put(\"nro_identificacion\", tbxNro_identificacion.getValue());\r\n\t\tparameters.put(\"fecha_actual\", new Date());\r\n\r\n\t\t// log.info(\"parameters\" + parameters);\r\n\t\tseguimiento_control_pqtService.setLimit(\"limit 25 offset 0\");\r\n\r\n\t\t// log.info(\"parameters>>>>\" + parameters);\r\n\t\tBoolean fecha_tratamiento = seguimiento_control_pqtService\r\n\t\t\t\t.existe_fecha_fin_tratamiento(parameters);\r\n\t\t// log.info(\"fecha_tratamiento>>>>\" + fecha_tratamiento);\r\n\r\n\t\tif (fecha_tratamiento) {\r\n\t\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\t\tparametros.put(\"nro_ingreso\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_ingreso());\r\n\t\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE,\r\n\t\t\t\t\tadmision_seleccionada);\r\n\t\t\tparametros.put(IVias_ingreso.OPCION_VIA_INGRESO,\r\n\t\t\t\t\tOpciones_via_ingreso.REGISTRAR);\r\n\t\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\tIRutas_historia.PAGINA_CONTROL_CONVIVIENTES_LEPRA,\r\n\t\t\t\t\tIRutas_historia.LABEL_CONTROL_CONVIVIENTES_LEPRA,\r\n\t\t\t\t\tparametros);\r\n\t\t}\r\n\t}", "private void prepare()\n {\n Victoria victoria = new Victoria();\n addObject(victoria,190,146);\n Salir salir = new Salir();\n addObject(salir,200,533);\n Volver volver = new Volver();\n addObject(volver,198,401);\n }", "private void insertData() {\n \n for (int i = 0; i < 4; i++) {\n EmpleadoEntity entity = factory.manufacturePojo(EmpleadoEntity.class);\n entity.setSolicitudes(new ArrayList<>());\n entity.setPropuestas(new ArrayList<>());\n entity.setInvitaciones(new ArrayList<>());\n entity.setTipoEmpleado(TipoEmpleado.TRADUCTOR);\n if(i == 0)\n {\n SolicitudEntity solicitud = factory.manufacturePojo(SolicitudEntity.class);\n em.persist(solicitud);\n entity.getSolicitudes().add(solicitud);\n solicitud.setEmpleado(entity);\n solicitudesData.add(solicitud);\n }\n else if (i == 1)\n {\n InvitacionEntity invitacion = factory.manufacturePojo(InvitacionEntity.class);\n em.persist(invitacion);\n entity.getInvitaciones().add(invitacion); \n invitacion.setEmpleado(entity);\n invitacionesData.add(invitacion);\n }\n else if (i == 2){\n PropuestaEntity propuesta = factory.manufacturePojo(PropuestaEntity.class);\n em.persist(propuesta);\n entity.getPropuestas().add(propuesta);\n propuesta.setEmpleado(entity);\n propuestasData.add(propuesta);\n }\n em.persist(entity);\n data.add(entity);\n }\n }", "public static Factura insertFactura(Date fecha_inicio_factura,\n float tiene_costo_plan,\n float monto_total,\n ArrayList<String> comentarios_factura,\n Producto producto){\n \n Factura miFactura = new Factura(fecha_inicio_factura,tiene_costo_plan, \n 0,comentarios_factura,producto);\n \n //factura.registrarFactura();\n \n return miFactura;\n }", "private void remplirFabricantData() {\n\t}", "static void envoyerfrags(int machutil,FileInputStream raf,BufferedReader br,HashMap<Integer,String> cataloguefich,int j,String nom) throws IOException {\n\tint leng = (nom + \" CMDWRITE\").length();\n\tbyte[] buf = (nom + \" CMDWRITE\").getBytes();\n\t\t\n\tfor(int destIx=0; destIx < machutil; destIx++) {\n \tsocs[destIx] = new Socket(\"localhost\",ports[destIx]);\n \t\n\t\t DataOutputStream dw = new DataOutputStream(socs[destIx].getOutputStream());\n \tBufferedOutputStream bw = new BufferedOutputStream(socs[destIx].getOutputStream());\n\t\tdw.writeInt(leng);\n \tdw.flush();\n \t\tbw.write(buf);\n \tbw.flush();\n \n //\t}\n\t\n //envoie de la taille d'un fragement nbrebytes\n // for(int destIx=0; destIx < machutil; destIx++) {\n \tint numfrag = nbmachines*j + destIx;\n\tbyte[] b = Integer.toString(numfrag).getBytes();\n\tbyte longu = (byte) b.length;\n\tbw.write(longu);\n bw.flush();\n\tbw.write(b);\n bw.flush();\n \t\n \t\n \t// dw = new DataOutputStream(socs[destIx].getOutputStream());\n // try { Thread.sleep(10);}catch (Exception e) {}\t\n\n \tcataloguefich.put(numfrag, Integer.toString( ports[destIx]));\n\t System.out.println(\"num frag envoyé : \" + numfrag);\n\t String line;\n\t int nbrebytes = 0;\n \tfor(int i=0; i < nbligne; i++) {\n\t\t try {\t\n\t\t \tnbrebytes = br.readLine().getBytes().length +\"\\n\".getBytes().length + nbrebytes;\n\t\t } catch(Exception e) {\n\t\t\t break;\n\t\t }\n\t }\n //\tDataOutputStream dw1 = new DataOutputStream(socs[destIx].getOutputStream());\n \n\t/*byte b = (byte)nbrebytes;\n\tnbrebytes = 300000000;\n\tInteger nbbytes = new Integer(nbrebytes);\n\n\tByte b2 = new Byte(b);\n\n\t System.out.println(\"cong : \"+ (nbrebytes/256));\n\t System.out.println(\"b : \"+ b);\n\tint coeff = 0;\t\n\tint i2 = (b & 0xFF);\n\tif (b<0) {\n\t\tcoeff = ((nbrebytes/256)+1);\n\n\t}else {\n\t\tcoeff = nbrebytes/256;\n\t} \n\tint n = (256*coeff)+b ;*/\n\n\t b = Integer.toString(nbrebytes).getBytes();\n\t longu = (byte) b.length;\n\n\tbw.write(longu);\n bw.flush();\n\tbw.write(b);\n bw.flush();\n\tSystem.out.println(\"Taille frag envoyé : \" + nbrebytes);\n\n //envoie du contenue d'un fragement\n\t// BufferedOutputStream bw = new BufferedOutputStream(socs[destIx].getOutputStream());\n readWrites(raf, bw, nbrebytes,destIx);\n\n\n }\n\n}", "private void savePinchazos(String estado) {\n int c = mPinchazos.size();\n for (Pinchazo pinchazo : mPinchazos) {\n pinchazo.setEstado(estado);\n estudioAdapter.updatePinchazosSent(pinchazo);\n publishProgress(\"Actualizando Pinchazos\", Integer.valueOf(mPinchazos.indexOf(pinchazo)).toString(), Integer\n .valueOf(c).toString());\n }\n //actualizar.close();\n }" ]
[ "0.5811786", "0.5773883", "0.5745791", "0.56538534", "0.5585351", "0.5508232", "0.548796", "0.54877687", "0.54794645", "0.5456716", "0.5414121", "0.5384237", "0.5380679", "0.53773516", "0.53725797", "0.5366702", "0.53463644", "0.5338659", "0.5330674", "0.53194064", "0.5286797", "0.5254753", "0.5249078", "0.52470475", "0.52442914", "0.5237086", "0.522219", "0.52219886", "0.52002054", "0.5199569", "0.5199516", "0.5193274", "0.51899177", "0.51888", "0.5187409", "0.51821387", "0.51723087", "0.5156122", "0.51548564", "0.51482385", "0.51477414", "0.5144551", "0.51427865", "0.51418173", "0.51375663", "0.5126064", "0.51197183", "0.51158154", "0.5110489", "0.5109392", "0.51033294", "0.5098096", "0.5089162", "0.5084927", "0.50824136", "0.50766665", "0.5065969", "0.50637555", "0.5061853", "0.50592726", "0.50492835", "0.5045577", "0.5044068", "0.5035934", "0.5035541", "0.5034477", "0.5026626", "0.5024574", "0.5015923", "0.50149894", "0.5014929", "0.5005697", "0.50053114", "0.5003404", "0.49971533", "0.49890462", "0.49883562", "0.49821678", "0.49731532", "0.49729908", "0.4964449", "0.49623978", "0.49565926", "0.49552763", "0.49502346", "0.49470618", "0.49466625", "0.49424168", "0.49408555", "0.49401602", "0.49396628", "0.49307546", "0.49276632", "0.49257517", "0.49245468", "0.49229956", "0.49178353", "0.4916148", "0.4912984", "0.49128166", "0.49120128" ]
0.0
-1
Devuelve las reservas realizadas segun el nombre y apellido
@GetMapping("/prueba/{nombre}/{apellido}") public List<ReservasEntity> findReservasByUser(@PathVariable("nombre") String nombre,@PathVariable("apellido") String apellido){ return reservaRepo.findReservasByUser(nombre,apellido); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void loadReserva() {\r\n\t\tif(listaReservas.size() != 0) {\r\n\r\n\t\t}else {\r\n\t\t\tfor(int i = 0; i < 8; i++) {\r\n\t\t\t\tReservaDAO aux = new ReservaDAO();\r\n\t\t\t\taux.load_reserva(i+1);\r\n\t\t\t\tif(aux.getTitulo() != null) {\r\n\t\t\t\t\tlistaReservas.add(aux);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void ReservaEfetivadas () {\n Date hoje = new Date ();\n for (int z = 0; z < vecReserva.size(); z++) {\n if (((int) ((((entReserva)vecReserva.elementAt(z)).getDatain().getTime() - (hoje.getTime())) / 86400000L)) == 0){// Reserva será relaizada hj\n if (((entReserva)vecReserva.elementAt(z)).getPagamento().getSituacao() == 0){//Cliente fez todo o pagamento e o quarto será\n vecReservaEfetivadas.add(vecReserva.elementAt(z));\n }\n \n }\n }\n }", "private void createReservations() {\n final String username = extractUsername();\n final EMail email = extractEMail();\n if (!isReserved(username) || !isReserved(email)) {\n signupDelegate.enableNextButton(Boolean.FALSE);\n SwingUtil.setCursor(this, java.awt.Cursor.WAIT_CURSOR);\n UsernameReservation usernameReservation = null;\n EMailReservation emailReservation = null;\n try {\n errorMessageJLabel.setText(getString(\"CheckingUsername\"));\n errorMessageJLabel.paintImmediately(0, 0, errorMessageJLabel\n .getWidth(), errorMessageJLabel.getHeight());\n \n // get username reservation\n usernameReservation = createUsernameReservation(username);\n if (null == usernameReservation) {\n unacceptableUsername = username;\n } else {\n usernameReservations.put(username.toLowerCase(), usernameReservation);\n }\n \n // get email reservation\n emailReservation = createEMailReservation(email);\n if (null == emailReservation) {\n unacceptableEMail = email;\n } else {\n emailReservations.put(email, emailReservation);\n }\n } catch (final OfflineException ox) {\n logger.logError(ox, \"An offline error has occured.\");\n temporaryError = getSharedString(\"ErrorOffline\");\n } catch (final Throwable t) {\n logger.logError(t, \"An unexpected error has occured.\");\n temporaryError = getSharedString(\"ErrorUnexpected\");\n } finally {\n SwingUtil.setCursor(this, null);\n }\n validateInput();\n }\n }", "public long reserva_de_entradas(int identificador_evento, Date fechaevento, Horario[] listahorarios ) throws ParseException {\n fgen.info (\"Identificador del evento\" + identificador_evento);\n fgen.info (\"Fecha del evento\" + fechaevento);\n ArrayList<Horario> horariosReserva = new ArrayList<Horario>();\n for (int i = 0; i < listahorarios.length; i++) {\n \n Horario horario = listahorarios[i];\n fgen.info (\"Horario : \" + horario.getHorario().toString()); \n horariosReserva.add(horario);\n List<Disponibilidad> listadisponibles = listahorarios[i].disponibilidades;\n for (int j = 0; j < listadisponibles.size() ; j++) { \n fgen.info (\" Disponibilidad - Cantidad: \" + listadisponibles.get(j).getCantidad());\n fgen.info (\" Disponibilidad - Precio: \" + listadisponibles.get(j).getPrecio());\n fgen.info (\" Disponibilidad - Sector: \" + listadisponibles.get(j).getSector());\n } \n \n \n } \n //Inicializo o tomo lo que esta en memoria de la lista de reservas\n ListaReservas reservas= new ListaReservas(); \n // busco el evento y que la lista de horarios sea en la que quiero reservar\n ListaEventos eventos = new ListaEventos();\n Calendar c = Calendar.getInstance();\n c.setTime(fechaevento);\n Evento e = eventos.buscarEvento(identificador_evento, c);\n List<Horario> horariosRetornar = new ArrayList<Horario>();\n if(e != null)\n {\n horariosRetornar = e.getHorarios();\n } \n \n if (horariosRetornar != null)\n {\n for (int i = 0; i < horariosRetornar.size(); i++) {\n for (int j = 0; j < listahorarios.length; j++) {\n Date fechaE = horariosRetornar.get(i).getHorario().getTime(); \n Date fechaEventoDate = listahorarios[j].hora.getTime(); \n if(fechaE.equals(fechaEventoDate)) \n { for (int k = 0; k < horariosRetornar.get(i).disponibilidades.size(); k++) {\n for (int l = 0; l < listahorarios[j].disponibilidades.size(); l++) {\n Disponibilidad d= horariosRetornar.get(i).disponibilidades.get(k);\n Disponibilidad r= listahorarios[j].disponibilidades.get(l);\n if (d.cantidad >= r.cantidad && d.sector.equalsIgnoreCase(r.sector) && d.precio==r.precio)\n {\n d.setCantidad(d.cantidad-r.cantidad);\n //Reserva reserv= new Reserva();\n //reservas.contador_Id= reservas.contador_Id +1;\n //reserv.idReserva= reservas.contador_Id;\n //reserv.Estado=1;\n //reserv.idEvento = identificador_evento;\n //reserv.horarios.add(listahorarios[j]);\n //reservas.listaReserva.add(reserv);\n //return reserv.idReserva;\n }\n else if(d.cantidad < r.cantidad && d.sector.equalsIgnoreCase(r.sector) && d.precio==r.precio)\n {\n //Si hay alguna solicitud de de reserva que no se pueda cumplir. Re reorna 0.\n //TODO: Hay que volver para atras las cantidades modificadas.\n return 0;\n }\n \n }\n \n }\n }\n }\n }\n Reserva reserv= new Reserva();\n reservas.contador_Id= reservas.contador_Id +1;\n reserv.idReserva= reservas.contador_Id;\n reserv.Estado=1;\n reserv.idEvento = identificador_evento;\n reserv.horarios = horariosReserva;\n reserv.fechaEvento = c;\n reservas.listaReserva.add(reserv);\n return reserv.idReserva;\n }\n \n return 0;\n }", "public void mostrarReservas() {\n\t\tint numReserva=1;\r\n\t\tfor(Reserva reserva:reservas) {\r\n\t\t\tSystem.out.println(numReserva+\" \"+reserva.toString());\r\n\t\t\tnumReserva++;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public void reservarSitio() {\r\n\t\ttry {\r\n\t\t\tif (sitioId == null)\r\n\t\t\t\tMensaje.crearMensajeWARN(\"Debe seleccionar sitio para la reserva.\");\r\n\t\t\telse if (!mayorEdad && (getDniRepresentante() == null || getNombreRepresentante() == null\r\n\t\t\t\t\t|| getDniRepresentante().trim().isEmpty() || getDniRepresentante().length() < 9\r\n\t\t\t\t\t|| !Funciones.isNumeric(getDniRepresentante()) || !Funciones.validacionCedula(getDniRepresentante())\r\n\t\t\t\t\t|| getNombreRepresentante().trim().isEmpty()))\r\n\t\t\t\tMensaje.crearMensajeWARN(\"Los datos de representante son requeridos, y la cédula debe ser válida.\");\r\n\t\t\telse {\r\n\t\t\t\tif (reserva != null) {// POSEE RESERVA\r\n\t\t\t\t\tmodificarReserva();\r\n\t\t\t\t\tSystem.out.println(\"MODIFICA\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tingresarReserva();\r\n\t\t\t\t\tSystem.out.println(\"INGRESA\");\r\n\t\t\t\t}\r\n\t\t\t\tfinalizado = true;\r\n\t\t\t\treserva = mngRes.buscarReservaPorID(getDniEstudiante(), periodo.getPrdId());// CARGAR\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// RESERVA\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ACTUAL\r\n\t\t\t\tcargarSitiosLibres();\r\n\t\t\t\tcargarEstudiantesSitio();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tMensaje.crearMensajeERROR(\"Error al realizar reserva: \" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void listarRegistros() {\n System.out.println(\"\\nLISTA DE TODOS LOS REGISTROS\\n\");\n for (persona ps: pd.listaPersonas()){\n System.out.println(ps.getId()+ \" \"+\n ps.getNombre()+ \" \"+\n ps.getAp_paterno()+ \" \"+ \n ps.getAp_materno()+ \" DIRECCION: \"+ \n ps.getDireccion()+ \" SEXO: \"+ ps.getSexo());\n }\n }", "public static void BuscarReserva (Variables var,Menus Menus,BaseDades db,Reserva res, TReserva reserva,sMissatges missatge, bComprobadors comp){\r\n comp.bBuscar = true; \r\n \r\n //Mostra el menu de Buscar Reserva\r\n Menus(Menus.MenuBuscarReserva);\r\n \r\n //Llegeix les dades per buscar reserva\r\n reserva.iTelefon = sLlegirNumero(missatge.nTelefonReserva);\r\n\r\n //Mostra la Reserva\r\n MostrarReserva(var, db, res, reserva, Menus, comp);\r\n //Comprueba si la reserva se ha mostrado, sino muestra mensaje de no encontrada\r\n if(comp.bBuscar == true){\r\n Mostra(missatge.sReservaNoTrobada);\r\n }\r\n }", "void Planificar(Reserva unaReserva);", "public void setReservas(List<ReservaEntity> reservas) {\r\n this.reservas = reservas;\r\n }", "Sporthall() {\n reservationsList = new ArrayList<>();\n }", "public void GuardarPersonas()\r\n {\r\n System.out.print(\"Inserte su numero de cedula: \");\r\n setNumeroId(entrada.nextLine());\r\n System.out.print(\"Inserte su Primer Nombre: \");\r\n setNombre(entrada.nextLine());\r\n System.out.print(\"Inserte su Primer Apellido: \");\r\n setPrimerApellido(entrada.nextLine());\r\n System.out.print(\"Inserte su Segundo Apellido: \");\r\n setSegundoApellido(entrada.nextLine());\r\n System.out.print(\"Inserte su edad: \");\r\n setEdad(Integer.parseInt(entrada.nextLine()));\r\n System.out.print(\"Inserte su peso: \");\r\n setPeso(Float.valueOf(entrada.nextLine()));\r\n \r\n }", "private void ingresarReserva() throws Exception {\r\n\t\tif (mngRes.existeReservaPeriodo(getSitio().getId())) {\r\n\t\t\tif (mayorEdad) {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(), null);\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t} else {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(),\r\n\t\t\t\t\t\tgetDniRepresentante() + \";\" + getNombreRepresentante());\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t}\r\n\t\t\tMensaje.crearMensajeINFO(\"Reserva realizada correctamente, no olvide descargar su contrato.\");\r\n\t\t} else {\r\n\t\t\tMensaje.crearMensajeWARN(\"El sitio seleccionado ya esta copado, favor eliga otro.\");\r\n\t\t}\r\n\t}", "public List<ReservaEntity> getReservas() {\n LOGGER.log(Level.INFO, \"Inicia proceso de consultar todas las reservas\");\n // Note que, por medio de la inyección de dependencias se llama al método \"findAll()\" que se encuentra en la persistencia.\n List<ReservaEntity> reservas = persistence.findAllReservas();\n LOGGER.log(Level.INFO, \"Termina proceso de consultar todas las reservas\");\n return reservas;\n }", "private void atualizarTela() {\n\t\tSystem.out.println(\"\\n*** Refresh da Pagina / Consultando Todos os Registro da Tabela PressaoArterial\\n\");\n\t\tpressaoArterial = new PressaoArterial();\n\t\tlistaPressaoArterial = pressaoArterialService.buscarTodos();\n\n\t}", "public void cargarNombre() {\n\n System.out.println(\"Indique nombre del alumno\");\n nombre = leer.next();\n nombres.add(nombre);\n\n }", "public void setApellidos(String apellidos) { this.apellidos = apellidos; }", "private void buscar (String valor){\n try {\n int f,i;\n conn=App.ConnectionBd.Enlace(conn);\n String sql1=\"Select * from Reserva where idReserva like '%\"+valor+\"%' or tipoReserva like '%\"+valor+\"%';\";\n \n Statement st1=conn.createStatement();\n ResultSet rs1=st1.executeQuery(sql1);\n String datos[]=new String[7];\n f=datostabla.getRowCount();\n if(f>0)\n for(i=0;i<f;i++)\n datostabla.removeRow(0);\n while(rs1.next()) {\n datos[0]=(String)rs1.getString(1);\n datos[1]=(String)rs1.getString(2);\n datos[2]=(String)rs1.getString(3);\n datos[3]=(String)rs1.getString(5);\n datos[4]=(String)rs1.getString(6);\n datos[5]=(String)rs1.getString(7);\n datos[6]=(String)rs1.getString(9);\n datostabla.addRow(datos);\n }\n conn.close();\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(null, \"Error al buscar datos, verifique porfavor\");\n }\n }", "private void atualizarTela() {\n\t\tSystem.out.println(\"\\n*** Refresh da Pagina / Consultando Todos os Registro da Tabela Paciente\\n\");\n\t\tpaciente = new Paciente();\n\t\tlistaPaciente = pacienteService.buscarTodos();\n\t\t\n\t}", "public void loadReserva(String User) {\r\n\t\tif(listaReservas.size() != 0) {\r\n\r\n\t\t}else {\r\n\t\t\tfor(int i = 0; i < 8; i++) {\r\n\t\t\t\tReservaDAO aux = new ReservaDAO();\r\n\t\t\t\taux.load_reserva(User, i+1);\r\n\t\t\t\tif(aux.getTitulo() != null) {\r\n\t\t\t\t\tlistaReservas.add(aux);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void llenarArreglo(){\n\n\t\tString[] textoSeparado = texto.toLowerCase().split(\"\\\\W+\"); //pasa todo a minusculas y despues busca todas las no palabras con W y con + junta los que estan seguidos para separador, ver http://regexr.com/3dcpk\n\n\t\tif (palabras==null) {\n\t\t\t//agregar el primer elemento manualmente\n\t\t\tLabel etiqueta = new Label(textoSeparado[0]);\n\t\t\tpalabras = new Palabra[1];\n\t\t\tpalabras[0] = new Palabra(textoSeparado[0], etiqueta);\n\t\t}\n\n\t\t\tfor (int i=1; i<textoSeparado.length; i++) { //importante el uno para no contar la primera palabra dos veces\n\t\t\t\tString buscar= textoSeparado[i];\n\t\t\t\tif (!checarListaNegra(buscar)) { //solo se hace la operacion por cada palabra si no esta en la lista negra\n\t\t\t\t\tboolean yaExiste = false;\n\t\t\t\t\tfor (Palabra palabraActual : palabras) {\n\t\t\t\t\t\tif (palabraActual.getContenido().equals(buscar)) {\n\t\t\t\t\t\t\tyaExiste = true;\n\t\t\t\t\t\t\tpalabraActual.actualizarFrecuencia();\n\t\t\t\t\t\t//\tSystem.out.println(\"se actualizo\"+ palabraActual.getContenido());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!yaExiste) {\n\t\t\t\t\t\t//no se encontro la palabra (String buscar) en el gran arreglo de palabras entonces hay que crearla\n\t\t\t\t\t\tagregarPalabra(buscar);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void cargarNotas() {\n\n notas.add(null);\n notas.add(null);\n notas.add(null);\n\n int nota, cont = 0;\n for (int i = 0; i <= 2; i++) {\n\n System.out.println(\"Indique nota \" + (i + 1));\n nota = leer.nextInt();\n notas.set(cont, nota);\n cont++;\n\n }\n\n cont = 0;\n\n }", "public void schritt() {\r\n\t\tfor (int i = 0; i < anzahlRennautos; i++) {\r\n\t\t\tlisteRennautos[i].fahren(streckenlaenge);\r\n\t\t}\r\n\t}", "private static void grabarYllerPaciente() {\r\n\t\tPaciente paciente = new Paciente(\"Juan\", \"Garcia\", \"65\", \"casa\", \"2\", \"1998\");\r\n\t\tPaciente pacienteDos = new Paciente(\"MArta\", \"Garcia\", \"65\", \"casa\", \"3\", \"1998\");\r\n\t\tPaciente pacienteTres = new Paciente(\"MAria\", \"Garcia\", \"65\", \"casa\", \"4\", \"1998\");\r\n\t\tString ruta = paciente.getIdUnico();\r\n\t\tString rutaDos = pacienteDos.getIdUnico();\r\n\t\tString rutaTres = pacienteTres.getIdUnico();\r\n\t\tDTO<Paciente> dtoPacienteDos = new DTO<>(\"src/Almacen/\" + rutaDos + \".dat\");\r\n\t\tDTO<Paciente> dtoPaciente = new DTO<>(\"src/Almacen/\" + ruta + \".dat\");\r\n\t\tDTO<Paciente> dtoPacienteTres = new DTO<>(\"src/Almacen/\" + rutaTres + \".dat\");\r\n\t\tif (dtoPaciente.grabar(paciente) == true) {\r\n\r\n\t\t\tSystem.out.println(paciente.getNombre() + \" grabado\");\r\n\t\t}\r\n\t\t;\r\n\t\tif (dtoPacienteDos.grabar(pacienteDos) == true) {\r\n\r\n\t\t\tSystem.out.println(pacienteDos.getNombre() + \" grabado\");\r\n\t\t}\r\n\t\t;\r\n\t\tif (dtoPacienteTres.grabar(pacienteTres) == true) {\r\n\t\t\tSystem.out.println(pacienteTres.getNombre() + \" grabado\");\r\n\t\t}\r\n\t\t;\r\n\t\tPaciente pacienteLeer = dtoPaciente.leer();\r\n\t\tSystem.out.println(pacienteLeer);\r\n\t\tSystem.out.println(pacienteLeer.getNombre());\r\n\t}", "private void mostrarReservas() {\n\t\tJFReservasAdmin jfres =new JFReservasAdmin();\n\t\tjfres.setVisible(true);\n\t\t\n\t\tMap<Integer,Reserva> reservas = modelo.obtenerReservasPeriodo(per.getIdPeriodo());\n\t\tDefaultTableModel dtm = new DefaultTableModel(new Object[][] {},\n\t\t\t\tnew String[] { \"Dia\", \"Hora\", \"Email\" });\n\n\t\tfor (Integer key : reservas.keySet()) {\n\n\t\t\tdtm.addRow(new Object[] { reservas.get(key).getReserva_dia(), reservas.get(key).getReserva_hora(),reservas.get(key).getEmail() });\n\t\t}\n\t\tjfres.tReservas.setModel(dtm);\n\t}", "private Equipo buscarEquipoPorNombre(String buscado) {\n for (int i = 0; i < equipos.size(); i++) {\n if (equipos.get(i).getNombre().equalsIgnoreCase(buscado)) {\n return equipos.get(i);\n }\n }\n return null;\n }", "public ListaReservasBean() {\r\n\t\tthis.listaReservas = new ArrayList<ReservaDAO>();\r\n\t}", "public void buscarEntidad(){\r\n\t\tlistaEstructuraDetalle.clear();\r\n\t\tPersona persona = null;\r\n\t\tList<EstructuraDetalle> lstEstructuraDetalle = null;\r\n\t\ttry {\r\n\t\t\tstrFiltroTextoPersona = strFiltroTextoPersona.trim();\r\n\t\t\tif(intTipoPersonaC.equals(Constante.PARAM_T_TIPOPERSONA_JURIDICA)){\r\n\t\t\t\tif (intPersonaRolC.equals(Constante.PARAM_T_TIPOROL_ENTIDAD)) {\r\n\t\t\t\t\tlstEstructuraDetalle = estructuraFacade.getListaEstructuraDetalleIngresos(SESION_IDSUCURSAL,SESION_IDSUBSUCURSAL);\r\n\t\t\t\t\tif (lstEstructuraDetalle!=null && !lstEstructuraDetalle.isEmpty()) {\r\n\t\t\t\t\t\tfor (EstructuraDetalle estructuraDetalle : lstEstructuraDetalle) {\r\n\t\t\t\t\t\t\tpersona = personaFacade.getPersonaPorPK(estructuraDetalle.getEstructura().getJuridica().getIntIdPersona());\r\n\t\t\t\t\t\t\tif (persona.getStrRuc().trim().equals(\"strFiltroTextoPersona\")) {\r\n\t\t\t\t\t\t\t\testructuraDetalle.getEstructura().getJuridica().setPersona(persona);\r\n\t\t\t\t\t\t\t\tlistaEstructuraDetalle.add(estructuraDetalle);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t}\r\n\t}", "public List<Reserva> getAllReservas(){\n return repositorioReserva.findAll();\n }", "public Reservation makeReservation(Reservation trailRes){\n //Using a for each loop to chekc to see if a reservation can be made or not\n if(trailRes.getName().equals(\"\")) {\n System.out.println(\"Not a valid name\");\n return null;\n }\n \n \n for(Reservation r: listR){\n if(trailRes.getReservationTime() == r.getReservationTime()){\n System.out.println(\"Could not make the Reservation\");\n System.out.println(\"Reservation has already been made by someone else\");\n return null;\n }\n }\n\n //if the time slot is greater than 10 or less than 0, the reservation cannot be made\n if(trailRes.getReservationTime() > 10 || trailRes.getReservationTime() < 0){\n System.out.println(\"Time slot not available\");\n return null;\n }\n\n //check to see if the reservable list is empty or not\n if(listI.isEmpty())\n {\n System.out.println(\"No reservation available\");\n return null;\n }\n\n //find the item and fitnessValue that will most fit our reservation\n Reservable item = listI.get(0);\n int fitnessValue = item.findFitnessValue(trailRes);\n\n //loop through the table list and find the best fit for our reservation\n for(int i = 0; i < listI.size() ; i++){\n if(listI.get(i).findFitnessValue(trailRes) > fitnessValue){\n item = listI.get(i);\n fitnessValue = item.findFitnessValue(trailRes);\n }\n }\n //if we have found a table that works, then we can make our reservation\n if(fitnessValue > 0){\n //add reservation to our internal list\n //point our reservable to the appropriate reservation\n //set the reservable \n //print out the message here not using the iterator\n listR.add(trailRes);\n item.addRes(trailRes);\n trailRes.setMyReservable(item);\n System.out.println(\"Reservation made for \" + trailRes.getName() + \" at time \" + trailRes.getReservationTime() + \", \" + item.getId());\n return trailRes;\n }\n System.out.println(\"No reservation available, number of people in party may be too large\");\n return null; \n }", "public void crearPerfil(String nombre, String apellido1, String apellido2,\r\n String direccion, String nif, int telefono, int edad) {\r\n\r\n clientes.add(new Cliente(nombre, apellido1, apellido2, direccion, nif, telefono, edad));\r\n }", "public String guardarsalidatransferencia( List<ListviewGenerico> existencias, List<ListviewGenerico> salidatransferencia, String clavemobil, String observacion){\n\t\tint size = existencias.size();\n\t\tfor (int i = 0; i < size; i++){\n\t\t Double existencia =existencias.get(i).getexistencia();\n\t\t int idmaterial =existencias.get(i).getidmaterial();\n\t\t int idalmacen =existencias.get(i).getidalmacen();\n\t\t updateexistencia(existencia,idmaterial,idalmacen);\t\t \n\t\t}\n\t\t\n\t\tString cadenaimprimir=\"\";\n\t\tsize =salidatransferencia.size();\n\t\tVector vector=new Vector();\n\t\tfor (int i = 0; i < size; i++){\t\t\n\t\t\tint cont=0;\n\t\t\tfor (int j=0; j<vector.size(); j++){\n\t\t\t\tif(vector.elementAt(j).equals(salidatransferencia.get(i).getnombrealmacne()))\n\t\t\t\t\tcont++;\t\n\t\t\t}\n\t\t\tif(cont==0)\n\t\t\t\tvector.add(salidatransferencia.get(i).getnombrealmacne());\t\t\t\n\t\t}\n\t\tcadenaimprimir+=\"SALIDA TRANSFERECIA\\n\";\n\t\tfor (int j=0; j<vector.size(); j++) {\n\t\t\tLog.e(\"obra-concepto\",vector.elementAt(j)+\"\");\t\t\t\n\t\t\tcadenaimprimir+=\"--------------------------------------------\\n\";\n\t\t\tcadenaimprimir+=vector.elementAt(j).toString()+\"\\n\";\n\t\t\tcadenaimprimir+=\"--------------------------------------------\\n\";\n\t\t\tfor (int i = 0; i < size; i++){\n\t\t\t\t\tif(vector.elementAt(j).equals(salidatransferencia.get(i).getnombrealmacne())){\n\t\t\t\t\t\tLog.e(\"concepto\",\" \"+salidatransferencia.get(i).getexistencia()+\" - \"+salidatransferencia.get(i).getunidad()+\"\\n \"+salidatransferencia.get(i).getdescripcion());\n\t\t\t\t\t\tcadenaimprimir+=\" \"+salidatransferencia.get(i).getexistencia()+\" - \"+salidatransferencia.get(i).getunidad()+\"\\n \"+salidatransferencia.get(i).getdescripcion()+\"\\n\";\n\t\t\t\t\t\tif(salidatransferencia.get(i).getidcontratista()>0){\n\t\t\t\t\t\t\tcadenaimprimir+=\" Entregado a: \"+salidatransferencia.get(i).getnombrecontratista()+\"\";\t\n\t\t\t\t\t\t\tLog.e(\"material\",\" \"+salidatransferencia.get(i).getnombrecontratista());\n\t\t\t\t\t\t\tif(salidatransferencia.get(i).getconcargo()>0){\n\t\t\t\t\t\t\t\tcadenaimprimir+=\"(Con cargo)\\n\";\n\t\t\t\t\t\t\t\tLog.e(\"material\",\" -> Con cargo\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tcadenaimprimir+=\"\\n\\nObservaciones: \"+observacion;\n\t\t\n\t\tfor (int i = 0; i < size; i++){\n\t\t\t Double existencia =salidatransferencia.get(i).getexistencia();\n\t\t\t int idmaterial =salidatransferencia.get(i).getidmaterial();\n\t\t\t int idalmacen =salidatransferencia.get(i).getidalmacen();\n\t\t\t String unidad=salidatransferencia.get(i).getunidad();\t\n\t\t\t int idcontratista=salidatransferencia.get(i).getidcontratista();\t\n\t\t\t int concargo=salidatransferencia.get(i).getconcargo();\n\t\t\t \n\t\t\t salidatrasferenciapartidas(existencia, idmaterial, unidad, idalmacen, clavemobil, idcontratista, concargo);\n\t\t}\n\t\treturn cadenaimprimir;\n\t\t\n\t}", "public void buscaPersonalizada(){\n ClienteDAO cd = new ClienteDAO();\n String pesquisa = txtPesquisa.getText();\n String jcbx = jcbxTipoPesq.getSelectedItem().toString();\n \n\n if(pesquisa.equals(\"%\") || pesquisa.equals(\" %\") || pesquisa.equals(\"% \") || pesquisa.equals(\"\") && jcbx.equals(null)){\n exibeClientes();\n }\n else{ \n \n if(jcbx.equalsIgnoreCase(\"CNPJ\")){\n Vector row = new Vector();\n Cliente c = new Cliente(); \n \n c = cd.PesquisaCNPJ(pesquisa);\n\n if(!c.equals(null)){\n preecheTabCliente(c);\n } \n }else\n if(jcbx.equalsIgnoreCase(\"Razão Social\")){\n \n populaTabela(cd.PesquisaRSocial(pesquisa), tbClientes);\n \n }else\n if(jcbx.equalsIgnoreCase(\"Nome Fantasia\")){\n \n populaTabela(cd.PesquisaNFantasia(pesquisa), tbClientes);\n\n }else\n if(jcbx.equalsIgnoreCase(\"Responsável\")){\n \n \n populaTabela(cd.PesquisaResponsavel(pesquisa), tbClientes);\n \n }else\n if(jcbx.equalsIgnoreCase(\"Telefone\")){\n populaTabela(cd.PesquisaTelefone(pesquisa), tbClientes);\n \n }else\n if(jcbx.equalsIgnoreCase(null) ||jcbx.equalsIgnoreCase(\"\") ||jcbx.equalsIgnoreCase(\" \")){\n \n exibeClientes();\n } \n \n \n \n }\n }", "protected void showReservations() {\n storageDao.findAllRented()\n .forEach(System.out::println);\n }", "public List<ConceptoRetencionSRI> autocompletarConceptoRetencionIVASRI(String consulta)\r\n/* 550: */ {\r\n/* 551:583 */ String consultaMayuscula = consulta.toUpperCase();\r\n/* 552:584 */ List<ConceptoRetencionSRI> lista = new ArrayList();\r\n/* 553:586 */ for (ConceptoRetencionSRI conceptoRetencionSRI : getListaConceptoRetencionSRI()) {\r\n/* 554:587 */ if (((conceptoRetencionSRI.getCodigo().toUpperCase().contains(consultaMayuscula)) || \r\n/* 555:588 */ (conceptoRetencionSRI.getNombre().toUpperCase().contains(consultaMayuscula))) && \r\n/* 556:589 */ (conceptoRetencionSRI.getTipoConceptoRetencion().equals(TipoConceptoRetencion.IVA))) {\r\n/* 557:590 */ lista.add(conceptoRetencionSRI);\r\n/* 558: */ }\r\n/* 559: */ }\r\n/* 560:594 */ return lista;\r\n/* 561: */ }", "ParqueaderoEntidad agregar(String nombre);", "public void ConsultaVehiculosSQlite() {\n preguntas = mydb.getCartList();\n for( int i = 0 ; i < preguntas.size() ; i++ ){\n //Toast.makeText(getApplicationContext(), preguntas.get( i ).getPregunta(), Toast.LENGTH_SHORT).show();\n persons.add(new Solicitud(\"Pregunta \" + String.valueOf(i+1) +\": \"+preguntas.get( i ).getPregunta(),\"Fecha: \"+ preguntas.get( i ).getFecha(), R.drawable.solicitudes,\"Motivo: \"+preguntas.get( i ).getMotivo(),\"Observacion: \"+preguntas.get( i ).getObservacion(),\"\"));\n }\n }", "void rezervasyonYap(String name, String surname, String islem);", "public List<Carona> localizarCaronaRachada(String origem, String destino) {\r\n\t\tList<Carona> retorno = new LinkedList<Carona>();\r\n\t\t\r\n\t\tfor (Usuario usuarioTemp : listaDeUsuarios) {\r\n\t\t\tfor (Carona caronaTemp : usuarioTemp.getCaronas()) {\r\n\t\t\t\tif (caronaTemp.getTipoCarona().equals(TiposCarona.RACHADACOMUM) || caronaTemp.getTipoCarona().equals(TiposCarona.RACHADAESCAPADA) || caronaTemp.getTipoCarona().equals(TiposCarona.RACHADAMUNICIPAL)) {\r\n\t\t\t\t\tif(caronaTemp.getOrigem().equals(origem) && caronaTemp.getDestino().equals(destino)){\r\n\t\t\t\t\t\t\tretorno.add(caronaTemp);\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 retorno;\r\n\t}", "private void crearElementos() {\n\n\t\tRotonda rotonda1 = new Rotonda(new Posicion(400, 120), \"5 de octubre\");\n\t\tthis.getListaPuntos().add(rotonda1);\n\n\t\tCiudad esquel = new Ciudad(new Posicion(90, 180), \"Esquel\");\n\t\tthis.getListaPuntos().add(esquel);\n\n\t\tCiudad trelew = new Ciudad(new Posicion(450, 200), \"Trelew\");\n\t\tthis.getListaPuntos().add(trelew);\n\n\t\tCiudad comodoro = new Ciudad(new Posicion(550, 400), \"Comodoro\");\n\t\tthis.getListaPuntos().add(comodoro);\n\n\t\tCiudad rioMayo = new Ciudad(new Posicion(350, 430), \"Rio Mayo\");\n\t\tthis.getListaPuntos().add(rioMayo);\n\n\t\t// --------------------------------------------------------\n\n\t\tRutaDeRipio rutaRipio = new RutaDeRipio(230, 230, rotonda1, esquel);\n\t\tthis.getListaRuta().add(rutaRipio);\n\n\t\tRutaPavimentada rutaPavimentada1 = new RutaPavimentada(380, 100, trelew, comodoro);\n\t\tthis.getListaRuta().add(rutaPavimentada1);\n\n\t\tRutaPavimentada rutaPavimentada2 = new RutaPavimentada(800, 120, esquel, comodoro);\n\t\tthis.getListaRuta().add(rutaPavimentada2);\n\n\t\tRutaDeRipio rutaripio3 = new RutaDeRipio(380, 100, trelew, comodoro);\n\t\tthis.getListaRuta().add(rutaripio3);\n\n\t\tRutaEnConstruccion rutaConst1 = new RutaEnConstruccion(180, 70, rioMayo, comodoro);\n\t\tthis.getListaRuta().add(rutaConst1);\n\n\t\tRutaPavimentada rutaPavimentada3 = new RutaPavimentada(600, 110, rioMayo, esquel);\n\t\tthis.getListaRuta().add(rutaPavimentada3);\n\t}", "public void registrarPersona() {\n\t\ttry {\n\t\t\tif (validaNumDocumento(getNumDocumentPersona())) {\n\t\t\t\t\tif (validaDireccion()) {\n\t\t\t\t\t\tif (validaApellidosNombres()) {\n\t\t\t\t\t\t\tPaPersona persona = new PaPersona();\n\t\t\t\t\t\t\tif (getActualizaPersona() != null && getActualizaPersona().equals(\"N\")) {\n\t\t\t\t\t\t\t\tpersona.setPersonaId(Constante.RESULT_PENDING);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpersona.setPersonaId(getPersonaId() == null ? Constante.RESULT_PENDING: getPersonaId());\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tpersona.setTipoDocumentoId(Integer.valueOf(mapTipoDocumento.get(getTipoDocumento())));\n\t\t\t\t\t\t\tpersona.setNroDocIdentidad(getNumDocumentPersona());\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif (persona.getTipoDocumentoId() == Constante.TIPO_DOCUMENTO_RUC_ID) {\n\t\t\t\t\t\t\t\tpersona.setRazonSocial(getRazonSocial());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpersona.setPrimerNombre(getPrimerNombre());\n\t\t\t\t\t\t\t\tpersona.setSegundoNombre(getSegundoNombre());\n\t\t\t\t\t\t\t\tpersona.setApePaterno(getApellidoPaterno());\n\t\t\t\t\t\t\t\tpersona.setApeMaterno(getApellidoMaterno());\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tPaDireccion direccion = new PaDireccion();\n\t\t\t\t\t\t\tdireccion.setDireccionId(getDireccionId() == null ? Constante.RESULT_PENDING: getDireccionId());\n\t\t\t\t\t\t\tif (getSelectedOptBusc().intValue() == 1) {\n\t\t\t\t\t\t\t\tdireccion.setTipoViaId(mapGnTipoVia.get(getCmbtipovia().getValue()));\n\t\t\t\t\t\t\t\tdireccion.setViaId(mapGnVia.get(getCmbvia().getValue()));\n\t\t\t\t\t\t\t\tdireccion.setLugarId(null);\n\t\t\t\t\t\t\t\tdireccion.setSectorId(null);\n\t\t\t\t\t\t\t\tdireccion.setNumero(numero);\n\t\t\t\t\t\t\t\tdireccion.setPersonaId(persona.getPersonaId());\n\n\t\t\t\t\t\t\t\tString direccionCompleta = papeletaBo.getDireccionCompleta(direccion,mapIGnTipoVia, mapIGnVia);\n\t\t\t\t\t\t\t\tif (direccionCompleta != null && direccionCompleta.trim().length() > 0) {\n\t\t\t\t\t\t\t\t\tdireccion.setDireccionCompleta(direccionCompleta);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdireccion.setDireccionCompleta(getDireccionCompleta());\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tBuscarPersonaDTO personaDto = getPersonaDto(persona, direccion);\n\t\t\t\t\t\t\tString personaPapeleta = (String) getSessionMap().get(\"personaPapeleta\");\n\t\t\t\t\t\t\tif (personaPapeleta != null\n\t\t\t\t\t\t\t\t\t&& personaPapeleta.equals(\"I\")) {\n\t\t\t\t\t\t\t\tRegistroPapeletasManaged registro = (RegistroPapeletasManaged) getManaged(\"registroPapeletasManaged\");\n\t\t\t\t\t\t\t\tregistro.setDatosInfractor(personaDto);\n\t\t\t\t\t\t\t} else if (personaPapeleta != null\n\t\t\t\t\t\t\t\t\t&& personaPapeleta.equals(\"P\")) {\n\t\t\t\t\t\t\t\tRegistroPapeletasManaged registro = (RegistroPapeletasManaged) getManaged(\"registroPapeletasManaged\");\n\t\t\t\t\t\t\t\tregistro.setDatosPropietario(personaDto);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlimpiar();\n\t\t\t\t\t\t\tesContribuyente = (Boolean) getSessionMap().get(\"esContribuyente\");\n\t\t\t\t\t\t\tif (esContribuyente == true) {\t\n\t\t\t\t\t\t\t\tWebMessages.messageError(\"Es un Contribeyente s�lo se Actualiz� la Direcci�n para Papeletas, los otros datos es por DJ\");\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWebMessages\n\t\t\t\t\t\t\t\t\t.messageError(\"Apellidos y nombres no valido\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWebMessages\n\t\t\t\t\t\t\t\t.messageError(\"Especifique la direccion de la persona\");\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tWebMessages\n\t\t\t\t\t\t.messageError(\"Número de documento de identidad no valido\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\t/*Método para usarse en el momento de ver las reservas de un determinado usuaario en el panel del mismo*/\n\tpublic String verReservas(String nombreusuario) {\n\t\tGson json= new Gson(); \n\t\tDBConnection con = new DBConnection();\n\t\tString sql =\"Select * from alquileres alq, peliculas p where alq.pelicula=p.id and alq.usuario LIKE '\"+nombreusuario+\"' order by p.titulo\"; //Seleccion de los alquileres relacionados con el usuario \n\t\ttry {\n\t\t\t\n\t\t\tArrayList<Alquiler> datos= new ArrayList<Alquiler>(); //ArrayList que va a almacenar los alquileres del usuario\n\t\t\t\n\t\t\tStatement st = con.getConnection().createStatement();\n\t\t\tResultSet rs = st.executeQuery(sql);\n\t\t\t\n\t\t\t//Se cogen los datos necesarios \n\t\t\twhile(rs.next()) {\n\t\t\t\tString idpelicula=rs.getString(\"id\");\n\t\t\t\tint numero_alquiler=rs.getInt(\"numero_alquiler\");\n\t\t\t\tString fecha=rs.getString(\"fecha_alquiler\");\n\t\t\t\tString titulo= rs.getString(\"titulo\"); \n\t\t\t\tString genero= rs.getString(\"genero\"); \n\t\t\t\tString cadenaestreno=rs.getString(\"estreno\");\n\t\t\t\tString estreno=\"\"; \n\t\t\t\t\n\t\t\t\t//comprobación y asignación del atributo estreno:\n\t\t\t\t/*Como en la base de datos se guarda como una cadena de texto, cuando se devuelve\n\t\t\t\t * hay que comprobar su valor y dependiendo del que sea pasarlo a una cadena para pasarla a la clase \n\t\t\t\t * Alquiler*/\n\t\t\t\t\n\t\t\t\tif(cadenaestreno.equals(\"true\")) {\n\t\t\t\t\testreno=\"Si\";\n\t\t\t\t}else if(cadenaestreno.equals(\"false\")) {\n\t\t\t\t\testreno=\"No\";\n\t\t\t\t}\n\t\t\t\tAlquiler alquiler=new Alquiler(numero_alquiler,idpelicula,fecha,titulo,genero,estreno); //uso esta clase para poder enviar los datos\n\t\t\t\tdatos.add(alquiler); //añado el alquiler a los datos que se van a devolver\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\tst.close();\n\t\treturn json.toJson(datos); //devuelvo la lista de los datos en JSON \n\t\t}catch(Exception e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\treturn e.getMessage();\n\t\t}finally {\n\t\t\tcon.desconectar();\n\t\t}\n\t}", "public void consultasSeguimiento() {\r\n try {\r\n switch (opcionMostrarAnalistaSeguim) {\r\n case \"Cita\":\r\n ListSeguimientoRadicacionesConCita = Rad.ConsultasRadicacionYSeguimiento(2, mBsesion.codigoMiSesion());\r\n break;\r\n case \"Entrega\":\r\n ListSeguimientoRadicacionesConCita = Rad.ConsultasRadicacionYSeguimiento(3, mBsesion.codigoMiSesion());\r\n break;\r\n }\r\n } catch (Exception e) {\r\n mbTodero.setMens(\"Error en el metodo '\" + this.getClass() + \".consultasSeguimiento()' causado por: \" + e.getMessage());\r\n mbTodero.error();\r\n }\r\n\r\n }", "public void marcarTodos() {\r\n\t\tfor (int i = 0; i < listaPlantaCargoDto.size(); i++) {\r\n\t\t\tPlantaCargoDetDTO p = new PlantaCargoDetDTO();\r\n\t\t\tp = listaPlantaCargoDto.get(i);\r\n\t\t\tif (!obtenerCategoria(p.getPlantaCargoDet())\r\n\t\t\t\t\t.equals(\"Sin Categoria\"))\r\n\t\t\t\tp.setReservar(true);\r\n\t\t\tlistaPlantaCargoDto.set(i, p);\r\n\t\t}\r\n\t\tcantReservados = listaPlantaCargoDto.size();\r\n\t}", "public Afiliado(String nombrePersona, String apellidoPersona, String duiPersona) {\n //Inicializar Miembros de clase.\n Afiliados = new ArrayList<>();\n NumeroDui = new ArrayList<>();\n FechaAfiliacion = new ArrayList<>();\n //Agregar valores a los arraylist.\n Afiliados.add(nombrePersona + \" \" + apellidoPersona);\n NumeroDui.add(duiPersona);\n FechaAfiliacion.add(ObtenerFechaActual());\n }", "private void registrar() {\n String nombre = txtNombre.getText();\n if (!nombre.trim().isEmpty()) {\n Alumno a = new Alumno();\n \n // cont++ , ++cont\n// contIds++;\n a.setNombre(nombre);\n a.setId(++contIds);\n \n listaAlumnos.add(a);\n\n lblCantidad.setText(\"Cantidad de nombres: \" + listaAlumnos.size());\n\n txtNombre.setText(null);\n txtNombre.requestFocus();\n // Actualiza la interfaz gráfica de la tabla\n tblNombres.updateUI();\n \n// int cont = 1;\n// System.out.println(\"------------------\");\n// System.out.println(\"Listado de alumnos\");\n// System.out.println(\"------------------\");\n// for (String nom : listaNombres) {\n// System.out.println(cont+\") \"+nom);\n// cont++;\n// }\n// System.out.println(\"------------------\");\n }\n }", "public Repartidor(String nombre, String apellido, String direccion, String telefono, String cedula) {\n super(nombre, apellido, direccion, telefono, cedula);\n this.disponible = true; //empieza siendo disponible luego cuando lo utilicemos pasara a no estarlo y asi...\n this.salario = 50; //establecemos un salario inicial de 50 al que luego le adicionaremos segun la cantidad de envios que haya realizado con exito \n }", "public static void main(String[] args) {\n Perro perro = new Perro(1, \"Juanito\", \"Frespuder\", 'M');\n Gato gato = new Gato(2, \"Catya\", \"Egipcio\", 'F', true);\n Tortuga paquita = new Tortuga(3, \"Pquita\", \"Terracota\", 'F', 12345857);\n\n SetJuego equipo = new SetJuego(4, \"Gato equipo\", 199900, \"Variado\", \"16*16*60\", 15, \"Gatos\");\n PelotaMorder pelotita = new PelotaMorder(1, \"bola loca\", 15000, \"Azul\", \"60 diam\");\n\n System.out.println(perro.toString());//ToString original de \"mascotas\"\n System.out.println(gato.toString());//ToString sobrescrito\n System.out.println(paquita.toString());\n\n System.out.println(equipo);//ToString sobrescrito (tambien se ejecuta sin especificarlo)\n System.out.println(pelotita.toString());//Original de \"Juguetes\"\n\n //metodos clase mascota\n perro.darCredito();//aplicado de la interface darcredito\n paquita.darDeAlta(\"Terracota\",\"Paquita\");\n equipo.devolucion(4,\"Gato Equipo\");\n\n //vamos a crear un arraylist\n ArrayList<String> servicios = new ArrayList<String>();\n servicios.add(\"Inyectologia\");\n servicios.add(\"Peluqueria\");\n servicios.add(\"Baño\");\n servicios.add(\"Desparacitacion\");\n servicios.add(\"Castracion\");\n\n System.out.println(\"Lista de servicios: \" + servicios + \", con un total de \" + servicios.size());\n\n servicios.remove(3);//removemos el indice 3 \"Desparacitacion\"\n\n System.out.println(\"Se ha removido un servicio..................\");\n System.out.println(\"Lista de servicios: \" + servicios + \", con un total de \" + servicios.size());\n\n\n //creamos un vector\n Vector<String> promociones = new Vector<String>();\n\n promociones.addElement(\"Dia perruno\");\n promociones.addElement(\"Gatutodo\");\n promociones.addElement(\"10% Descuento disfraz de perro\");\n promociones.addElement(\"Jornada de vacunacion\");\n promociones.addElement(\"Serpiente-Promo\");\n\n System.out.println(\"Lista de promos: \" + promociones);\n System.out.println(\"Total de promos: \" + promociones.size());\n\n promociones.remove(4);//removemos 4 \"Serpiente-Promo\"\n System.out.println(\"Se ha removido una promocion..................\");\n\n System.out.println(\"Lista de promos: \" + promociones);\n System.out.println(\"Total de promos: \" + promociones.size());\n\n String[] dias_Semana = {\"Lunes\",\"Martes\",\"Miercoles\",\"Jueves\",\"Viernes\", \"Sabado\",\"Domingo\"};\n\n try{\n System.out.println(\"Elemento 6 de servicios: \" + dias_Semana[8]);\n } catch (ArrayIndexOutOfBoundsException e){\n System.out.println(\"Ey te pasaste del indice, solo hay 5 elementos\");\n } catch (Exception e){\n System.out.println(\"Algo paso, el problema es que no se que...\");\n System.out.println(\"La siguiente linea ayudara a ver el error\");\n e.printStackTrace();//solo para desarrolladores\n }finally {\n System.out.println(\"------------------------El curso termino! Pero sigue el de Intro a Android!!!!--------------------------\");\n }\n\n }", "public void searchAll() {\r\n\t\tconfiguracionUoDet = new ConfiguracionUoDet();\r\n\t\tidConfiguracionUoDet = null;\r\n\t\tidBarrio = null;\r\n\t\tidCiudad = null;\r\n\t\tidCpt = null;\r\n\t\tidDpto = null;\r\n\t\tmodalidadOcupacion = null;\r\n\t\tcodigoUnidOrgDep = null;\r\n\t\tdenominacion = null;\r\n\t\tllenarListado1();\r\n\t}", "@Override\n public void onClick(View v) {\n\n String nombre=cajanombre.getText().toString();\n String descripcion=descripcionActividad.getText().toString();\n int numeroPersonas = Integer.parseInt(cajaNumerodePersonas.getText().toString());\n\n //String datoResultado=cajaResultado.getText().toString();\n if (numeroPersonas >=2) {\n paquete = numeroPersonas * 50000;\n cajaResultado.setText(\"Valor paquete turistico es:$\" + paquete);\n }\n else {\n paquete = 70000;\n cajaResultado.setText(\"Valor paquete turistico es:$\" + paquete);\n\n }\n\n //Armo los datos de la colección\n reservacion.put(\"nombre\",nombre);\n reservacion.put(\"numeroPersonas\",numeroPersonas);\n reservacion.put(\"valorReserva\",paquete);\n reservacion.put(\"descripcion\",descripcion);\n\n\n registrarPaquete();\n\n\n\n\n }", "public void roomMems(){\r\n\tString[] names ={\"vivek\", \"satish\", \"neeraj\", \"Raju\", \"Dilip\"};\r\n\r\n\tfor(String i:names){ \r\n\t\tSystem.out.println(names[3]);\r\n\t}\r\n\t}", "public void buscarPessoa(){\n\t\tstrCelular = CareFunctions.limpaStrFone(strCelular);\n\t\t System.out.println(\"Preparar \" + strCelular);//\n\t\t \n\t\tif (strCelular.trim().length() > 0){\n\t\t\tSystem.out.println(\"Buscar \" + strCelular);//\n\t\t\tList<Usuario> lstusuario = usuarioDAO.listPorcelular(strCelular);\n\t\t\tSystem.out.println(\"Buscou \" + lstusuario.size());\n\t\t\tsetBooIdentifiquese(false);\n\t\t\tif (lstusuario.size() > 0){\n\t\t\t\tusuario = lstusuario.get(0);\n\t\t\t\tsetBooSelecionouUsuario(true);\n\t\t\t}else{\n\t\t\t\tsetBooSelecionouUsuario(false);\t\t\t\t\n\t\t\t\tsetBooCadastrandose(true);\n\t\t\t\tusuario = new Usuario();\n\t\t\t\tusuario.setUsu_celular(strCelular);\n\t\t\t}\n\t\t\tFacesContext.getCurrentInstance().addMessage(\n\t\t\t\t\tnull,\n\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_INFO,\n\t\t\t\t\t\t\t\"Ahoe\", \"Bem Vindo\"));\t\n\t\t}else{\n\t\t\tSystem.out.println(\"Buscar \" + strCelular);//\n\t\t\tFacesContext.getCurrentInstance().addMessage(\n\t\t\t\t\tnull,\n\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_INFO,\n\t\t\t\t\t\t\t\"Você deve informar o Celular\", \"Não foi possível pesquisar\"));\t\t\t\n\t\t}\n\t}", "public GestorAtracciones()\n {\n gestor_trabajadores = new GestorTrabajadores();\n atracciones = new ArrayList<>();\n lectura = new Scanner(System.in);\n crearAtracciones();\n calculoTipoAtraccion();\n calculoPersonal();\n }", "public void carregarAno() {\n\t\tif (usuario.getOrganizacaoMilitar().toString().equals(\"AMAN\")){\n\t\t\tano.addAll(Arrays.asList(Ano.values()));\n\t\t}\n\t\telse if (usuario.getOrganizacaoMilitar().toString().equals(\"ECEME\")){\n\t\t\tano.addAll(Arrays.asList(Ano.values()));\n\t\t\tano.remove(Ano.TERCEIRO);\n\t\t\tano.remove(Ano.QUARTO);\n\t\t}\n\t\telse{\n\t\t\tcarregarRegistroDoPrimeiroAno();\n\t\t}\n\t}", "public static void SolicitarReserva(Variables var,BaseDades db,Menus Menus,Reserva res,TReserva reserva,sMissatges missatge,bComprobadors comp){\n IntroduccionComprobacionDatos(Menus, var, db, res, reserva, missatge, comp);\r\n }", "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 }", "private void carregarAlunosTurma() {\n AcessoFirebase.getFirebase().addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n getUidUsuariosTurma(dataSnapshot);\n montandoArrayListUsuarios(dataSnapshot);\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n }\n });\n }", "public static void main(String[] args) {\n\t\t\r\n\tString nombre = leerTexto(\"Ingrese un nombre:\");\r\n\tint edad = leerNumero(\"Ingrese su edad:\");\r\n\tString rut = leerTexto(\"Ingresa el RUT:\");\r\n\tchar genero = leerTexto(\"Ingresa el genero: (M/F/O)\").charAt(0);\r\n\tfloat peso = leerNumero(\"Ingrese peso:\");\r\n\tfloat altura = leerNumero(\"Ingrese la altura:\");\r\n\tPersona claudia = new Persona(nombre, rut, edad, genero, peso, altura);\r\n\t\r\n\tnombre = leerTexto(\"Ingrese un nombre:\");\r\n\tedad = leerNumero(\"Ingrese su edad:\");\r\n\trut = leerTexto(\"Ingresa el RUT:\");\r\n\tgenero = leerTexto(\"Ingresa el genero: (M/F/O)\").charAt(0);\r\n\tPersona juliano = new Persona(nombre, rut, edad, genero);\r\n\t\r\n\tPersona noelia = new Persona();\r\n\tnoelia.setNombre(leerTexto(\"Ingresa un nombre\"));\r\n\tnoelia.setEdad(leerNumero(\"Ingresa la edad\"));\r\n\tnoelia.setRut(leerTexto(\"Ingresa el RUT\"));\r\n\tnoelia.setGenero(leerTexto(\"Ingresa el genero\").charAt(0));\r\n\tnoelia.setAltura(leerNumero(\"Ingresa la altura\"));\r\n\tnoelia.setPeso(leerNumero(\"Ingresa el peso\"));\r\n\t\r\n\tPersona[] perso = new Persona[3];\r\n\tperso[0] = claudia;\r\n\tperso[1] = juliano;\r\n\tperso[2] = noelia;\r\n\t\r\n\tfor (Persona persona : perso) {\r\n\t\tif (persona.calcularIMC()==Persona.PESO_BAJO) {\r\n\t\t\tescribir(\"Pongale sus buenas cazuelas\");\r\n\t\t}else {\r\n\t\t\tif (persona.calcularIMC()==Persona.PESO_IDEAL) {\r\n\t\t\t\tescribir(\"Estamos tiki taka\");\r\n\t\t\t}else {\r\n\t\t\t\tescribir(\"Menos coffe break!\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Mayor de edad\r\n\t\tescribir(\"La persona \" + persona.getNombre() + \" es mayor de edad? \" + persona.esMayorDeEdad());\r\n\t\t//Mostrar el toString()\r\n\t\tescribir(persona.toString());\r\n\t }\r\n\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 void adicionarServicos() {\n int i;\n if (hospedesCadastrados.isEmpty()) {\n System.err.println(\"Não existem hospedes cadastrados!\\n\");\n } else {\n\n System.err.println(\"Digite o cpf do hospede que deseja adicionar servicos:\");\n listarHospedes();\n int cpf = verifica();\n for (i = 0; i < hospedesCadastrados.size(); i++) {\n if (hospedesCadastrados.get(i).getCpf() == cpf) {//pega o indice i do objeo pessoa, pega o id da pessoa e compara com o id da pessoa digitada\n if (hospedesCadastrados.get(i).getContrato().isSituacao()) {//verifica se a situaçao do contrato ainda está aberta para esse hospede\n\n System.err.println(\"O que deseja editar do contrato\\n\");\n //adicionar carro, trocar de quarto, adicionar conta de restaurante,\n //encerrar contrato\n\n System.err.println(\"Adicionar carro (1):\\nAdicionar restaurante (2):\\n\"\n + \"Adicionar horas de BabySitter (3):\\nAdicionar quarto(4):\\n\");\n int caso = verifica();\n switch (caso) {\n case 1://carro\n if (carrosCadastrados.isEmpty()) {\n System.err.println(\"Nao existem carros cadastrados!\\n\");\n } else {\n listarCarros();\n System.err.println(\"Digite o id do carro que deseja contratar:\\n\");\n int idCarro = verifica();\n\n for (int j = 0; j < carrosCadastrados.size(); j++) {\n if (carrosCadastrados.get(j).getId() == idCarro) {\n if (carrosCadastrados.get(j).isEstado()) {\n System.err.println(\"Esse carro já está cadastrado.\\n\");\n } else {\n hospedesCadastrados.get(i).getContrato().setCarros(carrosCadastrados.get(j));\n carrosCadastrados.get(j).setEstado(true);\n }\n }\n }\n }\n break;\n\n case 2://restaurante\n System.err.println(\"Digite o quanto deseja gastar no restaurente\\n\");\n double valorRestaurante = ler.nextDouble();\n// idd();\n// int idRestaurante = id;\n// Restaurante restaurante = new Restaurante(idRestaurante, valorRestaurante);\n hospedesCadastrados.get(i).getContrato().setValorRestaurante(valorRestaurante);\n break;\n case 3://babysitter\n System.err.println(\"Digite o tempo gasto no BabySytter em horas\\n\");\n double tempoBaby = ler.nextDouble();\n hospedesCadastrados.get(i).getContrato().setHorasBaby(tempoBaby);\n break;\n case 4://quartos\n\n if (quartosCadastrados.isEmpty()) {\n\n } else {\n System.err.println(\"Digite o numero do quarto que deseja contratar:\\n\");\n listarQuartos();\n int num = verifica();\n System.err.println(\"Digite a quantidade de dis que pretente alugar o quarto:\\n\");\n int dias = verifica();\n for (int j = 0; j < quartosCadastrados.size(); j++) {\n if (num == quartosCadastrados.get(j).getNumero()) {//verifica se o numero digitado é igual ao numero do quarto do laco\n if (quartosCadastrados.get(j).getEstado()) {//verifica se o estado do quarto está como true\n System.err.println(\"Este quarto já está cadastrado em um contrato\");\n } else {//se o estado tiver em true é porque o quarto ja está cadastrado\n\n hospedesCadastrados.get(i).getContrato().setQuartos(quartosCadastrados.get(j));\n hospedesCadastrados.get(i).getContrato().getQuartosCadastrados().get(j).setDias(dias);\n hospedesCadastrados.get(i).getContrato().getQuartosCadastrados().get(j).setEstado(true);//seta o estado do quarto como ocupado\n System.err.println(\"Quarto cadastrado!\\n\");\n }\n\n }\n\n }\n\n//remove all remove todas as pessoas com tal nome\t\n }\n break;\n\n }\n } else {\n System.err.println(\"O contrato deste Hospede encontra-se encerrado\");\n break;\n }\n }\n }\n }\n }", "private void cargarAutos() {\n Auto autos[]={\n new Auto(\"Bocho\",\"1994\"),\n new Auto(\"Jetta\",\"1997\"),\n new Auto(\"Challenger\",\"2011\"),\n new Auto(\"Ferrari\",\"2003\")\n };\n for (Auto auto : autos) {\n cboAutos.addItem(auto);\n \n }\n spnIndice.setModel(new SpinnerNumberModel(0, 0, autos.length-1, 1));\n }", "public static void main(String args[]){\n int x = 10;\r\n List<Perro> perros = new ArrayList();\r\n \r\n Perro perro=new Perro();\r\n \r\n Persona persona = new Persona();\r\n persona.setAltura(5.5);\r\n persona.setColorPiel(\"Blanca\");\r\n persona.setEdad(16);\r\n persona.setGenero('f');\r\n persona.setNacionalidad(\"Japonesa\");\r\n persona.setPeso(130);\r\n persona.setTipoDePelo(\"Lacio\"); \r\n persona.setOcupacion(\"Dinero\");\r\n \r\n //Se dan todas las características\r\n perro.setNombre(\"Manuel\");\r\n perro.setColor(\"Negro\");\r\n perro.setTamano(10.2);\r\n perro.setRaza(\"Golden\");\r\n perro.setTipoDePelo(\"Crespo\");\r\n perro.setAdoptado(false);\r\n perro.setGenero('H');\r\n \r\n perros.add(perro);//Se añade a la instancia\r\n \r\n perro = new Perro();//Se limpia y se vuelve a llamar la instancia\r\n perro.setNombre(\"Igor\");\r\n perro.setColor(\"Negro\");\r\n perro.setTamano(10.2);\r\n perro.setRaza(\"Golden\");\r\n perro.setTipoDePelo(\"Lacio\");\r\n perro.setAdoptado(false);\r\n perro.setGenero('H');\r\n \r\n perros.add(perro);\r\n \r\n perro = new Perro();\r\n perro.setNombre(\"Luli\");\r\n perro.setColor(\"Negro\");\r\n perro.setTamano(10.2);\r\n perro.setRaza(\"Siberiano\");\r\n perro.setTipoDePelo(\"Crespo\");\r\n perro.setAdoptado(false);\r\n perro.setGenero('H');\r\n \r\n perros.add(perro);\r\n //****************CUANDO EJECUTES ESTO VE COMENTADO LOS BLOQUES QUE NO QUIERES QUE SE USEN*************\r\n //foreach y for hace la misma funcion\r\n //Uso de for\r\n for (Perro perro1:perros){\r\n System.out.println(perro1.getNombre());\r\n System.out.println(perro1.getColor());\r\n System.out.println(perro1.getTamano());\r\n System.out.println(perro1.getRaza());\r\n System.out.println(perro1.getTipoDePelo());\r\n }\r\n \r\n //Formas de uso del for each\r\n perros.forEach(perro1->\r\n System.out.println(perro1.getNombre()));\r\n \r\n perros.forEach(perro1 ->{//Se define una variable que es perro1 y esta recorrera toda la lista\r\n System.out.println(perro1.getNombre());\r\n System.out.println(perro1.getColor());\r\n System.out.println(perro1.getTamano());\r\n System.out.println(perro1.getRaza());\r\n System.out.println(perro1.getTipoDePelo()); \r\n System.out.println();\r\n \r\n });\r\n \r\n \r\n System.out.println(\"Blanco\".equals(perro.color)? \"Si es blanco\":\"No es blanco\");\r\n \r\n //Uso del if\r\n if (((4/2==0)&&(10/5 !=0))||(100/20==0)){\r\n System.out.println(\"Es bisiesto\");\r\n }else{\r\n System.out.println(\"No es bisiesto\");\r\n }\r\n \r\n //Uso del switcH\r\n switch(x){\r\n case 6:\r\n System.out.println(\"Es verdadero\");\r\n break;\r\n case 2:\r\n System.out.println(\"Es falso\");\r\n break;\r\n default:\r\n System.out.println(\"No es ninguna\");\r\n \r\n //Uso de la lista de un item en especifico \r\n System.out.println(\"Nombre: \" + perros.get(2).getNombre());//El número del get\r\n System.out.println(\"Color: \"+perros.get(2).getColor());//define que item es que tomará\r\n System.out.println(\"Raza: \"+perros.get(2).getRaza());\r\n \r\n \r\n //Demostración del uso de getters\r\n System.out.println(\"Nombre: \");\r\n System.out.println(\"Altura: \" + persona.getAltura());\r\n System.out.println(\"Color: \" + persona.getColorPiel());\r\n System.out.println(\"Edad: \"+persona.getEdad());\r\n System.out.println(\"Genero: \"+persona.getGenero());\r\n System.out.println(\"Nacionalidad: \"+persona.getNacionalidad());\r\n System.out.println(\"Peso: \"+persona.getPeso());\r\n System.out.println(\"Tipo de Pelo: \"+persona.getTipoDePelo());\r\n \r\n }\r\n \r\n}", "public ArrayList<Reserva> getReservasDoVeiculo() {\n\t\treturn reservasDoVeiculo;\n\t}", "private void realizarVinculos() {\n btnVoltar = findViewById(R.id.btnVoltar);\n\n edtNome = findViewById(R.id.edtNome);\n edtCPF = findViewById(R.id.edtCpf);\n edtTelefone = findViewById(R.id.edtTelefone);\n edtIdade = findViewById(R.id.edtIdade);\n edtEmail = findViewById(R.id.edtEmail);\n }", "private void recogerDatos() {\n\t\ttry {\n\t\t\tusuSelecc.setId(etId.getText().toString());\n\t\t\tusuSelecc.setName(etNombre.getText().toString());\n\t\t\tusuSelecc.setFirstName(etPApellido.getText().toString());\n\t\t\tusuSelecc.setLastName(etSApellido.getText().toString());\n\t\t\tusuSelecc.setEmail(etCorreo.getText().toString());\n\t\t\tusuSelecc.setCustomFields(etAuth.getText().toString());\n\t\t} catch (Exception e) {\n\t\t\t// Auto-generated catch block\n\t\t\tmostrarException(e.getMessage());\n\t\t}\n\t}", "private void modificarReserva() throws Exception {\r\n\t\tif (mngRes.existeReservaPeriodo(getSitio().getId())) {\r\n\t\t\tif (mayorEdad) {\r\n\t\t\t\tmngRes.modificarReserva(getEstudiante(), periodo.getPrdId(), getSitio(), null);\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t} else {\r\n\t\t\t\tmngRes.modificarReserva(getEstudiante(), periodo.getPrdId(), getSitio(),\r\n\t\t\t\t\t\tgetDniRepresentante() + \";\" + getNombreRepresentante());\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t}\r\n\t\t\tMensaje.crearMensajeINFO(\"Reserva realizada correctamente, no olvide descargar su contrato.\");\r\n\t\t} else {\r\n\t\t\tMensaje.crearMensajeWARN(\"El sitio seleccionado ya esta copado, favor eliga otro.\");\r\n\t\t}\r\n\t}", "List<Reservation> trouverlisteDeReservationAyantUneDateDenvoieDeMail();", "public void retur() {\r\n System.out.println(\"Hvem skal returnere DVD'en?\");\r\n String person = scan.nextLine().toLowerCase();\r\n if(personListe.containsKey(person)) {\r\n\r\n if (personListe.get(person).laanerSize() > 0) {\r\n System.out.println(\"Hvilken DVD skal returneres?\");\r\n String tittel = scan.nextLine();\r\n DVD dvd = personListe.get(person).hentLaanerListe().get(tittel);\r\n\r\n if(personListe.get(person).hentLaanerListe().containsKey(tittel)) {\r\n personListe.get(person).fjernFraLaaner(personListe.get(person).hentLaanerListe().get(tittel));\r\n dvd.hentEier().faaTilbake(dvd);\r\n }\r\n\r\n else {\r\n System.out.println(person + \" laaner ikke \" + tittel);\r\n }\r\n\r\n }\r\n\r\n else {\r\n System.out.println(person + \" laaner ikke noen DVD'er\");\r\n }\r\n\r\n }\r\n else {\r\n System.out.println(\"Den personen finnes ikke\");\r\n }\r\n\r\n }", "public ReservaBean() {\r\n nrohabitacion=1;\r\n createLista(nrohabitacion);\r\n editable=true;\r\n sino=\"\";\r\n \r\n reserva = new TReserva();\r\n }", "private void caricaLista() {\n /** variabili e costanti locali di lavoro */\n ArrayList unaLista = null;\n CampoDati unCampoDati = null;\n CDBLinkato unCampoDBLinkato = null;\n //@todo da cancellare\n try { // prova ad eseguire il codice\n /* recupera il campo DB specializzato */\n unCampoDBLinkato = (CDBLinkato)unCampoParente.getCampoDB();\n\n /* recupera la lista dal campo DB */\n unaLista = unCampoDBLinkato.caricaLista();\n\n /* recupera il campo dati */\n unCampoDati = unCampoParente.getCampoDati();\n\n /* registra i valori nel modello dei dati del campo */\n if (unaLista != null) {\n unCampoDati.setValoriInterni(unaLista);\n// unCampoDatiElenco.regolaElementiAggiuntivi();\n } /* fine del blocco if */\n\n } catch (Exception unErrore) { // intercetta l'errore\n /* mostra il messaggio di errore */\n Errore.crea(unErrore);\n } /* fine del blocco try-catch */\n\n }", "public Regla2(){ /*ESTE ES EL CONSTRUCTOR POR DEFECTO */\r\n\r\n /* TODAS LAS CLASES TIENE EL CONSTRUCTOR POR DEFECTO, A VECES SE CREAN AUTOMATICAMENTE, PERO\r\n PODEMOS CREARLOS NOSOTROS TAMBIEN SI NO SE HUBIERAN CREADO AUTOMATICAMENTE\r\n */\r\n \r\n }", "public void search() {\n listTbagendamentos\n = agendamentoLogic.findAllTbagendamentoByDataAndPacienteAndFuncionario(dataSearch, tbcliente, tbfuncionario);\n }", "@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}", "public void searchCliente(JTextField txt, TextAutoCompleter match){\n match.removeAllItems(); // Remover todos los elementos del Autocompletador. \n cl = clientes();//Inserta todos los clientes en el vector. \n cl.forEach(item -> { //Agrega al autocompletador nombre e ID de los clientes \n match.addItem(item.getNombreCliente()+ \" \" + item.getApellidoPaterno() + \" \" + String.valueOf(item.getID_Cliente()));\n match.addItem(String.valueOf(item.getID_Cliente()));\n });\n }", "public void setApellidos(String p) { this.apellidos = p; }", "public String getApellidos(){\n return apellidos;\n }", "public String[] DevuelvecabeceraRen(){\r\n\t\tString vec[]={\" \",\"id\",\"int\",\"-\",\"*\",\"/\",\"(\",\")\",\"$\",\"E\",\"T\",\"F\"};\r\n\t\treturn vec;\r\n\t\t\r\n\t}", "private void cargarRegistro() {\n\t\tif (filaId != null) {\n\t\t\tCursor bar = bdHelper.getBar(filaId);\n // Indicamos que queremos controlar el Cursor\n\t\t\tstartManagingCursor(bar);\n\n\t\t\t// Obtenemos el campo categoria\n\t\t\tString categoria = bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_CATEGORIA));\n\t\t\t// Seleccionamos la categoría en el Spinner\n\t\t\tfor (int i=0; i<categoriaSpinner.getCount();i++){\n\t\t\t\t// Cargamos una de la opciones del listado desplegable\n\t\t\t\tString s = (String) categoriaSpinner.getItemAtPosition(i);\n\t\t\t\t// Si coindice con la que está en la BD la seleccionamos en el listado desplegable\n\t\t\t\tif (s.equalsIgnoreCase(categoria)){\n\t\t\t\t\tcategoriaSpinner.setSelection(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Obtenemos el campo relacion calidad-precio\n\t\t\tString relacion = bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_RELACION));\n\t\t\t// Seleccionamos en el Spinner la relacion c-p\n\t\t\tfor (int i=0; i<relacionSpinner.getCount();i++){\n\t\t\t\t// Cargamos una de la opciones del listado desplegable\n\t\t\t\tString s = (String) relacionSpinner.getItemAtPosition(i);\n\t\t\t\t// Si coindice con la que está en la BD la seleccionamos en el listado desplegable\n\t\t\t\tif (s.equalsIgnoreCase(relacion)){\n\t\t\t\t\trelacionSpinner.setSelection(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Obtenemos el campo del acompañante\n\t\t\tString acompanante = bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_ACOMPANANTE));\n\t\t\t// Seleccionamos el formato en el Spinner\n\t\t\tfor (int i=0; i<acompananteSpinner.getCount();i++){\n\t\t\t\t// Cargamos una de la opciones del listado desplegable\n\t\t\t\tString s = (String) acompananteSpinner.getItemAtPosition(i);\n\t\t\t\t// Si coindice con la que está en la BD la seleccionamos en el listado desplegable\n\t\t\t\tif (s.equalsIgnoreCase(acompanante)){\n\t\t\t\t\tacompananteSpinner.setSelection(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Rellenamos las Vistas\n\t\t\tnombreText.setText(bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_NOMBRE)));\n\t\t\tdireccionText.setText(bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_DIRECCION)));\n\t\t\tnotasText.setText(bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_NOTAS)));\n\t\t\tprecioText.setText(bar.getString(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_PRECIO)));\n\t\t\tvaloracionRB.setRating(bar.getFloat(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_VALORACION)));\n\n // Tratamos las fechas del registro\n\t\t\tlong fecha = bar.getLong(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_FEC_ULT_VIS));\n\t\t\tprimeraFecha.setTimeInMillis(fecha);\n\t\t\tfecha = bar.getLong(bar.getColumnIndexOrThrow(BaresBDAdapter.CAMPO_FEC_PRI_VIS));\n\t\t\tif (fecha>0) {\n\t\t\t\tultimaFecha=Calendar.getInstance();\n\t\t\t\tultimaFecha.setTimeInMillis(fecha);\n\t\t\t}\n\t\t\t// Dejamos de controlar el cursor de la BD\n\t\t\tstopManagingCursor(bar);\n\t\t}\n\t}", "public void listarProvincia() {\n provincias = JPAFactoryDAO.getFactory().getProvinciaDAO().find();\n// for(int i=0;i<provincias.size();i++ ){\n// System.out.println(\"lista:\"+provincias.get(i).getNombreprovincia());\n// }\n }", "public void guardarSolicitud() {\n Map<String, String> paramMap = getParametrosSesion();\n String cadenaFirmada;\n try {\n if (paramMap != null) {\n cadenaFirmada = paramMap.get(firmaFormHelper.FIRMA_DIGITAL);\n firmaFormHelper.setSelloDigital(paramMap.get(FirmaFormHelper.FIRMA_DIGITAL));\n\n SimpleDateFormat formato = new SimpleDateFormat(\"dd/MM/yyyy\");\n produccion.setFechProduccion(new Date());\n desperdiciosHelper.setFechaAcuse(formato.format(produccion.getFechProduccion()));\n\n if (cadenaFirmada.length() > 0) {\n guardarRangosFolios();\n Acuse acuse = new Acuse();\n acuse.setSerieAcuse(TipoAcuse.DESPERDICIO);\n acuse.setIdProveedor(produccionCigarrosHelper.getProveedor().getIdProveedor());\n acuse.setSelloDigital(firmaFormHelper.getSelloDigital());\n acuse.setCadenaOriginal(firmaFormHelper.getCadenaOriginal());\n acuse.setFecCaptura(new Date());\n desperdiciosHelper.setIdAcuseRecibo(commonService.crearAcuse(acuse));\n habilitarPnlAcuse();\n registroMovimientoBitacora(getSession(), IdentificadorProcesoEnum.CONTRIBUYENTE_TRAMITES, new Date(), new Date(), MovimientosBitacoraEnum.DESPERDICIOS_DESTRUCCION);\n } else {\n habilitarPnlPrincipal();\n }\n }\n } catch (CommonServiceException e) {\n LOGGER.error(e.getMessage(), e);\n addErrorMessage(ERROR, \"No se pudo generar el acuse\");\n } catch (Exception ex) {\n LOGGER.error(ex.getMessage());\n }\n }", "public void AumentarVictorias() {\r\n\t\tthis.victorias_actuales++;\r\n\t\tif (this.victorias_actuales >= 9) {\r\n\t\t\tthis.TituloNobiliario = 3;\r\n\t\t} else if (this.victorias_actuales >= 6) {\r\n\t\t\tthis.TituloNobiliario = 2;\r\n\t\t} else if (this.victorias_actuales >= 3) {\r\n\t\t\tthis.TituloNobiliario = 1;\r\n\t\t} else {\r\n\t\t\tthis.TituloNobiliario = 0;\r\n\t\t}\r\n\t}", "@Test\n public void testBuscar_String() {\n Repositorio repo = new RepositorioImpl();\n \n Persona persona = new Persona();\n persona.setNombre(\"Hugo\");\n persona.setApellido(\"González\");\n persona.setNumeroDocumento(\"4475199\");\n repo.crear(persona);\n \n Persona persona2 = new Persona();\n persona2.setNombre(\"Hugoncho\");\n persona2.setApellido(\"González\");\n persona2.setNumeroDocumento(\"4475188\");\n repo.crear(persona2);\n \n Persona persona3 = new Persona();\n persona3.setNombre(\"Ismael\");\n persona3.setApellido(\"González\");\n persona3.setNumeroDocumento(\"4477777\");\n repo.crear(persona3);\n \n \n List<Identificable> lista = repo.buscar(\"Hugo\");\n assertThat(lista, hasItems(persona, persona2));\n assertThat(lista, not(hasItem(persona3)));\n \n List<Identificable> lista2 = repo.buscar(\"4477777\");\n assertThat(lista2, hasItem(persona3));\n assertThat(lista2,not(hasItems(persona,persona2)));\n \n \n }", "public void armarPreguntas(){\n preguntas = file.listaPreguntas(\"Preguntas.txt\");\n }", "public ModifyRoomReservation() {\n initComponents();\n\n btn_search.requestFocus();\n\n getAllIds();\n\n }", "@Override\r\n\tpublic String toString() {\r\n\t\treturn \"Reservas [id=\" + id + \", id_habitacion=\" + id_habitacion + \", dni=\" + dni + \", desde=\" + desde\r\n\t\t\t\t+ \", hasta=\" + hasta + \"]\";\r\n\t}", "private void cargarRemisiones() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\tparametros.put(\"nro_ingreso\", admision_seleccionada.getNro_ingreso());\r\n\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\tparametros.put(\"tipo_hc\", \"\");\r\n\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE, admision_seleccionada);\r\n\r\n\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\tIRutas_historia.PAGINA_REMISIONES, \"REMISIONES\", parametros);\r\n\t}", "public void update() {\n\t\trl = DBManager.getReservationList();\n\t}", "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 void transcribir() \r\n\t{\r\n\t\tpalabras = new ArrayList<List<CruciCasillas>>();\r\n\t\tmanejadorArchivos = new CruciSerializacion();\r\n\t\tint contador = 0;\r\n\t\t\r\n\t\tmanejadorArchivos.leer(\"src/Archivos/crucigrama.txt\");\r\n\t\t\r\n\t\tfor(int x = 0;x<manejadorArchivos.getPalabras().size();x++){\r\n\t\t\t\r\n\t\t\tcontador++;\r\n\t\t\t\r\n\t\t\tif (contador == 4) {\r\n\t\t\t\r\n\t\t\t\tList<CruciCasillas> generico = new ArrayList<CruciCasillas>();\r\n\t\t\t\t\r\n\t\t\t\tfor(int y = 0; y < manejadorArchivos.getPalabras().get(x).length();y++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\tgenerico.add(new CruciCasillas(manejadorArchivos.getPalabras().get(x).charAt(y)));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (y == (manejadorArchivos.getPalabras().get(x).length() - 1)) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tpalabras.add(generico);\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}\r\n\t\t\t\tcontador = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t}", "@Override\n protected void carregaObjeto() throws ViolacaoRegraNegocioException {\n entidade.setNome( txtNome.getText() );\n entidade.setDescricao(txtDescricao.getText());\n entidade.setTipo( txtTipo.getText() );\n entidade.setValorCusto(new BigDecimal((String) txtCusto.getValue()));\n entidade.setValorVenda(new BigDecimal((String) txtVenda.getValue()));\n \n \n }", "private void creaModuloMem() {\n /* variabili e costanti locali di lavoro */\n ArrayList<Campo> campi = new ArrayList<Campo>();\n ModuloRisultati modulo;\n Campo campo;\n\n try { // prova ad eseguire il codice\n\n campo = CampoFactory.intero(Campi.Ris.codicePiatto.getNome());\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.nomePiatto.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"piatto\");\n campo.setToolTipLista(\"nome del piatto\");\n campo.decora()\n .etichetta(\"nome del piatto\"); // le etichette servono per il dialogo ricerca\n campo.setLarghezza(250);\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.categoria.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"categoria\");\n campo.setToolTipLista(\"categoria del piatto\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteVolte.getNome());\n campo.setVisibileVistaDefault();\n campo.setLarghezza(80);\n campo.setTitoloColonna(\"quante volte\");\n campo.setToolTipLista(\n \"quante volte questo piatto è stato offerto nel periodo analizzato\");\n campo.decora().etichetta(\"quante volte\");\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quantiCoperti.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"coperti\");\n campo.setToolTipLista(\"numero di coperti che avrebbero potuto ordinare\");\n campo.decora().etichetta(\"n. coperti\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteComande.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"comande\");\n campo.setToolTipLista(\"numero di comande effettive\");\n campo.decora().etichetta(\"n. comande\");\n campo.setLarghezza(80);\n campo.setTotalizzabile(true);\n campi.add(campo);\n\n campo = CampoFactory.percentuale(Campi.Ris.gradimento.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"gradimento\");\n campo.setToolTipLista(\n \"percentuale di gradimento (è il 100% se tutti i coperti potenziali lo hanno ordinato)\");\n campo.decora().etichetta(\"% gradimento\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n modulo = new ModuloRisultati(campi);\n setModuloRisultati(modulo);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }", "Reserva Obtener();", "public void setApellidos(String apellidos){\n if(apellidos == null){\n throw new IllegalArgumentException(\"Apellidos de usuario igual a null\");\n }\n this.apellidos = apellidos;\n }", "public Iterator<R> reservationsByName(String name){\n // Return an iterator of active reservations for a name.\n //loop through the arrayList\n for(Reservation r: listR){\n //if we find the name that equals our given name, add that reservation to our temp list\n if(r.getName().equals(name)){\n newList.add(r);\n }\n }\n //return iterator for temp list\n IterName iter = new IterName();\n return iter;\n }", "public static void myReservations(String p, ArrayList<Reservation> rTable) {\n\t\tSystem.out.println(\"Reservations of passenger \" + p + \":\" );\n\t\tfor(int i = 0; i < rTable.size(); i++){\n\t\t\tif(rTable.get(i).seatOwner() == p){\n\t\t\t\tSystem.out.println(rTable.get(i));\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic List<Reservation> rechercherReservation(Voyage v, Client c) {\n\t\treturn null;\r\n\t}", "public void asignarNombre(String name);", "Reservation createReservation();", "public static void main(String[] args) {\n Locale.setDefault(Locale.US);\n Scanner sc = new Scanner(System.in);\n \n System.out.println(\"Entre com total de quartos\"); \n int n = sc.nextInt();\n String nome;\n String email;\n Integer quarto;\n \n aluguel[] vect = new aluguel[n];\n \n for (int i=0; i<3; i++) { \n System.out.println(\"\"); \n System.out.println(\"Entre com os dados da locatario: Nome, e-mail e número do quarto:\");\n System.out.println(\"\");\n System.out.println(\"Nome:\");\n \n nome = sc.next();\n System.out.println(\"\");\n System.out.println(\"E-mail:\"); \n email = sc.next();\n System.out.println(\"\");\n System.out.println(\"Quarto:\");\n\n quarto = sc.nextInt();\n \n vect[quarto] = new aluguel(nome,email,quarto);\n }\n \n System.out.println(\"\");\n System.out.println(\"Quartos ocupados:\");\n System.out.println(\"\");\n for (int i=0; i<vect.length; i++) {\n\t \n\t if (vect[i] != null) {\n\t\t System.out.println(\"\");\n\t\t System.out.println(Integer.toString(i)+\" - \" + vect[i].getNome()+\", \"+vect[i].getEmail());\n\t\t \n\t }\n }\n sc.close();\t\t\n\t}", "private String autores(Proyecto proyecto) {\r\n String resultado = \"\";\r\n Item estadoRenunciado = itemService.buscarPorCatalogoCodigo(CatalogoEnum.ESTADOAUTOR.getTipo(), EstadoAutorEnum.RENUNCIADO.getTipo());\r\n if (proyecto.getAutorProyectoList() == null) {\r\n return \"\";\r\n }\r\n int contador = 0;\r\n for (AutorProyecto autorProyecto : proyecto.getAutorProyectoList()) {\r\n if (estadoRenunciado.getId().equals(autorProyecto.getEstadoAutorId())) {\r\n continue;\r\n }\r\n EstudianteCarrera estudianteCarrera = estudianteCarreraService.buscarPorId(new EstudianteCarrera(autorProyecto.getAspiranteId().getId()));\r\n Persona persona = personaService.buscarPorId(new Persona(estudianteCarrera.getEstudianteId().getId()));\r\n if (contador == 0) {\r\n if (persona == null) {\r\n continue;\r\n }\r\n resultado = (persona.getApellidos() + \" \" + persona.getNombres());\r\n } else {\r\n resultado = (resultado + \", \" + persona.getApellidos() + \" \" + persona.getNombres());\r\n }\r\n contador++;\r\n }\r\n return resultado;\r\n }" ]
[ "0.621324", "0.61553824", "0.59605914", "0.58454245", "0.58108026", "0.5787472", "0.57851744", "0.57541585", "0.56516916", "0.56512725", "0.5633586", "0.56235445", "0.5589853", "0.5572178", "0.5500801", "0.5498725", "0.54685557", "0.543382", "0.54228914", "0.5418998", "0.53743714", "0.53557223", "0.5354427", "0.53524005", "0.53345984", "0.5322175", "0.5318543", "0.5311339", "0.5302858", "0.5297865", "0.529174", "0.5290214", "0.5270374", "0.5257691", "0.5254991", "0.5252364", "0.5251721", "0.52436376", "0.52416986", "0.5232144", "0.52304375", "0.52296335", "0.521907", "0.52158874", "0.52157927", "0.52131116", "0.5211954", "0.5201258", "0.5200692", "0.5199097", "0.5198721", "0.5189704", "0.51895183", "0.518752", "0.51866925", "0.518486", "0.51725096", "0.51711595", "0.51677346", "0.51655877", "0.51636225", "0.5146726", "0.51435435", "0.5138708", "0.51355195", "0.5134107", "0.5123172", "0.51205397", "0.5118624", "0.5116559", "0.5111006", "0.5091205", "0.50904506", "0.509024", "0.50875115", "0.50847846", "0.5081712", "0.5077423", "0.5074816", "0.50707686", "0.5068152", "0.50533515", "0.5051712", "0.50501555", "0.5044075", "0.50351244", "0.503368", "0.50332844", "0.50317645", "0.5029327", "0.50258887", "0.50250447", "0.502074", "0.50123215", "0.500986", "0.5008044", "0.50068414", "0.50038254", "0.50003964", "0.49958098" ]
0.6239032
0
Post que realizamos para agregar una reserva de una sala
@PostMapping("reservar") public ReservasEntity add(@RequestBody ReservasEntity reserva ) { return reservaService.add(reserva); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void ingresarReserva() throws Exception {\r\n\t\tif (mngRes.existeReservaPeriodo(getSitio().getId())) {\r\n\t\t\tif (mayorEdad) {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(), null);\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t} else {\r\n\t\t\t\tmngRes.crearReserva(getEstudiante(), getSitio(), periodo.getPrdId(),\r\n\t\t\t\t\t\tgetDniRepresentante() + \";\" + getNombreRepresentante());\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t}\r\n\t\t\tMensaje.crearMensajeINFO(\"Reserva realizada correctamente, no olvide descargar su contrato.\");\r\n\t\t} else {\r\n\t\t\tMensaje.crearMensajeWARN(\"El sitio seleccionado ya esta copado, favor eliga otro.\");\r\n\t\t}\r\n\t}", "@RequestMapping(value=\"/add\", method = RequestMethod.POST)\r\n public void addAction(@RequestBody Reservation reservation){\n reservationService.create(reservation);\r\n }", "@RequestMapping(value=\"/reservas\", method=RequestMethod.POST)\r\n\tpublic void crearReserva(@RequestBody @Valid Reserva r) throws SistemaReservaException{\n\t\tif(!reservaRpository.obtenerTraslapes(r.getFechaInicio(), r.getFechaFin()).isEmpty()){\r\n\t\t\tthrow new SistemaReservaException(); \r\n\t\t }\r\n\t\t reservaRpository.save(r);\r\n\t}", "private void insertServiceRequest() {\n Random rand = new Random();\r\n service_id = rand.nextInt(Integer.MAX_VALUE);\r\n int tokenSeed = rand.nextInt(Integer.MAX_VALUE);\r\n current_token = md5(tokenSeed + \"\");\r\n\r\n Calendar cal = Calendar.getInstance();\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\r\n String fecha = sdf.format(cal.getTime());\r\n\r\n int deliver_state = 1;\r\n\r\n int costo = (int) Math.round(destinations.get(0).total_price);\r\n\r\n ArrayList<String> param = new ArrayList<>();\r\n param.add(service_id + \"\");\r\n param.add(current_token);\r\n param.add(fecha);\r\n param.add(deliver_state + \"\");\r\n param.add(id_cliente + \"\");\r\n param.add(costo + \"\");\r\n param.add(\"0\");\r\n RestClient.get().executeCommand(\"8\", param.toString(), new Callback<Response>() {\r\n @Override\r\n public void success(Response response, retrofit.client.Response response2) {\r\n\r\n insertRoutes();\r\n }\r\n\r\n @Override\r\n public void failure(RetrofitError error) {\r\n hideOverlay();\r\n showDialog(\r\n getResources().getString(\r\n R.string.msg_serverError_title),\r\n getResources().getString(\r\n R.string.msg_serverError), false, false);\r\n }\r\n });\r\n\r\n\r\n }", "@TargetApi(Build.VERSION_CODES.KITKAT)\n @RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public void createReservation() {\n Time timeObj = null;\n DateFormat formatter= new SimpleDateFormat(\"kk:mm\");\n try {\n timeObj = new Time(formatter.parse(time).getTime());\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n Bitmap generatedQR = generateQR();\n //Create reservation & save to Repository\n Reservation reservation = new Reservation(film, timeObj, listPlaces, generatedQR);\n Repository.addReservation(reservation);\n }", "Reservierung insert(Reservierung reservierung) throws ReservierungException;", "public void reservarSitio() {\r\n\t\ttry {\r\n\t\t\tif (sitioId == null)\r\n\t\t\t\tMensaje.crearMensajeWARN(\"Debe seleccionar sitio para la reserva.\");\r\n\t\t\telse if (!mayorEdad && (getDniRepresentante() == null || getNombreRepresentante() == null\r\n\t\t\t\t\t|| getDniRepresentante().trim().isEmpty() || getDniRepresentante().length() < 9\r\n\t\t\t\t\t|| !Funciones.isNumeric(getDniRepresentante()) || !Funciones.validacionCedula(getDniRepresentante())\r\n\t\t\t\t\t|| getNombreRepresentante().trim().isEmpty()))\r\n\t\t\t\tMensaje.crearMensajeWARN(\"Los datos de representante son requeridos, y la cédula debe ser válida.\");\r\n\t\t\telse {\r\n\t\t\t\tif (reserva != null) {// POSEE RESERVA\r\n\t\t\t\t\tmodificarReserva();\r\n\t\t\t\t\tSystem.out.println(\"MODIFICA\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tingresarReserva();\r\n\t\t\t\t\tSystem.out.println(\"INGRESA\");\r\n\t\t\t\t}\r\n\t\t\t\tfinalizado = true;\r\n\t\t\t\treserva = mngRes.buscarReservaPorID(getDniEstudiante(), periodo.getPrdId());// CARGAR\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// RESERVA\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ACTUAL\r\n\t\t\t\tcargarSitiosLibres();\r\n\t\t\t\tcargarEstudiantesSitio();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tMensaje.crearMensajeERROR(\"Error al realizar reserva: \" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "void Planificar(Reserva unaReserva);", "public int insertReserva(Reserva reserva)\n {\n int regInsertado;\n long contador = 0;\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"IDRESERVA\",reserva.getIdReserva());\n contentValues.put(\"ESTADO\", reserva.getEstado());\n contentValues.put(\"IDACTIVIDAD\", reserva.getIdActividad());\n contador = db.insert(\"RESERVA\",null,contentValues);\n db.close();\n\n if(contador == -1 || contador == 0){\n regInsertado = 1;\n }else{\n\n regInsertado = 2;\n\n }\n return regInsertado;\n }", "public static void insertarTiempoAplicacion(Context context, int idusu, String duracion) {\n String url = \"http://161.35.14.188/Persuhabit/tiempoaplicacion\";\n RequestQueue queue = Volley.newRequestQueue(context);\n\n// POST parameters\n Map<String, Object> params = new HashMap<String, Object>();\n params.put(\"idusu\", idusu);\n params.put(\"duracion\", duracion);\n\n\n JSONObject jsonObj = new JSONObject(params);\n\n// Request a json response from the provided URL\n JsonObjectRequest jsonObjRequest = new JsonObjectRequest\n (Request.Method.POST, url, jsonObj, new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n }\n });\n\n// Add the request to the RequestQueue.\n queue.add(jsonObjRequest);\n }", "void addReservation(ReservationDto reservationDto) ;", "@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "com.soa.SolicitarServicioDocument.SolicitarServicio addNewSolicitarServicio();", "public void postularse() {\n\t\t\n\t\ttry {\t\t\t\n\n\t\t\tPostulante postulante= new Postulante();\n\t\t\tpostulante.setLegajo(Integer.valueOf(this.txtLegajo.getText()));\n\t\t\tpostulante.setFamiliaresACargo(Integer.valueOf(this.txtFamiliaresACargo.getText()));\n\t\t\tpostulante.setNombre(txtNombre.getText());\n\t\t\tpostulante.setApellido(txtApellido.getText());\n\t\t\t//postulante.setFechaDeNacimiento(this.txtFechaDeNaciminto.getText());\n\t\t\tpostulante.setCarrera(this.cmbCarrera.getSelectedItem().toString());\n\t\t\tpostulante.setNacionalidad(this.txtNacionalidad.getText());\n\t\t\tpostulante.setLocalidad(this.txtLocalidad.getText());\n\t\t\tpostulante.setProvincia(this.txtProvincia.getText());\n\t\t\t//postulante.setSituacionSocial(this.txtSituacionSocial.getText());\n\t\t\tpostulante.setDomicilio(this.txtDomicilio.getText());\n\t\t\tpostulante.setCodigoPostal(this.txtCodigoPostal.getText());\n\t\t\tpostulante.setEmail(this.txtEmail.getText());\n\t\t\tpostulante.setTelefono(Long.valueOf(this.txtTelefono.getText()));\n\t\t\t\n\t\t\t\n\t\t\tint ingresos=0, miembrosEconomicamenteActivos = 0;\n\t\t\tfor(Familiar familiar: familiares) {\n\t\t\t\tingresos+=familiar.getIngresos();\n\t\t\t\tif(ingresos > 0) {\n\t\t\t\t\tmiembrosEconomicamenteActivos++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpostulante.setCantidadDeFamiliares(familiares.size());\n\t\t\tdouble promedio = Math.random() * (61) + 30 ; \n\t\t\tpostulante.setPromedio((int) promedio);\n\t\t\t\n\t\t\t\n\t\t\tint pIngresos, pActLaboral = 0, pVivienda = 0, pSalud = 0, pDependencia, pPromedio, pRendimiento, pDesarrollo;\n\t\t\t\n\t\t\t//Puntaje Ingresos\n\t\t\tint canastaBasicaPostulante = familiares.size() * canastaBasicaPromedio; \n\t\t\tif(ingresos <= canastaBasicaPostulante) {\n\t\t\t\tpIngresos = 30;\n\t\t\t}\n\t\t\telse if(ingresos >= (2*canastaBasicaPostulante)) {\n\t\t\t\tpIngresos = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpIngresos = (int) (30 - 0.15 * (familiares.size() - ingresos));\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Condicion Actividad Laboral\n\t\t\t\n\t\t\t\n\t\t\tint puntajeMiembros = 0;\n\t\t\t\n\t\t\tfor (Familiar familiar: familiares) {\n\t\t\t\t\tif(familiar.getIngresos() == 0) {\n\t\t\t\t\t\tpuntajeMiembros = puntajeMiembros + 5;\n\t\t\t\t\t}\n\t\t\t\t\telse if(familiar.getIngresos() < salarioMinimo) {\n\t\t\t\t\t\tpuntajeMiembros = puntajeMiembros + 3;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(miembrosEconomicamenteActivos>0) {\n\t\t\tpActLaboral = puntajeMiembros/miembrosEconomicamenteActivos;\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Vivienda - Extrae de cmbVivienda: 0 sin deudas - 1 con deudas - 2 sin propiedad\n\t\t\tint condicionVivienda = this.cmbVivienda.getSelectedIndex();\n\t\t\tswitch (condicionVivienda) {\n\t\t\tcase 0:\n\t\t\t\tpVivienda = 0;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tpVivienda = 3;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tpVivienda = 5;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Salud - Extrae de cmbSalud: 0 tiene obra - 1 cobertura parcial - 2 no tiene\n\t\t\tint condicionSalud = this.cmbSalud.getSelectedIndex();\n\t\t\tswitch (condicionSalud) {\n\t\t\tcase 0:\n\t\t\t\tpSalud = 0;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tpSalud = 3;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tpSalud = 5;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Dependencia\n\t\t\tif (familiares.size() - miembrosEconomicamenteActivos == 0) {\n\t\t\t\tpDependencia = 0;\n\t\t\t}\n\t\t\telse if(familiares.size() - miembrosEconomicamenteActivos > 2) {\n\t\t\t\tpDependencia = 5;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tpDependencia = 3;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Rendimiento académico\n\t\t\tint materiasAprobadas = (int) (Math.random() * (11));\n\t\t\tif(materiasAprobadas == 0) {\n\t\t\t\tpRendimiento = 4;\n\t\t\t\tpPromedio = 14;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tint materiasRegularizadas = (int) (Math.random() * (41 - materiasAprobadas));\n\t\t\t\tpRendimiento = materiasAprobadas/materiasRegularizadas * 10;\n\t\t\t//Puntaje Promedio: Se recuperaria del sysacad\n\t\t\t\tpPromedio = (int) (promedio/10 * 3.5);\n\t\t\t}\n\t\t\t\n\t\t\t//Puntaje Plan Desarrollo: Evaluado por comisión local\n\t\t\tpDesarrollo = (int) (Math.random() * 5 + 1);\n\n\n\t\t\tpuntaje = pIngresos + pActLaboral + pVivienda + pSalud + pDependencia + pPromedio + pRendimiento + pDesarrollo;\n\t\t\tpostulante.setMatAprobadas(materiasAprobadas);\n\t\t\t\n\t\t\ttry{ \n\t\t\t\tcontroller.postular(postulante,puntaje); \n\t\t\t\tJOptionPane.showMessageDialog(null, \"Se postuló al alumno \"+postulante.getNombre()+\" \"+postulante.getApellido()+\".\", \"Postulación exitosa.\", JOptionPane.OK_OPTION);\n\t\t\t\tlimpiarCampos();\n\t\t\t} \n\t\t\tcatch(Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t\tJOptionPane.showMessageDialog(null, \"No se pudo postular el alumno\", \"Error\", JOptionPane.OK_OPTION);\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\tcatch(Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\tJOptionPane.showMessageDialog(null, \"Datos incorrectos\", \"Error\", JOptionPane.OK_OPTION);\n\t\t}\n\t\t\n\t}", "@POST\r\n\t@Consumes(MediaType.APPLICATION_JSON)\r\n\tpublic void addNewTpa(Tpa tpa){\r\n\t}", "public void registrarReserva(Reserva reserva) throws Exception {\n\n\t\tDAOReserva dao= new DAOReserva();\n\n\t\ttry {\n\t\t\tthis.conn= darConexion();\n\t\t\tdao.setConn(conn);\n\t\t\tconn.commit();\n\t\t\tdao.registrarReserva(reserva);\n\t\t}catch (SQLException sqlException) {\n\t\t\tSystem.err.println(\"[EXCEPTION] SQLException:\" + sqlException.getMessage());\n\t\t\tsqlException.printStackTrace();\n\t\t\tconn.rollback();\n\t\t\tthrow sqlException;\n\t\t}catch (Exception exception) {\n\t\t\tSystem.err.println(\"[EXCEPTION] General Exception:\" + exception.getMessage());\n\t\t\texception.printStackTrace();\n\t\t\tconn.rollback();\n\t\t\tthrow exception;\n\t\t} \n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tdao.cerrarRecursos();\n\t\t\t\tif(this.conn!=null){\n\t\t\t\t\tthis.conn.close();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (SQLException exception) {\n\t\t\t\tSystem.err.println(\"[EXCEPTION] SQLException While Closing Resources:\" + exception.getMessage());\n\t\t\t\texception.printStackTrace();\n\t\t\t\tthrow exception;\n\t\t\t}\n\t\t}\n\t}", "public void createNewSkateSpot(){\n \t\tEditText skatespot_name = (EditText) findViewById(R.id.new_skatespot_name);\n \t\tString name = skatespot_name.getText().toString();\n \t\t\n \t\t//Finds the description of the SkateSpot\n \t\tEditText skatespot_description = (EditText) findViewById(R.id.new_skatespot_description);\n \t\tString description = skatespot_description.getText().toString();\n \t\t\n \t\t//Finds the chosen type from the spinner\n \t\tSpinner spinner = (Spinner) findViewById(R.id.new_skatespot_spinner);\n \t\tString type = spinner.getSelectedItem().toString();\n \t\t\n \t\t//Finds the current location\n \t\tLocation loc = app.getLocation();\n \t\tdouble latitude = loc.getLatitude();\n \t\tdouble longitude = loc.getLongitude();\n \n \t\tJsonObject obj = new JsonObject();\n \t\tobj.add(\"key\", new JsonPrimitive(\"ourKey\")); // TODO create a secret key\n \t\tobj.add(\"type\", new JsonPrimitive(4));\n \t\tobj.add(\"name\", new JsonPrimitive(name));\n \t\tobj.add(\"description\", new JsonPrimitive(description));\n \t\tobj.add(\"spottype\", new JsonPrimitive(type));\n \t\tobj.add(\"latitude\", new JsonPrimitive(latitude));\n \t\tobj.add(\"longitude\", new JsonPrimitive(longitude));\n \n \t\tAsyncHttpResponseHandler responseHandler = new AsyncHttpResponseHandler();\t\n \t\tSkateSpotsHttpClient.post(getApplicationContext(), obj, responseHandler);\n \t}", "public void procesarRespuestaServidor(RutinaG rutina) {\n\n bdHelperRutinas = new BdHelperRutinas(context, BD_Rutinas);\n bdHelperRutinas.openBd();\n ContentValues registro = prepararRegistroRutina(rutina);\n bdHelperRutinas.insertTabla(DataBaseManagerRutinas.TABLE_NAME, registro);\n bdHelperRutinas.closeBd();\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String nombre = request.getParameter(\"nombre\");\n String descripcion = request.getParameter(\"descripcion\");\n String cantidad = request.getParameter(\"cantidad\");\n String precio = request.getParameter(\"precio\");\n String pago = request.getParameter(\"pago\");\n \n //creando objeto del costructor\n modelo.ventas venta = new modelo.ventas();\n //almacenando datos en las variables con el constructor \n venta.setNombre(nombre);\n venta.setDescripcion(descripcion);\n venta.setCantidad(Integer.parseInt(cantidad));\n venta.setPrecio(Double.parseDouble(precio));\n venta.setPago(Integer.parseInt(pago));\n \n //creando objeto para guardar cliente\n modelo.addVenta addventa = new modelo.addVenta();\n try {\n addventa.agrega(venta);\n } catch (SQLException ex) {\n Logger.getLogger(formVenta.class.getName()).log(Level.SEVERE, null, ex);\n }\n response.sendRedirect(\"ventas\");//si se guarda exitosamente se redirecciona a membresia\n }", "Reservation createReservation();", "public static void insertarGestoGenial(Context context, int idNino, int idalimento) {\n String url = \"http://161.35.14.188/Persuhabit/GestoGenial\";\n RequestQueue queue = Volley.newRequestQueue(context);\n\n// POST parameters\n Map<String, Object> params = new HashMap<String, Object>();\n params.put(\"idNino\", idNino);\n params.put(\"idalimento\", idalimento);\n\n\n JSONObject jsonObj = new JSONObject(params);\n\n// Request a json response from the provided URL\n JsonObjectRequest jsonObjRequest = new JsonObjectRequest\n (Request.Method.POST, url, jsonObj, new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n }\n });\n\n// Add the request to the RequestQueue.\n queue.add(jsonObjRequest);\n }", "public void addReserva(Reserva reserva) throws Exception \n\t\t{\n\t\t\t\n\t\t\tDAOReserva daoReserva = new DAOReserva( );\n\t\t\ttry\n\t\t\t{\n\t\t\t\tthis.conn = darConexion();\n\t\t\t\tdaoReserva.setConn(conn);\n\t\t\t\tdaoReserva.addReserva(reserva);\n\n\t\t\t}\n\t\t\tcatch (SQLException sqlException) {\n\t\t\t\tSystem.err.println(\"[EXCEPTION] SQLException:\" + sqlException.getMessage());\n\t\t\t\tsqlException.printStackTrace();\n\t\t\t\tthrow sqlException;\n\t\t\t} \n\t\t\tcatch (Exception exception) {\n\t\t\t\tSystem.err.println(\"[EXCEPTION] General Exception:\" + exception.getMessage());\n\t\t\t\texception.printStackTrace();\n\t\t\t\tthrow exception;\n\t\t\t} \n\t\t\tfinally {\n\t\t\t\ttry {\n\t\t\t\t\tdaoReserva.cerrarRecursos();\n\t\t\t\t\tif(this.conn!=null){\n\t\t\t\t\t\tthis.conn.close();\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (SQLException exception) {\n\t\t\t\t\tSystem.err.println(\"[EXCEPTION] SQLException While Closing Resources:\" + exception.getMessage());\n\t\t\t\t\texception.printStackTrace();\n\t\t\t\t\tthrow exception;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n public void onClick(View view) {\n PSMApplication newApp = new PSMApplication();\n newApp.setFullName(txtName.getText().toString());\n newApp.setAddress(txtAddress.getText().toString());\n newApp.setEmail(txtEmail.getText().toString());\n newApp.setDocId(db.collection(\"PSMApplication\").document().getId());// get id of new entry\n // Record in the database\n DocumentReference docRef = db.collection(\"PSMApplication\").document(newApp.getDocId());\n Task insert = docRef.set(newApp);\n insert.addOnSuccessListener(o -> {\n Log.d(\"TAG\", \"New PSM application added!\");\n // Show thank you message\n txtThankYou.setVisibility(View.VISIBLE);\n btnBack.setVisibility(View.VISIBLE);\n btnApply.setEnabled(false);\n txtName.setEnabled(false);\n txtAddress.setEnabled(false);\n txtEmail.setEnabled(false);\n });\n insert.addOnFailureListener(o->{\n Log.e(\"TAG\", \"Failed to add new PSM application.\");\n Toast.makeText(ApplyPsmLicenseActivity.this, \"An error occurred\", Toast.LENGTH_SHORT).show();\n finish();\n });\n\n }", "private void salvarVenda(String nomeCliente, double precoFinal, double desconto ,String mesAnoAt,String dataCompra,String formaDePagamento) {\n\n\t\tFirebaseAuth autenticacion = configFireBase.getFireBaseAutenticacao();\n\n\t\tString idUsuario = Base64Custom.codificarBase64(autenticacion.getCurrentUser().getEmail());\n\t\tDatabaseReference VendaRef=mDatabase.child(\"vendas\");\n\n\n\t\tvenda.setIdVenda(VendaRef.push().getKey());\n\t\tvenda.setNomeCliente(nomeCliente);\n\t\tvenda.setValorTotal(precoFinal);\n\t\tvenda.setMesAno(mesAnoAt);\n\t\tvenda.setDesconto(desconto);\n\t\tvenda.setDataCompra(dataCompra);\n\t\tvenda.setLista(ListagemDeProdutosParaCompras.produtosSelecionados);\n\t\tvenda.setFormaDePagamento(formaDePagamento);\n\n\t\tmDatabase.child(\"armazenamento\").child(idUsuario).child(\"vendas\").child(venda.getIdVenda()).setValue(venda).addOnCompleteListener(new OnCompleteListener<Void>() {\n\n\t\t\t@Override\n\t\t\tpublic void onComplete(@NonNull Task<Void> task) {\n\n\t\t\t}\n\n\t\t});\n\n\t\tToast.makeText(CadastrarVendaActivity.this, \"Venda Realizada\", Toast.LENGTH_SHORT).show();\n\t\tstartActivity(new Intent(getApplicationContext(), ListagemDeVendasRealizadas.class));\n\t\tvenda.subtrairVendas();\n\n\t\tthis.finish();\n\t}", "public void makeOfferRouteStata() {\n\t\tlog(String.format(\"Making DEBUG Offer for Vassar-1\"));\n\n\t\tResRequest res = new ResRequest(mId, ResRequest.RES_GET, \"Stata-1\");\n\t\tres = new ResRequest(mId, ResRequest.RES_GET, \"Stata-1\");\n\t\tres.done = true;\n\t\tres.completed = getTime();\n\t\tres.tokenString = \"DEBUG\";\n\t\tres.signature = \"DEBUG\";\n\t\tres.issued = getTime();\n\t\tres.expires = getTime() + 30 * 60 * 1000;\n\t\tres.hardDeadline = res.completed\n\t\t\t\t+ Globals.REQUEST_DIRECT_PUT_DEADLINE_FROM_NOW;\n\t\tthis.offers.add(res);\n\n\t\tlog(String.format(\"Added to offers: %s\", res.regionId));\n\t}", "@_esCocinero\n public Result crearPaso() {\n Form<Paso> frm = frmFactory.form(Paso.class).bindFromRequest();\n\n // Comprobación de errores\n if (frm.hasErrors()) {\n return status(409, frm.errorsAsJson());\n }\n\n Paso nuevoPaso = frm.get();\n\n // Comprobar autor\n String key = request().getQueryString(\"apikey\");\n if (!SeguridadFunctions.esAutorReceta(nuevoPaso.p_receta.getId(), key))\n return Results.badRequest();\n\n // Checkeamos y guardamos\n if (nuevoPaso.checkAndCreate()) {\n Cachefunctions.vaciarCacheListas(\"pasos\", Paso.numPasos(), cache);\n Cachefunctions.vaciarCacheListas(\"recetas\", Receta.numRecetas(), cache);\n return Results.created();\n } else {\n return Results.badRequest();\n }\n\n }", "public void addGuest(Invitato Guest){\n /*\n se il numero di posti è maggiore di zero il tavolo è disponibile , quando il numero di posti cala a zero,\n la disponibilità del tavolo viene meno.\n */\n if (disponibile) {\n AssegnamentiTavolo.add(Guest);\n num_posti--;\n }\n // controllo quanti posti sono rimasti se sono zero metto il tavolo non disponible\n if(num_posti == 0){\n endAssignment();\n }\n }", "public static void insertarVioNotificacion(Context context, int idusu) {\n String url = \"http://161.35.14.188/Persuhabit/VioNotificacion\";\n RequestQueue queue = Volley.newRequestQueue(context);\n\n// POST parameters\n Map<String, Object> params = new HashMap<String, Object>();\n params.put(\"idusu\", idusu);\n\n\n JSONObject jsonObj = new JSONObject(params);\n\n// Request a json response from the provided URL\n JsonObjectRequest jsonObjRequest = new JsonObjectRequest\n (Request.Method.POST, url, jsonObj, new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n }\n });\n\n// Add the request to the RequestQueue.\n queue.add(jsonObjRequest);\n }", "public static void insertarGestoTerrible(Context context, int idNino, int idalimento) {\n String url = \"http://161.35.14.188/Persuhabit/GestoTerrible\";\n RequestQueue queue = Volley.newRequestQueue(context);\n\n// POST parameters\n Map<String, Object> params = new HashMap<String, Object>();\n params.put(\"idNino\", idNino);\n params.put(\"idalimento\", idalimento);\n\n\n JSONObject jsonObj = new JSONObject(params);\n\n// Request a json response from the provided URL\n JsonObjectRequest jsonObjRequest = new JsonObjectRequest\n (Request.Method.POST, url, jsonObj, new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n }\n });\n\n// Add the request to the RequestQueue.\n queue.add(jsonObjRequest);\n }", "public void storeRegularDayTripStationScheduleWithRS();", "@PUT\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"/guardarReserva/{descripcion}/{funcion}/{ubicacion}/{id}\")\n public String guardarReserva(@PathParam(\"descripcion\")String descripcion,\n @PathParam(\"funcion\")String funcion, \n @PathParam(\"ubicacion\")String ubicacion,\n @PathParam(\"id\")String id){\n LOG.log(Level.INFO, \"Entrada al metodo guardarReserva \");\n String resultado = \"15EBEA440AE\";\n \n try {\n Reservas reserva = new Reservas();\n reserva.setDescripcion(descripcion);\n reserva.setFuncion(funcion);\n reserva.setUbicacion(ubicacion);\n Usuarios usuario = em.find(Usuarios.class, new BigDecimal(id));\n reserva.setId(usuario);\n Long confirmacion = System.currentTimeMillis();\n reserva.setConfirmacion(String.valueOf(confirmacion));\n em.persist(reserva);\n resultado = confirmacion.toString();\n GetdeGeneradorQR.generarQR(resultado);\n } catch (Exception e) {\n LOG.log(Level.SEVERE, \"Error \", e);\n }\n \n LOG.log(Level.INFO, \"Salida del metodo guardarReserva \");\n return resultado;\n \n }", "void realizarReserva(Reserva reserva) throws OperationNotSupportedException;", "com.soa.SolicitarCreditoDocument.SolicitarCredito addNewSolicitarCredito();", "public static void insertarRegistroNuevo(Context context, int idNino, String fechar) {\n String url = \"http://161.35.14.188/Persuhabit/registro\";\n RequestQueue queue = Volley.newRequestQueue(context);\n\n// POST parameters\n Map<String, Object> params = new HashMap<String, Object>();\n params.put(\"idNino\", idNino);\n params.put(\"fechar\", fechar);\n\n\n JSONObject jsonObj = new JSONObject(params);\n\n// Request a json response from the provided URL\n JsonObjectRequest jsonObjRequest = new JsonObjectRequest\n (Request.Method.POST, url, jsonObj, new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n }\n });\n\n// Add the request to the RequestQueue.\n queue.add(jsonObjRequest);\n }", "@PostMapping(\"/sys-appointments\")\n @Timed\n public ResponseEntity<SysAppointment> createSysAppointment(@RequestBody SysAppointment sysAppointment) throws URISyntaxException {\n log.debug(\"REST request to save SysAppointment : {}\", sysAppointment);\n if (sysAppointment.getId() != null) {\n throw new BadRequestAlertException(\"A new sysAppointment cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n SysAppointment result = sysAppointmentService.save(sysAppointment);\n return ResponseEntity.created(new URI(\"/api/sys-appointments/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "public static void insertarGestoBien(Context context, int idNino, int idalimento) {\n String url = \"http://161.35.14.188/Persuhabit/GestoBien\";\n RequestQueue queue = Volley.newRequestQueue(context);\n\n// POST parameters\n Map<String, Object> params = new HashMap<String, Object>();\n params.put(\"idNino\", idNino);\n params.put(\"idalimento\", idalimento);\n\n\n JSONObject jsonObj = new JSONObject(params);\n\n// Request a json response from the provided URL\n JsonObjectRequest jsonObjRequest = new JsonObjectRequest\n (Request.Method.POST, url, jsonObj, new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n }\n });\n\n// Add the request to the RequestQueue.\n queue.add(jsonObjRequest);\n }", "public Reservation addResv(String roomNo, String roomType,int gID, int aNo, int kNo, LocalDate dIn, LocalDate dOut,\n\t\t\t\t\t\t\t\t String rStatus, LocalTime time) {\n\n\t\tint newResvNo =0;\n\t\tReservation newResv = null;\n\t\tif (checkGap() == false) { //no gap, add resv at back\n\t\t\tnewResvNo = numOfReservation + 1;\n\t\t}\n\t\telse { //add resv in between\n\t\t\tfor (int i = 0; i < rList.size(); i++) {\n\t\t\t\tif (rList.get(i).getResvNo() != (i+1)) {\n\t\t\t\t\tnewResvNo = i+1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tnewResv = new Reservation(newResvNo, roomNo, roomType, gID, aNo, kNo, dIn, dOut, rStatus, time);\n\t\t\trList.add(newResv);\n\t\t\tnumOfReservation++;\n\t\t\tSystem.out.println(\"Total number of reservations: \" + numOfReservation);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn newResv;\n\t}", "@PostMapping(\"/bookings\")\n @ResponseStatus(HttpStatus.CREATED)\n public Booking addBooking(@RequestBody Booking booking){\n bookingClient.addBooking(booking);\n return booking;\n }", "@Override\n\tpublic void posSave() {\n\t\tfor(ItemRequisicionEta tmpItm : itemsAgregados) {\n\t\t\ttmpItm.setReqEtapa(instance);\n\t\t\tgetEntityManager().persist(tmpItm);\n\t\t}\n\t\tgetEntityManager().refresh(etapaRepCliHome.getInstance());\n\t}", "public void guardarSolicitud() {\n Map<String, String> paramMap = getParametrosSesion();\n String cadenaFirmada;\n try {\n if (paramMap != null) {\n cadenaFirmada = paramMap.get(firmaFormHelper.FIRMA_DIGITAL);\n firmaFormHelper.setSelloDigital(paramMap.get(FirmaFormHelper.FIRMA_DIGITAL));\n\n SimpleDateFormat formato = new SimpleDateFormat(\"dd/MM/yyyy\");\n produccion.setFechProduccion(new Date());\n desperdiciosHelper.setFechaAcuse(formato.format(produccion.getFechProduccion()));\n\n if (cadenaFirmada.length() > 0) {\n guardarRangosFolios();\n Acuse acuse = new Acuse();\n acuse.setSerieAcuse(TipoAcuse.DESPERDICIO);\n acuse.setIdProveedor(produccionCigarrosHelper.getProveedor().getIdProveedor());\n acuse.setSelloDigital(firmaFormHelper.getSelloDigital());\n acuse.setCadenaOriginal(firmaFormHelper.getCadenaOriginal());\n acuse.setFecCaptura(new Date());\n desperdiciosHelper.setIdAcuseRecibo(commonService.crearAcuse(acuse));\n habilitarPnlAcuse();\n registroMovimientoBitacora(getSession(), IdentificadorProcesoEnum.CONTRIBUYENTE_TRAMITES, new Date(), new Date(), MovimientosBitacoraEnum.DESPERDICIOS_DESTRUCCION);\n } else {\n habilitarPnlPrincipal();\n }\n }\n } catch (CommonServiceException e) {\n LOGGER.error(e.getMessage(), e);\n addErrorMessage(ERROR, \"No se pudo generar el acuse\");\n } catch (Exception ex) {\n LOGGER.error(ex.getMessage());\n }\n }", "private void modificarReserva() throws Exception {\r\n\t\tif (mngRes.existeReservaPeriodo(getSitio().getId())) {\r\n\t\t\tif (mayorEdad) {\r\n\t\t\t\tmngRes.modificarReserva(getEstudiante(), periodo.getPrdId(), getSitio(), null);\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t} else {\r\n\t\t\t\tmngRes.modificarReserva(getEstudiante(), periodo.getPrdId(), getSitio(),\r\n\t\t\t\t\t\tgetDniRepresentante() + \";\" + getNombreRepresentante());\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t}\r\n\t\t\tMensaje.crearMensajeINFO(\"Reserva realizada correctamente, no olvide descargar su contrato.\");\r\n\t\t} else {\r\n\t\t\tMensaje.crearMensajeWARN(\"El sitio seleccionado ya esta copado, favor eliga otro.\");\r\n\t\t}\r\n\t}", "private void ReservarCita(String horaini,String horafin)\n {\n progressDialog=new ProgressDialog(HorasCitasActivity.this);\n progressDialog.setTitle(\"Agregado horario\");\n progressDialog.setMessage(\"cargando...\");\n progressDialog.show();\n progressDialog.setCancelable(false);\n String key = referenceehoras.push().getKey();\n\n // para gaurar el nodo Citas\n // sadfsdfsdfsd1212sdss\n Horario objecita =new Horario(key,idespecialidad,horaini,horafin,nombreespecialidad );\n //HorarioAtencion\n // reference=FirebaseDatabase.getInstance().getReference(\"HorarioAtencion\");\n // referenceCitas= FirebaseDatabase.getInstance().getReference(\"CitasReservadas\").child(user_id);\n referenceehoras.child(key).setValue(objecita).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()){\n Toast.makeText(HorasCitasActivity.this, \"Agregado\", Toast.LENGTH_SHORT).show();\n progressDialog.dismiss();\n }\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(HorasCitasActivity.this, \"Error :\" +e.getMessage(), Toast.LENGTH_SHORT).show();\n\n }\n });\n }", "public void apuntarAsignatura(Asignatura asignatura) {\n\t\t\t\t \n\t\tthis.asignaturas.add(asignatura);\t\t\n\t}", "private void crearUsuarioWS(RequestParams params){\n prgDialog.show();\n AsyncHttpClient client = new AsyncHttpClient();\n client.post(ws.urlservice+\"registroCliente\", params, new AsyncHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n prgDialog.dismiss();\n if(statusCode==201){\n //Toast.makeText(getApplicationContext(), \"Registro con Exito!\", Toast.LENGTH_SHORT).show();\n AlertDialog.Builder builder = new AlertDialog.Builder(RegisterActivity.this);\n builder.setTitle(\"Registro con Exito!\");\n builder.setMessage(\"Por favor revise su correo electrónico para verificar su cuenta.\").setPositiveButton(\"ACEPTAR\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n finish();\n }\n });\n AlertDialog alert = builder.create();\n alert.setCancelable(false);\n alert.show();\n }else{\n Toast.makeText(getApplicationContext(), \"No se pudo guardar el registro!\", Toast.LENGTH_SHORT).show();\n }\n }\n @Override\n public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {\n prgDialog.dismiss();\n Toast.makeText(getApplicationContext(), \"Ocurrio un error con el servidor\", Toast.LENGTH_SHORT).show();\n }\n });\n }", "private void commitApuesta() {\n\t\tif(tipo != -1){\n\t\t\tmodelo.setDestLogin(ModeloApuestas.DEST_APOSTUBERRI);\n\t\t\tmodelo.setApuestaInProgress(apostado.get(), tipo);\n\t\t\tif(!myController.isScreenLoaded(\"login\")){\n\t\t\t\tmyController.loadScreen(ScreensFramework.Login, ScreensFramework.Login_FXML);\n\t\t\t}\n\t\t\tmyController.setScreenOverlay(\"login\");\n\t\t}\n\t\t\n\t\t\n\t}", "@PostMapping(\"/addCita\")\r\n public String addCita(HttpServletRequest request,\r\n @RequestParam(value = \"nombre\", required = false) String nombre,\r\n @RequestParam(value = \"apellidoP\", required = false) String apellidoP,\r\n @RequestParam(value = \"apellidoM\", required = false) String apellidoM,\r\n @RequestParam(value = \"asunto\", required = false) String asunto,\r\n @RequestParam(value = \"fecha\", required = false) String fecha,\r\n @RequestParam(value = \"hora\", required = false) String hora,\r\n @RequestParam(value = \"docId\", required = false) int idDoctor) {\n asunto=asunto.trim();\r\n try {\r\n //Creo una fecha auxiliar con un formato con los valores recibidos\r\n Date fechaAux = formatter.parse(fecha+ \" \" + hora );\r\n //Instancio y agrego cita\r\n citas.add(new Cita(contCita, nombre, apellidoP, apellidoM, asunto, fechaAux, idDoctor));\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n contCita++;\r\n return \"redirect:/consultorio/agendarCita\";\r\n }", "private void hitApiForCreateDeal() {\n appUtils.showProgressDialog(mActivity,false);\n\n HashMap<String, String> params = new HashMap<>();\n params.put(ApiKeys.DEAL_TITLE, etTitle.getText().toString().trim());\n params.put(ApiKeys.DEAL_DESCRIPTION, etDescription.getText().toString().trim());\n params.put(ApiKeys.TOTAL_ITEMS, etTotalItems.getText().toString().trim());\n params.put(ApiKeys.ORIGINAL_PRICE, etOriginalPrice.getText().toString().trim());\n params.put(ApiKeys.NEW_PRICE, tvNewPrice.getText().toString());\n params.put(ApiKeys.START_DATE_TIME, parseTime(etBeginTime.getText().toString().trim()));\n params.put(ApiKeys.END_DATE_TIME, parseTime(etEndTime.getText().toString().trim()));\n\n ApiInterface service = RestApi.createService(ApiInterface.class);\n Call<ResponseBody> call = service.createDeal(AppSharedPrefs.getInstance(mActivity).\n getString(AppSharedPrefs.PREF_KEY.ACCESS_TOKEN, \"\"), appUtils.encryptData(params));\n ApiCall.getInstance().hitService(mActivity, call, new NetworkListener() {\n @Override\n public void onSuccess(int responseCode, String response) {\n CreateDealModel createDealModel = new Gson().fromJson(response, CreateDealModel.class);\n if (createDealModel.getCODE() == 200) {\n /*Intent intent = new Intent(mActivity, MerchantActivity.class);\n startActivity(intent);*/\n setResult(Constants.CREATE_DEAL_REQ_CODE);\n\n Intent intent1 = new Intent(Constants.REFRESH_RECCEIVER_KEY);\n // You can also include some extra data.\n intent1.putExtra(\"refresh\", true);\n LocalBroadcastManager.getInstance(mActivity).sendBroadcast(intent1);\n\n mActivity.finish();\n\n } else if (createDealModel.getCODE() == ApiKeys.UNAUTHORISED_CODE) {\n appUtils.logoutFromApp(mActivity, createDealModel.getMESSAGE());\n } else {\n appUtils.showSnackBar(mActivity.findViewById(android.R.id.content), createDealModel.getMESSAGE());\n }\n\n appUtils.hideProgressDialog(mActivity);\n }\n\n @Override\n public void onSuccessErrorBody(String response) {\n\n }\n\n @Override\n public void onFailure() {\n appUtils.hideProgressDialog(mActivity);\n appUtils.showSnackBar(mActivity.findViewById(android.R.id.content), getString(R.string.txt_something_went_wrong));\n\n }\n });\n\n }", "Booking createBooking(Booking newBooking) throws Exception;", "public static void addBooking(BookingImpl b, String status){\n Firebase bRefChild;\n if(!status.equals(\"new\")){\n //Dispatched Booking\n //Removes from Awaiting_Dispatch and puts in Dispatched\n bRefChild = dRef.child(status);\n bRef.child(b.getBookingNumber()+\"\").removeValue();\n } else {\n bRefChild = bRef.child(b.getBookingNumber() + \"\");\n }\n bRefChild.child(\"pickup\").setValue(b.getPickUpAddress());//\n bRefChild.child(\"dropoff\").setValue(b.getDropOffAddress());//\n bRefChild.child(\"name\").setValue(b.getClientName());//\n bRefChild.child(\"time\").setValue(b.getTime().toString());\n bRefChild.child(\"comment\").setValue(b.getComments());//\n bRefChild.child(\"tel\").setValue(b.getClientTel());//\n bRefChild.child(\"email\").setValue(b.getClientEmail());//\n bRefChild.child(\"booking_number\").setValue(b.getBookingNumber());//\n bRefChild.child(\"account\").setValue(Cash.getInstance().getId());\n bRefChild.child(\"vehicle_type\").setValue(b.getVehicleType());\n bRefChild.child(\"no_passengers\").setValue(b.getNoPassengers());\n bRefChild.child(\"date\").setValue(b.getDate());\n try {\n bRefChild.child(\"time\").setValue(new SimpleDateFormat(\"HH:mm\").format(b.getTime()));\n } catch (IllegalArgumentException e){\n // Always throws this exception - unsure why as it saves correctly.\n // Do nothing as it still writes to database as expected\n // Maybe need to look at different formats for time?\n }\n bRefChild.child(\"price\").setValue(b.getPrice());\n\n }", "public Respuesta addRespuesta(String resp, Pregunta p, Usuario autor);", "@Override\n public void onClick(View v) {\n String nom=editNom.getText().toString();\n String descripcio=editDesripcio.getText().toString();\n String estat=txtEstat.getText().toString();\n try{\n //fa la conexio a la base de dades amb els parametres que fica l'usuari per generar una ruta+\n if(!(nom.equals(\"\") && descripcio.equals(\"\") && estat.equals(\"\"))){\n String[] parametres={nom,descripcio, String.valueOf(usuari.getID()),rutaSTR,estatSTR};\n new PostGenerarRuta(context,progressBar).execute(parametres);\n }else {\n Toast.makeText(getApplicationContext(),\"Les dades no son valides\",Toast.LENGTH_SHORT).show();\n }\n }catch (Exception ex) {\n Toast.makeText(context, ex.getMessage(), Toast.LENGTH_SHORT).show();\n Log.i(\"errorPost\", ex.getMessage());\n }\n }", "public void requestAccountCreation(Secretary sec) {\n \n System.out.println(this.iD + \": Requesting account creation from secretary \" + sec.iD);\n sec.addToWaitingListForApproval(this);\n }", "@POST\n @Consumes({\"application/json\"})\n @Produces({\"application/json\"})\n public RestRsp<Tp> createSite(final Tp tp) throws ServiceException {\n ScopeChecker.checkScope(tp);\n return new RestRsp<Tp>(ResultConstants.SUCCESS, service.createTp(tp));\n }", "PastReservation createPastReservation();", "private void sendPost() {\n Map<String,Object> values = new HashMap<>();\n values.put(Constants.MANAGEMENT,management);\n values.put(Constants.GENERAL_INFORMATION,generalnformation);\n values.put(Constants.SYMPTOMS,symptoms);\n\n FireBaseUtils.mDatabaseDiseases.child(caseStudyUrl).child(url).updateChildren(values);\n Toast.makeText(DiseaseEditActivity.this, \"Item Posted\",LENGTH_LONG).show();\n finish();\n }", "@Override\n public Reservation createReservation(String reservationID, Reservation newReservation) {\n Reservation reservation = new Reservation(getHostName(), getHostAddress(), getUID(), generateNextNumber());\n\n //Plan: Add new reservation into the list, then update it on firebase\n reservationList.add(reservation);\n\n //Get reference to reservation\n DatabaseReference userSpaceRef = FirebaseDatabase.getInstance().getReference().child(\"Host/\" + UID);\n return null;\n }", "@Override\n\tpublic Json add(StoreRecharge storeRecharge, HttpSession session) {\n\t\tJson json = new Json();\n\t\ttry {\n\t\t\tMap<String, Object> variables = new HashMap<String, Object>();\n\t\t\tProcessInstance pi = runtimeService.startProcessInstanceByKey(\"storeRecharge\", variables);\n\t\t\t// 根据流程实例Id查询任务\n\t\t\tTask task = taskService.createTaskQuery().processInstanceId(pi.getProcessInstanceId()).singleResult();\n\t\t\t// 完成 门店经理交押金申请\n\t\t\t\n\t\t\ttaskService.addComment(task.getId(), pi.getProcessInstanceId(), \" :1\");\n\t\t\ttaskService.complete(task.getId());\n\t\t\tString username = (String) session.getAttribute(CommonAttributes.Principal);\n\t\t\tHyAdmin hyAdmin = hyAdminService.find(username);\n\t\t\tDepartment department = hyAdmin.getDepartment();\n\t\t\tList<Filter> filters = new LinkedList<>();\n\t\t\tfilters.add(Filter.eq(\"department\", department));\n\t\t\tList<Store> stores = storeService.findList(null, filters, null);\n\t\t\tif (stores == null || stores.size() == 0) {\n\t\t\t\tjson.setSuccess(false);\n\t\t\t\tjson.setMsg(\"所属门店不存在\");\n\t\t\t} else {\n\t\t\t\tStore store = stores.get(0);\n\t\t\t\tstoreRecharge.setStore(store);\n\t\t\t}\n\t\t\tstoreRecharge.setOperator(hyAdmin);\n\t\t\tStoreAccountLog storeAccountLog = new StoreAccountLog();\n\t\t\tstoreAccountLog.setMoney(storeRecharge.getMoney());\n\t\t\tstoreAccountLog.setStore(storeRecharge.getStore());\n\t\t\tstoreAccountLog.setStatus(0);\n\t\t\tstoreAccountLog.setProfile(\"预存款充值\");\n\t\t\tstoreAccountLog.setType(0);\n\t\t\tstoreAccountLogService.save(storeAccountLog);\n\t\t\tstoreRecharge.setStoreAccountLogId(storeAccountLog.getId());\n\t\t\tstoreRecharge.setProcessInstanceId(task.getProcessInstanceId());\n\t\t\tstoreRecharge.setStatus(0);\t\t\t\n\t\t\tthis.save(storeRecharge);\n\t\t\tjson.setSuccess(true);\n\t\t\tjson.setMsg(\"申请成功\");\n\t\t} catch (Exception e) {\n\t\t\tjson.setSuccess(false);\n\t\t\tjson.setMsg(\"申请错误: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t\t// TODO: handle exception\n\t\t}\n\t\treturn json;\n\t}", "@Override\n public void onClick(View v) {\n\n String nombre=cajanombre.getText().toString();\n String descripcion=descripcionActividad.getText().toString();\n int numeroPersonas = Integer.parseInt(cajaNumerodePersonas.getText().toString());\n\n //String datoResultado=cajaResultado.getText().toString();\n if (numeroPersonas >=2) {\n paquete = numeroPersonas * 50000;\n cajaResultado.setText(\"Valor paquete turistico es:$\" + paquete);\n }\n else {\n paquete = 70000;\n cajaResultado.setText(\"Valor paquete turistico es:$\" + paquete);\n\n }\n\n //Armo los datos de la colección\n reservacion.put(\"nombre\",nombre);\n reservacion.put(\"numeroPersonas\",numeroPersonas);\n reservacion.put(\"valorReserva\",paquete);\n reservacion.put(\"descripcion\",descripcion);\n\n\n registrarPaquete();\n\n\n\n\n }", "com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest addNewEvSORequest();", "protected void uploadSottoPagine() {\n LinkedHashMap<String, LinkedHashMap<String, List<String>>> mappa;\n int numVoci = 0;\n\n for (String key : lista.getSottoPagine().keySet()) {\n mappa = lista.getSottoPagine().get(key);\n numVoci = lista.getMappaLista().getDimParagrafo(key);\n incipitSottopagina = elaboraIncipitSpecificoSottopagina(key);\n listaCorrelate = listaVociCorrelate();\n appContext.getBean(UploadSottoPagina.class, soggetto, key, mappa, typeDidascalia, numVoci, usaParagrafoSize, incipitSottopagina, usaNote, usaVociCorrelate, listaCorrelate);\n }// end of for cycle\n }", "public Paciente agregar(PacienteDTO nuevoPaciente) {\n\n int valor_hipertension = nuevoPaciente.getHipertension().equalsIgnoreCase(\"Si\") ? 100 : 0;\n int valor_mareo = nuevoPaciente.getMareo().equalsIgnoreCase(\"Si\") ? 100 : 0;\n int valor_presion = medirPresion(nuevoPaciente.getPresion());\n int valor_fiebre = medirFiebre(nuevoPaciente.getFiebre());\n int valor_edad = medirEdad(nuevoPaciente.getEdad());\n int puntaje = valor_mareo + valor_edad + valor_presion + valor_fiebre + valor_hipertension;\n\n Date date = new Date(new java.util.Date().getTime());\n Color color = colorRepository.getColorBetweenRange(puntaje);\n\n Paciente paciente = new Paciente();\n paciente.setName(nuevoPaciente.getNombre());\n paciente.setDni(nuevoPaciente.getDni());\n paciente.setColor(color);\n paciente.setScore(puntaje);\n paciente.setStatus(cantidadSiendoAtendidos(color) < color.getCant_max_patient() ? \"Siendo atendido\" : \"En espera\");\n paciente.setDate(date);\n Paciente elemento = pacienteRepository.saveAndFlush(paciente);\n return elemento;\n }", "public void addItem() {\n Url url = new Url();\n Venue item = new Venue(venuename.getText().toString(), address.getText().toString(), venueimage.getText().toString(), details.getText().toString());\n Call<Void> additem = url.createInstanceofRetrofit().addNewVenue(item);\n additem.enqueue(new Callback<Void>() {\n @Override\n public void onResponse(Call<Void> call, Response<Void> response) {\n Toast.makeText(VenueAdd.this, \"Venue Added Successfully\", Toast.LENGTH_SHORT).show();\n Intent intent=new Intent(VenueAdd.this, Dash.class);\n startActivity(intent);\n finish();\n }\n\n @Override\n public void onFailure(Call<Void> call, Throwable t) {\n Toast.makeText(VenueAdd.this, \"Error:\"+t, Toast.LENGTH_SHORT).show();\n }\n });\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n registerNewMember(request, response);\n }", "public void makeReservationRouteStata() {\n\t\tlog(String.format(\"Making DEBUG ResRequest for Stata-1\"));\n\t\tmakeRequest(new ResRequest(mId, ResRequest.RES_GET, \"Stata-1\"));\n\t}", "public void insertRestaurnants(String name, String address, String contact, String ratting, String description) {\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"name\", name);\n contentValues.put(\"address\", address);\n contentValues.put(\"contact\", contact);\n contentValues.put(\"ratting\", ratting);\n contentValues.put(\"description\", description);\n long isInsert = database.insert(AppConstant.RESTAU_TABLE_NAME, null, contentValues);\n if (isInsert == -1) {\n Toast.makeText(context, \"Restaurnant failed to register.\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(context, \"Restaurnant registered successfully.\", Toast.LENGTH_SHORT).show();\n }\n }", "public void registrarReservaColectiva(ReservaColectiva reserva) throws Exception {\n\n\t\tDAOReserva dao= new DAOReserva();\n\n\t\ttry {\n\t\t\tthis.conn= darConexion();\n\t\t\tdao.setConn(conn);\n\t\t\tconn.commit();\n\t\t\tdao.registrarReservaColectiva(reserva);\n\t\t}catch (SQLException sqlException) {\n\t\t\tSystem.err.println(\"[EXCEPTION] SQLException:\" + sqlException.getMessage());\n\t\t\tsqlException.printStackTrace();\n\t\t\tconn.rollback();\n\t\t\tthrow sqlException;\n\t\t}catch (Exception exception) {\n\t\t\tSystem.err.println(\"[EXCEPTION] General Exception:\" + exception.getMessage());\n\t\t\texception.printStackTrace();\n\t\t\tconn.rollback();\n\t\t\tthrow exception;\n\t\t} \n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tdao.cerrarRecursos();\n\t\t\t\tif(this.conn!=null){\n\t\t\t\t\tthis.conn.close();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (SQLException exception) {\n\t\t\t\tSystem.err.println(\"[EXCEPTION] SQLException While Closing Resources:\" + exception.getMessage());\n\t\t\t\texception.printStackTrace();\n\t\t\t\tthrow exception;\n\t\t\t}\n\t\t}\n\t}", "public void reservas_pista(int pista,int socio,String fecha,String hora_inicio,String hora_fin) throws SQLException {\n\t\t\n\t\t\n\t\tcst= conn.prepareCall(\"{call reservar_pista(?,?,?,?,?)}\");\n\t\t\n\t\tcst.setInt(1, pista);\n\t\tcst.setInt(2, socio);\n\t\tcst.setString(3, fecha);\n\t\tcst.setString(4, hora_inicio);\n\t\tcst.setString(5, hora_fin);\n\t\t\n\t\tif(cst.executeUpdate() == 1){\n\t\t\tJOptionPane.showMessageDialog(null, \"Reserva Aņadida Correctamente\",\n\t\t\t\t\t\"Reserva\", JOptionPane.INFORMATION_MESSAGE);\n\t\t}\n\t\t\n\t}", "public void onClick(DialogInterface dialog, int which) {\n Toast.makeText(SpaceViewActivity.this, \"Reserved a \" + type, Toast.LENGTH_SHORT).show();\n drDatabaseRef.child(i.getStringExtra(Keys.KEY_SPACE_UPLOAD_ID.name()))\n .child(Keys.COLLECTIONS_RESERVEES.name())\n .child(String.valueOf(System.currentTimeMillis()))\n .child(\"id\").setValue(userId);\n //Add spaceId to reserved list of user\n DatabaseReference rsDatabaseRef = FirebaseDatabase.getInstance().getReference(Keys.COLLECTIONS_PROFILES.name() + \"/\" + userId);\n rsDatabaseRef.child(Keys.KEY_RESERVATIONS.name())\n .child(String.valueOf(System.currentTimeMillis()))\n .child(\"id\").setValue(spaceID);\n\n finish();\n }", "@PostMapping(\"/Scheduling/addAppointment\")\r\n\tpublic String addAppointment(Scheduling scheduling) {\r\n\t\tschedulingService.createAppointment(scheduling);\r\n\t\treturn \"redirect:/Scheduling\";\r\n\t}", "public BookedActivity getNewlyAddSavedTrip();", "@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}", "@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}", "public void createAgendamento() {\n\n if (tbagendamento.getTmdataagendamento().after(TimeControl.getDateIni())) {\n if (agendamentoLogic.createTbagendamento(tbagendamento)) {\n AbstractFacesContextUtils.redirectPage(PagesUrl.URL_AGENDAMENTO_LIST);\n AbstractFacesContextUtils.addMessageInfo(\"Agendamento cadastrado com sucesso.\");\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"Falhar ao realizado cadastro do agendamento.\");\n }\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"verifique se a data de agendamento esta correta.\");\n }\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"pasaporAddtoCart\");\n \n ArrayList<Integer> productoParaPanier= new ArrayList<Integer>();\n ArrayList<Integer> existenciaPanier= new ArrayList<Integer>();\n HttpSession session=request.getSession(); \n if (session.getAttribute(\"Panier\")==null){\n // no hay una sesion de Panier, creacion de Panier desde cero con su ID\n \n String Utilisateur= (String) session.getAttribute(\"Utilisateur\");\n String articulo= (String) session.getAttribute(\"current\");\n String aexistencia =( String) request.getParameter(\"cantidad\");\n int existencia = Integer.parseInt(aexistencia);\n productoParaPanier.add(Integer.parseInt(articulo));\n existenciaPanier.add(existencia);\n \n String PanierID= \"asdasd\";\n Timestamp timeStamp = new Timestamp(System.currentTimeMillis()); \n \n System.out.println(\"Utilisateur: \"+Utilisateur);\n System.out.println(\"articulo: \"+articulo);\n System.out.println(\"PanierID: \"+PanierID);\n System.out.println(\"time stamp \"+timeStamp);\n \n carroActual= new Panier(PanierID,Utilisateur,12);\n \n carroActual.setExistenciaProduitPanier(existenciaPanier);\n carroActual.setProduitPanier(productoParaPanier);\n \n session.setAttribute(\"Panier\", PanierID);\n session.setAttribute(\"PanierArticulo\", productoParaPanier);\n session.setAttribute(\"PanierExistencia\", existenciaPanier);\n \n \n }\n else{\n \n \n \n // aqui ya hay una sesion de Panier (update a la base de datos)\n String Utilisateur= (String) session.getAttribute(\"Utilisateur\");\n String articulo= (String) session.getAttribute(\"current\");\n \n \n ArrayList<Integer> productoParaPanier2 =(ArrayList<Integer>) session.getAttribute(\"PanierArticulo\");\n ArrayList<Integer> existenciaPanier2 =(ArrayList<Integer>) session.getAttribute(\"PanierExistencia\");\n \n if(productoParaPanier2.contains(Integer.parseInt(articulo))){ // Aqui se validan que no se agreguen(sumen) mas de los que hay en stock\n \n int indexArticuloCambiarCantidad= productoParaPanier2.indexOf(Integer.parseInt(articulo));\n \n int nuevoValor=existenciaPanier2.get(indexArticuloCambiarCantidad)+ Integer.parseInt(request.getParameter(\"cantidad\").toString());\n \n existenciaPanier2.set(indexArticuloCambiarCantidad, nuevoValor);\n carroActual.setExistenciaProduitPanier(existenciaPanier2);\n System.out.println(\"ya creado------\");\n System.out.println(\"Produits en el Panier\"+productoParaPanier2);\n System.out.println(\"Cantidad en el Panier\"+existenciaPanier2); \n \n }\n else {\n \n \n \n productoParaPanier2.add(Integer.parseInt(articulo));\n String aexistencia =( String) request.getParameter(\"cantidad\");\n int existencia = Integer.parseInt(aexistencia);\n existenciaPanier2.add(existencia);\n \n //actualizar valores\n \n carroActual.setExistenciaProduitPanier(existenciaPanier2);\n carroActual.setProduitPanier(productoParaPanier2);\n \n //String PanierID= \"asdasd\"; // es un update por lo tanto el id se mantiene\n Timestamp timeStamp = new Timestamp(System.currentTimeMillis());\n session.setAttribute(\"PanierArticulo\", productoParaPanier2);\n session.setAttribute(\"PanierExistencia\", existenciaPanier2);\n \n System.out.println(\"ya creado------\");\n System.out.println(\"Produits en el Panier\"+productoParaPanier2);\n System.out.println(\"Cantidad en el Panier\"+existenciaPanier2);\n \n \n }\n }\n session.setAttribute(\"productoAgregado\", \"si\");\n session.setAttribute(\"carroData\",carroActual);\n \n //RequestDispatcher rd = request.getRequestDispatcher(\"index.jsp\");\n //rd.forward(request, response);\n response.sendRedirect(\"index.jsp\");\n\n//processRequest(request, response);\n }", "public void insertar(int rafaga, int tiempo) {\n\t\tif (rafaga <= 0 || tiempo < 0) {\n\t\t\treturn;\n\t\t}\n\t\tProceso nuevo = new Proceso();\n\t\tnuevo.id = String.valueOf((char) this.caracter);\n\t\tthis.caracter++;\n\t\tnuevo.rafaga = rafaga;\n\t\tnuevo.tllegada = tiempo;\n\t\tnuevo.IdCola = this.IdCola;\n\t\tnuevo.NombreCola = this.NombreCola;\n\t\tnuevo.ColaProviene = this.NombreCola;\n\t\tif (raiz.sig == raiz) {\n\t\t\traiz.sig = nuevo;\n\t\t\tcabeza = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\tnuevo.padre = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t} else {\n\t\t\tProceso aux = raiz.padre;\n\t\t\taux.sig = nuevo;\n\t\t\tnuevo.sig = raiz;\n\t\t\traiz.padre = nuevo;\n\t\t\tnuevo.padre = aux;\n\t\t}\n\t\tthis.numProcesos++;\n\t\tthis.rafagaTotal += rafaga;\n\t\tthis.Ordenamiento();\n\t}", "Secuencia createSecuencia();", "@Override\n public void onClick(View v) {\n titleTask = txtTitle.getText().toString();\n descriptionTask = txtDescription.getText().toString();\n locationTask = txtLocation.getText().toString();\n\n\n //Also set the code to add the object to the server,\n //It should call getInfo() which will store all of the inputs into strings or ints\n\n\n //This checks to make sure the input is valid, if not will not allow the user to save to database\n if (dayPass == 0 || monthPass == 0 || yearPass == 0 || titleTask == null || descriptionTask == null || startMinute == 0 || startHour == 0)\n Toast.makeText(AddTask.this, \"Incorrect input, please try again\", Toast.LENGTH_SHORT).show();\n else {\n if(MainActivity.groupview)\n MainActivity.dh.writeTask(MainActivity.user.getUserID(), MainActivity.group.getGroupID(), new Task(dayPass, monthPass, yearPass, startHour, startMinute, categoryTask, titleTask, descriptionTask, locationTask, false, MainActivity.user));\n else\n MainActivity.dh.writeTask(MainActivity.user.getUserID(), \"\", new Task(dayPass, monthPass, yearPass, startHour, startMinute, categoryTask, titleTask, descriptionTask, locationTask, false, MainActivity.user));\n //MainActivity.dh.readBlock(MainActivity.user.getUserID(), \"\", \"04202019\");\n Toast.makeText(AddTask.this, \"Task saved to your calendar\", Toast.LENGTH_LONG).show();\n Intent intentHome = new Intent(AddTask.this,\n MainActivity.class);\n startActivity(intentHome);\n }\n\n }", "@PostMapping(\"/produtos\")\n @Timed\n public ResponseEntity<Produto> createProduto(@RequestBody Produto produto) throws URISyntaxException {\n log.debug(\"REST request to save Produto : {}\", produto);\n\n produto = DoubleUtil.handleProduto(produto);\n\n//////////////////////////////////REQUER PRIVILEGIOS\n if (!PrivilegioService.podeCriar(cargoRepository, ENTITY_NAME)) {\n log.error(\"TENTATIVA DE CRIAR SEM PERMISSÃO BLOQUEADA! \" + ENTITY_NAME + \" : {}\", produto);\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, \"privilegios insuficientes.\", \"Este usuario não possui privilegios sufuentes para criar esta entidade.\")).body(null);\n }\n//////////////////////////////////REQUER PRIVILEGIOS\n if (produto.getId() != null) {\n throw new BadRequestAlertException(\"A new produto cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n Produto result = produtoRepository.save(produto);\n return ResponseEntity.created(new URI(\"/api/produtos/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "public void addReservation(Prenotazione newReservation) {\n final String sql = \"INSERT INTO prenotazioni (data_p, ora_inizio, ora_fine, clienti, ufficio_id, utente_id) VALUES (?,?,?,?,?,?)\";\n\n try {\n Connection conn = DBConnect.getInstance().getConnection();\n PreparedStatement st = conn.prepareStatement(sql);\n st.setString(1, newReservation.getDate());\n st.setInt(2, newReservation.getStartHour());\n st.setInt(3, newReservation.getFinalHour());\n st.setInt(4, newReservation.getClients());\n st.setInt(5, newReservation.getOfficeId());\n st.setString(6, newReservation.getUserId());\n\n st.executeUpdate();\n\n conn.close();\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "CurrentReservation createCurrentReservation();", "@PostMapping(\"/asignacion\")\n public ResponseEntity<Asignacion> createAsignacion(@Valid @RequestBody Asignacion asignacion) throws URISyntaxException {\n log.debug(\"REST request to save asignacion : {}\", asignacion);\n if (asignacion.getId_asignacion() != null) {\n throw new BadRequestAlertException(\"A new asignacion cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n Asignacion result = asignacionService.save(asignacion);\n return ResponseEntity.created(new URI(\"/api/asignacion/\" + result.getId_asignacion()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId_asignacion().toString()))\n .body(result);\n }", "@Override\n\tpublic void registrarSalida() {\n\n\t}", "public void agregarPlanPost(String nombre, String valor, String numMin, String valorMinAd) throws ExPlan{\n\n\t\tPlan a = buscarPlan(nombre);\n\n\t\tif (a == null || (a != null && a instanceof PlanPrepago))\n\t\t{\t\n\n\t\t\t\tPlanPostpago p = new PlanPostpago(Long.parseLong(valor), nombre, Long.parseLong(numMin), Long.parseLong(valorMinAd));\n\t\t\n\t\t\t\t\n\t\t\t\tplanes.add(p);\n\t\t\t\t\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow (new ExPlan(\"Plan postpago repetido\"));\n\t\t\t}\t\t\n\t\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // processRequest(request, response);\n final OutPass p=new OutPass();\n p.setRollno(request.getParameter(\"rollno\"));\n p.setReason(request.getParameter(\"reason\"));\n p.setFrom(request.getParameter(\"from\"));\n p.setTill(request.getParameter(\"till\"));\n p.setStatus(request.getParameter(\"status\")); \n boolean res=p.insert();\n //System.err.println(p.getStatus().equals(\"Accepted\"));\n \n // System.err.println(res);\n if(p.getStatus().equals(\"Accepted\")&&res){\n final General.OutPass op = new General.OutPass(p.getRollno());\n new Thread(new Runnable(){\n \n @Override\n public void run(){\n if(op.insert(p.getRequestid())){\n if(Student.getById(p.getRollno()).getAccomodation().equalsIgnoreCase(\"hostel\"))\n SMSTemplate.send(Parent.getNumber(p.getRollno()),p.getSMSContent());\n }\n }\n }).start();\n }\n \n if(res)\n response.sendRedirect(\"hostel/requests.jsp?msg=done\");\n }", "Long crear(Espacio espacio);", "public void registaAposta (Aposta a){\n this.listaApostas.add(a);\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n \n String id_entrada=request.getParameter(\"id_entrada\");\n String fecha_entrada=request.getParameter(\"fecha_entrada\");\n String cantidad=request.getParameter(\"cantidad\");\n String id_material=request.getParameter(\"id_material\");\n \n Entradamaterial e=new Entradamaterial();\n e.setId_entrada(id_entrada);\n e.setFecha_entrada(fecha_entrada);\n e.setCantidad(cantidad);\n e.setId_material(id_material);\n \n if(EntradamaterialDao.registrar(e)){\n request.setAttribute(\"mensaje\", \"La entrada fue registrada\");\n } else {\n request.setAttribute(\"mensaje\", \"La entrada NO fue registrada\");\n }\n request.getRequestDispatcher(\"RegistroEntrada.jsp\").forward(request, response);\n }", "void postGasData(GasData gasData);", "public void onClick(DialogInterface dialog, int which) {\n\n reserved_package reservedPackage = new reserved_package();\n reservedPackage.setPackage_id(package_id);\n reservedPackage.setTourist_id(session.getUserId());\n ToEgyptAPI api = retrofit.create(ToEgyptAPI.class);\n api.reserve(reservedPackage).enqueue(new Callback<reserved_package>() {\n @Override\n public void onResponse(Call<reserved_package> call, Response<reserved_package> response) {\n Toast.makeText(UpdatePackage.this, \"added to your package\", Toast.LENGTH_SHORT).show();\n finish();\n }\n\n @Override\n public void onFailure(Call<reserved_package> call, Throwable t) {\n Toast.makeText(UpdatePackage.this, \"Error ,Please Check your internet connection\", Toast.LENGTH_SHORT).show();\n //progressDialog.dismiss();\n }\n });\n\n\n }", "@POST\r\n\t\t@Path(\"/hostal\")\r\n\t\t@Consumes({ MediaType.APPLICATION_JSON })\r\n\t\t@Produces({ MediaType.APPLICATION_JSON })\r\n\t\tpublic Response postHostal(Hostal hostal) {\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tAlohaTransactionManager tm = new AlohaTransactionManager(getPath());\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\ttm.addHotel(hostal);\r\n\t\t\t\t\r\n\t\t\t\treturn Response.status(200).entity(hostal).build();\r\n\t\t\t} \r\n\t\t\tcatch (Exception e) {\r\n\t\t\t\treturn Response.status(500).entity(doErrorMessage(e)).build();\r\n\t\t\t}\r\n\t\t}", "@Override\n public void run() {\n HttpsURLConnection connPut = null;\n try {\n URL webServerUrl = new URL(DB_URL);\n\n connPut = (HttpsURLConnection) webServerUrl.openConnection();\n\n connPut.setReadTimeout(10000 /* milliseconds */);\n connPut.setConnectTimeout(15000 /* milliseconds */);\n connPut.setDoOutput(true);\n\n connPut.setRequestMethod(\"POST\");\n connPut.setRequestProperty(\"Content-type\", \"application/json\");\n AuthenticationValidator authenticationValidator = new AuthenticationValidator(context);\n String token = authenticationValidator.getAuthenticationToken();\n connPut.addRequestProperty(\"Authorization\", \"Bearer \" + token);\n connPut.connect();\n OutputStreamWriter out = new OutputStreamWriter(connPut.getOutputStream());\n\n\n\n\n for(RestRecord rr : toBePushed)\n {\n out.write(rr.getJSON().toString());\n out.flush();\n }\n out.close();\n\n if(connPut.getResponseCode() == 200)\n System.out.println(\"Successfully posted new route(s).\");\n else\n System.out.println(connPut.getResponseMessage());\n\n connPut.disconnect();\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if(connPut!=null)\n connPut.disconnect();\n }\n }", "private void registrarRecibo_() throws Exception {\t\n\t\t\n\t\tif (CajaUtil.CAJAS_ABIERTAS.get(this.selectedItem.getPos6()) != null) {\n\t\t\tString msg = \"CAJA BLOQUEADA POR USUARIO: \" + CajaUtil.CAJAS_ABIERTAS.get(this.selectedItem.getPos6());\n\t\t\tClients.showNotification(msg, Clients.NOTIFICATION_TYPE_ERROR, null, null, 0);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis.nvoRecibo.setPos1(\"\");\n\t\tthis.nvoRecibo.setPos2(new Date());\n\t\tWindowPopup wp = new WindowPopup();\n\t\twp.setDato(this);\n\t\twp.setModo(WindowPopup.NUEVO);\n\t\twp.setHigth(\"300px\");\n\t\twp.setWidth(\"400px\");\n\t\twp.setCheckAC(new ValidadorRegistrarRecibo());\n\t\twp.setTitulo(\"Registrar Recibo de Pago\");\n\t\twp.show(ZUL_REGISTRAR_RECIBO);\n\t\tif (wp.isClickAceptar()) {\n\t\t\t\n\t\t\tif (CajaUtil.CAJAS_ABIERTAS.get(this.selectedItem.getPos6()) != null) {\n\t\t\t\tString msg = \"CAJA BLOQUEADA POR USUARIO: \" + CajaUtil.CAJAS_ABIERTAS.get(this.selectedItem.getPos6());\n\t\t\t\tClients.showNotification(msg, Clients.NOTIFICATION_TYPE_ERROR, null, null, 0);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tString numeroRecibo = ((String) this.nvoRecibo.getPos1()).toUpperCase();\n\t\t\tDate fechaRecibo = (Date) this.nvoRecibo.getPos2();\n\t\t\tlong idOrdenPago = this.selectedItem.getId();\n\t\t\tString user = this.getLoginNombre();\n\t\t\tAssemblerRecibo.registrarReciboPago(numeroRecibo, fechaRecibo, idOrdenPago, user, false, false);\t\t\t\n\t\t\tthis.selectedItem = null;\n\t\t\tthis.mensajePopupTemporal(\"Recibo Registrado..\", 5000);\n\t\t}\t\n\t}", "public void salvar() throws Exception {\t\r\n\t\t\t\t\r\n\t\tDate date = new Date();\r\n\t\tString url = evento.getUrl();\r\n\t\tevento.setNmStatus(EventoService.getStatus(url));\r\n\t\tevento.setDataHora(date);\r\n\t\teventoRepository.save(evento); // COLOCAMOS NO BANCO\r\n\t\tFacesContext.getCurrentInstance().addMessage(null, new FacesMessage(\"Cadastro inserido\"));\r\n\t\tif (!modoEdicao)\r\n\t\t\teventos.add(evento); // COLOCAMOS NA LISTA\r\n\t\tevento = new Evento();\r\n\t\tmodoEdicao = false;\r\n\t}", "protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n\n Conexion conex = new Conexion();\n Connection conn = conex.getConnection();\n\n int IdReserva = Integer.parseInt(req.getParameter(\"IdReserva\"));\n int Validacion = 0;\n try {\n String Update_Reserva = \"UPDATE reservas SET Estado = 2 , FechaaFin = NOW() WHERE IdReserva = \" + IdReserva;\n PreparedStatement ps1 = conn.prepareStatement(Update_Reserva);\n if (ps1.executeUpdate() == 1) {\n String Update_Receta = \"UPDATE recetas SET Estado = 1 WHERE IdReserva = \" + IdReserva;\n PreparedStatement ps2 = conn.prepareStatement(Update_Receta);\n Validacion = ps2.executeUpdate();\n }\n\n } catch (SQLException e) {\n System.out.println(\"e Finzalizar Sita = \" + e);\n }\n PrintWriter out = resp.getWriter();\n out.print(Validacion);\n out.close();\n }", "private void creerAnnonce(View view){\n\r\n ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(),\r\n R.array.catégorie, android.R.layout.simple_spinner_item);\r\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n categorieSpinner.setAdapter(adapter);\r\n\r\n\r\n\r\n Retrofit retrofit = new Retrofit.Builder()\r\n .baseUrl(ROOT_URL )\r\n .addConverterFactory(GsonConverterFactory.create())\r\n .build();\r\n apiHold = retrofit.create(ApiHold.class);\r\n\r\n\r\n creer.setOnClickListener(new View.OnClickListener() {\r\n @Override\r\n public void onClick(View v) {\r\n\r\n final String myTitle = titreChamp.getText().toString();\r\n final String myDescription = descriptionChamp.getText().toString();\r\n\r\n Annonce annonce= new Annonce(myTitle,myDescription,categorie,SessionManager.getInstance(getActivity())\r\n .getUser().getId());\r\n\r\n\r\n Call<Annonce> call = apiHold.createAnnonce(annonce);\r\n call.enqueue(new Callback<Annonce>() {\r\n @Override\r\n public void onResponse(Call<Annonce> call, Response<Annonce> response) {\r\n\r\n if (!response.isSuccessful()) {\r\n\r\n Toast.makeText(getActivity(),\r\n \"Error \" , LENGTH_LONG).show();\r\n return;\r\n }\r\n view.getContext().startActivity(new Intent(view.getContext(),MyAnnonceActivity.class));\r\n }\r\n\r\n\r\n @Override\r\n public void onFailure(Call<Annonce> call, Throwable t) {\r\n Toast.makeText(getActivity(),\r\n t.getMessage(), LENGTH_LONG).show();\r\n }\r\n\r\n });\r\n\r\n }\r\n });\r\n\r\n }", "@Override\n\tpublic void add() {\n\t\tHashMap<String, String> data = new HashMap<>();\n\t\tdata.put(\"title\", title);\n\t\tdata.put(\"author\", author);\n\t\tdata.put(\"publisher\", publisher);\n\t\tdata.put(\"isbn\", isbn);\n\t\tdata.put(\"bookID\", bookID);\n\t\tHashMap<String, Object> result = null;\n\t\tString endpoint = \"bookinfo/post.php\";\n\t\ttry {\n\t\t\tresult = APIClient.post(BookInfo.host + endpoint, data);\n\t\t\tvalid = result.get(\"status_code\").equals(\"Success\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void createReservations() {\n final String username = extractUsername();\n final EMail email = extractEMail();\n if (!isReserved(username) || !isReserved(email)) {\n signupDelegate.enableNextButton(Boolean.FALSE);\n SwingUtil.setCursor(this, java.awt.Cursor.WAIT_CURSOR);\n UsernameReservation usernameReservation = null;\n EMailReservation emailReservation = null;\n try {\n errorMessageJLabel.setText(getString(\"CheckingUsername\"));\n errorMessageJLabel.paintImmediately(0, 0, errorMessageJLabel\n .getWidth(), errorMessageJLabel.getHeight());\n \n // get username reservation\n usernameReservation = createUsernameReservation(username);\n if (null == usernameReservation) {\n unacceptableUsername = username;\n } else {\n usernameReservations.put(username.toLowerCase(), usernameReservation);\n }\n \n // get email reservation\n emailReservation = createEMailReservation(email);\n if (null == emailReservation) {\n unacceptableEMail = email;\n } else {\n emailReservations.put(email, emailReservation);\n }\n } catch (final OfflineException ox) {\n logger.logError(ox, \"An offline error has occured.\");\n temporaryError = getSharedString(\"ErrorOffline\");\n } catch (final Throwable t) {\n logger.logError(t, \"An unexpected error has occured.\");\n temporaryError = getSharedString(\"ErrorUnexpected\");\n } finally {\n SwingUtil.setCursor(this, null);\n }\n validateInput();\n }\n }", "public void btnApostarClick(View v) {\n\t\tString idAposta = (getIntent().getStringExtra(\"Usuari\") + getIntent()\r\n\t\t\t\t.getStringExtra(\"Circuit\"));\r\n\t\tAposta ap = new Aposta(idAposta, pr.getSelectedItem().toString(), sn\r\n\t\t\t\t.getSelectedItem().toString(), tr.getSelectedItem().toString(),\r\n\t\t\t\tqt.getSelectedItem().toString(), ce.getSelectedItem()\r\n\t\t\t\t\t\t.toString(), vr.getSelectedItem().toString());\r\n\r\n\t\tguardarAposta(ap);\r\n\r\n\t\tToast.makeText(this, \"Aposta Realitzada!\", Toast.LENGTH_SHORT).show();\r\n\r\n\t\tIntent i = new Intent(ApostaActivity.this, GPListActivity.class);\r\n\t\ti.putExtra(\"Usuari\", getIntent().getStringExtra(\"Usuari\"));\r\n\t\tstartActivity(i);\r\n\t}", "public void onAddSighting(View view) {\n HashMap<String, String> dataMap = new HashMap<>();\n\n String addressEdit = ((EditText) findViewById(R.id.address)).getText().toString();\n String locationEdit = ((EditText) findViewById(R.id.location)).getText().toString();\n String zipEdit = ((EditText) findViewById(R.id.zip)).getText().toString();\n String cityEdit = ((EditText) findViewById(R.id.city)).getText().toString();\n String boroughEdit = ((EditText) findViewById(R.id.borough)).getText().toString();\n String latitudeEdit = ((EditText) findViewById(R.id.latitude)).getText().toString();\n String longitudeEdit = ((EditText) findViewById(R.id.longitude)).getText().toString();\n\n Date date = new Date();\n SimpleDateFormat f = new SimpleDateFormat(\"MM/dd/yyyy hh:mm:ss a\");\n String dateTime = f.format(date);\n\n dataMap.put(\"date\", dateTime);\n dataMap.put(\"location\", locationEdit);\n dataMap.put(\"zip\", zipEdit);\n dataMap.put(\"address\", addressEdit);\n dataMap.put(\"city\", cityEdit);\n dataMap.put(\"borough\", boroughEdit);\n dataMap.put(\"latitude\", latitudeEdit);\n dataMap.put(\"longitude\", longitudeEdit);\n\n RatData sighting = new RatData(dataMap);\n\n DataHandler.addData(sighting, new ResponseHandler() {\n @Override\n public void handle(NetworkUtils.Response response) {\n if (response.getAccept()) {\n finish();\n }\n }\n });\n }", "public void postInventory(String Name) throws SQLException {\r\n dataAccess = new Connection_SQL(\"jdbc:mysql://localhost:3306/items\", \"root\", \"P@ssword123\");\r\n dataAccess.archiveInventory(Name);\r\n try {\r\n new Inventory_Table();\r\n } catch (SQLException throwable) {\r\n throwable.printStackTrace();\r\n }\r\n }" ]
[ "0.62042457", "0.60428023", "0.59491825", "0.594874", "0.5771968", "0.5741549", "0.57219315", "0.5692098", "0.56787556", "0.5668839", "0.56539774", "0.5644233", "0.56424445", "0.5631398", "0.55722445", "0.55718356", "0.5566401", "0.55221653", "0.5481528", "0.54639447", "0.546301", "0.5435255", "0.54233503", "0.54095817", "0.5400634", "0.5383297", "0.53672796", "0.5365706", "0.53510296", "0.5346917", "0.5327855", "0.53270817", "0.53059626", "0.5296594", "0.52932906", "0.5280456", "0.52734125", "0.5252933", "0.5243294", "0.5240224", "0.5230811", "0.5226862", "0.5225483", "0.5221426", "0.5207975", "0.5201051", "0.51842797", "0.51796967", "0.5174444", "0.51657444", "0.5165438", "0.5163082", "0.5161687", "0.5160083", "0.51598376", "0.5158886", "0.5158378", "0.5153417", "0.5150365", "0.51477265", "0.51459485", "0.51386267", "0.51368475", "0.5133121", "0.51325417", "0.512918", "0.51104176", "0.5103727", "0.5095782", "0.509273", "0.50867724", "0.50867724", "0.5083924", "0.5081806", "0.50786513", "0.5077524", "0.50774634", "0.507566", "0.5075501", "0.50703174", "0.5067087", "0.50641567", "0.5052864", "0.50408983", "0.5038313", "0.5038199", "0.5032573", "0.50268835", "0.50265324", "0.50261533", "0.5023228", "0.5019612", "0.5017954", "0.5016322", "0.5008828", "0.50040185", "0.49949923", "0.49931657", "0.4982254", "0.49796414" ]
0.6303657
0
TODO Autogenerated method stub
public static void main(String[] args) { SpringApplication.run(userManagementStart.class, args); }
{ "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
/ Test de stack stack
@Test public void testStackstack() { StackArrayList<Integer> stack = new StackArrayList<Integer>(); stack.push(1); stack.push(2); stack.push(3); stack.push(4); stack.push(5); assertEquals(5, stack.peek()); assertEquals(5, stack.pop()); assertEquals(4, stack.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deleteStack(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // if stack is present\n topOfStack=-1;\n arr=null;\n System.out.println(\"Stack deleted successfully\");\n }", "public void popFrame(){\n runStack.popFrame();\n }", "public void popAllStacks(){\n // if top is lost then all elements are lost.\n top = null;\n }", "@Test\r\n\tpublic void testPop()\r\n\t{\n\t\tassertEquals(null,myStack.pop());\r\n\t\r\n\t\tassertEquals(true, myStack.push(new Element(2,\"Basel\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(4,\"Wil\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(27,\"Chur\")));\r\n\t\tassertEquals(27,myStack.top().getId());\r\n\t\tassertEquals(\"Chur\",myStack.pop().getName());\r\n\t\tassertEquals(4,myStack.pop().getId());\r\n\t\tassertEquals(2,myStack.pop().getId());\r\n\t\t\r\n\t\t// leerer Stack\r\n\t\tassertEquals(null,myStack.pop());\r\n\t\tassertEquals(null,myStack.top());\r\n\t}", "@Test\n public void pushOnStackTest_InCorrect(){\n assertNotEquals(10 , stack.getStack().returnFirst());\n }", "@Test\n public void pushOnStackTest_Correct(){\n assertEquals(stack.getTop().getData() , stack.getStack().returnFirst());\n }", "@Test\n public void testStack() {\n DatastructureTest.STACK.push(3);\n DatastructureTest.STACK.push(7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == -1);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == -1);\n }", "public void pop()\r\n\t{\r\n\t\ttop--;\r\n\t\tstack[top] = null;\r\n\t}", "@Test\n public void revertBackTest() {\n stack.revertBack(stack2);\n assertEquals(stack2.toString(), stack.toString());\n\n ResourceStack stack3 = new ResourceStack(99,99,99,99);\n stack2.revertBack(stack3);\n assertEquals(stack3.toString(), stack2.toString());\n }", "public void pop(){\n \n if(top==null) System.out.println(\"stack is empty\");\n else top=top.next;\n \t\n }", "public void pop(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // check if stack is empty\n if(this.topOfStack==-1){\n System.out.println(\"Stack is empty, can't pop from stack\");\n return;\n }\n // if stack is not empty\n this.arr[this.topOfStack]=Integer.MIN_VALUE;\n this.topOfStack--;\n }", "private List<ThroughNode> popStackStackForward() {\n List<ThroughNode> popped = nodeStackStack.peek();\n nodeStackStack.push(C.tail(popped));\n return popped;\n }", "void onStackEmpty();", "private void pop() {\r\n pop( false );\r\n }", "@Test\n public void testPushPop(){\n ms=new MyStack();\n ms.push(2);\n ms.pop();\n assertTrue(ms.IsEmpty());\n }", "public String getStack();", "@Test\n public void testPushCallTop(){\n ms = new MyStack();\n ms.push(1);\n ms.top();\n assertFalse(ms.IsEmpty());\n }", "@Override\r\n\tpublic void pop() {\n\t\tSystem.out.println(\"Pop logic for Fixed Stack\");\r\n\t}", "@Test\n public void testPopEmptyStack(){\n ms = new MyStack();\n try {\n ms.pop();\n }catch(EmptyStackException e){\n System.out.println(\"Error, cannot pop an empty stack.\");\n }\n }", "@Test\r\npublic void testTop()\r\n{\n\tassertEquals(null,myStack.top());\r\n\r\n\tassertEquals(true, myStack.push(new Element(2,\"Basel\")));\t\r\n\tassertEquals(true, myStack.push(new Element(4,\"Wil\")));\t\r\n\tassertEquals(true, myStack.push(new Element(27,\"Chur\")));\r\n\tassertEquals(27,myStack.top().getId());\r\n\tassertEquals(27,myStack.pop().getId());\r\n\tassertEquals(4,myStack.top().getId());\r\n\tassertEquals(4,myStack.pop().getId());\r\n\tassertEquals(2,myStack.pop().getId());\r\n\t\r\n\t// Stack leer\r\n\tassertEquals(null,myStack.top());\r\n\r\n}", "public void pop() throws StackUnderflowException;", "public void pop() {\n\t\tif(stackTmp.isEmpty()){\n\t\t\twhile(!stack.isEmpty()){\n\t\t\t\tint tmp = stack.peek();\n\t\t\t\tstackTmp.push(tmp);\n\t\t\t\tstack.pop();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tstackTmp.pop();\n\t\t}\n\t}", "public void pop() {\n myCStack.delete();\n }", "private static int pop(Stack<Integer> top_ref) {\n /*If stack is empty then error */\n if (top_ref.isEmpty()) {\n System.out.println(\"Stack Underflow\");\n System.exit(0);\n }\n //pop the data from the stack\n return top_ref.pop();\n }", "@Test\r\n public void testPopShouldReturnObjectWhenStackNotEmpty() {\r\n stackInstance=new StackUsingLinkedList<Integer>();\r\n stackInstance.push(49);\r\n stackInstance.push(57);\r\n stackInstance.push(2);\r\n Integer actualOutput=stackInstance.pop();\r\n Integer expectedOutput=2;\r\n assertEquals(expectedOutput,actualOutput);\r\n }", "public void popScope() {\n this.stack.removeFirst();\n }", "public void clearStack() {\n\n\t\tNode<T> current = getTopNode();\n\n\t\twhile (current != null) {\n\t\t\tpop();\n\t\t\tcurrent = current.nextNode;\n\t\t}\n\n\t\tSystem.out.println(\"\\n*****************\");\n\t\tSystem.out.println(\" STACK CLEARED!! \");\n\t\tSystem.out.println(\"*****************\");\n\t}", "protected abstract List breakOutOfStateStack();", "static void stack_pop(Stack<Integer> stack)\r\n\t{\r\n\t\t\r\n\t\tSystem.out.print(\"Pop : \");\r\n\t\tfor(int i=0;i<5;i++)\r\n\t\t{\r\n\t\t\tInteger dataElement=(Integer)stack.pop();\r\n\t\t\tSystem.out.print(\" \"+ dataElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "@Override\n public void backtrack() {\n if (!stack.isEmpty()) {\n int index = (Integer) stack.pop();\n\n if (index > arr.length) {//popping the insert function unneeded push\n insert((Integer) stack.pop());\n stack.pop();\n }\n if (index < arr.length) {//popping the delete function unneeded push\n delete(index);\n stack.pop();\n stack.pop();\n }\n System.out.println(\"backtracking performed\");\n }\n }", "@Override\n\tpublic void reset() {\n\t\tstack.clear();\n\t}", "@SubL(source = \"cycl/stacks.lisp\", position = 1928) \n public static final SubLObject clear_stack(SubLObject stack) {\n checkType(stack, $sym1$STACK_P);\n _csetf_stack_struc_num(stack, ZERO_INTEGER);\n _csetf_stack_struc_elements(stack, NIL);\n return stack;\n }", "public void testClear() {\n assertEquals(this.stack.size(), 10, 0.01);\n this.stack.clear();\n assertEquals(this.stack.size(), 0, 0.01);\n Exception exception = null;\n try {\n this.empty.pop();\n }\n catch (Exception e) {\n exception = e;\n }\n assertNotNull(exception);\n assertTrue(exception instanceof EmptyStackException);\n }", "@Test\n public void testPrintStack() {\n System.out.println(\"printStack\");\n Stack2 instance = new Stack2();\n instance.push(2);\n instance.push(4);\n instance.push(5);\n int temp = instance.pop();\n instance.printStack();\n }", "public void pop() {\n\t\tif (top == -1) {\n\t\t\tSystem.out.println(\"Stack is empty\");\n\t\t} else {\n\t\t\tSystem.out.println(stacks[top] + \" is popped\");\n\t\t\ttop--;\n\t\t}\n\t\tsize--;\n\t}", "static int pop(Stack<Integer> top_ref) {\r\n /* If stack is empty then error */\r\n if (top_ref.isEmpty()) {\r\n System.out.println(\"Stack Underflow\");\r\n System.exit(0);\r\n }\r\n\r\n // pop the data from the stack\r\n return top_ref.pop();\r\n }", "public void clearTheStack() {\n int size = expStack.size();\n for (int i = size - 1; i >= 0; i--) {\n String str = expStack.get(i);\n if (!str.equals(\"(\")) {\n postFix.add(str);\n }\n }\n }", "@Override\n public ItemStack decrStackSize(int par1, int par2) {\n if (this.stack[par1] != null)\n {\n ItemStack var3;\n\n if (this.stack[par1].stackSize <= par2)\n {\n var3 = this.stack[par1];\n this.stack[par1] = null;\n return var3;\n }\n else\n {\n var3 = this.stack[par1].splitStack(par2);\n\n if (this.stack[par1].stackSize == 0)\n {\n this.stack[par1] = null;\n }\n\n return var3;\n }\n }\n else\n {\n return null;\n }\n }", "@Test\n public void testThreePushPop(){\n ms = new MyStack();\n int pn1=3, pn2=4, pn3=5;\n ms.push(pn1);\n ms.push(pn2);\n ms.push(pn3);\n assertEquals(pn3,ms.pop());\n assertEquals(pn2,ms.pop());\n assertEquals(pn1,ms.pop());\n }", "@Test\r\n public void isEmptyTest1(){\r\n stack.pop();\r\n stack.pop();\r\n stack.pop();\r\n assertThat(stack.isEmpty(), is(true));\r\n }", "private void minus() throws Exception{\n\t\tif(!(stackBiggerThanTwo())) throw new Exception(\"Stack hat zu wenig einträge mindestens 2 werden gebraucht!!\");\n\t\telse{\n\t\t\tvalue1=stack.pop();\n\t\t\tvalue2=stack.pop();\n\t\t\tstack.push(value2-value1);\n\t\t}\n\t}", "@Test\n public void pop() {\n SimpleStack stack = new DefaultSimpleStack();\n Item item = new Item();\n Item item1 = new Item();\n stack.push(item);\n stack.push(item1);\n\n // When we pop the stack\n Item topItem = stack.pop();\n\n // Then…\n assertEquals(\"The stack constains 1 item\", 1, stack.getSize());\n assertSame(\"The first item is on top of the stack\", item, stack.peek());\n assertSame(item1, topItem);\n }", "static int deQueue(Queue q) {\r\n int x;\r\n\r\n /* If both stacks are empty then error */\r\n if (q.stack1.isEmpty() && q.stack2.isEmpty()) {\r\n System.out.println(\"Q is empty\");\r\n System.exit(0);\r\n }\r\n\r\n /*\r\n * Move elements from stack1 to stack 2 only if\r\n * stack2 is empty\r\n */\r\n if (q.stack2.isEmpty()) {\r\n while (!q.stack1.isEmpty()) {\r\n x = pop(q.stack1);\r\n push(q.stack2, x);\r\n }\r\n }\r\n x = pop(q.stack2);\r\n return x;\r\n }", "@Test\n public void testPop(){\n FunctionalLinkedList newList = new FunctionalLinkedList(); \n stack = new ImprovedStackImpl(newList);\n for(int i = 1; i < 101; i++){\n stack.push(i * 10);\n }\n \n // Check that popping an element leave the correct element on top.\n stack.pop();\n int pop = (Integer) stack.pop().getReturnValue();\n assertEquals(\"Initial pop did not work correctly.\", 990, pop);\n \n // Check that the size after popping is correct.\n int size = stack.size();\n assertEquals(\"Stack is not the correct size.\", 98, size);\n \n // Check that correct error is returned from popping an empty stack.\n for(int i = 98; i > 0; i--){\n stack.pop();\n }\n ErrorMessage error = stack.pop().getError();\n assertEquals(\"A correct error message is not returned.\", ErrorMessage.EMPTY_STRUCTURE, error);\n }", "public void testPop() {\n Exception exception = null;\n try {\n this.empty.pop();\n }\n catch (Exception e) {\n exception = e;\n }\n assertNotNull(exception);\n assertTrue(exception instanceof EmptyStackException);\n\n assertEquals(this.stack.size(), 10, 0.01);\n this.stack.pop();\n assertEquals(this.stack.size(), 9, 0.01);\n assertEquals(this.stack.peek(), 8, 0.01);\n }", "private void uminus() throws Exception{\n\t\tif(stackEmpty()) throw new Exception(\"Stack ist leer\");\n\t\telse{\n\t\t\tvalue1=stack.pop();\n\t\t\tstack.push(value1*(-1));\n\t\t}\n\t\t\n\t}", "public void StackTest() {\n\tSystem.out.println( \"\\nQuestion (8) Stack Test\" );\n\tSystem.out.println( \"-----------------------\");\n\tStack s = new Stack(3);\n\tSystem.out.println( \"push 0\");\n\ts.push(0);\n\tSystem.out.println( \"push 1\");\n\ts.push(1);\n\tSystem.out.println( \"push 2\");\n\ts.push(2);\n\tSystem.out.println( \"try to push 3\");\n\ts.push(3); // error here pushing beyond stack depth, will print error messgae\n\n\tSystem.out.println( \"pop \" + s.pop() );\n\tSystem.out.println( \"pop \" + s.pop() );\n\tSystem.out.println( \"pop \" + s.pop() ); \n\tSystem.out.println( \"try to pop \" ); // error here poping off empty stack\n\ts.pop();\n }", "static void pop_from_stack(String passed){\n\t\tchar r = passed.charAt(4);\n\t\tswitch(r){\n\t\tcase 'B':\n\t\t\tregisters.put('C',memory.get(SP++));\n\t\t\tregisters.put('B',memory.get(SP++));\n\t\t\tbreak;\n\t\tcase 'D':\n\t\t\tregisters.put('E',memory.get(SP++));\n\t\t\tregisters.put('D',memory.get(SP++));\n\t\t\tbreak;\n\t\tcase 'H':\n\t\t\tregisters.put('L',memory.get(SP++));\n\t\t\tregisters.put('H',memory.get(SP++));\n\t\t\tbreak;\n\t\tcase 'P':\n\t\t\tString w = memory.get(SP++);\n\t\t\tregisters.put('A',memory.get(SP++));\n\t\t\tw = Integer.toBinaryString(hexa_to_deci(w));\n\t\t\tCS = w.charAt(0)=='1'?true:false;\n\t\t\tP = w.charAt(2)=='1'?true:false;\n\t\t\tAC = w.charAt(4)=='1'?true:false;\n\t\t\tZ = w.charAt(6)=='1'?true:false;\n\t\t\tS = w.charAt(7)=='1'?true:false;\n\t\t}\n\t}", "Object pop(){\r\n\t\tlastStack = getLastStack();\r\n\t\tif(lastStack!=null){\r\n\t\t\tint num = lastStack.pop();\r\n\t\t\treturn num;\r\n\t\t} else {stacks.remove(stacks.size()-1);\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "@Test\n public void testPushAndPopD() {\n System.out.println(\"popC - Out of Order\");\n\n String elementOne = \"Bill\";\n String elementTwo = \"Steve\";\n String elementThree = \"Tim\";\n String elementFour = \"Dave\";\n\n //Stack<String> instance = new StackArrayImpl();\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n instance.push(elementOne);\n instance.push(elementTwo);\n instance.push(elementThree);\n\n int fourSize = instance.size();\n assertEquals(fourSize, 3);\n assertEquals(instance.isEmpty(), false);\n\n String resultThree = instance.pop();\n String resultTwo = instance.pop();\n\n instance.push(elementFour);\n String resultFour = instance.pop();\n\n String resultOne = instance.pop();\n\n assertEquals(elementOne, resultOne);\n assertEquals(elementTwo, resultTwo);\n assertEquals(elementThree, resultThree);\n assertEquals(elementFour, resultFour);\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public void pop() {\r\n readyForPop();\r\n outStack.pop();\r\n }", "E pop() throws EmptyStackException;", "@Test\n public void testPush(){\n ms=new MyStack();\n ms.push(1);\n assertFalse(ms.IsEmpty());\n }", "private final Object pop() {\r\n\t\treturn eval_stack.remove(eval_stack.size() - 1);\r\n\t}", "public boolean stackPop() {\r\n\t\t if(stackEmpty())\r\n\t\t {\r\n\t\t\t return false;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t if(top == 0)\r\n\t\t {\r\n\t\t \ttop = -1;\r\n\t\t \tcount--;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t \tarray[top] = array[top-1];\r\n\t\t \ttop--;\r\n\t\t \tcount--;\r\n\t\t }\r\n\t\t\t return true;\r\n\t\t } \t\r\n\t }", "public void pop() {\n while(!stack.isEmpty()) container.push(stack.pop());\n container.pop();\n while(!container.isEmpty()) stack.push(container.pop());\n }", "public void pop() {\n System.out.print(stack1.pop());\n }", "public AnyType pop() throws StackException;", "public static void main(String[] args) throws StackFullException, StackEmptyException {\n\t try {\n\t DiscardPile<Card> discardPile1 = null; \n\t\tdiscardPile1 = new DiscardPile<Card>(52, 0);// max is 52\n\t\tdiscardPile1.push(new Card(8));\n\t\tdiscardPile1.push(new Card(32));\n\t\tdiscardPile1.push(new Card(48));\t\t\n\t\tdiscardPile1.push(new Card(2));\n\t\tdiscardPile1.push(new Card(17));\n\t\tdiscardPile1.push(new Card(20)); //removeTopCard should remove all that's above\n\t\tdiscardPile1.push(new Card(25));\n\t\tdiscardPile1.push(new Card(50));\n\t\tdiscardPile1.push(new Card(19));\n\t\tdiscardPile1.push(new Card(41)); //10 Cards that must be popped\n\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\tCollections.reverse(discardPile1);\n\t\tfor(Card comi : discardPile1) { //for loop for objects\n\t\t\tSystem.out.println(comi);\n\t\t\t}\t\t\t\n\t }\n\t catch (StackFullException SFE) {\n\t System.out.println(\"StackFullException: \" + SFE.getMessage());\n}\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(20));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(50));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\n}", "void pop()\n\t\t{\n\t\t\tsp--;\n\t\t\tfor(int i = 0; i < sp; i++)\n\t\t\t\tXMLStream.print(\" \");\n\t\t\tif(sp < 0)\n\t\t\t\tDebug.e(\"RFO: XMLOut stack underflow.\");\n\t\t\tXMLStream.println(\"</\" + stack[sp] + \">\");\n\t\t}", "public int popFrame() {\n int result = runStack.remove(runStack.size()-1);\n int top = framePointers.pop();\n while(runStack.size() > top) {\n runStack.remove(runStack.size()-1);\n }\n runStack.add(result);\n return result;\n }", "@Test /*Test 20 - implemented pop() method to NumStack class. Refactored this method to a singe \n line return statement.*/\n public void testPop() throws Exception {\n numStackTest.push(5);\n assertEquals(\"The pop() method should return 5\", numStackTest.pop(), 5, 0.001);\n assertTrue(\"The stack should be empty after popping the only entry\", numStackTest.isEmpty());\n }", "public void pop()\n {\n EmptyStackException ex = new EmptyStackException();\n if (top <= 0)\n {\n throw ex;\n }\n else\n {\n stack.remove(top - 1);\n top--;\n }\n }", "protected void stackEmptyButton() {\n \tif (stack.empty()) {\n \t\tenter();\n \t}\n \telse {\n \t\tstack.pop();\n \t\tif (stack.empty()) {\n \t\t\tenter();\n \t}\n \t}\n }", "public DecodeStack() {\n head = null;\n }", "public void pop() {\n if (top==-1) {\n System.out.println(\"Stack is empty\");\n return;\n\n\n } else {\n System.out.println(\"item popde is:-\"+ stack[top]);\n top--;\n }\n }", "@Test\n public void testPop() {\n System.out.println(\"pop\");\n Stack2 instance = new Stack2();\n int expResult = 3;\n instance.push(1);\n instance.push(2);\n instance.push(expResult);\n int result = instance.pop();\n assertEquals(expResult, result);\n }", "final boolean init_stacks()\r\n{\r\n stateptr = -1;\r\n val_init();\r\n return true;\r\n}", "@Test /*Test 21 - the pop() method now throws the EmptyStackException if it is called when \n the stack size is currently 0.*/\n public void testPopEmptyStackException() throws EmptyStackException, BadTypeException {\n exception.expect(EmptyStackException.class);\n exception.expectMessage(\"The stack is empty. No element can be removed.\");\n numStackTest.pop();\n }", "default void popNestedPath() throws IllegalStateException {\n\t\tthrow new IllegalStateException(\"Cannot pop nested path: no nested path on stack\");\n\t}", "static void showPop(Stack<String> stack) {\n\t\tSystem.out.println(\"pop -> \" + stack.pop());\n\t\tSystem.out.println(\"Stack: \" + stack);\n\t}", "private void assertStackTop(Tree<Token> t) {\n assertEquals(t, parser.stack.peek());\n }", "private synchronized BackStep pop() {\r\n\t\t\tBackStep bs;\r\n\t\t\tbs = stack[top];\r\n\t\t\tif (size == 1) {\r\n\t\t\t\ttop = -1;\r\n\t\t\t} else {\r\n\t\t\t\ttop = (top + capacity - 1) % capacity;\r\n\t\t\t}\r\n\t\t\tsize--;\r\n\t\t\treturn bs;\r\n\t\t}", "public GenericStack popStack(){\n if(isEmpty() == true)return null;\n GenericStack temp = top;\n // makes next item in list the tip\n top = top.next;\n return temp;\n }", "@Override\n\tpublic T pop() {\n\t\tif(isEmpty()) {\n\t\t\tSystem.out.println(\"Stack is Empty\");\n\t\treturn null;}\n\t\ttop--;\t\t\t\t\t\t//top-- now before since we need index top-1\n\t\tT result = stack[top];\n\t\tstack[top] = null;\n\t\treturn result;\n\t\t\t\n\t}", "final boolean init_stacks()\n{\n stateptr = -1;\n val_init();\n return true;\n}", "final boolean init_stacks()\n{\n stateptr = -1;\n val_init();\n return true;\n}", "final boolean init_stacks()\n{\n stateptr = -1;\n val_init();\n return true;\n}", "@Test\n public void testStackCodeExamples() {\n logger.info(\"Beginning testStackCodeExamples()...\");\n\n // Allocate an empty stack\n Stack<String> stack = new Stack<>();\n logger.info(\"Start with an empty stack: {}\", stack);\n\n // Push a rock onto it\n String rock = \"rock\";\n stack.pushElement(rock);\n assert stack.getTop().equals(rock);\n logger.info(\"Push a rock on it: {}\", stack);\n\n // Push paper onto it\n String paper = \"paper\";\n stack.pushElement(paper);\n assert stack.getTop().equals(paper);\n logger.info(\"Push paper on it: {}\", stack);\n\n // Push scissors onto it\n String scissors = \"scissors\";\n stack.pushElement(scissors);\n assert stack.getTop().equals(scissors);\n assert stack.getSize() == 3;\n logger.info(\"Push scissors on it: {}\", stack);\n\n // Pop off the scissors\n assert stack.popElement().equals(scissors);\n assert stack.getSize() == 2;\n logger.info(\"Pop scissors from it: {}\", stack);\n\n // Pop off the paper\n assert stack.popElement().equals(paper);\n assert stack.getSize() == 1;\n logger.info(\"Pop paper from it: {}\", stack);\n\n // Pop off the rock\n assert stack.popElement().equals(rock);\n assert stack.isEmpty();\n logger.info(\"Pop rock from it: {}\", stack);\n\n logger.info(\"Completed testStackCodeExamples().\\n\");\n }", "public boolean stackEmpty() {\r\n\t\treturn (top == -1) ? true : false;\r\n\t }", "public boolean onPopBackStack() {\n\t\treturn false;\n\t}", "@Test(expected = EmptyStackException.class)\n public void testPopOnEmptyStack() throws EmptyStackException {\n SimpleStack stack = new DefaultSimpleStack();\n\n // When we « pop » the stack\n stack.pop(); // should throws an EmptyStackException.\n }", "@Test\n public void testRememberNumberPushPop(){\n ms = new MyStack();\n int pushNum=4, popNum;\n ms.push(pushNum);\n popNum=ms.pop();\n assertEquals(pushNum,popNum);\n }", "@Test\n public void testPushAndPopC() {\n\n System.out.println(\"pushB - All Nulls\");\n String elementOne = null;\n String elementTwo = null;\n String elementThree = null;\n String elementFour = null;\n\n //Stack<String> instance = new StackArrayImpl();\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n instance.push(elementOne);\n instance.push(elementTwo);\n instance.push(elementThree);\n instance.push(elementFour);\n\n int fourSize = instance.size();\n assertEquals(fourSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String resultFour = instance.pop();\n String resultThree = instance.pop();\n String resultTwo = instance.pop();\n String resultOne = instance.pop();\n\n assertEquals(elementOne, resultOne);\n assertEquals(elementTwo, resultTwo);\n assertEquals(elementThree, resultThree);\n assertEquals(elementFour, resultFour);\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "static void perform_pop(String passed){\n\t\tint type = type_of_pop(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tpop_from_stack(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "protected void deleteStack(DBTraceStack stack) {\n\t\tstackStore.delete(stack);\n\t}", "public int pop() throws EmptyStackException{\n //To be written by student\n if(top==-1){\n System.out.println(\"Stack is Empty!\");\n throw new EmptyStackException();\n }\n else if(localSize==A.getSize()/2){\n \tint tp=0;\n \ttry{\n \t\t tp=A.getElement(top);\n \t}catch(Exception e){e.printStackTrace();}\n top--;localSize--;\n A.halveSize();\n return tp;\n }\n else{ int tp=0;\n \ttry{\n \t\t tp=A.getElement(top);\n \t}catch(Exception e){e.printStackTrace();}\n top--;localSize--;\n \n return tp;\n }\n }", "public void pop() {\n if(!empty()){\n \tstack.pop();\n }\n }", "public static void main(String[] args) {\n \n QueuetoStack a=new QueuetoStack();\n a.add(1);\n a.add(2);\n a.add(3);\n a.add(4);\n a.remove();\n a.remove();\n a.remove();\n a.remove();\n }", "int pop() {\r\n\t\ttop--;\r\n\t\treturn stack[top];\r\n\t}", "private synchronized BackStep peek() {\r\n\t\t\treturn stack[top];\r\n\t\t}", "public void popState();", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:49.369 -0500\", hash_original_method = \"D28ACF4ED7DED6C7ED370F52380381BA\", hash_generated_method = \"21646247B3F1AB7BA202FFA1C126FBBF\")\n \npublic void popContext ()\n {\n contexts[contextPos].clear();\n contextPos--;\n if (contextPos < 0) {\n throw new EmptyStackException();\n }\n currentContext = contexts[contextPos];\n }", "int pop() \r\n {\n if(top < 0)\r\n {\r\n System.out.println(\"Stack Underflow Occurred!\");\r\n return -1;\r\n }\r\n //Write your code here\r\n int p = a[top];\r\n top--;\r\n return p; \r\n }", "public static void main(String[] args) {\n// reverse(queue);\n// System.out.println(queue);\n\n Stack<Integer> stack=new Stack<>();\n stack.push(1);\n stack.push(2);\n stack.push(3);\n stack.push(4);\n System.out.println(stack);\n stack=reverse(stack);\n System.out.println(stack);\n\n\n\n\n }", "@Override\r\n\tpublic void pop() {\n\t\tSystem.out.println(\"Pop logic for Dynamic Stack\");\r\n\t}", "@Override\r\n\tpublic AnyType pop() throws StackException {\n\t\tif(isEmpty()) throw new StackException(\"Stack is full\");\r\n\t\tAnyType data = top.data;\r\n\t\ttop=top.next;\r\n\t\treturn data;\r\n\t}", "public int pop(){\n \tint data=0;\n \tif(isEmpty())\n \tSystem.out.println(\"Stack is underflow\");\n \telse\n \tdata=elements[top--];\n \treturn data;\n\t}", "public static void main(String[] args) {\n// System.out.println(\"as.getSize() == \" + as.getSize());\n// as.pop();\n// System.out.println(\"as.pop() == \" + as);\n// System.out.println(\"as.peek() == \" + as.peek());\n// as.push(\"17\");\n// System.out.println(as);\n\n LinkedListStack<Integer> stack = new LinkedListStack<>();\n\n for(int i = 0 ; i < 5 ; i ++){\n stack.push(i);\n System.out.println(stack);\n }\n\n stack.pop();\n System.out.println(stack);\n\n }", "@Test\n public void testPushTop(){\n ms = new MyStack();\n ms.push(2);\n assertEquals(2,ms.top());\n }" ]
[ "0.7154337", "0.6963489", "0.6858587", "0.6719213", "0.6717482", "0.6670034", "0.66611147", "0.66449064", "0.66427517", "0.6586373", "0.6566242", "0.6546642", "0.65436614", "0.6501338", "0.6438919", "0.6418129", "0.6410533", "0.6378543", "0.63678974", "0.63670456", "0.6359942", "0.6347027", "0.63411736", "0.63310546", "0.63250995", "0.6316375", "0.63018686", "0.6275055", "0.6267437", "0.6264998", "0.6241561", "0.6239793", "0.6218572", "0.6213175", "0.6193689", "0.61904293", "0.61895376", "0.6177049", "0.6160768", "0.61597335", "0.6155876", "0.61550593", "0.61452097", "0.6135883", "0.61302775", "0.6127014", "0.6124984", "0.61224926", "0.6120879", "0.61158127", "0.6112928", "0.61071795", "0.6099307", "0.60792774", "0.6076335", "0.6075684", "0.60711986", "0.60693115", "0.60661536", "0.606005", "0.6058984", "0.605419", "0.6033521", "0.6020766", "0.60200685", "0.60197824", "0.6009516", "0.60083175", "0.60011", "0.59988034", "0.5994302", "0.5986446", "0.5983173", "0.59824574", "0.5972596", "0.5971856", "0.5971856", "0.5971856", "0.59690946", "0.5967504", "0.5966858", "0.5958766", "0.5951545", "0.5937678", "0.5930461", "0.59290093", "0.59222496", "0.59209013", "0.5913017", "0.5909783", "0.59022886", "0.5899603", "0.5898409", "0.589838", "0.589677", "0.5895891", "0.58950573", "0.58942264", "0.5893234", "0.5885765" ]
0.6022786
63
/ Test de stack Lista Encadenada
@Test public void testStackListaEncadenada() { StackListaEncadenada<Integer> stack = new StackListaEncadenada<Integer>(); stack.push(1); stack.push(2); stack.push(3); stack.push(4); stack.push(5); assertEquals(5, stack.peek()); assertEquals(5, stack.pop()); assertEquals(4, stack.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void pushOnStackTest_Correct(){\n assertEquals(stack.getTop().getData() , stack.getStack().returnFirst());\n }", "@Test\r\n public void testStackListaDobleEncadenada() {\r\n StackListaDobleEncadenada<Integer> stack = new StackListaDobleEncadenada<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek());\r\n assertEquals(5, stack.pop());\r\n assertEquals(4, stack.size());\r\n }", "@Test\n public void testStack() {\n DatastructureTest.STACK.push(3);\n DatastructureTest.STACK.push(7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == -1);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == -1);\n }", "@Test\r\n public void testStackstack() {\r\n StackArrayList<Integer> stack = new StackArrayList<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek());\r\n assertEquals(5, stack.pop());\r\n assertEquals(4, stack.size());\r\n }", "@Test\r\npublic void testTop()\r\n{\n\tassertEquals(null,myStack.top());\r\n\r\n\tassertEquals(true, myStack.push(new Element(2,\"Basel\")));\t\r\n\tassertEquals(true, myStack.push(new Element(4,\"Wil\")));\t\r\n\tassertEquals(true, myStack.push(new Element(27,\"Chur\")));\r\n\tassertEquals(27,myStack.top().getId());\r\n\tassertEquals(27,myStack.pop().getId());\r\n\tassertEquals(4,myStack.top().getId());\r\n\tassertEquals(4,myStack.pop().getId());\r\n\tassertEquals(2,myStack.pop().getId());\r\n\t\r\n\t// Stack leer\r\n\tassertEquals(null,myStack.top());\r\n\r\n}", "@Test\n public void pushOnStackTest_InCorrect(){\n assertNotEquals(10 , stack.getStack().returnFirst());\n }", "public static void main(String[] args) throws Exception {\n\t\t// TODO Auto-generated method stub\n\t\tLinkedListAsStack stack = new LinkedListAsStack();\n\t\tstack.push(10);\n\t\tstack.push(20);\n\t\tstack.push(30);\n\t\tstack.push(40);\n\t\tstack.display();// 40 30 20 10-> act as a stack\n\t\tSystem.out.println(stack.size());// 4\n\t\tSystem.out.println(stack.isEmpty());// false\n\t\tSystem.out.println(stack.pop());// 40\n\t\tSystem.out.println(stack.top());// 30\n\t\tstack.display();// 30 20 10\n\t\tSystem.out.println(stack.size());// 3\n\t}", "@Test\n public void testPush(){\n ms=new MyStack();\n ms.push(1);\n assertFalse(ms.IsEmpty());\n }", "@Test\n public void testStackCodeExamples() {\n logger.info(\"Beginning testStackCodeExamples()...\");\n\n // Allocate an empty stack\n Stack<String> stack = new Stack<>();\n logger.info(\"Start with an empty stack: {}\", stack);\n\n // Push a rock onto it\n String rock = \"rock\";\n stack.pushElement(rock);\n assert stack.getTop().equals(rock);\n logger.info(\"Push a rock on it: {}\", stack);\n\n // Push paper onto it\n String paper = \"paper\";\n stack.pushElement(paper);\n assert stack.getTop().equals(paper);\n logger.info(\"Push paper on it: {}\", stack);\n\n // Push scissors onto it\n String scissors = \"scissors\";\n stack.pushElement(scissors);\n assert stack.getTop().equals(scissors);\n assert stack.getSize() == 3;\n logger.info(\"Push scissors on it: {}\", stack);\n\n // Pop off the scissors\n assert stack.popElement().equals(scissors);\n assert stack.getSize() == 2;\n logger.info(\"Pop scissors from it: {}\", stack);\n\n // Pop off the paper\n assert stack.popElement().equals(paper);\n assert stack.getSize() == 1;\n logger.info(\"Pop paper from it: {}\", stack);\n\n // Pop off the rock\n assert stack.popElement().equals(rock);\n assert stack.isEmpty();\n logger.info(\"Pop rock from it: {}\", stack);\n\n logger.info(\"Completed testStackCodeExamples().\\n\");\n }", "public void printStack() {\n\t\tif (this.l.getHead() != null) {\n\t\t\tl.printList();\n\t\t} else {\n\t\t\tSystem.out.println(\"No element in stack\");\n\t\t}\n\t}", "public static void main(String[] args) {\n Solution solution = new Solution();\n TreeNode root = new TreeNode(1);\n root.left = new TreeNode(2);\n root.left.left = new TreeNode(6);\n root.left.left.right = new TreeNode(10);\n root.left.left.right.left = new TreeNode(-1);\n root.left.right = new TreeNode(9);\n\n root.right = new TreeNode(3);\n root.right.right = new TreeNode(5);\n root.right.left = new TreeNode(4);\n root.right.left.left = new TreeNode(7);\n root.right.left.right = new TreeNode(8);\n \n solution.stackList(root);\n for (int i = 0 ; i < solution.list.size(); i++) System.out.print(solution.list.get(i) + \" \");\n }", "@Test\n public void testSingleStack() {\n ProgramStack ps = new ProgramStack();\n\n ps.push(1);\n\n Assert.assertEquals(\"[1]\", ps.toString());\n }", "@Test\n public void testPushCallTop(){\n ms = new MyStack();\n ms.push(1);\n ms.top();\n assertFalse(ms.IsEmpty());\n }", "public void printStack(Stack list){\n while(!list.isEmpty()){\n temp.push(list.peek());\n list.pop();\n }\n\n //printing temp and inserting items back to list\n while(!temp.isEmpty()){\n System.out.println(temp.peek()+\" \");\n list.push(temp.peek());\n temp.pop();\n }\n System.out.println();\n\n }", "@Test\r\n\tpublic void testCardStack() {\r\n\t\t\r\n\t\t// create a card stack\r\n\t\tCardStack testStack = new CardStack();\r\n\t\t\r\n\t\t// test if we can place a non-king card onto the empty stack\r\n\t\tassertFalse(testStack.isValidMove(deckCards.get(1)));\r\n\t\t\r\n\t\t// test if we can place a king onto an empty stack\r\n\t\t// remember testStack starts at 0 not 1, so kings are at position 12\r\n\t\tassertTrue(testStack.isValidMove(deckCards.get(12)));\r\n\t\t\r\n\t\t// add the king to the stack\r\n\t\tassertEquals(deckCards.get(12), testStack.push(deckCards.get(12)));\r\n\t\t\r\n\t\t// now test can we add the same suit queen\r\n\t\tassertFalse(testStack.isValidMove(deckCards.get(12)));\r\n\t\t\r\n\t\t// now test if can add an off-suit different color queen\r\n\t\tassertTrue(testStack.isValidMove(deckCards.get(37)));\r\n\t\t\r\n\t\t// place the card to the stack\r\n\t\tassertEquals(deckCards.get(37), testStack.push(deckCards.get(37)));\r\n\t\t\r\n\t\t// add a card to the stack via add method as if being dealt\r\n\t\ttestStack.addCard(deckCards.get(40));\r\n\t\t\r\n\t\t// now check if that changes what will be accepted\r\n\t\tassertFalse(testStack.isValidMove(deckCards.get(41)));\r\n\t}", "@Test\n public void testBiggerStack() {\n\n System.out.println(\"isEmpty\");\n\n int sizeTest = 5000;\n\n List<String> elementList = new ArrayList();\n String tempString = \"\";\n\n for (int i = 0; i < sizeTest; i++) {\n\n tempString = tempString + \"z\";\n elementList.add(tempString);\n\n }\n\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n for (String string : elementList) {\n instance.push(string);\n }\n\n int fourSize = instance.size();\n assertEquals(fourSize, sizeTest);\n assertEquals(instance.isEmpty(), false);\n\n for (int i = sizeTest; i > 0; i--) {\n\n String result = instance.pop();\n\n String expected = elementList.get(i - 1);\n\n assertEquals(expected, result);\n\n }\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public String getStack();", "@Test\r\n\tpublic void testPop()\r\n\t{\n\t\tassertEquals(null,myStack.pop());\r\n\t\r\n\t\tassertEquals(true, myStack.push(new Element(2,\"Basel\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(4,\"Wil\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(27,\"Chur\")));\r\n\t\tassertEquals(27,myStack.top().getId());\r\n\t\tassertEquals(\"Chur\",myStack.pop().getName());\r\n\t\tassertEquals(4,myStack.pop().getId());\r\n\t\tassertEquals(2,myStack.pop().getId());\r\n\t\t\r\n\t\t// leerer Stack\r\n\t\tassertEquals(null,myStack.pop());\r\n\t\tassertEquals(null,myStack.top());\r\n\t}", "@Test\n\tpublic void testPush(){\n\t\tArrayIntStack stack = buildStack(4);\n\t\tassertEquals(4, stack.intCol.size());\n\t}", "@Test\n public void testPushPop(){\n ms=new MyStack();\n ms.push(2);\n ms.pop();\n assertTrue(ms.IsEmpty());\n }", "@Test\n public void testBigStack() {\n\n System.out.println(\"isEmpty\");\n\n int sizeTest = 500;\n\n List<String> elementList = new ArrayList();\n String tempString = \"\";\n\n for (int i = 0; i < sizeTest; i++) {\n\n tempString = tempString + \"z\";\n elementList.add(tempString);\n\n }\n\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n for (String string : elementList) {\n instance.push(string);\n }\n\n int fourSize = instance.size();\n assertEquals(fourSize, sizeTest);\n assertEquals(instance.isEmpty(), false);\n\n for (int i = sizeTest; i > 0; i--) {\n\n String result = instance.pop();\n\n String expected = elementList.get(i - 1);\n\n assertEquals(expected, result);\n\n }\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public void traverseStack(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // check if stack is empty\n if(this.topOfStack==-1){\n System.out.println(\"Stack is empty, can't traverse\");\n return;\n }\n // if stack is not empty\n System.out.println(\"Printing stack...\");\n for(int i=0;i<=this.topOfStack;i++){\n System.out.print(this.arr[i]+\" \");\n }\n System.out.println();\n }", "public static void main( String[] args )\n {\n\tStack<String> cakes = new LLStack<String>();\n\n\t//\"bronze jungle fail smite challenger nunu consume blue\"\n\tSystem.out.println( \"is cakes empty: \" + cakes.isEmpty() + \"\\n\" );\n\t\n\t//push tests\n\tcakes.push( \"blue\" );\t\n\tSystem.out.println( \"top value of cakes after pushing blue:\\n\" + cakes.peek() );\t\n\tcakes.push( \"consume\" );\t\n\tSystem.out.println( \"top value of cakes after pushing consume:\\n\" + cakes.peek() );\t\n\tcakes.push( \"nunu\" );\n\tSystem.out.println( \"top value of cakes after pushing nunu:\\n\" + cakes.peek() );\t\t\n\tcakes.push( \"challenger\" );\n\tSystem.out.println( \"top value of cakes after pushing challenger:\\n\" + cakes.peek() );\t\n\tcakes.push( \"smite\" );\t\n\tSystem.out.println( \"top value of cakes after pushing smite:\\n\" + cakes.peek() );\t\n\tcakes.push( \"fail\" );\t\n\tSystem.out.println( \"top value of cakes after pushing fail:\\n\" + cakes.peek() );\t\n\tcakes.push( \"jungle\" );\t\n\tSystem.out.println( \"top value of cakes after pushing jungle:\\n\" + cakes.peek() );\t\n\tcakes.push( \"bronze\" );\t\n\tSystem.out.println( \"top value of cakes after pushing bronze:\\n\" + cakes.peek() );\n\t\n\tSystem.out.println( \"\\nis cakes empty: \" + cakes.isEmpty() + \"\\n\" );\n\t\n\t//pop tests\n\tfor( int i = 0; i < 8; i ++ ){\n\t\tSystem.out.println( \"top value of cakes: \" + cakes.peek() );\n\t\tSystem.out.println( \"value popped from cakes: \" + cakes.pop() );\n\t}\n\t\n\tSystem.out.println( \"\\nis cakes empty: \" + cakes.isEmpty() + \"\\n\" );\n\t\n }", "@Test\n public void testPushTop(){\n ms = new MyStack();\n ms.push(2);\n assertEquals(2,ms.top());\n }", "public static void main (String[] args) {\n // testing LinkedStack\n // ===================\n System.out.println(\"\\n** Test output for LinkedStack **\\n\");\n\n // instantiate new LinkedStack\n LinkedStack<String> stack = new LinkedStack<String>();\n\n // check size is 0 and isEmpty() returns true\n System.out.println(\"Checking that size = 0 and isEmpty is true...\");\n System.out.println(\"Size: \" + stack.size() + \" isEmpty: \" + stack.isEmpty());\n\n // test peeking and popping empty stack, should throw exception\n System.out.println(\"Popping empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(stack.pop());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n }\n System.out.println(\"Peeking at empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(stack.peek());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n\n }\n\n // push an element onto stack, stack should have one element\n System.out.println(\"Pushing an element...\");\n stack.push(\"One\");\n System.out.println(\"After pushing a single element, the stack should have one element \\\"One\\\"\");\n System.out.println(stack);\n System.out.println();\n\n // pop the element, stack should be empty again\n System.out.println(\"Popping...\");\n stack.pop();\n System.out.println(\"After the pop operation, stack should be empty:\");\n System.out.println(stack);\n\n // push more elements\n System.out.println(\"Pushing an element...\");\n stack.push(\"Two\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Three\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Four\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Five\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Six\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Seven\");\n System.out.println(\"Stack with six elements:\");\n System.out.println(stack);\n System.out.println();\n\n // check size is 6 and isEmpty() returns false\n System.out.println(\"Checking that size = 6 and isEmpty is false...\");\n System.out.println(\"Size: \" + stack.size() + \" isEmpty: \" + stack.isEmpty());\n System.out.println();\n\n // test peeking at top element from stack\n System.out.println(\"Peeking at top element..\");\n System.out.println(stack.peek());\n System.out.println();\n\n // test popping top element from stack\n System.out.println(\"Popping...\");\n System.out.println(stack.pop());\n System.out.println(\"Stack after pop operation:\");\n System.out.println(stack);\n System.out.println();\n\n\n // ====================\n // testing DropOutStack\n // ====================\n System.out.println(\"\\n** Test output for DropOutStack **\\n\");\n // instantiate new DropOutStack with capacity of 5\n DropOutStack<String> dropStack = new DropOutStack<String>(5);\n\n // test peeking and popping empty stack, should throw exception\n System.out.println(\"Popping empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(dropStack.pop());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n }\n System.out.println(\"Peeking at empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(dropStack.peek());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n\n }\n\n // check size is 0 and isEmpty() returns true\n System.out.println(\"Checking that size = 0 and isEmpty is true...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // push 3 elements to stack, stack not full\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"One\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Two\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Three\");\n System.out.println(\"After 3 push operations, the stack looks like this:\");\n System.out.println(dropStack);\n System.out.println();\n\n // check size is 3 and isEmpty() returns false\n System.out.println(\"Checking that size = 3 and isEmpty is false...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // push 3 more elements to stack, should drop first element pushed to stack (\"One\")\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Four\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Five\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Six\");\n System.out.println(\"Stack after 3 more push operations, first element \\\"One\\\" is lost:\");\n System.out.println(dropStack);\n System.out.println();\n\n // check size is 5 and isEmpty() returns false\n System.out.println(\"Checking that size = 5 and isEmpty is false...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // test peeking at top element from stack\n System.out.println(\"Peeking at top element..\");\n System.out.println(dropStack.peek());\n System.out.println();\n\n // test popping top element from stack\n System.out.println(\"Popping next element\");\n dropStack.pop();\n System.out.println(\"Stack after pop operation:\");\n System.out.println(dropStack);\n System.out.println();\n\n // push another element\n System.out.println(\"Pushing another element...\");\n dropStack.push(\"Seven\");\n System.out.println(\"After push operation:\");\n System.out.println(dropStack);\n System.out.println();\n\n // pop all elements from stack, stack should be empty\n System.out.println(\"Popping all elements from stack:\");\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n\n System.out.println(\"Stack is empty:\");\n System.out.println(dropStack);\n\n\n }", "@Test\n public void testNonemptyStack() {\n ProgramStack ps = new ProgramStack();\n\n ps.push(1);\n ps.push(2);\n ps.push(3);\n\n Assert.assertEquals(\"[1, 2, 3]\", ps.toString());\n }", "@Test\n public void testStackInteger() {\n DatastructureTest.INTSTACK.push(3);\n DatastructureTest.INTSTACK.push(7);\n Assert.assertTrue(DatastructureTest.INTSTACK.peek() == 7);\n Assert.assertTrue(DatastructureTest.INTSTACK.pop() == 7);\n Assert.assertTrue(DatastructureTest.INTSTACK.peek() == 3);\n Assert.assertTrue(DatastructureTest.INTSTACK.pop() == 3);\n Assert.assertTrue(DatastructureTest.INTSTACK.peek() == -1);\n Assert.assertTrue(DatastructureTest.INTSTACK.pop() == -1);\n }", "public static void main(String[] args) throws Exception {\n StackUsingArrays stack=new StackUsingArrays(5);\n \n for(int i=1;i<=5;i++) {\n \tstack.push(i*10);\n \tstack.display();\n }\n \n System.out.println(stack.size());\n \n //stack.push(60);\n System.out.println(stack.top());\n \n// while(!stack.isEmpty()) {\n// \tstack.display();\n// \tstack.pop();\n// \t\n// }\n// \n// stack.pop();\n\t}", "public static void main(String[] args) {\n// System.out.println(\"as.getSize() == \" + as.getSize());\n// as.pop();\n// System.out.println(\"as.pop() == \" + as);\n// System.out.println(\"as.peek() == \" + as.peek());\n// as.push(\"17\");\n// System.out.println(as);\n\n LinkedListStack<Integer> stack = new LinkedListStack<>();\n\n for(int i = 0 ; i < 5 ; i ++){\n stack.push(i);\n System.out.println(stack);\n }\n\n stack.pop();\n System.out.println(stack);\n\n }", "@Override\n <E> Stack<E> getStack(String list) {\n if (list.equalsIgnoreCase(\"Simple\")){\n return new StackSinglyLinkedList<E>();\n\n } else if (list.equalsIgnoreCase(\"Doble\")){\n return new StackDoublyLinkedList<E>();\n\n } else if (list.equalsIgnoreCase(\"Circular\")){\n return new StackCircularList<E>();\n\n }\n\n return null;\n }", "public static void main(String[] args) {\n\t\tStack stack = new Stack(3);\n\t\tSystem.out.println(\"Is stack empty ? - \" + isEmpty(stack));\n\t\tpush(stack, 10);\n\t\tpush(stack, 20);\n\t\tpush(stack, 30);\n\t\tpush(stack, 40);\n\t\tfor(int i = 0; i <= stack.top; i++){\n\t\t\tSystem.out.print(stack.list[i] + \" -\");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"No of element in stack - \"+(stack.top +1));\n\t\twhile(!isEmpty(stack)){\n\t\t\tSystem.out.println(\"Poping ...\"+ pop(stack));\n\t\t}\n\t}", "@Test\r\n public void testPushShouldReturnTrue() {\r\n stackInstance=new StackUsingLinkedList<Integer>();\r\n boolean actualOutput=stackInstance.push(4);\r\n assertEquals(true,actualOutput);\r\n }", "@Test\n public void testEmptyStack() {\n ProgramStack ps = new ProgramStack();\n\n Assert.assertEquals(\"[]\", ps.toString());\n }", "public static void main(String[] args) {\n\t\tTestStack s = new TestStack();\n\t\ts.push(1);\n\t\ts.push(\"2\");\n\t\ts.push(\"as\");\n\t\t\n\t\tint size =stack.size();\n\t\t\n\t\tfor(int i=0;i<size;i++)\n\t\t\tSystem.out.println(s.pop());\n\t\t\t\t\n\t}", "@Test\n public void testMassiveStack() {\n\n System.out.println(\"isEmpty\");\n\n int sizeTest = 10000;\n\n List<String> elementList = new ArrayList();\n String tempString = \"\";\n\n for (int i = 0; i < sizeTest; i++) {\n\n tempString = tempString + \"z\";\n elementList.add(tempString);\n\n }\n\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n for (String string : elementList) {\n instance.push(string);\n }\n\n int fourSize = instance.size();\n assertEquals(fourSize, sizeTest);\n assertEquals(instance.isEmpty(), false);\n\n for (int i = sizeTest; i > 0; i--) {\n\n String result = instance.pop();\n\n String expected = elementList.get(i - 1);\n\n assertEquals(expected, result);\n\n }\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public void testMyStack() {\n\t\tMyStack<String> s = new MyStack<String>();\n\t\ts.push(\"1\");\n\t\ts.push(\"2\");\n\t\ts.push(\"3\");\n\t\ts.pop();\n\t\ts.push(\"4\");\n\t\ts.toString();\n\t\tSystem.out.println(\"MyStack size is: \" + s.size());\n\t}", "public static void main(String[] args) {\n\t\tString palabrejas[] = { \"columnas\", \"filas\", \"zalamero\", \"zascandil\" };\n\t\tStack<String> palabrasPila = new Stack<String>();\n\t\t// Aunque tiene varios métodos suelen usarse los de ingreso o extraccion\n\t\t// a la pila\n\t\t// para poner en la pila\n\t\t// push coloca un elemento en la cima de la pila\n\t\tpalabrasPila.push(palabrejas[0]);\n\t\tpalabrasPila.push(palabrejas[1]);\n\t\tSystem.out.println(palabrasPila);\n\t\t// como se obtienen los elementos seegun el criterio de una pila\n\t\t// dos formas\n\t\t// 1º obteniendo el elemento y borrandolo de la pila\n\t\t// con pop se retorna el elemento en la cima y se borra de la pila\n\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\tSystem.out.println(palabrasPila);\n\t\ttry {\n\t\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"pila vacia\");\n\t\t}\n\t\t// Como hemos dicho se puede trabajar con Stack como si fuese una colecction\n\t\tfor (int i = 0; i < palabrejas.length; i++) {\n\t\t\tpalabrasPila.push(palabrejas[i]);\n\t\t}\n\t\t// 2º metodo de acceso a Stack como pila\n\t\t// Se trata del metodo peek que es como el pop pero\n\t\t// no elimina el elemento de la cima\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"cima \" + palabrasPila.peek());\n\t\t}\n\t\t// Si usas una Stack es porque lo necesitas. java te permite usarla como\n\t\t// una collection normal, pero en realidad solo se deberian usar las\n\t\t// cuatro funciones asociadas a a pila\n\t\t// pop,push,peek,isEmpty\n\t\tSystem.out.println(palabrasPila.size());\n\t}", "@Test\n void whenElementAddedToStackLastElementShouldTop() {\n\n MyNode<Integer> myFirstNode = new MyNode<>(70);\n MyNode<Integer> mySecondNode = new MyNode<>(30);\n MyNode<Integer> myThirdNode = new MyNode<>(56);\n MyStack myStack = new MyStack();\n myStack.push(myFirstNode);\n myStack.push(mySecondNode);\n myStack.push(myThirdNode);\n\n boolean result = myStack.head.equals(myFirstNode) && myStack.head.getNext().equals(mySecondNode)\n && myStack.tail.equals(myThirdNode);\n\n Assertions.assertTrue(result);\n }", "public static void main(String[] args) {\n\t\tStack<String> stack = new Stack<>();\n\t\t//push é o metodo adiciona\n\t\tstack.push(\"ricardo\");\n\t\tstack.push(\"rodrigo\");\n\t\tstack.push(\"rogerio\");\n\t\tstack.push(\"ronaldo\");\n\t\t\n\t\tSystem.out.println(stack);\n\t\t\n\t\t//pop é o metodo delete\n\t\tstack.pop();\n\t\t\n\t\tSystem.out.println(stack);\n\t\t//peek é o metodo para retornar o ultimo elemento sem apagar\n\t\tSystem.out.println(stack.peek());\n\t\t\n\t\t//System.out.println(stack);\n\t\t\n\t\t\n\t}", "@Test /*Test 19 - implemented push() method to NumStack class.*/\n public void testPush() {\n numStackTest.push(5);\n assertFalse(\"NumStack object shouldn't be empty after pushing first entry onto it\", \n numStackTest.isEmpty());\n numStackTest.push(10);\n assertFalse(\"NumStack object shouldn't be empty after pushing second entry onto it\", \n numStackTest.isEmpty());\n numStackTest.push(15);\n assertFalse(\"NumStack object shouldn't be empty after pushing third entry onto it\", \n numStackTest.isEmpty());\n }", "@Test\n public void basicQueueOfStacksTest() {\n \n QueueOfStacks<String> tempQueue = new QueueOfStacks<String>();\n String tempCurrentElement;\n \n assertTrue(\"Element not in queue\", tempQueue.isEmpty());\n tempQueue.add(\"a\");\n assertTrue(\"Element not in queue\", !tempQueue.isEmpty());\n tempQueue.add(\"b\");\n assertTrue(\"Number of elements not correct\", tempQueue.size() == 2);\n \n tempCurrentElement = tempQueue.peek();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"a\"));\n\n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"a\") &&\n tempQueue.size() == 1);\n \n tempQueue.add(\"c\");\n assertTrue(\"Number of elements not correct\", tempQueue.size() == 2);\n \n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"b\") &&\n tempQueue.size() == 1 &&\n !tempQueue.isEmpty());\n \n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"c\") &&\n tempQueue.size() == 0 &&\n tempQueue.isEmpty());\n \n }", "public void isPalindromeListStackMethod() {\n\n\t\tStack<Integer> stk = new Stack<Integer>();\n\n\t\tNode temp = head;\n\t\twhile(temp != null) {\n\t\t\tstk.push(temp.data);\n\t\t\ttemp = temp.next;\n\t\t}\n\n\t\ttemp = head;\n\t\twhile(temp != null && stk.empty() == false) {\n\t\t\tif(temp.data == stk.peek()) {\n\t\t\t\ttemp = temp.next;\n\t\t\t\tstk.pop();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(stk.empty() == true) {\n\t\t\tSystem.out.println(\"List is Palindrome\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"List is not Palindrome\");\n\t\t}\n\n\t}", "public interface Stack<E> {\r\n \r\n /** \r\n * Pre: Se ingresa el dato\r\n * @param data se ingresa un dato para agregar al Vector\r\n * Post: Se guarda el dato en Stack\r\n */\r\n public void push(E data);\r\n\r\n /** \r\n * Pre: Estan todos los datos en el Stack\r\n * @return E se regresa un item.\r\n * Post: Se regresa y elimina un dato del Stack\r\n */\r\n public E pop();\r\n\r\n /** \r\n * Pre: Se encuentra el Stack con sus datos\r\n * @return E se regresa cualquier tipo de dato\r\n * @throws EmptyStackException regresa un error\r\n * Post: Se regresa el dato sobre la lista\r\n */\r\n public E peek();\r\n\r\n /** \r\n * Pre:Se encuentra el Stack\r\n * @return boolean se regresa un valor True o False\r\n * Post: Si el Stack se encuentra vacio este regresa True\r\n */\r\n public boolean empty();\r\n\r\n /** \r\n * Pre:Se encuentra el Stack \r\n * @return int se regrea cualquier numero\r\n * Post: Se devuelve el numero de objetos que tiene el Stack\r\n */\r\n public int size();\r\n\r\n}", "@Test\n public void testModuloStackSize() {\n MainPanel mp = new MainPanel();\n ProgramArea pa = new ProgramArea();\n ProgramStack ps = new ProgramStack();\n\n ps.push(10);\n ps.push(3);\n\n ProgramExecutor pe = new ProgramExecutor(mp, ps, pa);\n\n pe.modulo();\n ps.pop();\n\n Assert.assertEquals(\"[]\", ps.toString());\n }", "static void stackPush(Stack<Integer> stack)\r\n\t{\r\n\t\tfor(int i=0;i<5;i++)\r\n\t\t{\r\n\t\t\tstack.push(i*5);\r\n\t\t}\r\n\t\tSystem.out.println(\"Printing the stack value which is push:\");\r\n\t\tSystem.out.println(\"Push :\"+stack +\"\\nsize of stack: \"+ stack.size());\r\n\t}", "@Test\r\n public void testIsEmptyShouldReturnFalseWhenStackNotEmpty() {\r\n stackInstance=new StackUsingLinkedList<Integer>();\r\n stackInstance.push(90);\r\n stackInstance.push(5);\r\n boolean actualOutput=stackInstance.isEmpty();\r\n assertEquals(false,actualOutput);\r\n }", "@Test\r\n public void isEmptyTest1(){\r\n stack.pop();\r\n stack.pop();\r\n stack.pop();\r\n assertThat(stack.isEmpty(), is(true));\r\n }", "public void testPush() {\n assertEquals(this.stack.size(), 10, 0.01);\n this.stack.push(10);\n assertEquals(this.stack.size(), 11, 0.01);\n assertEquals(this.stack.peek(), 10, 0.01);\n }", "@Test\n public void testPrintStack() {\n System.out.println(\"printStack\");\n Stack2 instance = new Stack2();\n instance.push(2);\n instance.push(4);\n instance.push(5);\n int temp = instance.pop();\n instance.printStack();\n }", "@Test\n public void testPop(){\n FunctionalLinkedList newList = new FunctionalLinkedList(); \n stack = new ImprovedStackImpl(newList);\n for(int i = 1; i < 101; i++){\n stack.push(i * 10);\n }\n \n // Check that popping an element leave the correct element on top.\n stack.pop();\n int pop = (Integer) stack.pop().getReturnValue();\n assertEquals(\"Initial pop did not work correctly.\", 990, pop);\n \n // Check that the size after popping is correct.\n int size = stack.size();\n assertEquals(\"Stack is not the correct size.\", 98, size);\n \n // Check that correct error is returned from popping an empty stack.\n for(int i = 98; i > 0; i--){\n stack.pop();\n }\n ErrorMessage error = stack.pop().getError();\n assertEquals(\"A correct error message is not returned.\", ErrorMessage.EMPTY_STRUCTURE, error);\n }", "@Test\n public void copyStackTest() {\n ResourceStack copiedStack = stack.copyStack();\n assertEquals(copiedStack.toString(), stack.toString());\n }", "@Test\n public void toStringTest() {\n assertEquals(\"1 2 3 4\", stack.toString());\n }", "@Test\n public void testRemove(){\n FunctionalLinkedList newList = new FunctionalLinkedList();\n for(int i = 1; i < 101; i++){\n if(i%2 == 1){\n newList.add(\"Odd\");\n } else {\n newList.add(\"Even\");\n }\n }\n stack = new ImprovedStackImpl(newList);\n \n // Remove one set of elements & check size.\n stack.remove(\"Odd\");\n assertEquals(\"Size of list is incorrect.\", 50, stack.size());\n String even;\n for(int i = 0; i < stack.size(); i++){\n even = (String) stack.pop().getReturnValue();\n assertEquals(\"'Odd' not removed at loop \"+ i +\".\", \"Even\", even);\n }\n }", "@Test\n public void push() {\n SimpleStack stack = new DefaultSimpleStack();\n Item item = new Item();\n\n // When the item is pushed in the stack\n stack.push(item);\n\n // Then…\n assertFalse(\"The stack must be not empty\", stack.isEmpty());\n assertEquals(\"The stack constains 1 item\", 1, stack.getSize());\n assertSame(\"The pushed item is on top of the stack\", item, stack.peek());\n }", "@Test\n public void addAllTypesTest(){\n stack.addToAllTypes(stack2);\n ResourceStack stack3 = new ResourceStack(3, 5, 7, 9);\n assertEquals(stack3.toString(), stack.toString());\n\n stack.addToAllTypes(stack2);\n stack3 = new ResourceStack(5, 8, 11, 14);\n assertEquals(stack3.toString(), stack.toString());\n }", "public ListStack() {\n\t\tlist = new ArrayList<>();\n\t}", "@Test\n public void isEmpty() {\n SimpleStack stack = new DefaultSimpleStack();\n\n // then the stack is empty\n assertTrue(stack.isEmpty());\n }", "@Override \n\tpublic String toString() {\n\t\t\n\t\tSystem.out.println(\"New Stack\");\n\t\t\n\t\tfor(int i = 0; i < arraySize; i++) {\n\t\t\tSystem.out.println(\"stack: \" + list[i].toString());\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\");// Print and empty new line\n\t\t\n\t\treturn \"\";\n\t}", "@Override\r\n\tpublic void excecute() {\n\t\tdata = stack.pop();\r\n\t\tJList1.setListData(stack.getStackVector()); // refresh the JList\r\n\t}", "@Test\n public void ListFactoryTester() {\n \tCalculator calculadora = new ImpCalculadora();\n \t//Se inicializan los factorys\n \tStackFactory<Integer> stackFactory = new StackFactory<Integer>();\n \tListFactory<Integer> listFactory = new ListFactory<Integer>();\n \tStack<Integer> stack;\n \tAbstractList<Integer> lista;\n \t\n \t lista = listFactory.getList(\"Lista Circular\");\n \t CircularList<Integer> list = (CircularList<Integer>) lista;\n // assert statements\n //Aquí se ejecutara nuestro test.\n \n assertEquals(0, list.size(), \"Se debe verificar que el list inicie vacío.\");\n list.addLast(10);\n list.addLast(5);\n int num2=list.removeLast();\n int num1= list.removeLast();\n int suma=calculadora.Calculate(num1,num2 , \"+\");\n int resta=calculadora.Calculate(num1,num2 , \"-\");\n int multiplicacion=calculadora.Calculate(num1,num2 , \"*\");\n int division=(int)(calculadora.Calculate(num1,num2 , \"/\"));\n assertEquals(15, suma, \"Se debe verificar que el resultado de la suma sea 15 y que funcione\");\n assertEquals(5, resta, \"Se debe verificar que el resultado de la resta sea 5 y que funcione\");\n assertEquals(2, division, \"Se debe verificar que el resultado de la division sea 2 y que funcione\");\n assertEquals(50, multiplicacion, \"Se debe verificar que el resultado de la multiplicacion sea 50 y que funcione\");\n }", "@Test\n\tpublic void testGetStack() {\n\t\tip = new ImagePlus();\n\t\tst = ip.getStack();\n\t\tassertEquals(1,ip.getStackSize());\n\n\t\t// if stack == null and not proc == null and no info string\n\t\t// do stuff and setRoi() if needed\n\t\tproc = new ByteProcessor(1,1,new byte[] {22}, null);\n\t\tip = new ImagePlus(\"CareBearStation\",proc);\n\t\tst = ip.getStack();\n\t\tassertEquals(1,ip.getStackSize());\n\t\tassertNull(st.getSliceLabel(1));\n\t\tassertEquals(proc.getColorModel(),st.getColorModel());\n\t\tassertEquals(proc.getRoi(),st.getRoi());\n\n\t\t// if stack == null and not proc == null and yes info string\n\t\t// do stuff and setRoi() if needed\n\t\tproc = new ByteProcessor(1,1,new byte[] {22}, null);\n\t\tip = new ImagePlus(\"CareBearStation\",proc);\n\t\tip.setProperty(\"Info\",\"SnapDragon\");\n\t\tst = ip.getStack();\n\t\tassertEquals(1,ip.getStackSize());\n\t\tassertEquals(\"CareBearStation\\nSnapDragon\",st.getSliceLabel(1));\n\t\tassertEquals(proc.getColorModel(),st.getColorModel());\n\t\tassertEquals(proc.getRoi(),st.getRoi());\n\n\t\t// if not stack == null\n\t\t// do stuff and setRoi() if needed\n\t\tproc = new ByteProcessor(1,1,new byte[] {22}, null);\n\t\tip = new ImagePlus(\"CareBearStation\",proc);\n\t\tst = new ImageStack(1,1);\n\t\tst.addSlice(\"Fixed\", proc);\n\t\tst.addSlice(\"Crooked\", proc);\n\t\tip.setStack(\"Odds\",st);\n\t\tst = ip.getStack();\n\t\tassertEquals(2,ip.getStackSize());\n\t\tassertEquals(proc.getColorModel(),st.getColorModel());\n\t\tassertEquals(proc.getRoi(),st.getRoi());\n\t}", "public static void main(String[] args) \r\n\t{\n\t \r\n Stack st=new Stack();\r\n st.push(6);\r\n st.push(5);\r\n st.push(3);\r\n st.push(2);\r\n st.push(1);\r\n \r\n System.out.println( st.peek());\r\n \r\n \r\n // System.out.println( st.isEmpty());\r\n\t}", "public void printCarStack() {\n if(!isCarStackEmpty()) {\n System.out.println(\"Car stack contains \" + (top + 1) + \" cars\");\n for (int index = top; index >= 0; index--) {\n System.out.println (\"element[\" + index + \"] = \" + carStack[index]);\n }\n System.out.println();\n }\n else {System.out.println(\"Car stack is empty\");\n }\n }", "public static void main(String[] args) {\n Stack testStack = new Stack();\n testStack.add(\"a\");\n testStack.add(\"b\");\n testStack.add(\"c\");\n System.out.println(testStack.values());\n System.out.println(testStack.take());\n System.out.println(testStack.values());\n System.out.println(testStack.take());\n System.out.println(testStack.values());\n \n\n }", "@Test\n\tpublic void test1(){\n\t\tI_Stack<String> is = new I_Stack<String>();\n\t\tis.push(\"string1\");\n\t\tis.push(\"string2\");\n\t\tis.show(System.out);\n\t\t\n\t}", "public void testToString() {\n assertEquals(this.empty.toString(), \"[]\");\n assertEquals(this.stack.toString(), \"[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\");\n }", "@Test\r\n\tpublic void addPatientStackTest() {\r\n\t\tstack.addPatient(sp1);\r\n\t\tAssert.assertEquals(\"failed to add patient to StackHospital\", 1, stack.numPatients(),0.0000001);\r\n\t\t\r\n\t\tstack.addPatient(sp2);\r\n\t\tAssert.assertEquals(\"allPatientInfo incorrect for Stack Hospital\",sp1.toString() + sp2.toString(), stack.allPatientInfo());\r\n\t}", "public void setStack(String stack);", "boolean isFull(Stack stack){\n\t\tif(stack.getStackSize() >= 100) return true;\r\n\t\telse return false;\t\r\n\t}", "public static void main(String args[]) throws FileNotFoundException{\n PrintStream fileOut = new PrintStream(\"UnoStackTest.txt\");\r\n System.setOut(fileOut);\r\n \r\n // Constructor declaration test\r\n NumberCard redCard = new NumberCard(\"red\",3,\"none\");\r\n NumberCard blueCard = new NumberCard(\"blue\",5,\"none\");\r\n NumberCard greenCard = new NumberCard(\"green\",9,\"none\");\r\n NumberCard yellowCard = new NumberCard(\"yellow\",7,\"none\");\r\n \r\n // -6 used for sorting purposes in UnoStack\r\n NumberCard wildCard = new NumberCard(\"black\",-6,\"wild\");\r\n \r\n // UnoStack constructor declaration test\r\n UnoStack A = new UnoStack();\r\n UnoStack B = new UnoStack();\r\n UnoStack C = new UnoStack();\r\n \r\n // UnoStack A manual push\r\n System.out.println(\"--------------------\");\r\n A.Push(redCard);\r\n A.Push(blueCard);\r\n A.Push(greenCard);\r\n A.Push(yellowCard);\r\n A.Push(wildCard);\r\n \r\n // A prints deck and size\r\n A.printDeck(true, A);\r\n System.out.println(\"--------------------\");\r\n int aCount = A.sizeCount(A.rCount());\r\n \r\n System.out.println(aCount);\r\n System.out.println(\"--------------------\");\r\n // Shuffle test\r\n A.Shuffle();\r\n A.Shuffle();\r\n A.Shuffle();\r\n \r\n A.printDeck(true, A);\r\n System.out.println(\"--------------------\");\r\n \r\n // pop test\r\n A.pop();\r\n A.pop();\r\n A.pop();\r\n A.pop();\r\n A.pop();\r\n System.out.println(\"--------------------\");\r\n // size check\r\n A.sizeCount(A.rCount());\r\n System.out.println(\"--------------------\");\r\n \r\n \r\n \r\n // make deck function test for false and true action cards\r\n B.MakeDeck(B, true);\r\n System.out.println(\"--------------------\");\r\n int bCount = B.sizeCount(B.rCount());\r\n System.out.println(bCount);\r\n System.out.println(\"--------------------\");\r\n B.printDeck(true, B);\r\n System.out.println(\"--------------------\");\r\n C.MakeDeck(C, false);\r\n System.out.println(\"--------------------\");\r\n C.sizeCount(C.rCount());\r\n System.out.println(\"--------------------\");\r\n C.printDeck(false, C);\r\n System.out.println(\"--------------------\");\r\n \r\n \r\n }", "protected abstract List breakOutOfStateStack();", "@Test\n public void testPush() {\n System.out.println(\"push\");\n int number = 5;\n Stack2 instance = new Stack2();\n instance.push(number);\n assertEquals(instance.array[0], number);\n }", "@Test\r\n public void testStackVector() {\r\n StackVector<Integer> stack = new StackVector<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek());\r\n assertEquals(5, stack.pop());\r\n assertEquals(4, stack.size());\r\n }", "static void dump(Stack stack) {\n String temp = \" stack = \";\n for (int i = stack.size() - 1; i >= 0; i--) {\n temp = temp + ((TreeNode) (stack.elementAt(i))).data + \" \";\n }\n System.out.println(temp);\n }", "@Test\n public void testPopEmptyStack(){\n ms = new MyStack();\n try {\n ms.pop();\n }catch(EmptyStackException e){\n System.out.println(\"Error, cannot pop an empty stack.\");\n }\n }", "@Test\r\n public void testPopShouldReturnObjectWhenStackNotEmpty() {\r\n stackInstance=new StackUsingLinkedList<Integer>();\r\n stackInstance.push(49);\r\n stackInstance.push(57);\r\n stackInstance.push(2);\r\n Integer actualOutput=stackInstance.pop();\r\n Integer expectedOutput=2;\r\n assertEquals(expectedOutput,actualOutput);\r\n }", "@Test\n public void testIsEmpty(){\n ms = new MyStack();\n assertTrue(ms.IsEmpty());\n }", "public static void main(String[] args) {\n\n\t\tStack<String> testStack = new Stack<String>();\n\t\ttestStack.push(\"1\");\n\t\ttestStack.push(\"2\");\n\t\ttestStack.push(\"3\");\n\t\ttestStack.push(\"4\");\n\t\tSystem.out.println(testStack.peek());\n\t\tSystem.out.println(testStack.pop());\n\t\tSystem.out.println(testStack.pop());\n\t\tSystem.out.println(testStack);\n\t}", "@Test\n public void testPushAndPopC() {\n\n System.out.println(\"pushB - All Nulls\");\n String elementOne = null;\n String elementTwo = null;\n String elementThree = null;\n String elementFour = null;\n\n //Stack<String> instance = new StackArrayImpl();\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n instance.push(elementOne);\n instance.push(elementTwo);\n instance.push(elementThree);\n instance.push(elementFour);\n\n int fourSize = instance.size();\n assertEquals(fourSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String resultFour = instance.pop();\n String resultThree = instance.pop();\n String resultTwo = instance.pop();\n String resultOne = instance.pop();\n\n assertEquals(elementOne, resultOne);\n assertEquals(elementTwo, resultTwo);\n assertEquals(elementThree, resultThree);\n assertEquals(elementFour, resultFour);\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "@Test\n public void TestStackPeek() { Assert.assertEquals(\"C\", stack.peek()); }", "public static void printStacks(Thread currentThread) {\n\t\tStackTraceElement[] stackTrace = currentThread.getStackTrace();\n\t\t\n\t\tif (stackTrace.length == 0) {\n\t\t\tSystem.out.println(\"!!! No stacks available at the moment !!!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"=========================================================\");\n\t\tfor (int i= stackTrace.length-1; i >= 0; i--) {\n\t\t\tStackTraceElement stEle = stackTrace[i];\n\t\t\tSystem.out.println((stackTrace.length - i) + \". \" + stEle.toString());\n\t\t}\n\t\tSystem.out.println(\"=========================================================\\n\");\n\t}", "protected void stackEmptyButton() {\n \tif (stack.empty()) {\n \t\tenter();\n \t}\n \telse {\n \t\tstack.pop();\n \t\tif (stack.empty()) {\n \t\t\tenter();\n \t}\n \t}\n }", "static void printStack(Stack<Integer> s)\n\t{\n/*\t\tListIterator<Integer> lt = s.listIterator();\n\n\t\t// forwarding\n\t\twhile (lt.hasNext())\n\t\t\tlt.next();\n\n\t\t// printing from top to bottom\n\t\twhile (lt.hasPrevious())\n\t\t\tSystem.out.print(lt.previous() + \" \");*/\n\t\t\tSystem.out.println(s);\n\t}", "public DSAStack()\n {\n stack = new DSALinkedList<E>();\n }", "public static void main(String[] args) {\n \n QueuetoStack a=new QueuetoStack();\n a.add(1);\n a.add(2);\n a.add(3);\n a.add(4);\n a.remove();\n a.remove();\n a.remove();\n a.remove();\n }", "public MinStack() {\r\n list = new LinkedList();\r\n }", "static\nboolean\ncheck(\nint\nA[], \nint\nN) { \n\n// Stack S \n\nStack<Integer> S = \nnew\nStack<Integer>(); \n\n\n// Pointer to the end value of array B. \n\nint\nB_end = \n0\n; \n\n\n// Traversing each element of A[] from starting \n\n// Checking if there is a valid operation \n\n// that can be performed. \n\nfor\n(\nint\ni = \n0\n; i < N; i++) { \n\n// If the stack is not empty \n\nif\n(!S.empty()) { \n\n// Top of the Stack. \n\nint\ntop = S.peek(); \n\n\n// If the top of the stack is \n\n// Equal to B_end+1, we will pop it \n\n// And increment B_end by 1. \n\nwhile\n(top == B_end + \n1\n) { \n\n// if current top is equal to \n\n// B_end+1, we will increment \n\n// B_end to B_end+1 \n\nB_end = B_end + \n1\n; \n\n\n// Pop the top element. \n\nS.pop(); \n\n\n// If the stack is empty We cannot \n\n// further perfom this operation. \n\n// Therefore break \n\nif\n(S.empty()) { \n\nbreak\n; \n\n} \n\n\n// Current Top \n\ntop = S.peek(); \n\n} \n\n\n// If stack is empty \n\n// Push the Current element \n\nif\n(S.empty()) { \n\nS.push(A[i]); \n\n} \nelse\n{ \n\ntop = S.peek(); \n\n\n// If the Current element of the array A[] \n\n// if smaller than the top of the stack \n\n// We can push it in the Stack. \n\nif\n(A[i] < top) { \n\nS.push(A[i]); \n\n} \n// Else We cannot sort the array \n\n// Using any valid operations. \n\nelse\n{ \n\n// Not Stack Sortable \n\nreturn\nfalse\n; \n\n} \n\n} \n\n} \nelse\n{ \n\n// If the stack is empty push the current \n\n// element in the stack. \n\nS.push(A[i]); \n\n} \n\n} \n\n\n// Stack Sortable \n\nreturn\ntrue\n; \n\n}", "@Test\r\n public void testGetHand() {\r\n Player player = new Player();\r\n ArrayList<Tile> expResult = new ArrayList<>();\r\n ArrayList<Tile> result = player.getHand();\r\n assertEquals(expResult, result);\r\n \r\n Stack stack=new Stack(false);\r\n Tile tile=new Tile(0,0);\r\n player.setHand(stack.drawTiles(1));\r\n ArrayList<Tile> exphand=new ArrayList<>();\r\n exphand.add(tile);\r\n boolean expResult2=true;\r\n boolean result2;\r\n result2=(player.getHand().get(0).getHead()==exphand.get(0).getHead() && player.getHand().get(0).getTail()==exphand.get(0).getTail());\r\n assertEquals(expResult2, result2);\r\n \r\n \r\n }", "@Override\r\n\tpublic String toString() {\r\n\t\tString stackString = \"\";\r\n\t\tfor (T e: stack) {\r\n\t\t\tstackString = stackString +e;\r\n\t\t}\r\n\t\treturn stackString;\r\n}", "public static void main(String[] args) {\n\t\t \r\n\t\tArrayList datos = new ArrayList(50);\r\n\t\t\r\n\t\t//insertar datos:\r\n\t\t\r\n\t\tdatos.add(5);\r\n\t\tdatos.add(10);\r\n\t\tint x = 100;\r\n\t\tdatos.add(x);\r\n\t\t\r\n\t\tfor(int i = 0; i<10 ; i++) {\r\n\t\t\t\r\n\t\t\tdatos.add(i+1);\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(datos);\r\n\t\t//recuperar tamaņo de arraylist\r\n\t\t\r\n\t\tSystem.out.println(datos.size());\r\n\t\t\r\n\t\t//Stack-Pila (Last in First out)\r\n\t\t//Push : insertar elementos en la parte posterior de la pila \r\n\t\t//Pop : eliminar elementos(eliminara el ultimo elemento aņadido al stack)\r\n\t\t\r\n\t\tStack miPila = new Stack();\r\n\t\tmiPila.push(\"Lola\");\r\n\t\tmiPila.push(\"Carmen\");\r\n\t\tmiPila.push(\"La Mona Lisa\");\r\n\t\tmiPila.push(\"El Quijote\");\r\n\t\t\r\n\t\t//miPila.clear();//Limpiar el stack vaciarla\r\n\t\t\r\n\t\tString elemento;\r\n\t\telemento = (String)miPila.pop();\r\n\t\t\r\n\t\tSystem.out.println(elemento);\r\n\t\t\r\n\t\t\r\n\t\t//Queu-cola(LIFO: Last in first out)\r\n\t\t//add : aņadir elementos a la queu\r\n\t\t//poll : eliminar el ultimo elemento aņadido\r\n\t\t//peek : consulta ultimo elemento aņadido a la cola\r\n\t\t\r\n\t\tQueue cola = new LinkedList();\r\n\t\t\r\n\t\tcola.add(5);\r\n\t\tcola.add(10);\r\n\t\tcola.add(15);\r\n\t\t\r\n\t\tSystem.out.println(cola.poll());\r\n\t\tSystem.out.println(cola);\r\n\t\t\r\n\t\t//HashTable\r\n\t\t\r\n\t\t\r\n\t\tHashtable tabla = new Hashtable();\r\n\t\t//Hashtable<Integer, String> tabla2 = new Hashtable();\r\n\t\ttabla.put(1, \"Apple\");\r\n\t\ttabla.put(2, \"Sony\");\r\n\t\ttabla.put(6, \"Samsung\");\r\n\t\ttabla.put(\"ferrari\", 400);\r\n\t\t\r\n\t\tSystem.out.println(tabla.get(\"ferrari\"));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\r\n\r\n\t\tArrayStack arrst = new ArrayStack(5);\r\n\t\tIntStream.range(0, 5).forEach(arrst::push);\r\n\t\tSystem.out.println(\"Response of peek \" + arrst.peek());\r\n\t\tSystem.out.println(\"Response of pop\" + arrst.pop());\r\n\t\tSystem.out.println(\"push one random number in the middle\");\r\n\t\tarrst.push(10);\r\n\t\tSystem.out.println(\"printing stack after first pop\");\r\n\t\tarrst.display();\r\n\r\n\t\tIntStream.range(0, arrst.size()).forEach(i -> arrst.pop());\r\n\r\n\t\tSystem.out.println(\"isEmpty after poping all the elements ???\" + arrst.isEmpty());\r\n\r\n\t\tarrst.display();\r\n\r\n\t}", "public Stacked(){\n count = 0;\n stackArray = (E[]) new Object[START_CAP];\n }", "static void stack_peek(Stack<Integer> stack)\r\n\t{\r\n\t\tInteger element=stack.peek();\r\n\t\tSystem.out.println(\"Element on stack top :\" + element);\r\n\t}", "public void pop(){\n \n if(top==null) System.out.println(\"stack is empty\");\n else top=top.next;\n \t\n }", "public void showStack() {\n\n\t\t/*\n\t\t * Traverse the stack by starting at the top node and then get to the\n\t\t * next node by setting to current node \"pointer\" to the next node until\n\t\t * Null is reached.\n\t\t */\n\t\tNode<T> current = getTopNode();\n\n\t\tSystem.out.println(\"\\n---------------------\");\n\t\tSystem.out.println(\"STACK INFO\");\n\n\t\twhile (current != null) {\n\t\t\tSystem.out.println(\"Node Data: \" + current.data);\n\t\t\tcurrent = current.nextNode;\n\t\t}\n\n\t\tSystem.out.println(\"<< Stack Size: \" + getStackSize() + \" >>\");\n\t\tSystem.out.println(\"----------------------\");\n\n\t}", "public void print_stacks(ArrayList<ArrayList<Stack<Integer>>> stacks) {\n\t\tfor (int k=0; k<size*size; k++) {\n\t\t\tSystem.out.println(\"----------------------------------------\\n\\tRow \"+k+\"'s Possible Values\\n----------------------------------------\");\n\t\t\tfor (int l=0; l<size*size; l++) {\n\t\t\t\tSystem.out.print(\"col \"+l+\" |\");\n\t\t\t\tif (!stacks.get(k).get(l).empty()) System.out.println(stacks.get(k).get(l));\n\t\t\t\telse System.out.println();\t\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testIsEmpty() {\n System.out.println(\"isEmpty\");\n instance = new Stack();\n assertTrue(instance.isEmpty());\n instance.push(\"ab\");\n instance.push(\"cd\");\n assertFalse(instance.isEmpty());\n instance.pop();\n instance.pop();\n assertTrue(instance.isEmpty());\n }", "public void deleteStack(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // if stack is present\n topOfStack=-1;\n arr=null;\n System.out.println(\"Stack deleted successfully\");\n }", "public boolean isEmpty() {return stackList.isEmpty();}", "@Test\n public void testThreePushPop(){\n ms = new MyStack();\n int pn1=3, pn2=4, pn3=5;\n ms.push(pn1);\n ms.push(pn2);\n ms.push(pn3);\n assertEquals(pn3,ms.pop());\n assertEquals(pn2,ms.pop());\n assertEquals(pn1,ms.pop());\n }" ]
[ "0.7053237", "0.704571", "0.67384064", "0.6691952", "0.66667897", "0.6513621", "0.6475161", "0.64173234", "0.6337412", "0.6313889", "0.6270945", "0.6236521", "0.62022173", "0.6197192", "0.61378485", "0.6131064", "0.6129885", "0.6074258", "0.6050875", "0.6037952", "0.6026106", "0.6016331", "0.6006117", "0.59952456", "0.5994196", "0.59801155", "0.5965385", "0.59555286", "0.5950536", "0.5939198", "0.5932563", "0.59228945", "0.59094083", "0.5904543", "0.5901176", "0.58671016", "0.5866712", "0.5863079", "0.5856133", "0.58544344", "0.58483523", "0.5846884", "0.5818229", "0.5791029", "0.5769601", "0.5758167", "0.5757786", "0.5757433", "0.574324", "0.5739039", "0.572417", "0.5716107", "0.5690139", "0.5682891", "0.5682763", "0.56824434", "0.5669284", "0.5667109", "0.5660628", "0.56353915", "0.56302845", "0.56252366", "0.5608483", "0.56084067", "0.55966073", "0.55965614", "0.55929", "0.5585939", "0.5574171", "0.55726534", "0.5565263", "0.55587393", "0.5551161", "0.5548038", "0.5543529", "0.5542282", "0.55359674", "0.5533343", "0.5520861", "0.5512309", "0.5504891", "0.5500277", "0.5498586", "0.54977655", "0.5495352", "0.54839075", "0.5477921", "0.54779106", "0.5476677", "0.54693633", "0.54666394", "0.54649764", "0.5463054", "0.54596305", "0.5453018", "0.5445751", "0.544178", "0.5441509", "0.5436645", "0.5435139" ]
0.72690415
0
/ Test de stack Lista Doblemente Encadenada
@Test public void testStackListaDobleEncadenada() { StackListaDobleEncadenada<Integer> stack = new StackListaDobleEncadenada<Integer>(); stack.push(1); stack.push(2); stack.push(3); stack.push(4); stack.push(5); assertEquals(5, stack.peek()); assertEquals(5, stack.pop()); assertEquals(4, stack.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void testStackListaEncadenada() {\r\n StackListaEncadenada<Integer> stack = new StackListaEncadenada<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek());\r\n assertEquals(5, stack.pop());\r\n assertEquals(4, stack.size());\r\n }", "@Test\r\npublic void testTop()\r\n{\n\tassertEquals(null,myStack.top());\r\n\r\n\tassertEquals(true, myStack.push(new Element(2,\"Basel\")));\t\r\n\tassertEquals(true, myStack.push(new Element(4,\"Wil\")));\t\r\n\tassertEquals(true, myStack.push(new Element(27,\"Chur\")));\r\n\tassertEquals(27,myStack.top().getId());\r\n\tassertEquals(27,myStack.pop().getId());\r\n\tassertEquals(4,myStack.top().getId());\r\n\tassertEquals(4,myStack.pop().getId());\r\n\tassertEquals(2,myStack.pop().getId());\r\n\t\r\n\t// Stack leer\r\n\tassertEquals(null,myStack.top());\r\n\r\n}", "@Test\n public void pushOnStackTest_Correct(){\n assertEquals(stack.getTop().getData() , stack.getStack().returnFirst());\n }", "@Test\n public void testStack() {\n DatastructureTest.STACK.push(3);\n DatastructureTest.STACK.push(7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == -1);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == -1);\n }", "@Test\r\n public void testStackstack() {\r\n StackArrayList<Integer> stack = new StackArrayList<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek());\r\n assertEquals(5, stack.pop());\r\n assertEquals(4, stack.size());\r\n }", "@Test\r\n\tpublic void testPop()\r\n\t{\n\t\tassertEquals(null,myStack.pop());\r\n\t\r\n\t\tassertEquals(true, myStack.push(new Element(2,\"Basel\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(4,\"Wil\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(27,\"Chur\")));\r\n\t\tassertEquals(27,myStack.top().getId());\r\n\t\tassertEquals(\"Chur\",myStack.pop().getName());\r\n\t\tassertEquals(4,myStack.pop().getId());\r\n\t\tassertEquals(2,myStack.pop().getId());\r\n\t\t\r\n\t\t// leerer Stack\r\n\t\tassertEquals(null,myStack.pop());\r\n\t\tassertEquals(null,myStack.top());\r\n\t}", "public interface Stack<E> {\r\n \r\n /** \r\n * Pre: Se ingresa el dato\r\n * @param data se ingresa un dato para agregar al Vector\r\n * Post: Se guarda el dato en Stack\r\n */\r\n public void push(E data);\r\n\r\n /** \r\n * Pre: Estan todos los datos en el Stack\r\n * @return E se regresa un item.\r\n * Post: Se regresa y elimina un dato del Stack\r\n */\r\n public E pop();\r\n\r\n /** \r\n * Pre: Se encuentra el Stack con sus datos\r\n * @return E se regresa cualquier tipo de dato\r\n * @throws EmptyStackException regresa un error\r\n * Post: Se regresa el dato sobre la lista\r\n */\r\n public E peek();\r\n\r\n /** \r\n * Pre:Se encuentra el Stack\r\n * @return boolean se regresa un valor True o False\r\n * Post: Si el Stack se encuentra vacio este regresa True\r\n */\r\n public boolean empty();\r\n\r\n /** \r\n * Pre:Se encuentra el Stack \r\n * @return int se regrea cualquier numero\r\n * Post: Se devuelve el numero de objetos que tiene el Stack\r\n */\r\n public int size();\r\n\r\n}", "@Test\n public void testBiggerStack() {\n\n System.out.println(\"isEmpty\");\n\n int sizeTest = 5000;\n\n List<String> elementList = new ArrayList();\n String tempString = \"\";\n\n for (int i = 0; i < sizeTest; i++) {\n\n tempString = tempString + \"z\";\n elementList.add(tempString);\n\n }\n\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n for (String string : elementList) {\n instance.push(string);\n }\n\n int fourSize = instance.size();\n assertEquals(fourSize, sizeTest);\n assertEquals(instance.isEmpty(), false);\n\n for (int i = sizeTest; i > 0; i--) {\n\n String result = instance.pop();\n\n String expected = elementList.get(i - 1);\n\n assertEquals(expected, result);\n\n }\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public static void main(String[] args) {\n Solution solution = new Solution();\n TreeNode root = new TreeNode(1);\n root.left = new TreeNode(2);\n root.left.left = new TreeNode(6);\n root.left.left.right = new TreeNode(10);\n root.left.left.right.left = new TreeNode(-1);\n root.left.right = new TreeNode(9);\n\n root.right = new TreeNode(3);\n root.right.right = new TreeNode(5);\n root.right.left = new TreeNode(4);\n root.right.left.left = new TreeNode(7);\n root.right.left.right = new TreeNode(8);\n \n solution.stackList(root);\n for (int i = 0 ; i < solution.list.size(); i++) System.out.print(solution.list.get(i) + \" \");\n }", "@Test\n public void testGetListaExposicoes() {\n System.out.println(\"getListaExposicoes\");\n List<Exposicao> listaExposicoes = new ArrayList<>();\n listaExposicoes.add(new Exposicao());\n RegistoExposicoes instance = new RegistoExposicoes(listaExposicoes);\n List<Exposicao> expResult = listaExposicoes;\n List<Exposicao> result = instance.getListaExposicoes();\n assertEquals(expResult, result);\n }", "public void printStack() {\n\t\tif (this.l.getHead() != null) {\n\t\t\tl.printList();\n\t\t} else {\n\t\t\tSystem.out.println(\"No element in stack\");\n\t\t}\n\t}", "@Test\n public void testBigStack() {\n\n System.out.println(\"isEmpty\");\n\n int sizeTest = 500;\n\n List<String> elementList = new ArrayList();\n String tempString = \"\";\n\n for (int i = 0; i < sizeTest; i++) {\n\n tempString = tempString + \"z\";\n elementList.add(tempString);\n\n }\n\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n for (String string : elementList) {\n instance.push(string);\n }\n\n int fourSize = instance.size();\n assertEquals(fourSize, sizeTest);\n assertEquals(instance.isEmpty(), false);\n\n for (int i = sizeTest; i > 0; i--) {\n\n String result = instance.pop();\n\n String expected = elementList.get(i - 1);\n\n assertEquals(expected, result);\n\n }\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "@Test\n public void pushOnStackTest_InCorrect(){\n assertNotEquals(10 , stack.getStack().returnFirst());\n }", "public static void main(String[] args) throws Exception {\n\t\t// TODO Auto-generated method stub\n\t\tLinkedListAsStack stack = new LinkedListAsStack();\n\t\tstack.push(10);\n\t\tstack.push(20);\n\t\tstack.push(30);\n\t\tstack.push(40);\n\t\tstack.display();// 40 30 20 10-> act as a stack\n\t\tSystem.out.println(stack.size());// 4\n\t\tSystem.out.println(stack.isEmpty());// false\n\t\tSystem.out.println(stack.pop());// 40\n\t\tSystem.out.println(stack.top());// 30\n\t\tstack.display();// 30 20 10\n\t\tSystem.out.println(stack.size());// 3\n\t}", "@Test\n public void testPush(){\n ms=new MyStack();\n ms.push(1);\n assertFalse(ms.IsEmpty());\n }", "public void isPalindromeListStackMethod() {\n\n\t\tStack<Integer> stk = new Stack<Integer>();\n\n\t\tNode temp = head;\n\t\twhile(temp != null) {\n\t\t\tstk.push(temp.data);\n\t\t\ttemp = temp.next;\n\t\t}\n\n\t\ttemp = head;\n\t\twhile(temp != null && stk.empty() == false) {\n\t\t\tif(temp.data == stk.peek()) {\n\t\t\t\ttemp = temp.next;\n\t\t\t\tstk.pop();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(stk.empty() == true) {\n\t\t\tSystem.out.println(\"List is Palindrome\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"List is not Palindrome\");\n\t\t}\n\n\t}", "public DSAStack()\n {\n stack = new DSALinkedList<E>();\n }", "@Test\n public void testMassiveStack() {\n\n System.out.println(\"isEmpty\");\n\n int sizeTest = 10000;\n\n List<String> elementList = new ArrayList();\n String tempString = \"\";\n\n for (int i = 0; i < sizeTest; i++) {\n\n tempString = tempString + \"z\";\n elementList.add(tempString);\n\n }\n\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n for (String string : elementList) {\n instance.push(string);\n }\n\n int fourSize = instance.size();\n assertEquals(fourSize, sizeTest);\n assertEquals(instance.isEmpty(), false);\n\n for (int i = sizeTest; i > 0; i--) {\n\n String result = instance.pop();\n\n String expected = elementList.get(i - 1);\n\n assertEquals(expected, result);\n\n }\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public static void main(String[] args) {\n\t\tString palabrejas[] = { \"columnas\", \"filas\", \"zalamero\", \"zascandil\" };\n\t\tStack<String> palabrasPila = new Stack<String>();\n\t\t// Aunque tiene varios métodos suelen usarse los de ingreso o extraccion\n\t\t// a la pila\n\t\t// para poner en la pila\n\t\t// push coloca un elemento en la cima de la pila\n\t\tpalabrasPila.push(palabrejas[0]);\n\t\tpalabrasPila.push(palabrejas[1]);\n\t\tSystem.out.println(palabrasPila);\n\t\t// como se obtienen los elementos seegun el criterio de una pila\n\t\t// dos formas\n\t\t// 1º obteniendo el elemento y borrandolo de la pila\n\t\t// con pop se retorna el elemento en la cima y se borra de la pila\n\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\tSystem.out.println(palabrasPila);\n\t\ttry {\n\t\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"pila vacia\");\n\t\t}\n\t\t// Como hemos dicho se puede trabajar con Stack como si fuese una colecction\n\t\tfor (int i = 0; i < palabrejas.length; i++) {\n\t\t\tpalabrasPila.push(palabrejas[i]);\n\t\t}\n\t\t// 2º metodo de acceso a Stack como pila\n\t\t// Se trata del metodo peek que es como el pop pero\n\t\t// no elimina el elemento de la cima\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"cima \" + palabrasPila.peek());\n\t\t}\n\t\t// Si usas una Stack es porque lo necesitas. java te permite usarla como\n\t\t// una collection normal, pero en realidad solo se deberian usar las\n\t\t// cuatro funciones asociadas a a pila\n\t\t// pop,push,peek,isEmpty\n\t\tSystem.out.println(palabrasPila.size());\n\t}", "public Stacked(){\n count = 0;\n stackArray = (E[]) new Object[START_CAP];\n }", "@Test\n public void testStackCodeExamples() {\n logger.info(\"Beginning testStackCodeExamples()...\");\n\n // Allocate an empty stack\n Stack<String> stack = new Stack<>();\n logger.info(\"Start with an empty stack: {}\", stack);\n\n // Push a rock onto it\n String rock = \"rock\";\n stack.pushElement(rock);\n assert stack.getTop().equals(rock);\n logger.info(\"Push a rock on it: {}\", stack);\n\n // Push paper onto it\n String paper = \"paper\";\n stack.pushElement(paper);\n assert stack.getTop().equals(paper);\n logger.info(\"Push paper on it: {}\", stack);\n\n // Push scissors onto it\n String scissors = \"scissors\";\n stack.pushElement(scissors);\n assert stack.getTop().equals(scissors);\n assert stack.getSize() == 3;\n logger.info(\"Push scissors on it: {}\", stack);\n\n // Pop off the scissors\n assert stack.popElement().equals(scissors);\n assert stack.getSize() == 2;\n logger.info(\"Pop scissors from it: {}\", stack);\n\n // Pop off the paper\n assert stack.popElement().equals(paper);\n assert stack.getSize() == 1;\n logger.info(\"Pop paper from it: {}\", stack);\n\n // Pop off the rock\n assert stack.popElement().equals(rock);\n assert stack.isEmpty();\n logger.info(\"Pop rock from it: {}\", stack);\n\n logger.info(\"Completed testStackCodeExamples().\\n\");\n }", "@Override\n <E> Stack<E> getStack(String list) {\n if (list.equalsIgnoreCase(\"Simple\")){\n return new StackSinglyLinkedList<E>();\n\n } else if (list.equalsIgnoreCase(\"Doble\")){\n return new StackDoublyLinkedList<E>();\n\n } else if (list.equalsIgnoreCase(\"Circular\")){\n return new StackCircularList<E>();\n\n }\n\n return null;\n }", "@Test\n public void testSetListaExposicoes() {\n System.out.println(\"setListaExposicoes\");\n List<Exposicao> listaExposicoes = new ArrayList<>();\n listaExposicoes.add(new Exposicao());\n RegistoExposicoes instance = new RegistoExposicoes();\n instance.setListaExposicoes(listaExposicoes);\n assertEquals(instance.getListaExposicoes(), listaExposicoes);\n }", "@Test\r\n public void testGetElement() throws Exception {\r\n System.out.println(\"getElement ModeloListaOrganizadores\");\r\n\r\n String expResult = \"Diana\";\r\n Utilizador u = new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5);\r\n u.setNome(\"Diana\");\r\n Organizador o = new Organizador(u);\r\n\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n instance.addElement(o);\r\n instance.getElementAt(0);\r\n\r\n Organizador teste = e.getListaOrganizadores().getListaOrganizadores().get(0);\r\n\r\n String result = teste.getUtilizador().getNome();\r\n assertEquals(expResult, result);\r\n\r\n }", "public static void main(String[] args) {\n\t\tStack<String> stack = new Stack<>();\n\t\t//push é o metodo adiciona\n\t\tstack.push(\"ricardo\");\n\t\tstack.push(\"rodrigo\");\n\t\tstack.push(\"rogerio\");\n\t\tstack.push(\"ronaldo\");\n\t\t\n\t\tSystem.out.println(stack);\n\t\t\n\t\t//pop é o metodo delete\n\t\tstack.pop();\n\t\t\n\t\tSystem.out.println(stack);\n\t\t//peek é o metodo para retornar o ultimo elemento sem apagar\n\t\tSystem.out.println(stack.peek());\n\t\t\n\t\t//System.out.println(stack);\n\t\t\n\t\t\n\t}", "public void printStack(Stack list){\n while(!list.isEmpty()){\n temp.push(list.peek());\n list.pop();\n }\n\n //printing temp and inserting items back to list\n while(!temp.isEmpty()){\n System.out.println(temp.peek()+\" \");\n list.push(temp.peek());\n temp.pop();\n }\n System.out.println();\n\n }", "public static void main(String[] args) {\n// System.out.println(\"as.getSize() == \" + as.getSize());\n// as.pop();\n// System.out.println(\"as.pop() == \" + as);\n// System.out.println(\"as.peek() == \" + as.peek());\n// as.push(\"17\");\n// System.out.println(as);\n\n LinkedListStack<Integer> stack = new LinkedListStack<>();\n\n for(int i = 0 ; i < 5 ; i ++){\n stack.push(i);\n System.out.println(stack);\n }\n\n stack.pop();\n System.out.println(stack);\n\n }", "@Override\r\n\tpublic void excecute() {\n\t\tdata = stack.pop();\r\n\t\tJList1.setListData(stack.getStackVector()); // refresh the JList\r\n\t}", "public static void main(String[] args) {\n\t\t \r\n\t\tArrayList datos = new ArrayList(50);\r\n\t\t\r\n\t\t//insertar datos:\r\n\t\t\r\n\t\tdatos.add(5);\r\n\t\tdatos.add(10);\r\n\t\tint x = 100;\r\n\t\tdatos.add(x);\r\n\t\t\r\n\t\tfor(int i = 0; i<10 ; i++) {\r\n\t\t\t\r\n\t\t\tdatos.add(i+1);\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(datos);\r\n\t\t//recuperar tamaņo de arraylist\r\n\t\t\r\n\t\tSystem.out.println(datos.size());\r\n\t\t\r\n\t\t//Stack-Pila (Last in First out)\r\n\t\t//Push : insertar elementos en la parte posterior de la pila \r\n\t\t//Pop : eliminar elementos(eliminara el ultimo elemento aņadido al stack)\r\n\t\t\r\n\t\tStack miPila = new Stack();\r\n\t\tmiPila.push(\"Lola\");\r\n\t\tmiPila.push(\"Carmen\");\r\n\t\tmiPila.push(\"La Mona Lisa\");\r\n\t\tmiPila.push(\"El Quijote\");\r\n\t\t\r\n\t\t//miPila.clear();//Limpiar el stack vaciarla\r\n\t\t\r\n\t\tString elemento;\r\n\t\telemento = (String)miPila.pop();\r\n\t\t\r\n\t\tSystem.out.println(elemento);\r\n\t\t\r\n\t\t\r\n\t\t//Queu-cola(LIFO: Last in first out)\r\n\t\t//add : aņadir elementos a la queu\r\n\t\t//poll : eliminar el ultimo elemento aņadido\r\n\t\t//peek : consulta ultimo elemento aņadido a la cola\r\n\t\t\r\n\t\tQueue cola = new LinkedList();\r\n\t\t\r\n\t\tcola.add(5);\r\n\t\tcola.add(10);\r\n\t\tcola.add(15);\r\n\t\t\r\n\t\tSystem.out.println(cola.poll());\r\n\t\tSystem.out.println(cola);\r\n\t\t\r\n\t\t//HashTable\r\n\t\t\r\n\t\t\r\n\t\tHashtable tabla = new Hashtable();\r\n\t\t//Hashtable<Integer, String> tabla2 = new Hashtable();\r\n\t\ttabla.put(1, \"Apple\");\r\n\t\ttabla.put(2, \"Sony\");\r\n\t\ttabla.put(6, \"Samsung\");\r\n\t\ttabla.put(\"ferrari\", 400);\r\n\t\t\r\n\t\tSystem.out.println(tabla.get(\"ferrari\"));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "@Test\n public void testSingleStack() {\n ProgramStack ps = new ProgramStack();\n\n ps.push(1);\n\n Assert.assertEquals(\"[1]\", ps.toString());\n }", "public ArrayListStack(){\r\n theData = new ArrayList<E>();\r\n }", "@Test\r\n\tpublic void testCardStack() {\r\n\t\t\r\n\t\t// create a card stack\r\n\t\tCardStack testStack = new CardStack();\r\n\t\t\r\n\t\t// test if we can place a non-king card onto the empty stack\r\n\t\tassertFalse(testStack.isValidMove(deckCards.get(1)));\r\n\t\t\r\n\t\t// test if we can place a king onto an empty stack\r\n\t\t// remember testStack starts at 0 not 1, so kings are at position 12\r\n\t\tassertTrue(testStack.isValidMove(deckCards.get(12)));\r\n\t\t\r\n\t\t// add the king to the stack\r\n\t\tassertEquals(deckCards.get(12), testStack.push(deckCards.get(12)));\r\n\t\t\r\n\t\t// now test can we add the same suit queen\r\n\t\tassertFalse(testStack.isValidMove(deckCards.get(12)));\r\n\t\t\r\n\t\t// now test if can add an off-suit different color queen\r\n\t\tassertTrue(testStack.isValidMove(deckCards.get(37)));\r\n\t\t\r\n\t\t// place the card to the stack\r\n\t\tassertEquals(deckCards.get(37), testStack.push(deckCards.get(37)));\r\n\t\t\r\n\t\t// add a card to the stack via add method as if being dealt\r\n\t\ttestStack.addCard(deckCards.get(40));\r\n\t\t\r\n\t\t// now check if that changes what will be accepted\r\n\t\tassertFalse(testStack.isValidMove(deckCards.get(41)));\r\n\t}", "@Test\r\n\tpublic void testPelikulaBaloratuDutenErabiltzaileenZerrenda() {\n\t\tArrayList<Integer> zer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p1.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(e1.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertFalse(zer.contains(e2.getId()));\r\n\t\t\r\n\t\t// p2 pelikula baloratu duten erabiltzaileen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p2.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 4);\r\n\t\tassertTrue(zer.contains(e1.getId()));\r\n\t\tassertTrue(zer.contains(e2.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertTrue(zer.contains(e4.getId()));\r\n\t\t\r\n\t\t// p3 pelikula baloratu duten erabiltzaileen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p3.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(e2.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertFalse(zer.contains(e1.getId()));\r\n\t\t\r\n\t\t// p4 pelikula baloratu duten erabiltzaileen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p4.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(e1.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertFalse(zer.contains(e4.getId()));\r\n\t\t\r\n\t}", "public static void main (String[] args) {\n // testing LinkedStack\n // ===================\n System.out.println(\"\\n** Test output for LinkedStack **\\n\");\n\n // instantiate new LinkedStack\n LinkedStack<String> stack = new LinkedStack<String>();\n\n // check size is 0 and isEmpty() returns true\n System.out.println(\"Checking that size = 0 and isEmpty is true...\");\n System.out.println(\"Size: \" + stack.size() + \" isEmpty: \" + stack.isEmpty());\n\n // test peeking and popping empty stack, should throw exception\n System.out.println(\"Popping empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(stack.pop());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n }\n System.out.println(\"Peeking at empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(stack.peek());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n\n }\n\n // push an element onto stack, stack should have one element\n System.out.println(\"Pushing an element...\");\n stack.push(\"One\");\n System.out.println(\"After pushing a single element, the stack should have one element \\\"One\\\"\");\n System.out.println(stack);\n System.out.println();\n\n // pop the element, stack should be empty again\n System.out.println(\"Popping...\");\n stack.pop();\n System.out.println(\"After the pop operation, stack should be empty:\");\n System.out.println(stack);\n\n // push more elements\n System.out.println(\"Pushing an element...\");\n stack.push(\"Two\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Three\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Four\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Five\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Six\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Seven\");\n System.out.println(\"Stack with six elements:\");\n System.out.println(stack);\n System.out.println();\n\n // check size is 6 and isEmpty() returns false\n System.out.println(\"Checking that size = 6 and isEmpty is false...\");\n System.out.println(\"Size: \" + stack.size() + \" isEmpty: \" + stack.isEmpty());\n System.out.println();\n\n // test peeking at top element from stack\n System.out.println(\"Peeking at top element..\");\n System.out.println(stack.peek());\n System.out.println();\n\n // test popping top element from stack\n System.out.println(\"Popping...\");\n System.out.println(stack.pop());\n System.out.println(\"Stack after pop operation:\");\n System.out.println(stack);\n System.out.println();\n\n\n // ====================\n // testing DropOutStack\n // ====================\n System.out.println(\"\\n** Test output for DropOutStack **\\n\");\n // instantiate new DropOutStack with capacity of 5\n DropOutStack<String> dropStack = new DropOutStack<String>(5);\n\n // test peeking and popping empty stack, should throw exception\n System.out.println(\"Popping empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(dropStack.pop());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n }\n System.out.println(\"Peeking at empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(dropStack.peek());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n\n }\n\n // check size is 0 and isEmpty() returns true\n System.out.println(\"Checking that size = 0 and isEmpty is true...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // push 3 elements to stack, stack not full\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"One\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Two\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Three\");\n System.out.println(\"After 3 push operations, the stack looks like this:\");\n System.out.println(dropStack);\n System.out.println();\n\n // check size is 3 and isEmpty() returns false\n System.out.println(\"Checking that size = 3 and isEmpty is false...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // push 3 more elements to stack, should drop first element pushed to stack (\"One\")\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Four\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Five\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Six\");\n System.out.println(\"Stack after 3 more push operations, first element \\\"One\\\" is lost:\");\n System.out.println(dropStack);\n System.out.println();\n\n // check size is 5 and isEmpty() returns false\n System.out.println(\"Checking that size = 5 and isEmpty is false...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // test peeking at top element from stack\n System.out.println(\"Peeking at top element..\");\n System.out.println(dropStack.peek());\n System.out.println();\n\n // test popping top element from stack\n System.out.println(\"Popping next element\");\n dropStack.pop();\n System.out.println(\"Stack after pop operation:\");\n System.out.println(dropStack);\n System.out.println();\n\n // push another element\n System.out.println(\"Pushing another element...\");\n dropStack.push(\"Seven\");\n System.out.println(\"After push operation:\");\n System.out.println(dropStack);\n System.out.println();\n\n // pop all elements from stack, stack should be empty\n System.out.println(\"Popping all elements from stack:\");\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n\n System.out.println(\"Stack is empty:\");\n System.out.println(dropStack);\n\n\n }", "public static void main(String[] args) {\n LinkedList<String> daftar= new LinkedList<String>();\r\n //menambahkan elemen pada linked list\r\n daftar.add(\"A\");\r\n daftar.add(\"B\");\r\n daftar.addLast(\"C\");\r\n daftar.addFirst(\"D\");\r\n daftar.add(3, \"B\");\r\n daftar.add(\"F\");\r\n daftar.add(\"G\");\r\n System.out.println(\"Linked List: \"+daftar);\r\n //menghapus elemen dari linked list\r\n daftar.remove(\"B\");\r\n daftar.remove(3);\r\n daftar.removeFirst();\r\n daftar.removeLast();\r\n System.out.println(\"Linked list setelah dihapus: \"+daftar);\r\n //menemukan elemen pada linked list\r\n boolean status=daftar.contains(\"E\");\r\n if(status)\r\n System.out.println(\"Di list terdapat elemen 'E'\");\r\n else\r\n System.out.println(\"Di list tidak terdapat elemen 'E'\");\r\n \r\n //ukuran dari elemen pada linked list\r\n int size=daftar.size();\r\n System.out.println(\"Ukuran dari linked list: \"+size);\r\n \r\n //menunjukkan dam memberi nilai elemen dari linked list\r\n Object elemen=daftar.get(2);\r\n System.out.println(\"elemen ditunjui oleh get(): \"+elemen);\r\n daftar.set(2, \"Y\");\r\n System.out.println(\"Linked list pasca perubahan: \"+daftar);\r\n }", "@Test\r\n\tpublic void testErabiltzaileakBaloratuDituenPelikulenZerrenda() {\n\t\tArrayList<Integer> zer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e1.getId());\r\n\t\tassertTrue(zer.size() == 3);\r\n\t\tassertTrue(zer.contains(p1.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p4.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p3.getPelikulaId()));\r\n\t\t\r\n\t\t// e2 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e2.getId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p3.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p1.getPelikulaId()));\r\n\t\t\r\n\t\t// e3 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e3.getId());\r\n\t\tassertTrue(zer.size() == 4);\r\n\t\tassertTrue(zer.contains(p1.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p3.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p4.getPelikulaId()));\r\n\t\t\r\n\t\t// e2 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e4.getId());\r\n\t\tassertTrue(zer.size() == 1);\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p1.getPelikulaId()));\r\n\t\t\r\n\t}", "public void testToString() {\n assertEquals(this.empty.toString(), \"[]\");\n assertEquals(this.stack.toString(), \"[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\");\n }", "@Test\n public void testRemove(){\n FunctionalLinkedList newList = new FunctionalLinkedList();\n for(int i = 1; i < 101; i++){\n if(i%2 == 1){\n newList.add(\"Odd\");\n } else {\n newList.add(\"Even\");\n }\n }\n stack = new ImprovedStackImpl(newList);\n \n // Remove one set of elements & check size.\n stack.remove(\"Odd\");\n assertEquals(\"Size of list is incorrect.\", 50, stack.size());\n String even;\n for(int i = 0; i < stack.size(); i++){\n even = (String) stack.pop().getReturnValue();\n assertEquals(\"'Odd' not removed at loop \"+ i +\".\", \"Even\", even);\n }\n }", "public void traverseStack(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // check if stack is empty\n if(this.topOfStack==-1){\n System.out.println(\"Stack is empty, can't traverse\");\n return;\n }\n // if stack is not empty\n System.out.println(\"Printing stack...\");\n for(int i=0;i<=this.topOfStack;i++){\n System.out.print(this.arr[i]+\" \");\n }\n System.out.println();\n }", "public String getStack();", "Deque<SearchStackElementCategory> getSearchStack() throws Exception;", "@Test\n public void toStringTest() {\n assertEquals(\"1 2 3 4\", stack.toString());\n }", "@Test\n\tpublic void testPush(){\n\t\tArrayIntStack stack = buildStack(4);\n\t\tassertEquals(4, stack.intCol.size());\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\tString stackString = \"\";\r\n\t\tfor (T e: stack) {\r\n\t\t\tstackString = stackString +e;\r\n\t\t}\r\n\t\treturn stackString;\r\n}", "@Test\n void whenElementAddedToStackLastElementShouldTop() {\n\n MyNode<Integer> myFirstNode = new MyNode<>(70);\n MyNode<Integer> mySecondNode = new MyNode<>(30);\n MyNode<Integer> myThirdNode = new MyNode<>(56);\n MyStack myStack = new MyStack();\n myStack.push(myFirstNode);\n myStack.push(mySecondNode);\n myStack.push(myThirdNode);\n\n boolean result = myStack.head.equals(myFirstNode) && myStack.head.getNext().equals(mySecondNode)\n && myStack.tail.equals(myThirdNode);\n\n Assertions.assertTrue(result);\n }", "@Test\n public void testPop(){\n FunctionalLinkedList newList = new FunctionalLinkedList(); \n stack = new ImprovedStackImpl(newList);\n for(int i = 1; i < 101; i++){\n stack.push(i * 10);\n }\n \n // Check that popping an element leave the correct element on top.\n stack.pop();\n int pop = (Integer) stack.pop().getReturnValue();\n assertEquals(\"Initial pop did not work correctly.\", 990, pop);\n \n // Check that the size after popping is correct.\n int size = stack.size();\n assertEquals(\"Stack is not the correct size.\", 98, size);\n \n // Check that correct error is returned from popping an empty stack.\n for(int i = 98; i > 0; i--){\n stack.pop();\n }\n ErrorMessage error = stack.pop().getError();\n assertEquals(\"A correct error message is not returned.\", ErrorMessage.EMPTY_STRUCTURE, error);\n }", "@Test\r\n public void testGetListaEnvases() {\r\n ArrayList<Envase> lst=new ArrayList<>();\r\n Envase e=new Envase(1,\"nombre\",\"material\");\r\n lst.add(e);\r\n articuloPrueba.setListaEnvases(lst);\r\n ArrayList<Envase> expResult = lst;\r\n ArrayList<Envase> result = articuloPrueba.getListaEnvases();\r\n assertEquals(expResult, result);\r\n }", "@Test\r\n public void testAddElement() throws Exception {\r\n System.out.println(\"addElement ModeloListaOrganizadores\");\r\n\r\n String expResult = \"Diana\";\r\n Utilizador u = new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5);\r\n u.setNome(\"Diana\");\r\n Organizador o = new Organizador(u);\r\n\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n instance.addElement(o);\r\n\r\n Organizador teste = e.getListaOrganizadores().getListaOrganizadores().get(0);\r\n\r\n String result = teste.getUtilizador().getNome();\r\n assertEquals(expResult, result);\r\n\r\n }", "@SuppressWarnings({\"unchecked\"})\n private void expandStack() {\n T[] newStack;\n \n newStack = (T[]) new Object[Array.getLength(this.elements) + 1];\n for( int i = 0; i < Array.getLength(this.elements); i++ )\n newStack[i] = this.elements[i];\n this.elements = newStack;\n }", "@Test()\n public void testListarComprasEfetuadas() {\n System.out.println(\"listarComprasEfetuadas\");\n String busca = \"\";\n ControleCompra instance = new ControleCompra();\n List<Compra> expResult = listaComprasEfetuadas;\n List<Compra> result = instance.listarComprasEfetuadas(busca);\n assertEquals(expResult, result);\n }", "@Test\n public void testNonemptyStack() {\n ProgramStack ps = new ProgramStack();\n\n ps.push(1);\n ps.push(2);\n ps.push(3);\n\n Assert.assertEquals(\"[1, 2, 3]\", ps.toString());\n }", "public ListStack() {\n\t\tlist = new ArrayList<>();\n\t}", "@Test\r\n public void testListar() {\r\n TipoItemRN rn = new TipoItemRN();\r\n TipoItem item = new TipoItem();\r\n item.setDescricao(\"ListarDescriçãoTipoItem\");\r\n rn.salvar(item);\r\n \r\n TipoItem item2 = new TipoItem();\r\n item2.setDescricao(\"ListarDescriçãoTipoItem2\");\r\n rn.salvar(item2);\r\n \r\n List<TipoItem> tipoItens = rn.listar();\r\n \r\n assertTrue(tipoItens.size() >0);\r\n \r\n rn.remover(item);\r\n rn.remover(item2);\r\n }", "@Test\n public void basicQueueOfStacksTest() {\n \n QueueOfStacks<String> tempQueue = new QueueOfStacks<String>();\n String tempCurrentElement;\n \n assertTrue(\"Element not in queue\", tempQueue.isEmpty());\n tempQueue.add(\"a\");\n assertTrue(\"Element not in queue\", !tempQueue.isEmpty());\n tempQueue.add(\"b\");\n assertTrue(\"Number of elements not correct\", tempQueue.size() == 2);\n \n tempCurrentElement = tempQueue.peek();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"a\"));\n\n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"a\") &&\n tempQueue.size() == 1);\n \n tempQueue.add(\"c\");\n assertTrue(\"Number of elements not correct\", tempQueue.size() == 2);\n \n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"b\") &&\n tempQueue.size() == 1 &&\n !tempQueue.isEmpty());\n \n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"c\") &&\n tempQueue.size() == 0 &&\n tempQueue.isEmpty());\n \n }", "public void obrniListu() {\n if (prvi != null && prvi.veza != null) {\n Element preth = null;\n Element tek = prvi;\n \n while (tek != null) {\n Element sled = tek.veza;\n \n tek.veza = preth;\n preth = tek;\n tek = sled;\n }\n prvi = preth;\n }\n }", "@Test\n public void testStackInteger() {\n DatastructureTest.INTSTACK.push(3);\n DatastructureTest.INTSTACK.push(7);\n Assert.assertTrue(DatastructureTest.INTSTACK.peek() == 7);\n Assert.assertTrue(DatastructureTest.INTSTACK.pop() == 7);\n Assert.assertTrue(DatastructureTest.INTSTACK.peek() == 3);\n Assert.assertTrue(DatastructureTest.INTSTACK.pop() == 3);\n Assert.assertTrue(DatastructureTest.INTSTACK.peek() == -1);\n Assert.assertTrue(DatastructureTest.INTSTACK.pop() == -1);\n }", "public static void main(String[] args) throws Exception {\n StackUsingArrays stack=new StackUsingArrays(5);\n \n for(int i=1;i<=5;i++) {\n \tstack.push(i*10);\n \tstack.display();\n }\n \n System.out.println(stack.size());\n \n //stack.push(60);\n System.out.println(stack.top());\n \n// while(!stack.isEmpty()) {\n// \tstack.display();\n// \tstack.pop();\n// \t\n// }\n// \n// stack.pop();\n\t}", "@Test\n public void ListFactoryTester() {\n \tCalculator calculadora = new ImpCalculadora();\n \t//Se inicializan los factorys\n \tStackFactory<Integer> stackFactory = new StackFactory<Integer>();\n \tListFactory<Integer> listFactory = new ListFactory<Integer>();\n \tStack<Integer> stack;\n \tAbstractList<Integer> lista;\n \t\n \t lista = listFactory.getList(\"Lista Circular\");\n \t CircularList<Integer> list = (CircularList<Integer>) lista;\n // assert statements\n //Aquí se ejecutara nuestro test.\n \n assertEquals(0, list.size(), \"Se debe verificar que el list inicie vacío.\");\n list.addLast(10);\n list.addLast(5);\n int num2=list.removeLast();\n int num1= list.removeLast();\n int suma=calculadora.Calculate(num1,num2 , \"+\");\n int resta=calculadora.Calculate(num1,num2 , \"-\");\n int multiplicacion=calculadora.Calculate(num1,num2 , \"*\");\n int division=(int)(calculadora.Calculate(num1,num2 , \"/\"));\n assertEquals(15, suma, \"Se debe verificar que el resultado de la suma sea 15 y que funcione\");\n assertEquals(5, resta, \"Se debe verificar que el resultado de la resta sea 5 y que funcione\");\n assertEquals(2, division, \"Se debe verificar que el resultado de la division sea 2 y que funcione\");\n assertEquals(50, multiplicacion, \"Se debe verificar que el resultado de la multiplicacion sea 50 y que funcione\");\n }", "@Test\r\n public void testGetHand() {\r\n Player player = new Player();\r\n ArrayList<Tile> expResult = new ArrayList<>();\r\n ArrayList<Tile> result = player.getHand();\r\n assertEquals(expResult, result);\r\n \r\n Stack stack=new Stack(false);\r\n Tile tile=new Tile(0,0);\r\n player.setHand(stack.drawTiles(1));\r\n ArrayList<Tile> exphand=new ArrayList<>();\r\n exphand.add(tile);\r\n boolean expResult2=true;\r\n boolean result2;\r\n result2=(player.getHand().get(0).getHead()==exphand.get(0).getHead() && player.getHand().get(0).getTail()==exphand.get(0).getTail());\r\n assertEquals(expResult2, result2);\r\n \r\n \r\n }", "@Test\n public void testPushPop(){\n ms=new MyStack();\n ms.push(2);\n ms.pop();\n assertTrue(ms.IsEmpty());\n }", "@Test\n public void testEmptyStack() {\n ProgramStack ps = new ProgramStack();\n\n Assert.assertEquals(\"[]\", ps.toString());\n }", "public boolean klic() {\n\t\tif(first.next.zacetniIndex!=0) {\r\n\t\t\tfirst.next.zacetniIndex = 0;\r\n\t\t\tfirst.next.koncniIndex = first.next.size-1;\r\n\t\t\t//ce je en element, nimamo vec praznega prostora\r\n\t\t\tif(first==last) prazno=0;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\tList prev = first.next;\r\n\t\tList el = first.next.next;\r\n\t\t\r\n\t\twhile(el!=null) {\r\n\t\t\tif(prev.koncniIndex!=el.zacetniIndex-1) {\r\n\t\t\t\t\r\n\t\t\t\tint razlika = el.zacetniIndex - prev.koncniIndex - 1;\r\n\t\t\t\tel.zacetniIndex = el.zacetniIndex - razlika;\r\n\t\t\t\tel.koncniIndex = el.koncniIndex - razlika;\r\n\t\t\t\t//ce pomeramo zadnega zmanjsujemo praznega prostora\r\n\t\t\t\tif(prev==last) prazno = prazno - razlika;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tprev=el;\r\n\t\t\tel=el.next;\r\n\t }\r\n\t\treturn false;\r\n\t}", "public void listar() {\n\n if (!vacia()) {\n\n NodoEnteroSimple temp = head;\n\n int i = 0;\n\n while (temp != null) {\n\n System.out.print(i + \".[ \" + temp.getValor() + \" ]\" + \" -> \");\n\n temp = temp.getSiguiente();\n\n i++;\n }\n }\n \n }", "@Test\r\n public void testPushShouldReturnTrue() {\r\n stackInstance=new StackUsingLinkedList<Integer>();\r\n boolean actualOutput=stackInstance.push(4);\r\n assertEquals(true,actualOutput);\r\n }", "public void addExpList(Experiment e){ // bir method daha yazdim\r\n Node last = head; // listenin en sonuna ekleme yapiyor, gun bilgine bakmadan\r\n Node exp = new Node(e);\r\n\r\n if( head == null){ // hic eleman yoksa direk ekle.\r\n head = exp;\r\n }\r\n else{\r\n while( last.next != null ){ // son elemana kadar git.\r\n last = last.next;\r\n }\r\n last.next = exp; // son elemana ekle\r\n }\r\n }", "public void testMyStack() {\n\t\tMyStack<String> s = new MyStack<String>();\n\t\ts.push(\"1\");\n\t\ts.push(\"2\");\n\t\ts.push(\"3\");\n\t\ts.pop();\n\t\ts.push(\"4\");\n\t\ts.toString();\n\t\tSystem.out.println(\"MyStack size is: \" + s.size());\n\t}", "@Test\r\n public void testGetParentChainList_not_full_tree() {\r\n System.out.println(\"getParentChainList\");\r\n\r\n XmlCompoundElement books = new XmlDefaultElement(\"books\");\r\n\r\n List<XmlElement> result = XmlRoot.getParentChainList(books);\r\n assertNotNull(result);\r\n //\r\n // The list must contain a single element with a name 'books'\r\n //\r\n assertEquals(result.size(), 1);\r\n assertEquals(books, result.get(0));\r\n\r\n //\r\n // add another element\r\n //\r\n XmlElement book = new XmlDefaultTextElement(\"book\");\r\n books.addChild(book);\r\n\r\n // The list must contain three elements: \r\n // first - root tag with a name 'shop'\r\n // second - with a name 'books'\r\n // third - with a name 'book'\r\n //\r\n result = XmlRoot.getParentChainList(book);\r\n assertNotNull(result);\r\n assertEquals(result.size(), 2);\r\n assertEquals(books, result.get(0));\r\n assertEquals(book, result.get(1));\r\n }", "static void dump(Stack stack) {\n String temp = \" stack = \";\n for (int i = stack.size() - 1; i >= 0; i--) {\n temp = temp + ((TreeNode) (stack.elementAt(i))).data + \" \";\n }\n System.out.println(temp);\n }", "@Test\r\n public void testGetListaOrganizadores() {\r\n System.out.println(\"getListaOrganizadores\");\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n Organizador o =new Organizador(new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5));\r\n instance.addElement(o);\r\n ListaOrganizadores expResult = instance.getListaOrganizadores();\r\n ListaOrganizadores result = instance.getListaOrganizadores();\r\n assertEquals(expResult, result);\r\n \r\n }", "@Test\n public void testPushAndPopD() {\n System.out.println(\"popC - Out of Order\");\n\n String elementOne = \"Bill\";\n String elementTwo = \"Steve\";\n String elementThree = \"Tim\";\n String elementFour = \"Dave\";\n\n //Stack<String> instance = new StackArrayImpl();\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n instance.push(elementOne);\n instance.push(elementTwo);\n instance.push(elementThree);\n\n int fourSize = instance.size();\n assertEquals(fourSize, 3);\n assertEquals(instance.isEmpty(), false);\n\n String resultThree = instance.pop();\n String resultTwo = instance.pop();\n\n instance.push(elementFour);\n String resultFour = instance.pop();\n\n String resultOne = instance.pop();\n\n assertEquals(elementOne, resultOne);\n assertEquals(elementTwo, resultTwo);\n assertEquals(elementThree, resultThree);\n assertEquals(elementFour, resultFour);\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "private void structureListElement() {\n postBodyHTMLContent = postBodyHTMLContent.replaceAll(Data.LI_OPENING_REGEX_MATCHER, \"- \");\n\n // replace closing tag </li> with </br> to separate with other list item\n postBodyHTMLContent = postBodyHTMLContent.replaceAll(Data.LI_CLOSING_REGEX_MATCHER, \"<br>\");\n }", "@Test\n public void copyStackTest() {\n ResourceStack copiedStack = stack.copyStack();\n assertEquals(copiedStack.toString(), stack.toString());\n }", "@Test\n\tpublic void test1(){\n\t\tI_Stack<String> is = new I_Stack<String>();\n\t\tis.push(\"string1\");\n\t\tis.push(\"string2\");\n\t\tis.show(System.out);\n\t\t\n\t}", "@Test\n public void testPushCallTop(){\n ms = new MyStack();\n ms.push(1);\n ms.top();\n assertFalse(ms.IsEmpty());\n }", "public void testLst() {\n System.out.println(\"\");\n EcgCheck chk = EcgCheck.getInstance();\n System.out.println(\" Show TEstlist\");\n\n mail_lst.forEach(m -> {\n System.out.println(\"[\" + new String(chk.sha(m.getBytes())) + \"]\");\n });\n }", "@Test\n public void testModuloStackSize() {\n MainPanel mp = new MainPanel();\n ProgramArea pa = new ProgramArea();\n ProgramStack ps = new ProgramStack();\n\n ps.push(10);\n ps.push(3);\n\n ProgramExecutor pe = new ProgramExecutor(mp, ps, pa);\n\n pe.modulo();\n ps.pop();\n\n Assert.assertEquals(\"[]\", ps.toString());\n }", "public static void main(String[] args) {\n\t\tLinkedList<String> sujungtasSarasas = new LinkedList<String>();\n\t\t// i sarasa dedami\n\t\t \n\t\tsujungtasSarasas.add(\"vasaris\");\n\t\tsujungtasSarasas.add(\"kovas\");\n\t\tsujungtasSarasas.add(\"balandis\");\n\t\tsujungtasSarasas.add(\"geguze\");\n\t\tSystem.out.println(sujungtasSarasas);\n\t\t\n\t\t// idedame elementus i sarso i pradzia ir i\n\t\t// pabaigas\n\t\tsujungtasSarasas.addFirst(\"SAUSIS\");\n\t\tsujungtasSarasas.addLast(\"BIRZELIS\");\n\t\tSystem.out.println(sujungtasSarasas);\n\t\t\n\t\t// istriname pirma ir paskutini\n\t\t// elementus\n\t\tsujungtasSarasas.removeFirst();\n\t\tsujungtasSarasas.removeLast();\n\t\tSystem.out.println(sujungtasSarasas);\n\t\t\n\t\tSystem.out.println(sujungtasSarasas.removeFirst());\n\t\tSystem.out.println(sujungtasSarasas.removeLast());\n\t\tSystem.out.println(sujungtasSarasas);\n\t\tsujungtasSarasas.push(\"Rugpjutis\");\n\t\tSystem.out.println(sujungtasSarasas);\n\t\tsujungtasSarasas.pop();\n\t\tSystem.out.println(sujungtasSarasas);\n\t\tSystem.out.println(sujungtasSarasas.pop());\n//\t\t\n//\t\t// idedame ir istriname pagal indeksa \n//\t\tsujungtasSarasas.add(0, \"Dar vienas menuo\");\n//\t\tsujungtasSarasas.remove(2);// dar yra removeFirst() ir removeLast()\n//\t\t// metodai, // kurie istrina pirma ir paskutini elementus\n//\t\tSystem.out.println(sujungtasSarasas);\n//\t\t// grazina saraso pirmaji\n//\t\t// elementa ir ji istrina is saraso\n//\t\tString menuo = sujungtasSarasas.poll();\n//\t\tSystem.out.println(menuo);\n//\t\tSystem.out.println(sujungtasSarasas);\n//\t\t//\n//\t\t// grazina saraso pirmaji elementa ir ji istrina is saraso\n//\t\tmenuo = sujungtasSarasas.pollFirst();\n//\t\tSystem.out.println(menuo);\n//\t\tSystem.out.println(sujungtasSarasas);\n//\t\t\n//\t\t// grazina saraso pirmaji elementa ir ji istrina is saraso\n//\t\tmenuo = sujungtasSarasas.pollLast();\n//\t\tSystem.out.println(menuo);\n//\t\tSystem.out.println(sujungtasSarasas);\n\n\t}", "@Test\n public void testPushAndPopC() {\n\n System.out.println(\"pushB - All Nulls\");\n String elementOne = null;\n String elementTwo = null;\n String elementThree = null;\n String elementFour = null;\n\n //Stack<String> instance = new StackArrayImpl();\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n instance.push(elementOne);\n instance.push(elementTwo);\n instance.push(elementThree);\n instance.push(elementFour);\n\n int fourSize = instance.size();\n assertEquals(fourSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String resultFour = instance.pop();\n String resultThree = instance.pop();\n String resultTwo = instance.pop();\n String resultOne = instance.pop();\n\n assertEquals(elementOne, resultOne);\n assertEquals(elementTwo, resultTwo);\n assertEquals(elementThree, resultThree);\n assertEquals(elementFour, resultFour);\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public static void main(String[] args) throws StackFullException, StackEmptyException {\n\t try {\n\t DiscardPile<Card> discardPile1 = null; \n\t\tdiscardPile1 = new DiscardPile<Card>(52, 0);// max is 52\n\t\tdiscardPile1.push(new Card(8));\n\t\tdiscardPile1.push(new Card(32));\n\t\tdiscardPile1.push(new Card(48));\t\t\n\t\tdiscardPile1.push(new Card(2));\n\t\tdiscardPile1.push(new Card(17));\n\t\tdiscardPile1.push(new Card(20)); //removeTopCard should remove all that's above\n\t\tdiscardPile1.push(new Card(25));\n\t\tdiscardPile1.push(new Card(50));\n\t\tdiscardPile1.push(new Card(19));\n\t\tdiscardPile1.push(new Card(41)); //10 Cards that must be popped\n\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\tCollections.reverse(discardPile1);\n\t\tfor(Card comi : discardPile1) { //for loop for objects\n\t\t\tSystem.out.println(comi);\n\t\t\t}\t\t\t\n\t }\n\t catch (StackFullException SFE) {\n\t System.out.println(\"StackFullException: \" + SFE.getMessage());\n}\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(20));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(50));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\n}", "@Test\n public void testGetListaCidadao() {\n System.out.println(\"getListaCidadao\");\n Cidadao cid = new Cidadao(\"teste\", 999999999, \"@\", \"4490-479\", 1111);\n Reparticao instance = new Reparticao(\"porto\", 1111, 4490, new ArrayList<>());\n instance.addCidadao(cid);\n\n DoublyLinkedList<Cidadao> expResult = new DoublyLinkedList<>();\n expResult.addLast(cid);\n DoublyLinkedList<Cidadao> result = instance.getListaCidadao().getListaCidadao();\n assertEquals(expResult, result);\n }", "public void testDumpList() {\n \n String result = tester.dumpList(box); \n \n assertTrue(\"Wrong start\", result.startsWith(\"[item 0, item 1, item 2, item 3, item 4, item 5, \"));\n assertTrue(\"Wrong end\", result.endsWith(\", item 96, item 97, item 98, item 99]\"));\n }", "private void iniciarListas() {\n listaBebidas = new ElementoMenu[7];\n listaBebidas[0] = new ElementoMenu(1, \"Coca\");\n listaBebidas[1] = new ElementoMenu(4, \"Jugo\");\n listaBebidas[2] = new ElementoMenu(6, \"Agua\");\n listaBebidas[3] = new ElementoMenu(8, \"Soda\");\n listaBebidas[4] = new ElementoMenu(9, \"Fernet\");\n listaBebidas[5] = new ElementoMenu(10, \"Vino\");\n listaBebidas[6] = new ElementoMenu(11, \"Cerveza\");\n// inicia lista de platos\n listaPlatos = new ElementoMenu[14];\n listaPlatos[0] = new ElementoMenu(1, \"Ravioles\");\n listaPlatos[1] = new ElementoMenu(2, \"Gnocchi\");\n listaPlatos[2] = new ElementoMenu(3, \"Tallarines\");\n listaPlatos[3] = new ElementoMenu(4, \"Lomo\");\n listaPlatos[4] = new ElementoMenu(5, \"Entrecot\");\n listaPlatos[5] = new ElementoMenu(6, \"Pollo\");\n listaPlatos[6] = new ElementoMenu(7, \"Pechuga\");\n listaPlatos[7] = new ElementoMenu(8, \"Pizza\");\n listaPlatos[8] = new ElementoMenu(9, \"Empanadas\");\n listaPlatos[9] = new ElementoMenu(10, \"Milanesas\");\n listaPlatos[10] = new ElementoMenu(11, \"Picada 1\");\n listaPlatos[11] = new ElementoMenu(12, \"Picada 2\");\n listaPlatos[12] = new ElementoMenu(13, \"Hamburguesa\");\n listaPlatos[13] = new ElementoMenu(14, \"Calamares\");\n// inicia lista de postres\n listaPostres = new ElementoMenu[15];\n listaPostres[0] = new ElementoMenu(1, \"Helado\");\n listaPostres[1] = new ElementoMenu(2, \"Ensalada de Frutas\");\n listaPostres[2] = new ElementoMenu(3, \"Macedonia\");\n listaPostres[3] = new ElementoMenu(4, \"Brownie\");\n listaPostres[4] = new ElementoMenu(5, \"Cheescake\");\n listaPostres[5] = new ElementoMenu(6, \"Tiramisu\");\n listaPostres[6] = new ElementoMenu(7, \"Mousse\");\n listaPostres[7] = new ElementoMenu(8, \"Fondue\");\n listaPostres[8] = new ElementoMenu(9, \"Profiterol\");\n listaPostres[9] = new ElementoMenu(10, \"Selva Negra\");\n listaPostres[10] = new ElementoMenu(11, \"Lemon Pie\");\n listaPostres[11] = new ElementoMenu(12, \"KitKat\");\n listaPostres[12] = new ElementoMenu(13, \"IceCreamSandwich\");\n listaPostres[13] = new ElementoMenu(14, \"Frozen Yougurth\");\n listaPostres[14] = new ElementoMenu(15, \"Queso y Batata\");\n }", "@Test\r\n public void testStackVector() {\r\n StackVector<Integer> stack = new StackVector<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek());\r\n assertEquals(5, stack.pop());\r\n assertEquals(4, stack.size());\r\n }", "public void MostrarListas (){\n Nodo recorrer=inicio; // esto sirve para que el elemento de la lista vaya recorriendo conforme se inserta un elemento\r\n System.out.println(); // esto nos sirve para dar espacio a la codificacion de la lista al imprimir \r\n while (recorrer!=null){ // esta secuencia iterativa nos sirve para repetir las opciones del menu\r\n System.out.print(\"[\" + recorrer.dato +\"]--->\");\r\n recorrer=recorrer.siguiente;\r\n }\r\n }", "private void uminus() throws Exception{\n\t\tif(stackEmpty()) throw new Exception(\"Stack ist leer\");\n\t\telse{\n\t\t\tvalue1=stack.pop();\n\t\t\tstack.push(value1*(-1));\n\t\t}\n\t\t\n\t}", "@Override \n\tpublic String toString() {\n\t\t\n\t\tSystem.out.println(\"New Stack\");\n\t\t\n\t\tfor(int i = 0; i < arraySize; i++) {\n\t\t\tSystem.out.println(\"stack: \" + list[i].toString());\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\");// Print and empty new line\n\t\t\n\t\treturn \"\";\n\t}", "@Test(enabled = true, dependsOnMethods = {\"remove\"}, expectedExceptions = NullPointerException.class)\n\tpublic void getNullOnNull() {\n\t\tassert stack.getLast().getNext() == node5;\n\t}", "public ListaDuplamenteEncadeada(){\r\n\t\t\r\n\t}", "void evalua(String expresion){\n Queue entrada=stringtoChars(expresion); //entrada cola\r\n Queue salida= new Queue();//salida cola\r\n Stack pila=new Stack(); //pila\r\n char caracter;\r\n int cont=0;\r\n \r\n while((caracter=entrada.dequeue())!=0){//mientras que\r\n System.out.println(\"dequeue \"+caracter);\r\n System.out.println(\"contador \"+cont);\r\n if(isLetra(caracter)){//si es una letra\r\n salida.queue(caracter);//inserta a la cola de salida\r\n }else{//si es un signo ++++++++\r\n System.out.println(\"entra\");\r\n if(pila.isPilaVacia()){//si la pila está vacía\r\n pila.push(caracter);//inserta el caracter\r\n }else{//falta checar los () si no es vacia\r\n if(peso(caracter)==0){\r\n char c;\r\n while((c=pila.pop())!='('){//mientras que sacar de la pila es diferente de cero\r\n salida.queue(c); // a la salida insertar los caracteres\r\n } \r\n \r\n }else{\r\n char signo=pila.pop();\r\n if(signo=='('){\r\n pila.push(signo);\r\n pila.push(caracter);\r\n pila.imprimir();\r\n }else{\r\n //signo es igual al primer caracter de la pila\r\n //signo=adentro\r\n //caracter=afuera\r\n if(isAfuerMayorDentro(signo, caracter)){//si el que esta afuera es mayor que el de adentro\r\n\r\n // pila.push(caracter);//insertamos el que estaba adentro\r\n pila.push(signo);//insertamos el afuera\r\n pila.push(caracter);//insertamos el que estaba adentro\r\n pila.imprimir(); \r\n }else{//si el de adentro es mayor que el de afuera\r\n salida.queue(signo);//a la salida insertamos el signo afyera\r\n pila.push(caracter);//a la pila insertamos el que estaba \r\n pila.imprimir();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n cont++;\r\n }\r\n while((caracter=pila.pop())!=0){//mientras que sacar de la pila es diferente de cero\r\n salida.queue(caracter); // a la salida insertar los caracteres\r\n }\r\n while((caracter= salida.dequeue())!=0){//mientras que sacar de la salida es diferente de cero\r\n System.out.print(caracter);//imprimir los caracteres\r\n }\r\n \r\n }", "public interface Stack<E> {\n\n void push(E e) throws FullStackException;\n E pop() throws EmptyStackException; //devuelves / sacas un Elemento\n int size();\n}", "public void mostrarLista() {\n\n Nodo recorrer = temp;\n while (recorrer != null) {\n\n System.out.println(\"[ \" + recorrer.getDato() + \"]\");\n recorrer = recorrer.getSiguiente();\n\n }\n\n }", "public void listar(){\r\n // Verifica si la lista contiene elementoa.\r\n if (!esVacia()) {\r\n // Crea una copia de la lista.\r\n Nodo aux = inicio;\r\n // Posicion de los elementos de la lista.\r\n int i = 0;\r\n // Recorre la lista hasta el final.\r\n while(aux != null){\r\n // Imprime en pantalla el valor del nodo.\r\n System.out.print(i + \".[ \" + aux.getValor() + \" ]\" + \" -> \");\r\n // Avanza al siguiente nodo.\r\n aux = aux.getSiguiente();\r\n // Incrementa el contador de la posión.\r\n i++;\r\n }\r\n }\r\n }", "@Test\n public void addAllTypesTest(){\n stack.addToAllTypes(stack2);\n ResourceStack stack3 = new ResourceStack(3, 5, 7, 9);\n assertEquals(stack3.toString(), stack.toString());\n\n stack.addToAllTypes(stack2);\n stack3 = new ResourceStack(5, 8, 11, 14);\n assertEquals(stack3.toString(), stack.toString());\n }", "static void stack_pop(Stack<Integer> stack)\r\n\t{\r\n\t\t\r\n\t\tSystem.out.print(\"Pop : \");\r\n\t\tfor(int i=0;i<5;i++)\r\n\t\t{\r\n\t\t\tInteger dataElement=(Integer)stack.pop();\r\n\t\t\tSystem.out.print(\" \"+ dataElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public void ouvrirListe(){\n\t\n}", "public Stack pilaEliminaDatos( Stack pila )\n {\n // Verificamos que la pila no este vacia para eliminar datos\n if (!pila.isEmpty())\n {\n this.imprime(\"Se ha eliminado este elemento ->\" + pila.peek() +\"<- de la pila\");\n pila.pop();\n }\n else\n {\n this.imprime(\"La pila esta vacia, no se pueden eliminar datos\");\n }\n\n return pila;\n }", "@Test\n public void testPartieContinue(){\n Joueur NORD = new Joueur(\"NORD\");\n Joueur SUD = new Joueur(\"SUD\");\n assertTrue(Regles.partieContinue(NORD.clone(), SUD.clone(), 0,false));\n // avec des bases injouables\n NORD.setAscendant(61);\n NORD.setDescendant(0);\n SUD.setAscendant(61);\n SUD.setDescendant(0);\n assertFalse(Regles.partieContinue(NORD.clone(), SUD.clone(), 0, false));\n // avec un jeu vide\n NORD.jeu.clear();\n assertFalse(Regles.partieContinue(NORD.clone(), SUD.clone(), 0, false));\n\n SUD.jeu.clear();\n NORD.jeu.add(0,59);\n NORD.jeu.add(1,58);\n NORD.setAscendant(57);\n NORD.setDescendant(2);\n SUD.setAscendant(1);\n SUD.setDescendant(60);\n assertTrue(Regles.partieContinue(NORD.clone(), SUD.clone(), 0,false));\n NORD.setAscendant(58);\n assertFalse(Regles.partieContinue(NORD.clone(), SUD.clone(), 0,false));\n //cas spécifique\n NORD.setAscendant(49);\n NORD.setDescendant(2);\n SUD.setAscendant(53);\n SUD.setDescendant(9);\n SUD.jeu.add(0,34);\n SUD.jeu.add(1,44);\n SUD.jeu.add(2,38);\n SUD.jeu.add(3,6);\n SUD.jeu.add(4,41);\n SUD.jeu.add(5,39);\n assertTrue(Regles.partieContinue(SUD.clone(), NORD.clone(), 0, false));\n\n\n }", "public Stack<String> getCasillasPorVisitar(){\n\t\treturn casillasPorVisitar;\n\t}", "public void verifylistcreated(String orderrecape1){\r\n\r\n\t\tString order = getValue(orderrecape1);\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Created List should be dispalyed\");\r\n\t\ttry{\r\n\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"verifycurrentlist\"),order)) { \r\n\t\t\t\twaitForPageToLoad(20);\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Created List is Displayed\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- orderrecape is not displayed \"+elementProperties.getProperty(\"verifycurrentlist\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \" + elementProperties.getProperty(\"verifycurrentlist\").toString().replace(\"By.\", \" \") + \" not found\");\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "public void push(Object ob){\n \t Stack n_item=new Stack(ob);\n \tn_item.next=top;\n \ttop=n_item;\n }" ]
[ "0.68948317", "0.6102008", "0.6092188", "0.5890671", "0.58711314", "0.5754108", "0.5711736", "0.5671152", "0.56666815", "0.56453425", "0.5613913", "0.56069326", "0.560654", "0.5593514", "0.55313694", "0.5523208", "0.5469645", "0.544308", "0.5440731", "0.5439417", "0.5431478", "0.54246813", "0.541451", "0.54075646", "0.54037", "0.537033", "0.53649485", "0.5359065", "0.53549206", "0.5348875", "0.5344084", "0.53362125", "0.5333461", "0.5329725", "0.53222954", "0.5318996", "0.53110135", "0.5302755", "0.52762884", "0.5268031", "0.52546054", "0.52454233", "0.523439", "0.52316606", "0.5229061", "0.5227339", "0.52186555", "0.52154076", "0.52085745", "0.5205505", "0.5197276", "0.51896435", "0.518705", "0.51846164", "0.5182006", "0.5168019", "0.51655984", "0.51568204", "0.5155732", "0.5155382", "0.51552415", "0.51540387", "0.5151232", "0.5147486", "0.51396525", "0.51386523", "0.5132821", "0.51254827", "0.5121984", "0.5116031", "0.51132864", "0.5102772", "0.51026976", "0.51016414", "0.50994134", "0.5091198", "0.5083071", "0.5082685", "0.5082459", "0.50806004", "0.5074617", "0.5071505", "0.50709915", "0.50675935", "0.50668037", "0.5055987", "0.5051981", "0.5040652", "0.503751", "0.5036829", "0.5035504", "0.5033832", "0.5023886", "0.5007117", "0.5005725", "0.50039285", "0.49900156", "0.4989231", "0.49871117", "0.4985922" ]
0.6980468
0
/ Test de stack Lista Doblemente Encadenada
@Test public void testStackVector() { StackVector<Integer> stack = new StackVector<Integer>(); stack.push(1); stack.push(2); stack.push(3); stack.push(4); stack.push(5); assertEquals(5, stack.peek()); assertEquals(5, stack.pop()); assertEquals(4, stack.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void testStackListaDobleEncadenada() {\r\n StackListaDobleEncadenada<Integer> stack = new StackListaDobleEncadenada<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek());\r\n assertEquals(5, stack.pop());\r\n assertEquals(4, stack.size());\r\n }", "@Test\r\n public void testStackListaEncadenada() {\r\n StackListaEncadenada<Integer> stack = new StackListaEncadenada<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek());\r\n assertEquals(5, stack.pop());\r\n assertEquals(4, stack.size());\r\n }", "@Test\r\npublic void testTop()\r\n{\n\tassertEquals(null,myStack.top());\r\n\r\n\tassertEquals(true, myStack.push(new Element(2,\"Basel\")));\t\r\n\tassertEquals(true, myStack.push(new Element(4,\"Wil\")));\t\r\n\tassertEquals(true, myStack.push(new Element(27,\"Chur\")));\r\n\tassertEquals(27,myStack.top().getId());\r\n\tassertEquals(27,myStack.pop().getId());\r\n\tassertEquals(4,myStack.top().getId());\r\n\tassertEquals(4,myStack.pop().getId());\r\n\tassertEquals(2,myStack.pop().getId());\r\n\t\r\n\t// Stack leer\r\n\tassertEquals(null,myStack.top());\r\n\r\n}", "@Test\n public void pushOnStackTest_Correct(){\n assertEquals(stack.getTop().getData() , stack.getStack().returnFirst());\n }", "@Test\n public void testStack() {\n DatastructureTest.STACK.push(3);\n DatastructureTest.STACK.push(7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == -1);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == -1);\n }", "@Test\r\n public void testStackstack() {\r\n StackArrayList<Integer> stack = new StackArrayList<Integer>();\r\n\r\n stack.push(1);\r\n stack.push(2);\r\n stack.push(3);\r\n stack.push(4);\r\n stack.push(5);\r\n\r\n assertEquals(5, stack.peek());\r\n assertEquals(5, stack.pop());\r\n assertEquals(4, stack.size());\r\n }", "@Test\r\n\tpublic void testPop()\r\n\t{\n\t\tassertEquals(null,myStack.pop());\r\n\t\r\n\t\tassertEquals(true, myStack.push(new Element(2,\"Basel\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(4,\"Wil\")));\t\r\n\t\tassertEquals(true, myStack.push(new Element(27,\"Chur\")));\r\n\t\tassertEquals(27,myStack.top().getId());\r\n\t\tassertEquals(\"Chur\",myStack.pop().getName());\r\n\t\tassertEquals(4,myStack.pop().getId());\r\n\t\tassertEquals(2,myStack.pop().getId());\r\n\t\t\r\n\t\t// leerer Stack\r\n\t\tassertEquals(null,myStack.pop());\r\n\t\tassertEquals(null,myStack.top());\r\n\t}", "public interface Stack<E> {\r\n \r\n /** \r\n * Pre: Se ingresa el dato\r\n * @param data se ingresa un dato para agregar al Vector\r\n * Post: Se guarda el dato en Stack\r\n */\r\n public void push(E data);\r\n\r\n /** \r\n * Pre: Estan todos los datos en el Stack\r\n * @return E se regresa un item.\r\n * Post: Se regresa y elimina un dato del Stack\r\n */\r\n public E pop();\r\n\r\n /** \r\n * Pre: Se encuentra el Stack con sus datos\r\n * @return E se regresa cualquier tipo de dato\r\n * @throws EmptyStackException regresa un error\r\n * Post: Se regresa el dato sobre la lista\r\n */\r\n public E peek();\r\n\r\n /** \r\n * Pre:Se encuentra el Stack\r\n * @return boolean se regresa un valor True o False\r\n * Post: Si el Stack se encuentra vacio este regresa True\r\n */\r\n public boolean empty();\r\n\r\n /** \r\n * Pre:Se encuentra el Stack \r\n * @return int se regrea cualquier numero\r\n * Post: Se devuelve el numero de objetos que tiene el Stack\r\n */\r\n public int size();\r\n\r\n}", "@Test\n public void testBiggerStack() {\n\n System.out.println(\"isEmpty\");\n\n int sizeTest = 5000;\n\n List<String> elementList = new ArrayList();\n String tempString = \"\";\n\n for (int i = 0; i < sizeTest; i++) {\n\n tempString = tempString + \"z\";\n elementList.add(tempString);\n\n }\n\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n for (String string : elementList) {\n instance.push(string);\n }\n\n int fourSize = instance.size();\n assertEquals(fourSize, sizeTest);\n assertEquals(instance.isEmpty(), false);\n\n for (int i = sizeTest; i > 0; i--) {\n\n String result = instance.pop();\n\n String expected = elementList.get(i - 1);\n\n assertEquals(expected, result);\n\n }\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public static void main(String[] args) {\n Solution solution = new Solution();\n TreeNode root = new TreeNode(1);\n root.left = new TreeNode(2);\n root.left.left = new TreeNode(6);\n root.left.left.right = new TreeNode(10);\n root.left.left.right.left = new TreeNode(-1);\n root.left.right = new TreeNode(9);\n\n root.right = new TreeNode(3);\n root.right.right = new TreeNode(5);\n root.right.left = new TreeNode(4);\n root.right.left.left = new TreeNode(7);\n root.right.left.right = new TreeNode(8);\n \n solution.stackList(root);\n for (int i = 0 ; i < solution.list.size(); i++) System.out.print(solution.list.get(i) + \" \");\n }", "@Test\n public void testGetListaExposicoes() {\n System.out.println(\"getListaExposicoes\");\n List<Exposicao> listaExposicoes = new ArrayList<>();\n listaExposicoes.add(new Exposicao());\n RegistoExposicoes instance = new RegistoExposicoes(listaExposicoes);\n List<Exposicao> expResult = listaExposicoes;\n List<Exposicao> result = instance.getListaExposicoes();\n assertEquals(expResult, result);\n }", "public void printStack() {\n\t\tif (this.l.getHead() != null) {\n\t\t\tl.printList();\n\t\t} else {\n\t\t\tSystem.out.println(\"No element in stack\");\n\t\t}\n\t}", "@Test\n public void testBigStack() {\n\n System.out.println(\"isEmpty\");\n\n int sizeTest = 500;\n\n List<String> elementList = new ArrayList();\n String tempString = \"\";\n\n for (int i = 0; i < sizeTest; i++) {\n\n tempString = tempString + \"z\";\n elementList.add(tempString);\n\n }\n\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n for (String string : elementList) {\n instance.push(string);\n }\n\n int fourSize = instance.size();\n assertEquals(fourSize, sizeTest);\n assertEquals(instance.isEmpty(), false);\n\n for (int i = sizeTest; i > 0; i--) {\n\n String result = instance.pop();\n\n String expected = elementList.get(i - 1);\n\n assertEquals(expected, result);\n\n }\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "@Test\n public void pushOnStackTest_InCorrect(){\n assertNotEquals(10 , stack.getStack().returnFirst());\n }", "public static void main(String[] args) throws Exception {\n\t\t// TODO Auto-generated method stub\n\t\tLinkedListAsStack stack = new LinkedListAsStack();\n\t\tstack.push(10);\n\t\tstack.push(20);\n\t\tstack.push(30);\n\t\tstack.push(40);\n\t\tstack.display();// 40 30 20 10-> act as a stack\n\t\tSystem.out.println(stack.size());// 4\n\t\tSystem.out.println(stack.isEmpty());// false\n\t\tSystem.out.println(stack.pop());// 40\n\t\tSystem.out.println(stack.top());// 30\n\t\tstack.display();// 30 20 10\n\t\tSystem.out.println(stack.size());// 3\n\t}", "@Test\n public void testPush(){\n ms=new MyStack();\n ms.push(1);\n assertFalse(ms.IsEmpty());\n }", "public void isPalindromeListStackMethod() {\n\n\t\tStack<Integer> stk = new Stack<Integer>();\n\n\t\tNode temp = head;\n\t\twhile(temp != null) {\n\t\t\tstk.push(temp.data);\n\t\t\ttemp = temp.next;\n\t\t}\n\n\t\ttemp = head;\n\t\twhile(temp != null && stk.empty() == false) {\n\t\t\tif(temp.data == stk.peek()) {\n\t\t\t\ttemp = temp.next;\n\t\t\t\tstk.pop();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(stk.empty() == true) {\n\t\t\tSystem.out.println(\"List is Palindrome\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"List is not Palindrome\");\n\t\t}\n\n\t}", "public DSAStack()\n {\n stack = new DSALinkedList<E>();\n }", "@Test\n public void testMassiveStack() {\n\n System.out.println(\"isEmpty\");\n\n int sizeTest = 10000;\n\n List<String> elementList = new ArrayList();\n String tempString = \"\";\n\n for (int i = 0; i < sizeTest; i++) {\n\n tempString = tempString + \"z\";\n elementList.add(tempString);\n\n }\n\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n for (String string : elementList) {\n instance.push(string);\n }\n\n int fourSize = instance.size();\n assertEquals(fourSize, sizeTest);\n assertEquals(instance.isEmpty(), false);\n\n for (int i = sizeTest; i > 0; i--) {\n\n String result = instance.pop();\n\n String expected = elementList.get(i - 1);\n\n assertEquals(expected, result);\n\n }\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public static void main(String[] args) {\n\t\tString palabrejas[] = { \"columnas\", \"filas\", \"zalamero\", \"zascandil\" };\n\t\tStack<String> palabrasPila = new Stack<String>();\n\t\t// Aunque tiene varios métodos suelen usarse los de ingreso o extraccion\n\t\t// a la pila\n\t\t// para poner en la pila\n\t\t// push coloca un elemento en la cima de la pila\n\t\tpalabrasPila.push(palabrejas[0]);\n\t\tpalabrasPila.push(palabrejas[1]);\n\t\tSystem.out.println(palabrasPila);\n\t\t// como se obtienen los elementos seegun el criterio de una pila\n\t\t// dos formas\n\t\t// 1º obteniendo el elemento y borrandolo de la pila\n\t\t// con pop se retorna el elemento en la cima y se borra de la pila\n\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\tSystem.out.println(palabrasPila);\n\t\ttry {\n\t\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"pila vacia\");\n\t\t}\n\t\t// Como hemos dicho se puede trabajar con Stack como si fuese una colecction\n\t\tfor (int i = 0; i < palabrejas.length; i++) {\n\t\t\tpalabrasPila.push(palabrejas[i]);\n\t\t}\n\t\t// 2º metodo de acceso a Stack como pila\n\t\t// Se trata del metodo peek que es como el pop pero\n\t\t// no elimina el elemento de la cima\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"cima \" + palabrasPila.peek());\n\t\t}\n\t\t// Si usas una Stack es porque lo necesitas. java te permite usarla como\n\t\t// una collection normal, pero en realidad solo se deberian usar las\n\t\t// cuatro funciones asociadas a a pila\n\t\t// pop,push,peek,isEmpty\n\t\tSystem.out.println(palabrasPila.size());\n\t}", "public Stacked(){\n count = 0;\n stackArray = (E[]) new Object[START_CAP];\n }", "@Test\n public void testStackCodeExamples() {\n logger.info(\"Beginning testStackCodeExamples()...\");\n\n // Allocate an empty stack\n Stack<String> stack = new Stack<>();\n logger.info(\"Start with an empty stack: {}\", stack);\n\n // Push a rock onto it\n String rock = \"rock\";\n stack.pushElement(rock);\n assert stack.getTop().equals(rock);\n logger.info(\"Push a rock on it: {}\", stack);\n\n // Push paper onto it\n String paper = \"paper\";\n stack.pushElement(paper);\n assert stack.getTop().equals(paper);\n logger.info(\"Push paper on it: {}\", stack);\n\n // Push scissors onto it\n String scissors = \"scissors\";\n stack.pushElement(scissors);\n assert stack.getTop().equals(scissors);\n assert stack.getSize() == 3;\n logger.info(\"Push scissors on it: {}\", stack);\n\n // Pop off the scissors\n assert stack.popElement().equals(scissors);\n assert stack.getSize() == 2;\n logger.info(\"Pop scissors from it: {}\", stack);\n\n // Pop off the paper\n assert stack.popElement().equals(paper);\n assert stack.getSize() == 1;\n logger.info(\"Pop paper from it: {}\", stack);\n\n // Pop off the rock\n assert stack.popElement().equals(rock);\n assert stack.isEmpty();\n logger.info(\"Pop rock from it: {}\", stack);\n\n logger.info(\"Completed testStackCodeExamples().\\n\");\n }", "@Override\n <E> Stack<E> getStack(String list) {\n if (list.equalsIgnoreCase(\"Simple\")){\n return new StackSinglyLinkedList<E>();\n\n } else if (list.equalsIgnoreCase(\"Doble\")){\n return new StackDoublyLinkedList<E>();\n\n } else if (list.equalsIgnoreCase(\"Circular\")){\n return new StackCircularList<E>();\n\n }\n\n return null;\n }", "@Test\n public void testSetListaExposicoes() {\n System.out.println(\"setListaExposicoes\");\n List<Exposicao> listaExposicoes = new ArrayList<>();\n listaExposicoes.add(new Exposicao());\n RegistoExposicoes instance = new RegistoExposicoes();\n instance.setListaExposicoes(listaExposicoes);\n assertEquals(instance.getListaExposicoes(), listaExposicoes);\n }", "@Test\r\n public void testGetElement() throws Exception {\r\n System.out.println(\"getElement ModeloListaOrganizadores\");\r\n\r\n String expResult = \"Diana\";\r\n Utilizador u = new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5);\r\n u.setNome(\"Diana\");\r\n Organizador o = new Organizador(u);\r\n\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n instance.addElement(o);\r\n instance.getElementAt(0);\r\n\r\n Organizador teste = e.getListaOrganizadores().getListaOrganizadores().get(0);\r\n\r\n String result = teste.getUtilizador().getNome();\r\n assertEquals(expResult, result);\r\n\r\n }", "public static void main(String[] args) {\n\t\tStack<String> stack = new Stack<>();\n\t\t//push é o metodo adiciona\n\t\tstack.push(\"ricardo\");\n\t\tstack.push(\"rodrigo\");\n\t\tstack.push(\"rogerio\");\n\t\tstack.push(\"ronaldo\");\n\t\t\n\t\tSystem.out.println(stack);\n\t\t\n\t\t//pop é o metodo delete\n\t\tstack.pop();\n\t\t\n\t\tSystem.out.println(stack);\n\t\t//peek é o metodo para retornar o ultimo elemento sem apagar\n\t\tSystem.out.println(stack.peek());\n\t\t\n\t\t//System.out.println(stack);\n\t\t\n\t\t\n\t}", "public void printStack(Stack list){\n while(!list.isEmpty()){\n temp.push(list.peek());\n list.pop();\n }\n\n //printing temp and inserting items back to list\n while(!temp.isEmpty()){\n System.out.println(temp.peek()+\" \");\n list.push(temp.peek());\n temp.pop();\n }\n System.out.println();\n\n }", "public static void main(String[] args) {\n// System.out.println(\"as.getSize() == \" + as.getSize());\n// as.pop();\n// System.out.println(\"as.pop() == \" + as);\n// System.out.println(\"as.peek() == \" + as.peek());\n// as.push(\"17\");\n// System.out.println(as);\n\n LinkedListStack<Integer> stack = new LinkedListStack<>();\n\n for(int i = 0 ; i < 5 ; i ++){\n stack.push(i);\n System.out.println(stack);\n }\n\n stack.pop();\n System.out.println(stack);\n\n }", "@Override\r\n\tpublic void excecute() {\n\t\tdata = stack.pop();\r\n\t\tJList1.setListData(stack.getStackVector()); // refresh the JList\r\n\t}", "public static void main(String[] args) {\n\t\t \r\n\t\tArrayList datos = new ArrayList(50);\r\n\t\t\r\n\t\t//insertar datos:\r\n\t\t\r\n\t\tdatos.add(5);\r\n\t\tdatos.add(10);\r\n\t\tint x = 100;\r\n\t\tdatos.add(x);\r\n\t\t\r\n\t\tfor(int i = 0; i<10 ; i++) {\r\n\t\t\t\r\n\t\t\tdatos.add(i+1);\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(datos);\r\n\t\t//recuperar tamaņo de arraylist\r\n\t\t\r\n\t\tSystem.out.println(datos.size());\r\n\t\t\r\n\t\t//Stack-Pila (Last in First out)\r\n\t\t//Push : insertar elementos en la parte posterior de la pila \r\n\t\t//Pop : eliminar elementos(eliminara el ultimo elemento aņadido al stack)\r\n\t\t\r\n\t\tStack miPila = new Stack();\r\n\t\tmiPila.push(\"Lola\");\r\n\t\tmiPila.push(\"Carmen\");\r\n\t\tmiPila.push(\"La Mona Lisa\");\r\n\t\tmiPila.push(\"El Quijote\");\r\n\t\t\r\n\t\t//miPila.clear();//Limpiar el stack vaciarla\r\n\t\t\r\n\t\tString elemento;\r\n\t\telemento = (String)miPila.pop();\r\n\t\t\r\n\t\tSystem.out.println(elemento);\r\n\t\t\r\n\t\t\r\n\t\t//Queu-cola(LIFO: Last in first out)\r\n\t\t//add : aņadir elementos a la queu\r\n\t\t//poll : eliminar el ultimo elemento aņadido\r\n\t\t//peek : consulta ultimo elemento aņadido a la cola\r\n\t\t\r\n\t\tQueue cola = new LinkedList();\r\n\t\t\r\n\t\tcola.add(5);\r\n\t\tcola.add(10);\r\n\t\tcola.add(15);\r\n\t\t\r\n\t\tSystem.out.println(cola.poll());\r\n\t\tSystem.out.println(cola);\r\n\t\t\r\n\t\t//HashTable\r\n\t\t\r\n\t\t\r\n\t\tHashtable tabla = new Hashtable();\r\n\t\t//Hashtable<Integer, String> tabla2 = new Hashtable();\r\n\t\ttabla.put(1, \"Apple\");\r\n\t\ttabla.put(2, \"Sony\");\r\n\t\ttabla.put(6, \"Samsung\");\r\n\t\ttabla.put(\"ferrari\", 400);\r\n\t\t\r\n\t\tSystem.out.println(tabla.get(\"ferrari\"));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t}", "@Test\n public void testSingleStack() {\n ProgramStack ps = new ProgramStack();\n\n ps.push(1);\n\n Assert.assertEquals(\"[1]\", ps.toString());\n }", "public ArrayListStack(){\r\n theData = new ArrayList<E>();\r\n }", "@Test\r\n\tpublic void testPelikulaBaloratuDutenErabiltzaileenZerrenda() {\n\t\tArrayList<Integer> zer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p1.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(e1.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertFalse(zer.contains(e2.getId()));\r\n\t\t\r\n\t\t// p2 pelikula baloratu duten erabiltzaileen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p2.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 4);\r\n\t\tassertTrue(zer.contains(e1.getId()));\r\n\t\tassertTrue(zer.contains(e2.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertTrue(zer.contains(e4.getId()));\r\n\t\t\r\n\t\t// p3 pelikula baloratu duten erabiltzaileen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p3.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(e2.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertFalse(zer.contains(e1.getId()));\r\n\t\t\r\n\t\t// p4 pelikula baloratu duten erabiltzaileen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().pelikulaBaloratuDutenErabiltzaileenZerrenda(p4.getPelikulaId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(e1.getId()));\r\n\t\tassertTrue(zer.contains(e3.getId()));\r\n\t\tassertFalse(zer.contains(e4.getId()));\r\n\t\t\r\n\t}", "@Test\r\n\tpublic void testCardStack() {\r\n\t\t\r\n\t\t// create a card stack\r\n\t\tCardStack testStack = new CardStack();\r\n\t\t\r\n\t\t// test if we can place a non-king card onto the empty stack\r\n\t\tassertFalse(testStack.isValidMove(deckCards.get(1)));\r\n\t\t\r\n\t\t// test if we can place a king onto an empty stack\r\n\t\t// remember testStack starts at 0 not 1, so kings are at position 12\r\n\t\tassertTrue(testStack.isValidMove(deckCards.get(12)));\r\n\t\t\r\n\t\t// add the king to the stack\r\n\t\tassertEquals(deckCards.get(12), testStack.push(deckCards.get(12)));\r\n\t\t\r\n\t\t// now test can we add the same suit queen\r\n\t\tassertFalse(testStack.isValidMove(deckCards.get(12)));\r\n\t\t\r\n\t\t// now test if can add an off-suit different color queen\r\n\t\tassertTrue(testStack.isValidMove(deckCards.get(37)));\r\n\t\t\r\n\t\t// place the card to the stack\r\n\t\tassertEquals(deckCards.get(37), testStack.push(deckCards.get(37)));\r\n\t\t\r\n\t\t// add a card to the stack via add method as if being dealt\r\n\t\ttestStack.addCard(deckCards.get(40));\r\n\t\t\r\n\t\t// now check if that changes what will be accepted\r\n\t\tassertFalse(testStack.isValidMove(deckCards.get(41)));\r\n\t}", "public static void main (String[] args) {\n // testing LinkedStack\n // ===================\n System.out.println(\"\\n** Test output for LinkedStack **\\n\");\n\n // instantiate new LinkedStack\n LinkedStack<String> stack = new LinkedStack<String>();\n\n // check size is 0 and isEmpty() returns true\n System.out.println(\"Checking that size = 0 and isEmpty is true...\");\n System.out.println(\"Size: \" + stack.size() + \" isEmpty: \" + stack.isEmpty());\n\n // test peeking and popping empty stack, should throw exception\n System.out.println(\"Popping empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(stack.pop());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n }\n System.out.println(\"Peeking at empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(stack.peek());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n\n }\n\n // push an element onto stack, stack should have one element\n System.out.println(\"Pushing an element...\");\n stack.push(\"One\");\n System.out.println(\"After pushing a single element, the stack should have one element \\\"One\\\"\");\n System.out.println(stack);\n System.out.println();\n\n // pop the element, stack should be empty again\n System.out.println(\"Popping...\");\n stack.pop();\n System.out.println(\"After the pop operation, stack should be empty:\");\n System.out.println(stack);\n\n // push more elements\n System.out.println(\"Pushing an element...\");\n stack.push(\"Two\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Three\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Four\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Five\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Six\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Seven\");\n System.out.println(\"Stack with six elements:\");\n System.out.println(stack);\n System.out.println();\n\n // check size is 6 and isEmpty() returns false\n System.out.println(\"Checking that size = 6 and isEmpty is false...\");\n System.out.println(\"Size: \" + stack.size() + \" isEmpty: \" + stack.isEmpty());\n System.out.println();\n\n // test peeking at top element from stack\n System.out.println(\"Peeking at top element..\");\n System.out.println(stack.peek());\n System.out.println();\n\n // test popping top element from stack\n System.out.println(\"Popping...\");\n System.out.println(stack.pop());\n System.out.println(\"Stack after pop operation:\");\n System.out.println(stack);\n System.out.println();\n\n\n // ====================\n // testing DropOutStack\n // ====================\n System.out.println(\"\\n** Test output for DropOutStack **\\n\");\n // instantiate new DropOutStack with capacity of 5\n DropOutStack<String> dropStack = new DropOutStack<String>(5);\n\n // test peeking and popping empty stack, should throw exception\n System.out.println(\"Popping empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(dropStack.pop());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n }\n System.out.println(\"Peeking at empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(dropStack.peek());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n\n }\n\n // check size is 0 and isEmpty() returns true\n System.out.println(\"Checking that size = 0 and isEmpty is true...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // push 3 elements to stack, stack not full\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"One\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Two\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Three\");\n System.out.println(\"After 3 push operations, the stack looks like this:\");\n System.out.println(dropStack);\n System.out.println();\n\n // check size is 3 and isEmpty() returns false\n System.out.println(\"Checking that size = 3 and isEmpty is false...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // push 3 more elements to stack, should drop first element pushed to stack (\"One\")\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Four\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Five\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Six\");\n System.out.println(\"Stack after 3 more push operations, first element \\\"One\\\" is lost:\");\n System.out.println(dropStack);\n System.out.println();\n\n // check size is 5 and isEmpty() returns false\n System.out.println(\"Checking that size = 5 and isEmpty is false...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // test peeking at top element from stack\n System.out.println(\"Peeking at top element..\");\n System.out.println(dropStack.peek());\n System.out.println();\n\n // test popping top element from stack\n System.out.println(\"Popping next element\");\n dropStack.pop();\n System.out.println(\"Stack after pop operation:\");\n System.out.println(dropStack);\n System.out.println();\n\n // push another element\n System.out.println(\"Pushing another element...\");\n dropStack.push(\"Seven\");\n System.out.println(\"After push operation:\");\n System.out.println(dropStack);\n System.out.println();\n\n // pop all elements from stack, stack should be empty\n System.out.println(\"Popping all elements from stack:\");\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n\n System.out.println(\"Stack is empty:\");\n System.out.println(dropStack);\n\n\n }", "public static void main(String[] args) {\n LinkedList<String> daftar= new LinkedList<String>();\r\n //menambahkan elemen pada linked list\r\n daftar.add(\"A\");\r\n daftar.add(\"B\");\r\n daftar.addLast(\"C\");\r\n daftar.addFirst(\"D\");\r\n daftar.add(3, \"B\");\r\n daftar.add(\"F\");\r\n daftar.add(\"G\");\r\n System.out.println(\"Linked List: \"+daftar);\r\n //menghapus elemen dari linked list\r\n daftar.remove(\"B\");\r\n daftar.remove(3);\r\n daftar.removeFirst();\r\n daftar.removeLast();\r\n System.out.println(\"Linked list setelah dihapus: \"+daftar);\r\n //menemukan elemen pada linked list\r\n boolean status=daftar.contains(\"E\");\r\n if(status)\r\n System.out.println(\"Di list terdapat elemen 'E'\");\r\n else\r\n System.out.println(\"Di list tidak terdapat elemen 'E'\");\r\n \r\n //ukuran dari elemen pada linked list\r\n int size=daftar.size();\r\n System.out.println(\"Ukuran dari linked list: \"+size);\r\n \r\n //menunjukkan dam memberi nilai elemen dari linked list\r\n Object elemen=daftar.get(2);\r\n System.out.println(\"elemen ditunjui oleh get(): \"+elemen);\r\n daftar.set(2, \"Y\");\r\n System.out.println(\"Linked list pasca perubahan: \"+daftar);\r\n }", "@Test\r\n\tpublic void testErabiltzaileakBaloratuDituenPelikulenZerrenda() {\n\t\tArrayList<Integer> zer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e1.getId());\r\n\t\tassertTrue(zer.size() == 3);\r\n\t\tassertTrue(zer.contains(p1.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p4.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p3.getPelikulaId()));\r\n\t\t\r\n\t\t// e2 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e2.getId());\r\n\t\tassertTrue(zer.size() == 2);\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p3.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p1.getPelikulaId()));\r\n\t\t\r\n\t\t// e3 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e3.getId());\r\n\t\tassertTrue(zer.size() == 4);\r\n\t\tassertTrue(zer.contains(p1.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p3.getPelikulaId()));\r\n\t\tassertTrue(zer.contains(p4.getPelikulaId()));\r\n\t\t\r\n\t\t// e2 erabiltzaileak baloratu dituen pelikulen ID-ak itzuli\r\n\t\tzer = BalorazioenMatrizea.getBalorazioenMatrizea().erabiltzaileakBaloratuDituenPelikulenZerrenda(e4.getId());\r\n\t\tassertTrue(zer.size() == 1);\r\n\t\tassertTrue(zer.contains(p2.getPelikulaId()));\r\n\t\tassertFalse(zer.contains(p1.getPelikulaId()));\r\n\t\t\r\n\t}", "public void testToString() {\n assertEquals(this.empty.toString(), \"[]\");\n assertEquals(this.stack.toString(), \"[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\");\n }", "@Test\n public void testRemove(){\n FunctionalLinkedList newList = new FunctionalLinkedList();\n for(int i = 1; i < 101; i++){\n if(i%2 == 1){\n newList.add(\"Odd\");\n } else {\n newList.add(\"Even\");\n }\n }\n stack = new ImprovedStackImpl(newList);\n \n // Remove one set of elements & check size.\n stack.remove(\"Odd\");\n assertEquals(\"Size of list is incorrect.\", 50, stack.size());\n String even;\n for(int i = 0; i < stack.size(); i++){\n even = (String) stack.pop().getReturnValue();\n assertEquals(\"'Odd' not removed at loop \"+ i +\".\", \"Even\", even);\n }\n }", "public void traverseStack(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // check if stack is empty\n if(this.topOfStack==-1){\n System.out.println(\"Stack is empty, can't traverse\");\n return;\n }\n // if stack is not empty\n System.out.println(\"Printing stack...\");\n for(int i=0;i<=this.topOfStack;i++){\n System.out.print(this.arr[i]+\" \");\n }\n System.out.println();\n }", "public String getStack();", "Deque<SearchStackElementCategory> getSearchStack() throws Exception;", "@Test\n public void toStringTest() {\n assertEquals(\"1 2 3 4\", stack.toString());\n }", "@Test\n\tpublic void testPush(){\n\t\tArrayIntStack stack = buildStack(4);\n\t\tassertEquals(4, stack.intCol.size());\n\t}", "@Override\r\n\tpublic String toString() {\r\n\t\tString stackString = \"\";\r\n\t\tfor (T e: stack) {\r\n\t\t\tstackString = stackString +e;\r\n\t\t}\r\n\t\treturn stackString;\r\n}", "@Test\n void whenElementAddedToStackLastElementShouldTop() {\n\n MyNode<Integer> myFirstNode = new MyNode<>(70);\n MyNode<Integer> mySecondNode = new MyNode<>(30);\n MyNode<Integer> myThirdNode = new MyNode<>(56);\n MyStack myStack = new MyStack();\n myStack.push(myFirstNode);\n myStack.push(mySecondNode);\n myStack.push(myThirdNode);\n\n boolean result = myStack.head.equals(myFirstNode) && myStack.head.getNext().equals(mySecondNode)\n && myStack.tail.equals(myThirdNode);\n\n Assertions.assertTrue(result);\n }", "@Test\n public void testPop(){\n FunctionalLinkedList newList = new FunctionalLinkedList(); \n stack = new ImprovedStackImpl(newList);\n for(int i = 1; i < 101; i++){\n stack.push(i * 10);\n }\n \n // Check that popping an element leave the correct element on top.\n stack.pop();\n int pop = (Integer) stack.pop().getReturnValue();\n assertEquals(\"Initial pop did not work correctly.\", 990, pop);\n \n // Check that the size after popping is correct.\n int size = stack.size();\n assertEquals(\"Stack is not the correct size.\", 98, size);\n \n // Check that correct error is returned from popping an empty stack.\n for(int i = 98; i > 0; i--){\n stack.pop();\n }\n ErrorMessage error = stack.pop().getError();\n assertEquals(\"A correct error message is not returned.\", ErrorMessage.EMPTY_STRUCTURE, error);\n }", "@Test\r\n public void testGetListaEnvases() {\r\n ArrayList<Envase> lst=new ArrayList<>();\r\n Envase e=new Envase(1,\"nombre\",\"material\");\r\n lst.add(e);\r\n articuloPrueba.setListaEnvases(lst);\r\n ArrayList<Envase> expResult = lst;\r\n ArrayList<Envase> result = articuloPrueba.getListaEnvases();\r\n assertEquals(expResult, result);\r\n }", "@Test\r\n public void testAddElement() throws Exception {\r\n System.out.println(\"addElement ModeloListaOrganizadores\");\r\n\r\n String expResult = \"Diana\";\r\n Utilizador u = new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5);\r\n u.setNome(\"Diana\");\r\n Organizador o = new Organizador(u);\r\n\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n instance.addElement(o);\r\n\r\n Organizador teste = e.getListaOrganizadores().getListaOrganizadores().get(0);\r\n\r\n String result = teste.getUtilizador().getNome();\r\n assertEquals(expResult, result);\r\n\r\n }", "@Test()\n public void testListarComprasEfetuadas() {\n System.out.println(\"listarComprasEfetuadas\");\n String busca = \"\";\n ControleCompra instance = new ControleCompra();\n List<Compra> expResult = listaComprasEfetuadas;\n List<Compra> result = instance.listarComprasEfetuadas(busca);\n assertEquals(expResult, result);\n }", "@SuppressWarnings({\"unchecked\"})\n private void expandStack() {\n T[] newStack;\n \n newStack = (T[]) new Object[Array.getLength(this.elements) + 1];\n for( int i = 0; i < Array.getLength(this.elements); i++ )\n newStack[i] = this.elements[i];\n this.elements = newStack;\n }", "@Test\n public void testNonemptyStack() {\n ProgramStack ps = new ProgramStack();\n\n ps.push(1);\n ps.push(2);\n ps.push(3);\n\n Assert.assertEquals(\"[1, 2, 3]\", ps.toString());\n }", "public ListStack() {\n\t\tlist = new ArrayList<>();\n\t}", "@Test\r\n public void testListar() {\r\n TipoItemRN rn = new TipoItemRN();\r\n TipoItem item = new TipoItem();\r\n item.setDescricao(\"ListarDescriçãoTipoItem\");\r\n rn.salvar(item);\r\n \r\n TipoItem item2 = new TipoItem();\r\n item2.setDescricao(\"ListarDescriçãoTipoItem2\");\r\n rn.salvar(item2);\r\n \r\n List<TipoItem> tipoItens = rn.listar();\r\n \r\n assertTrue(tipoItens.size() >0);\r\n \r\n rn.remover(item);\r\n rn.remover(item2);\r\n }", "public void obrniListu() {\n if (prvi != null && prvi.veza != null) {\n Element preth = null;\n Element tek = prvi;\n \n while (tek != null) {\n Element sled = tek.veza;\n \n tek.veza = preth;\n preth = tek;\n tek = sled;\n }\n prvi = preth;\n }\n }", "@Test\n public void basicQueueOfStacksTest() {\n \n QueueOfStacks<String> tempQueue = new QueueOfStacks<String>();\n String tempCurrentElement;\n \n assertTrue(\"Element not in queue\", tempQueue.isEmpty());\n tempQueue.add(\"a\");\n assertTrue(\"Element not in queue\", !tempQueue.isEmpty());\n tempQueue.add(\"b\");\n assertTrue(\"Number of elements not correct\", tempQueue.size() == 2);\n \n tempCurrentElement = tempQueue.peek();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"a\"));\n\n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"a\") &&\n tempQueue.size() == 1);\n \n tempQueue.add(\"c\");\n assertTrue(\"Number of elements not correct\", tempQueue.size() == 2);\n \n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"b\") &&\n tempQueue.size() == 1 &&\n !tempQueue.isEmpty());\n \n tempCurrentElement = tempQueue.remove();\n assertTrue(\"Element not correct\", tempCurrentElement.equals(\"c\") &&\n tempQueue.size() == 0 &&\n tempQueue.isEmpty());\n \n }", "@Test\n public void testStackInteger() {\n DatastructureTest.INTSTACK.push(3);\n DatastructureTest.INTSTACK.push(7);\n Assert.assertTrue(DatastructureTest.INTSTACK.peek() == 7);\n Assert.assertTrue(DatastructureTest.INTSTACK.pop() == 7);\n Assert.assertTrue(DatastructureTest.INTSTACK.peek() == 3);\n Assert.assertTrue(DatastructureTest.INTSTACK.pop() == 3);\n Assert.assertTrue(DatastructureTest.INTSTACK.peek() == -1);\n Assert.assertTrue(DatastructureTest.INTSTACK.pop() == -1);\n }", "public static void main(String[] args) throws Exception {\n StackUsingArrays stack=new StackUsingArrays(5);\n \n for(int i=1;i<=5;i++) {\n \tstack.push(i*10);\n \tstack.display();\n }\n \n System.out.println(stack.size());\n \n //stack.push(60);\n System.out.println(stack.top());\n \n// while(!stack.isEmpty()) {\n// \tstack.display();\n// \tstack.pop();\n// \t\n// }\n// \n// stack.pop();\n\t}", "@Test\r\n public void testGetHand() {\r\n Player player = new Player();\r\n ArrayList<Tile> expResult = new ArrayList<>();\r\n ArrayList<Tile> result = player.getHand();\r\n assertEquals(expResult, result);\r\n \r\n Stack stack=new Stack(false);\r\n Tile tile=new Tile(0,0);\r\n player.setHand(stack.drawTiles(1));\r\n ArrayList<Tile> exphand=new ArrayList<>();\r\n exphand.add(tile);\r\n boolean expResult2=true;\r\n boolean result2;\r\n result2=(player.getHand().get(0).getHead()==exphand.get(0).getHead() && player.getHand().get(0).getTail()==exphand.get(0).getTail());\r\n assertEquals(expResult2, result2);\r\n \r\n \r\n }", "@Test\n public void ListFactoryTester() {\n \tCalculator calculadora = new ImpCalculadora();\n \t//Se inicializan los factorys\n \tStackFactory<Integer> stackFactory = new StackFactory<Integer>();\n \tListFactory<Integer> listFactory = new ListFactory<Integer>();\n \tStack<Integer> stack;\n \tAbstractList<Integer> lista;\n \t\n \t lista = listFactory.getList(\"Lista Circular\");\n \t CircularList<Integer> list = (CircularList<Integer>) lista;\n // assert statements\n //Aquí se ejecutara nuestro test.\n \n assertEquals(0, list.size(), \"Se debe verificar que el list inicie vacío.\");\n list.addLast(10);\n list.addLast(5);\n int num2=list.removeLast();\n int num1= list.removeLast();\n int suma=calculadora.Calculate(num1,num2 , \"+\");\n int resta=calculadora.Calculate(num1,num2 , \"-\");\n int multiplicacion=calculadora.Calculate(num1,num2 , \"*\");\n int division=(int)(calculadora.Calculate(num1,num2 , \"/\"));\n assertEquals(15, suma, \"Se debe verificar que el resultado de la suma sea 15 y que funcione\");\n assertEquals(5, resta, \"Se debe verificar que el resultado de la resta sea 5 y que funcione\");\n assertEquals(2, division, \"Se debe verificar que el resultado de la division sea 2 y que funcione\");\n assertEquals(50, multiplicacion, \"Se debe verificar que el resultado de la multiplicacion sea 50 y que funcione\");\n }", "public boolean klic() {\n\t\tif(first.next.zacetniIndex!=0) {\r\n\t\t\tfirst.next.zacetniIndex = 0;\r\n\t\t\tfirst.next.koncniIndex = first.next.size-1;\r\n\t\t\t//ce je en element, nimamo vec praznega prostora\r\n\t\t\tif(first==last) prazno=0;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\tList prev = first.next;\r\n\t\tList el = first.next.next;\r\n\t\t\r\n\t\twhile(el!=null) {\r\n\t\t\tif(prev.koncniIndex!=el.zacetniIndex-1) {\r\n\t\t\t\t\r\n\t\t\t\tint razlika = el.zacetniIndex - prev.koncniIndex - 1;\r\n\t\t\t\tel.zacetniIndex = el.zacetniIndex - razlika;\r\n\t\t\t\tel.koncniIndex = el.koncniIndex - razlika;\r\n\t\t\t\t//ce pomeramo zadnega zmanjsujemo praznega prostora\r\n\t\t\t\tif(prev==last) prazno = prazno - razlika;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tprev=el;\r\n\t\t\tel=el.next;\r\n\t }\r\n\t\treturn false;\r\n\t}", "public void listar() {\n\n if (!vacia()) {\n\n NodoEnteroSimple temp = head;\n\n int i = 0;\n\n while (temp != null) {\n\n System.out.print(i + \".[ \" + temp.getValor() + \" ]\" + \" -> \");\n\n temp = temp.getSiguiente();\n\n i++;\n }\n }\n \n }", "@Test\n public void testEmptyStack() {\n ProgramStack ps = new ProgramStack();\n\n Assert.assertEquals(\"[]\", ps.toString());\n }", "@Test\n public void testPushPop(){\n ms=new MyStack();\n ms.push(2);\n ms.pop();\n assertTrue(ms.IsEmpty());\n }", "@Test\r\n public void testPushShouldReturnTrue() {\r\n stackInstance=new StackUsingLinkedList<Integer>();\r\n boolean actualOutput=stackInstance.push(4);\r\n assertEquals(true,actualOutput);\r\n }", "public void addExpList(Experiment e){ // bir method daha yazdim\r\n Node last = head; // listenin en sonuna ekleme yapiyor, gun bilgine bakmadan\r\n Node exp = new Node(e);\r\n\r\n if( head == null){ // hic eleman yoksa direk ekle.\r\n head = exp;\r\n }\r\n else{\r\n while( last.next != null ){ // son elemana kadar git.\r\n last = last.next;\r\n }\r\n last.next = exp; // son elemana ekle\r\n }\r\n }", "public void testMyStack() {\n\t\tMyStack<String> s = new MyStack<String>();\n\t\ts.push(\"1\");\n\t\ts.push(\"2\");\n\t\ts.push(\"3\");\n\t\ts.pop();\n\t\ts.push(\"4\");\n\t\ts.toString();\n\t\tSystem.out.println(\"MyStack size is: \" + s.size());\n\t}", "@Test\r\n public void testGetParentChainList_not_full_tree() {\r\n System.out.println(\"getParentChainList\");\r\n\r\n XmlCompoundElement books = new XmlDefaultElement(\"books\");\r\n\r\n List<XmlElement> result = XmlRoot.getParentChainList(books);\r\n assertNotNull(result);\r\n //\r\n // The list must contain a single element with a name 'books'\r\n //\r\n assertEquals(result.size(), 1);\r\n assertEquals(books, result.get(0));\r\n\r\n //\r\n // add another element\r\n //\r\n XmlElement book = new XmlDefaultTextElement(\"book\");\r\n books.addChild(book);\r\n\r\n // The list must contain three elements: \r\n // first - root tag with a name 'shop'\r\n // second - with a name 'books'\r\n // third - with a name 'book'\r\n //\r\n result = XmlRoot.getParentChainList(book);\r\n assertNotNull(result);\r\n assertEquals(result.size(), 2);\r\n assertEquals(books, result.get(0));\r\n assertEquals(book, result.get(1));\r\n }", "@Test\r\n public void testGetListaOrganizadores() {\r\n System.out.println(\"getListaOrganizadores\");\r\n ModeloListaOrganizadores instance = new ModeloListaOrganizadores(e.getListaOrganizadores());\r\n Organizador o =new Organizador(new Utilizador(\"teste\", \"[email protected]\", \"teste\", \"teste\", true, 5));\r\n instance.addElement(o);\r\n ListaOrganizadores expResult = instance.getListaOrganizadores();\r\n ListaOrganizadores result = instance.getListaOrganizadores();\r\n assertEquals(expResult, result);\r\n \r\n }", "static void dump(Stack stack) {\n String temp = \" stack = \";\n for (int i = stack.size() - 1; i >= 0; i--) {\n temp = temp + ((TreeNode) (stack.elementAt(i))).data + \" \";\n }\n System.out.println(temp);\n }", "private void structureListElement() {\n postBodyHTMLContent = postBodyHTMLContent.replaceAll(Data.LI_OPENING_REGEX_MATCHER, \"- \");\n\n // replace closing tag </li> with </br> to separate with other list item\n postBodyHTMLContent = postBodyHTMLContent.replaceAll(Data.LI_CLOSING_REGEX_MATCHER, \"<br>\");\n }", "@Test\n public void testPushAndPopD() {\n System.out.println(\"popC - Out of Order\");\n\n String elementOne = \"Bill\";\n String elementTwo = \"Steve\";\n String elementThree = \"Tim\";\n String elementFour = \"Dave\";\n\n //Stack<String> instance = new StackArrayImpl();\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n instance.push(elementOne);\n instance.push(elementTwo);\n instance.push(elementThree);\n\n int fourSize = instance.size();\n assertEquals(fourSize, 3);\n assertEquals(instance.isEmpty(), false);\n\n String resultThree = instance.pop();\n String resultTwo = instance.pop();\n\n instance.push(elementFour);\n String resultFour = instance.pop();\n\n String resultOne = instance.pop();\n\n assertEquals(elementOne, resultOne);\n assertEquals(elementTwo, resultTwo);\n assertEquals(elementThree, resultThree);\n assertEquals(elementFour, resultFour);\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public void testLst() {\n System.out.println(\"\");\n EcgCheck chk = EcgCheck.getInstance();\n System.out.println(\" Show TEstlist\");\n\n mail_lst.forEach(m -> {\n System.out.println(\"[\" + new String(chk.sha(m.getBytes())) + \"]\");\n });\n }", "@Test\n\tpublic void test1(){\n\t\tI_Stack<String> is = new I_Stack<String>();\n\t\tis.push(\"string1\");\n\t\tis.push(\"string2\");\n\t\tis.show(System.out);\n\t\t\n\t}", "@Test\n public void copyStackTest() {\n ResourceStack copiedStack = stack.copyStack();\n assertEquals(copiedStack.toString(), stack.toString());\n }", "@Test\n public void testPushCallTop(){\n ms = new MyStack();\n ms.push(1);\n ms.top();\n assertFalse(ms.IsEmpty());\n }", "@Test\n public void testModuloStackSize() {\n MainPanel mp = new MainPanel();\n ProgramArea pa = new ProgramArea();\n ProgramStack ps = new ProgramStack();\n\n ps.push(10);\n ps.push(3);\n\n ProgramExecutor pe = new ProgramExecutor(mp, ps, pa);\n\n pe.modulo();\n ps.pop();\n\n Assert.assertEquals(\"[]\", ps.toString());\n }", "public static void main(String[] args) {\n\t\tLinkedList<String> sujungtasSarasas = new LinkedList<String>();\n\t\t// i sarasa dedami\n\t\t \n\t\tsujungtasSarasas.add(\"vasaris\");\n\t\tsujungtasSarasas.add(\"kovas\");\n\t\tsujungtasSarasas.add(\"balandis\");\n\t\tsujungtasSarasas.add(\"geguze\");\n\t\tSystem.out.println(sujungtasSarasas);\n\t\t\n\t\t// idedame elementus i sarso i pradzia ir i\n\t\t// pabaigas\n\t\tsujungtasSarasas.addFirst(\"SAUSIS\");\n\t\tsujungtasSarasas.addLast(\"BIRZELIS\");\n\t\tSystem.out.println(sujungtasSarasas);\n\t\t\n\t\t// istriname pirma ir paskutini\n\t\t// elementus\n\t\tsujungtasSarasas.removeFirst();\n\t\tsujungtasSarasas.removeLast();\n\t\tSystem.out.println(sujungtasSarasas);\n\t\t\n\t\tSystem.out.println(sujungtasSarasas.removeFirst());\n\t\tSystem.out.println(sujungtasSarasas.removeLast());\n\t\tSystem.out.println(sujungtasSarasas);\n\t\tsujungtasSarasas.push(\"Rugpjutis\");\n\t\tSystem.out.println(sujungtasSarasas);\n\t\tsujungtasSarasas.pop();\n\t\tSystem.out.println(sujungtasSarasas);\n\t\tSystem.out.println(sujungtasSarasas.pop());\n//\t\t\n//\t\t// idedame ir istriname pagal indeksa \n//\t\tsujungtasSarasas.add(0, \"Dar vienas menuo\");\n//\t\tsujungtasSarasas.remove(2);// dar yra removeFirst() ir removeLast()\n//\t\t// metodai, // kurie istrina pirma ir paskutini elementus\n//\t\tSystem.out.println(sujungtasSarasas);\n//\t\t// grazina saraso pirmaji\n//\t\t// elementa ir ji istrina is saraso\n//\t\tString menuo = sujungtasSarasas.poll();\n//\t\tSystem.out.println(menuo);\n//\t\tSystem.out.println(sujungtasSarasas);\n//\t\t//\n//\t\t// grazina saraso pirmaji elementa ir ji istrina is saraso\n//\t\tmenuo = sujungtasSarasas.pollFirst();\n//\t\tSystem.out.println(menuo);\n//\t\tSystem.out.println(sujungtasSarasas);\n//\t\t\n//\t\t// grazina saraso pirmaji elementa ir ji istrina is saraso\n//\t\tmenuo = sujungtasSarasas.pollLast();\n//\t\tSystem.out.println(menuo);\n//\t\tSystem.out.println(sujungtasSarasas);\n\n\t}", "@Test\n public void testGetListaCidadao() {\n System.out.println(\"getListaCidadao\");\n Cidadao cid = new Cidadao(\"teste\", 999999999, \"@\", \"4490-479\", 1111);\n Reparticao instance = new Reparticao(\"porto\", 1111, 4490, new ArrayList<>());\n instance.addCidadao(cid);\n\n DoublyLinkedList<Cidadao> expResult = new DoublyLinkedList<>();\n expResult.addLast(cid);\n DoublyLinkedList<Cidadao> result = instance.getListaCidadao().getListaCidadao();\n assertEquals(expResult, result);\n }", "public static void main(String[] args) throws StackFullException, StackEmptyException {\n\t try {\n\t DiscardPile<Card> discardPile1 = null; \n\t\tdiscardPile1 = new DiscardPile<Card>(52, 0);// max is 52\n\t\tdiscardPile1.push(new Card(8));\n\t\tdiscardPile1.push(new Card(32));\n\t\tdiscardPile1.push(new Card(48));\t\t\n\t\tdiscardPile1.push(new Card(2));\n\t\tdiscardPile1.push(new Card(17));\n\t\tdiscardPile1.push(new Card(20)); //removeTopCard should remove all that's above\n\t\tdiscardPile1.push(new Card(25));\n\t\tdiscardPile1.push(new Card(50));\n\t\tdiscardPile1.push(new Card(19));\n\t\tdiscardPile1.push(new Card(41)); //10 Cards that must be popped\n\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\tCollections.reverse(discardPile1);\n\t\tfor(Card comi : discardPile1) { //for loop for objects\n\t\t\tSystem.out.println(comi);\n\t\t\t}\t\t\t\n\t }\n\t catch (StackFullException SFE) {\n\t System.out.println(\"StackFullException: \" + SFE.getMessage());\n}\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(20));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\t try {\n\t\t\tDiscardPile<Card> discardPile = null; \n\t\t\tdiscardPile = new DiscardPile<Card>(52, 0);\n\t\t\tdiscardPile.push(new Card(8));\n\t\t\tdiscardPile.push(new Card(32));\n\t\t\tdiscardPile.push(new Card(48));\t\t\n\t\t\tdiscardPile.push(new Card(2));\n\t\t\tdiscardPile.push(new Card(17));\n\t\t\tdiscardPile.push(new Card(20)); //removeTopCard should remove all that's above\n\t\t\tdiscardPile.push(new Card(25));\n\t\t\tdiscardPile.push(new Card(50));\n\t\t\tdiscardPile.push(new Card(19));\n\t\t\tdiscardPile.push(new Card(41)); //10 Cards that must be popped\n\t\t\t \n\t\t\t\n\t\t\tCard[] cardArr = discardPile.removeTopCard(new Card(50));\n\t\t\tfor(Card co : cardArr) { //for loop for objects\n\t\t\t\tSystem.out.println(co);\n\t\t\t\t}\t\t\n\t\t\tSystem.out.println(\"*********************************************************************************\"); \n\n\t\t }\n\t\t catch (StackFullException SFE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SFE.getMessage());\n\t\t }\n\t\t catch (StackEmptyException SEE) {\n\t\t \tSystem.out.println(\"StackFullException: \" + SEE.getMessage());\n\t\t }\n\n}", "@Test\n public void testPushAndPopC() {\n\n System.out.println(\"pushB - All Nulls\");\n String elementOne = null;\n String elementTwo = null;\n String elementThree = null;\n String elementFour = null;\n\n //Stack<String> instance = new StackArrayImpl();\n int emptySize = instance.size();\n assertEquals(emptySize, 0);\n assertEquals(instance.isEmpty(), true);\n\n instance.push(elementOne);\n instance.push(elementTwo);\n instance.push(elementThree);\n instance.push(elementFour);\n\n int fourSize = instance.size();\n assertEquals(fourSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String resultFour = instance.pop();\n String resultThree = instance.pop();\n String resultTwo = instance.pop();\n String resultOne = instance.pop();\n\n assertEquals(elementOne, resultOne);\n assertEquals(elementTwo, resultTwo);\n assertEquals(elementThree, resultThree);\n assertEquals(elementFour, resultFour);\n\n int zeroSize = instance.size();\n assertEquals(zeroSize, 0);\n assertEquals(instance.isEmpty(), true);\n\n String shouldBeNull = instance.pop();\n\n assertEquals(shouldBeNull, null);\n\n assertEquals(instance.size(), 0);\n assertEquals(instance.isEmpty(), true);\n\n }", "public void testDumpList() {\n \n String result = tester.dumpList(box); \n \n assertTrue(\"Wrong start\", result.startsWith(\"[item 0, item 1, item 2, item 3, item 4, item 5, \"));\n assertTrue(\"Wrong end\", result.endsWith(\", item 96, item 97, item 98, item 99]\"));\n }", "private void iniciarListas() {\n listaBebidas = new ElementoMenu[7];\n listaBebidas[0] = new ElementoMenu(1, \"Coca\");\n listaBebidas[1] = new ElementoMenu(4, \"Jugo\");\n listaBebidas[2] = new ElementoMenu(6, \"Agua\");\n listaBebidas[3] = new ElementoMenu(8, \"Soda\");\n listaBebidas[4] = new ElementoMenu(9, \"Fernet\");\n listaBebidas[5] = new ElementoMenu(10, \"Vino\");\n listaBebidas[6] = new ElementoMenu(11, \"Cerveza\");\n// inicia lista de platos\n listaPlatos = new ElementoMenu[14];\n listaPlatos[0] = new ElementoMenu(1, \"Ravioles\");\n listaPlatos[1] = new ElementoMenu(2, \"Gnocchi\");\n listaPlatos[2] = new ElementoMenu(3, \"Tallarines\");\n listaPlatos[3] = new ElementoMenu(4, \"Lomo\");\n listaPlatos[4] = new ElementoMenu(5, \"Entrecot\");\n listaPlatos[5] = new ElementoMenu(6, \"Pollo\");\n listaPlatos[6] = new ElementoMenu(7, \"Pechuga\");\n listaPlatos[7] = new ElementoMenu(8, \"Pizza\");\n listaPlatos[8] = new ElementoMenu(9, \"Empanadas\");\n listaPlatos[9] = new ElementoMenu(10, \"Milanesas\");\n listaPlatos[10] = new ElementoMenu(11, \"Picada 1\");\n listaPlatos[11] = new ElementoMenu(12, \"Picada 2\");\n listaPlatos[12] = new ElementoMenu(13, \"Hamburguesa\");\n listaPlatos[13] = new ElementoMenu(14, \"Calamares\");\n// inicia lista de postres\n listaPostres = new ElementoMenu[15];\n listaPostres[0] = new ElementoMenu(1, \"Helado\");\n listaPostres[1] = new ElementoMenu(2, \"Ensalada de Frutas\");\n listaPostres[2] = new ElementoMenu(3, \"Macedonia\");\n listaPostres[3] = new ElementoMenu(4, \"Brownie\");\n listaPostres[4] = new ElementoMenu(5, \"Cheescake\");\n listaPostres[5] = new ElementoMenu(6, \"Tiramisu\");\n listaPostres[6] = new ElementoMenu(7, \"Mousse\");\n listaPostres[7] = new ElementoMenu(8, \"Fondue\");\n listaPostres[8] = new ElementoMenu(9, \"Profiterol\");\n listaPostres[9] = new ElementoMenu(10, \"Selva Negra\");\n listaPostres[10] = new ElementoMenu(11, \"Lemon Pie\");\n listaPostres[11] = new ElementoMenu(12, \"KitKat\");\n listaPostres[12] = new ElementoMenu(13, \"IceCreamSandwich\");\n listaPostres[13] = new ElementoMenu(14, \"Frozen Yougurth\");\n listaPostres[14] = new ElementoMenu(15, \"Queso y Batata\");\n }", "public void MostrarListas (){\n Nodo recorrer=inicio; // esto sirve para que el elemento de la lista vaya recorriendo conforme se inserta un elemento\r\n System.out.println(); // esto nos sirve para dar espacio a la codificacion de la lista al imprimir \r\n while (recorrer!=null){ // esta secuencia iterativa nos sirve para repetir las opciones del menu\r\n System.out.print(\"[\" + recorrer.dato +\"]--->\");\r\n recorrer=recorrer.siguiente;\r\n }\r\n }", "private void uminus() throws Exception{\n\t\tif(stackEmpty()) throw new Exception(\"Stack ist leer\");\n\t\telse{\n\t\t\tvalue1=stack.pop();\n\t\t\tstack.push(value1*(-1));\n\t\t}\n\t\t\n\t}", "@Override \n\tpublic String toString() {\n\t\t\n\t\tSystem.out.println(\"New Stack\");\n\t\t\n\t\tfor(int i = 0; i < arraySize; i++) {\n\t\t\tSystem.out.println(\"stack: \" + list[i].toString());\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\");// Print and empty new line\n\t\t\n\t\treturn \"\";\n\t}", "@Test(enabled = true, dependsOnMethods = {\"remove\"}, expectedExceptions = NullPointerException.class)\n\tpublic void getNullOnNull() {\n\t\tassert stack.getLast().getNext() == node5;\n\t}", "public ListaDuplamenteEncadeada(){\r\n\t\t\r\n\t}", "void evalua(String expresion){\n Queue entrada=stringtoChars(expresion); //entrada cola\r\n Queue salida= new Queue();//salida cola\r\n Stack pila=new Stack(); //pila\r\n char caracter;\r\n int cont=0;\r\n \r\n while((caracter=entrada.dequeue())!=0){//mientras que\r\n System.out.println(\"dequeue \"+caracter);\r\n System.out.println(\"contador \"+cont);\r\n if(isLetra(caracter)){//si es una letra\r\n salida.queue(caracter);//inserta a la cola de salida\r\n }else{//si es un signo ++++++++\r\n System.out.println(\"entra\");\r\n if(pila.isPilaVacia()){//si la pila está vacía\r\n pila.push(caracter);//inserta el caracter\r\n }else{//falta checar los () si no es vacia\r\n if(peso(caracter)==0){\r\n char c;\r\n while((c=pila.pop())!='('){//mientras que sacar de la pila es diferente de cero\r\n salida.queue(c); // a la salida insertar los caracteres\r\n } \r\n \r\n }else{\r\n char signo=pila.pop();\r\n if(signo=='('){\r\n pila.push(signo);\r\n pila.push(caracter);\r\n pila.imprimir();\r\n }else{\r\n //signo es igual al primer caracter de la pila\r\n //signo=adentro\r\n //caracter=afuera\r\n if(isAfuerMayorDentro(signo, caracter)){//si el que esta afuera es mayor que el de adentro\r\n\r\n // pila.push(caracter);//insertamos el que estaba adentro\r\n pila.push(signo);//insertamos el afuera\r\n pila.push(caracter);//insertamos el que estaba adentro\r\n pila.imprimir(); \r\n }else{//si el de adentro es mayor que el de afuera\r\n salida.queue(signo);//a la salida insertamos el signo afyera\r\n pila.push(caracter);//a la pila insertamos el que estaba \r\n pila.imprimir();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n cont++;\r\n }\r\n while((caracter=pila.pop())!=0){//mientras que sacar de la pila es diferente de cero\r\n salida.queue(caracter); // a la salida insertar los caracteres\r\n }\r\n while((caracter= salida.dequeue())!=0){//mientras que sacar de la salida es diferente de cero\r\n System.out.print(caracter);//imprimir los caracteres\r\n }\r\n \r\n }", "public void mostrarLista() {\n\n Nodo recorrer = temp;\n while (recorrer != null) {\n\n System.out.println(\"[ \" + recorrer.getDato() + \"]\");\n recorrer = recorrer.getSiguiente();\n\n }\n\n }", "public void listar(){\r\n // Verifica si la lista contiene elementoa.\r\n if (!esVacia()) {\r\n // Crea una copia de la lista.\r\n Nodo aux = inicio;\r\n // Posicion de los elementos de la lista.\r\n int i = 0;\r\n // Recorre la lista hasta el final.\r\n while(aux != null){\r\n // Imprime en pantalla el valor del nodo.\r\n System.out.print(i + \".[ \" + aux.getValor() + \" ]\" + \" -> \");\r\n // Avanza al siguiente nodo.\r\n aux = aux.getSiguiente();\r\n // Incrementa el contador de la posión.\r\n i++;\r\n }\r\n }\r\n }", "public interface Stack<E> {\n\n void push(E e) throws FullStackException;\n E pop() throws EmptyStackException; //devuelves / sacas un Elemento\n int size();\n}", "@Test\n public void addAllTypesTest(){\n stack.addToAllTypes(stack2);\n ResourceStack stack3 = new ResourceStack(3, 5, 7, 9);\n assertEquals(stack3.toString(), stack.toString());\n\n stack.addToAllTypes(stack2);\n stack3 = new ResourceStack(5, 8, 11, 14);\n assertEquals(stack3.toString(), stack.toString());\n }", "public void ouvrirListe(){\n\t\n}", "static void stack_pop(Stack<Integer> stack)\r\n\t{\r\n\t\t\r\n\t\tSystem.out.print(\"Pop : \");\r\n\t\tfor(int i=0;i<5;i++)\r\n\t\t{\r\n\t\t\tInteger dataElement=(Integer)stack.pop();\r\n\t\t\tSystem.out.print(\" \"+ dataElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public Stack pilaEliminaDatos( Stack pila )\n {\n // Verificamos que la pila no este vacia para eliminar datos\n if (!pila.isEmpty())\n {\n this.imprime(\"Se ha eliminado este elemento ->\" + pila.peek() +\"<- de la pila\");\n pila.pop();\n }\n else\n {\n this.imprime(\"La pila esta vacia, no se pueden eliminar datos\");\n }\n\n return pila;\n }", "@Test\n public void testPartieContinue(){\n Joueur NORD = new Joueur(\"NORD\");\n Joueur SUD = new Joueur(\"SUD\");\n assertTrue(Regles.partieContinue(NORD.clone(), SUD.clone(), 0,false));\n // avec des bases injouables\n NORD.setAscendant(61);\n NORD.setDescendant(0);\n SUD.setAscendant(61);\n SUD.setDescendant(0);\n assertFalse(Regles.partieContinue(NORD.clone(), SUD.clone(), 0, false));\n // avec un jeu vide\n NORD.jeu.clear();\n assertFalse(Regles.partieContinue(NORD.clone(), SUD.clone(), 0, false));\n\n SUD.jeu.clear();\n NORD.jeu.add(0,59);\n NORD.jeu.add(1,58);\n NORD.setAscendant(57);\n NORD.setDescendant(2);\n SUD.setAscendant(1);\n SUD.setDescendant(60);\n assertTrue(Regles.partieContinue(NORD.clone(), SUD.clone(), 0,false));\n NORD.setAscendant(58);\n assertFalse(Regles.partieContinue(NORD.clone(), SUD.clone(), 0,false));\n //cas spécifique\n NORD.setAscendant(49);\n NORD.setDescendant(2);\n SUD.setAscendant(53);\n SUD.setDescendant(9);\n SUD.jeu.add(0,34);\n SUD.jeu.add(1,44);\n SUD.jeu.add(2,38);\n SUD.jeu.add(3,6);\n SUD.jeu.add(4,41);\n SUD.jeu.add(5,39);\n assertTrue(Regles.partieContinue(SUD.clone(), NORD.clone(), 0, false));\n\n\n }", "public Stack<String> getCasillasPorVisitar(){\n\t\treturn casillasPorVisitar;\n\t}", "public void verifylistcreated(String orderrecape1){\r\n\r\n\t\tString order = getValue(orderrecape1);\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Created List should be dispalyed\");\r\n\t\ttry{\r\n\r\n\t\t\tif(getAndVerifyPartialText(locator_split(\"verifycurrentlist\"),order)) { \r\n\t\t\t\twaitForPageToLoad(20);\r\n\t\t\t\tReporter.log(\"PASS_MESSAGE:- Created List is Displayed\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- orderrecape is not displayed \"+elementProperties.getProperty(\"verifycurrentlist\"));\r\n\t\t\tthrow new NoSuchElementException(\"The element with \" + elementProperties.getProperty(\"verifycurrentlist\").toString().replace(\"By.\", \" \") + \" not found\");\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "@Test\n\tpublic void testAfficheListe() {\n\t\tList<Professeur> list = new ArrayList<Professeur>();\n\t\tlist.add(prof);\n\t}" ]
[ "0.6979757", "0.68936217", "0.6098149", "0.6088722", "0.5886073", "0.5866866", "0.5749474", "0.5708746", "0.56684655", "0.5664044", "0.56469136", "0.56115913", "0.56045103", "0.56032807", "0.5589689", "0.5527721", "0.5520961", "0.5466615", "0.5440436", "0.5438404", "0.54374635", "0.5427633", "0.5421465", "0.5415537", "0.5409374", "0.54005986", "0.53678316", "0.5361297", "0.5356418", "0.5354391", "0.53455657", "0.5342049", "0.53352916", "0.5333627", "0.53255993", "0.5322626", "0.5320857", "0.53108025", "0.52988684", "0.52727073", "0.5265541", "0.5251957", "0.52443504", "0.5231317", "0.5230785", "0.5224976", "0.52229935", "0.52205175", "0.52169126", "0.5207702", "0.52072906", "0.51943785", "0.5187577", "0.51871467", "0.51831394", "0.5181082", "0.5164701", "0.51629925", "0.5155227", "0.5154772", "0.5154685", "0.5153002", "0.51526386", "0.51512855", "0.5144333", "0.5140477", "0.5135394", "0.51317626", "0.512366", "0.51232624", "0.51131934", "0.5112216", "0.51017016", "0.51002866", "0.5099612", "0.50975513", "0.5088684", "0.5082024", "0.50813895", "0.5079978", "0.5078685", "0.507689", "0.5072801", "0.5068913", "0.5065196", "0.5055757", "0.5048126", "0.5042867", "0.5037781", "0.5036404", "0.5035334", "0.5034366", "0.5021639", "0.5007617", "0.5003172", "0.5001163", "0.4991227", "0.49881297", "0.4987874", "0.49844554" ]
0.50675637
84
chiamati dal controller Chiede all'utente su quale corsia vuole scommettere,quanto, e se piazzato o vincente
String[] chiediScommessa();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void estiloAcierto() {\r\n\t\t /**Bea y Jose**/\t\t\r\n \r\n\t}", "private void inToTrinh(HttpServletRequest request, ApplicationContext appConText, GiaHanForm giaHanForm, HttpServletResponse reponse) throws Exception {\r\n\t\tCuocTtktService service = new CuocTtktService();\r\n\t\tString cuocTtktId=giaHanForm.getIdCuocTtKt();\r\n\t\tSystem.out.println(\"Id cuoc ttkt : \"+cuocTtktId );\r\n\t\tif(!Formater.isNull(cuocTtktId))\r\n\t\t{\r\n\t\t\tif(\"4\".equals(service.getDonVerionTtkt(appConText, cuocTtktId)))\r\n\t\t\t{\r\n\t\t\t\tinToTrinhv4(request, reponse, giaHanForm, appConText);\r\n\t\t\t}\r\n\t\t\telse inToTrinhv3(request, reponse, giaHanForm, appConText);\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tif(\"4\".equals(Constants.APP_DEP_VERSION))\r\n\t\t\t\tinToTrinhv4(request, reponse, giaHanForm, appConText);\r\n\t\t\telse inToTrinhv3(request, reponse, giaHanForm, appConText);\r\n\t\t}\r\n\t}", "@RequestMapping(\"/tyhjenna\")\n public String poistaKaikkiTuotteet() {\n ostoskoriService.tyhjennaOstoskori();\n return \"redirect:/ostoskori\";\n }", "@Override\r\n\tpublic void hacerSonido() {\n\t\tSystem.out.print(\"miau,miau -- o depende\");\r\n\t\t\r\n\t}", "public void 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}", "@RequestMapping(value = \"/commandesMoisEnCours\", method = RequestMethod.GET)\r\n\t\t public ModelAndView commandesMoisEnCours(ModelMap model) {\n\t\t \tAuthentication auth =SecurityContextHolder.getContext().getAuthentication();\r\n\t\t \tUser user = interfaceService.findUserByMail(auth.getName());\r\n\t\t \t//Parameters.userconnect =user;\r\n\t\t \tParameters.userconnect=user; \r\n\t\t \t\r\n\t\t \tif(user.getGroup() !=null)\r\n\t\t \t\tParameters.setGroup(user.getGroup());\r\n\t\t \telse\r\n\t\t \t\tParameters.setGroup(null);\r\n\t\t \tif(user.getRevendeur()!=null && user.getRevendeur().getSociete()!=null)\r\n\t\t \t\tParameters.setSociete(user.getRevendeur().getSociete());\r\n\t\t \tif(user.getProfil().getId()==3){\r\n\t\t \t\t\tList<Revendeur> revendeurs=interfaceService.findAllRevendeurByMail(user.getLogin());\r\n\t\t \t\tParameters.setSociete(revendeurs.get(0).getSociete());\r\n\t\t \t\tParameters.revendeurUse=revendeurs.get(0);\r\n\t\t \t}\r\n\t\t \t//List<Produit> produits= iProductService.getListProductByFrns();\r\n\t\t \tList<Produit> produits = interfaceService.findAllProduit();\r\n\t\t \tmodel.addAttribute(\"produits\", produits);\r\n\t\t List<EtatCommande> etatCommandeList = new ArrayList<EtatCommande>();\r\n\t\t etatCommandeList = interfaceService.findAllEtatCommande();\r\n\t\t /* if(Parameters.group!=null)\r\n\t\t \tmodel.addAttribute(\"get_frns_list\", interfaceService.getListFrnst(Parameters.group));\r\n\t\t else*/\r\n\t\t \tmodel.addAttribute(\"get_frns_list\", interfaceService.getListFrnst());\r\n\t\t return new ModelAndView(\"accueil/commandesMoisEnCours\", new ModelMap(etatCommandeList));\r\n\t\t }", "public void orina() {\n System.out.println(\"Que bien me quedé! Deposito vaciado.\");\n }", "public void jugar_con_el() {\n System.out.println(nombre + \" esta jugando contigo :D\");\n }", "private void inQuyetDinh(HttpServletRequest request, ApplicationContext appConText, GiaHanForm giaHanForm, HttpServletResponse reponse) throws Exception {\r\n\t\tCuocTtktService service = new CuocTtktService();\r\n\t\tString cuocTtktId=giaHanForm.getIdCuocTtKt();\r\n\t\tSystem.out.println(\"Id cuoc ttkt : \"+cuocTtktId );\r\n\t\tif(!Formater.isNull(cuocTtktId))\r\n\t\t{\r\n\t\t\tif(Constants.DON_VERSION.equals(service.getDonVerionTtkt(appConText, cuocTtktId)))\r\n\t\t\t{\r\n\t\t\t\tinQuyetDinhv4(request, reponse, giaHanForm, appConText);\r\n\t\t\t}\r\n\t\t\telse inQuyetDinhv3(request, reponse, giaHanForm, appConText);\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tif(Constants.DON_VERSION.equals(Constants.APP_DEP_VERSION))\r\n\t\t\t\tinQuyetDinhv4(request, reponse, giaHanForm, appConText);\r\n\t\t\telse inQuyetDinhv3(request, reponse, giaHanForm, appConText);\r\n\t\t}\r\n\t}", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di friggere un uovo\";\r\n }", "public PacienteController() {\n\t\t\n\t\tatualizarTela();\n\t\t}", "@Override\n public void comunicar() {\n System.out.println(\"miauuuu\");\n\n }", "public void fecharConta() {\n\t\tcliente.setConta(new Conta());\r\n\t\tRepositorioCliente repositorioCliente = new FabricaRepositorio().getRepCliente();\r\n\t\trepositorioCliente.editar((ClienteIndividual)cliente);\r\n//\t\tGerenciadorContaImpl contaImpl = new GerenciadorContaImpl();\r\n//\t\ttry {\r\n//\t\t\tcontaImpl.fecharConta(cliente);\r\n//\t\t} catch (OperacaoInvalidaException e) {\r\n//\t\t\te.printStackTrace();\r\n//\t\t}\r\n\t}", "public static void saludo(){\n System.out.println(\"Bienvenido al Sistema\");\n }", "public String comunica() {\r\n// ritorna una stringa\r\n// posso usare il metodo astratto \r\n return msg + AggiungiQualcosa();\r\n }", "public void choixduJeu() {\n afficheMessage(\"*- Choisissez le jeu auquel vous voulez jouer : \\n- R pour Recherche +/-\\n- M pour Mastermind\");\n choixJeu = Console.saisieListeDeChoix(\"R|M\");\n afficheMessage(\"*- Choisissez le mode de jeu auquel vous voulez jouer :\\n- C pour Challenger,\\n- U pour Duel\\n- D pour Defense\");\n choixModeJeu = Console.saisieListeDeChoix(\"C|U|D\");\n }", "public void Pedircarnet() {\n\t\tSystem.out.println(\"solicitar carnet para verificar si es cliente de ese consultorio\");\r\n\t}", "private static void cajas() {\n\t\t\n\t}", "public void sincronizza() {\n boolean abilita;\n\n super.sincronizza();\n\n try { // prova ad eseguire il codice\n\n /* abilitazione bottone Esegui */\n abilita = false;\n if (!Lib.Data.isVuota(this.getDataInizio())) {\n if (!Lib.Data.isVuota(this.getDataFine())) {\n if (Lib.Data.isSequenza(this.getDataInizio(), this.getDataFine())) {\n abilita = true;\n }// fine del blocco if\n }// fine del blocco if\n }// fine del blocco if\n this.getBottoneEsegui().setEnabled(abilita);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "@Override\n public String comer(String c)\n {\n c=\"Gato No puede Comer Nada\" ;\n \n return c;\n }", "@Override\n\tpublic void coba() {\n\t\t\n\t}", "public void pedirValoresCabecera(){\n \r\n \r\n \r\n \r\n }", "public void asetaTeksti(){\n }", "@RequestMapping(value = \"/chuyenthembaotri\", method = RequestMethod.GET, produces = \"application/x-www-form-urlencoded;charest=UTF-8\")\n\tprivate String chuyenThemBaoTri(@RequestParam(name = \"id\", required = false) int maXuat, Model model) {\n\t\tmodel.addAttribute(\"maXuatThemLSBT\", baoTriDAO.layMaXuat(maXuat));\n\t\tmodel.addAttribute(\"formThem\", new TbLichSuBaoTri());\n\t\tmodel.addAttribute(\"danhsachtinhtrang\", tinhTrangThietBiDAO.layTinhTrang());\n\t\tmodel.addAttribute(\"danhsachkythuatvien\", nhanVienDAO.layDanhSachKyThuatVien());\n\t\treturn \"bt-bao-tri-them\";\n\t}", "@Override\n\tpublic void maasHesapla() {\n\t\tSystem.out.println(\"isciler icin maas 5000 tl \");\n \t\t\n\t}", "@RequestMapping(value = \"/kqdanhgia/{id}\",method = RequestMethod.GET)\r\n\tpublic String showkqdanhgia(@PathVariable(\"id\") String userb, Model model , HttpServletRequest request) {\n\t\tBangDanhGia bdg = choose.getBgd();\r\n\r\n\t\tif (bdg == null) {\r\n\t\t\tmodel.addAttribute(\"message\", \"Chưa ch�?n bảng đánh giá\");\r\n\t\t\treturn \"showkqdanhgia\";\r\n\t\t}\r\n\t\tmodel.addAttribute(\"bangdanhgia\", bdg);\r\n\t\tList<LoaiCauHoi> lchs = new ArrayList<LoaiCauHoi>(bdg.getLchs());\r\n\t\tCollections.sort(lchs);\r\n\t\tmodel.addAttribute(\"lchs\", lchs);\r\n\t\tmodel.addAttribute(\"nguoidang\", userb);\r\n\t\tList<BangDanhGiaKq> dgkqs = bdgkqService.findByUserb(userb);\r\n\t\tList<DisplayResult> kqs = new ArrayList<DisplayResult>();\r\n\t\tfor (CauHoi cauHoi : bdg.getCauhois()) {\r\n\t\t\tDisplayResult kq = new DisplayResult();\r\n\t\t\tkq.setCh(cauHoi);\r\n\t\t\tkq.setMch(cauHoi.getId());\r\n\t\t\tint a = 0, b = 0, c = 0, d = 0;\r\n\t\t\tfor (BangDanhGiaKq bangDanhGiaKq : dgkqs) {\r\n\t\t\t\tif (bangDanhGiaKq.getLoaiBang().getId() == bdg.getId()) {\r\n\t\t\t\t\tfor (CauHoiKq chkq : bangDanhGiaKq.getCauhoikqs()) {\r\n\t\t\t\t\t\tif (chkq.getCauhoi().getId().equals(cauHoi.getId())) {\r\n\t\t\t\t\t\t\tswitch (chkq.getKetqua()) {\r\n\t\t\t\t\t\t\tcase 'A':\r\n\t\t\t\t\t\t\t\ta++;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'B':\r\n\t\t\t\t\t\t\t\tb++;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'C':\r\n\t\t\t\t\t\t\t\tc++;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 'D':\r\n\t\t\t\t\t\t\t\td++;\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}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tkq.setNumA(((double) a / dgkqs.size()) * 100);\r\n\t\t\tkq.setNoidungA(\"Rất Tốt : \" + kq.getNumA() + \"%\");\r\n\t\t\tkq.setNumB(((double) b / dgkqs.size()) * 100);\r\n\t\t\tkq.setNoidungB(\"Tốt : \" + kq.getNumB() + \"%\");\r\n\t\t\tkq.setNumC(((double) c / dgkqs.size()) * 100);\r\n\t\t\tkq.setNoidungC(\"Bình Thường : \" + kq.getNumC() + \"%\");\r\n\t\t\tkq.setNumD(((double) d / dgkqs.size()) * 100);\r\n\t\t\tkq.setNoidungD(\"Chưa Tốt : \" + kq.getNumD() + \"%\");\r\n\t\t\tkqs.add(kq);\r\n\t\t}\r\n\t\tlog.error(\"BangDanhGiakq : \" + dgkqs.toString());\r\n\t\tlog.info(\"bang ket qua : \" + kqs.toString());\r\n\t\tmodel.addAttribute(\"kqs\", kqs);\r\n\t\treturn \"showkqdanhgia\";\r\n\t}", "public static void viaggia(List<Trasporto> lista,Taxi[] taxi,HandlerCoR h) throws SQLException\r\n {\n Persona app = (Persona) lista.get(0);\r\n /* ARGOMENTI handleRequest\r\n 1° Oggetto Request\r\n 2° Array Taxi per permettere la selezione e la modifica della disponibilità\r\n */\r\n h.handleRequest(new RequestCoR(app.getPosPartenza(),app.getPosArrivo(),taxi),taxi); \r\n SceltaPercorso tempo = new SceltaPercorso();\r\n SceltaPercorso spazio = new SceltaPercorso();\r\n tempo.setPercorsoStrategy(new timeStrategy());\r\n spazio.setPercorsoStrategy(new lenghtStrategy());\r\n for(int i=0;i<5;i++)\r\n if(!taxi[i].getLibero())\r\n {\r\n if(Scelta.equals(\"veloce\"))\r\n {\r\n JOptionPane.showMessageDialog(null,\"Hai Scelto il Percorso più Veloce...\");\r\n Connessione conn;\r\n conn = Connessione.getConnessione();\r\n String query = \"Delete from CRONOCORSE where PASSEGGERO = ? \";\r\n try (PreparedStatement ps = conn.connect.prepareStatement(query)) {\r\n ps.setString(1, app.getNome());\r\n ps.executeUpdate();\r\n ps.close();\r\n JOptionPane.showMessageDialog(null,\"Cliente in viaggio...\\n\"+app.getNome()+\" è arrivato a destinazione!\\nPrezzo Corsa: \"+taxi[i].getPrezzoTotale()+\"€\");\r\n \r\n \r\n }catch(SQLException e){JOptionPane.showMessageDialog(null,e);}\r\n tempo.Prenota(taxi[i]); \r\n app.setPosPartenza();\r\n taxi[i].setPosizione(app.getPosArrivo());\r\n taxi[i].setStato(true);\r\n taxi[i].clear();\r\n lista.set(0,app);\r\n i=5;\r\n \r\n } else\r\n \r\n {\r\n JOptionPane.showMessageDialog(null,\"Hai Scelto il Percorso più Breve...\");\r\n Connessione conn;\r\n conn = Connessione.getConnessione();\r\n String query = \"Delete from CRONOCORSE where PASSEGGERO = ? \";\r\n try (PreparedStatement ps = conn.connect.prepareStatement(query)) {\r\n ps.setString(1, app.getNome());\r\n ps.executeUpdate();\r\n ps.close();\r\n JOptionPane.showMessageDialog(null,\"Cliente in viaggio...\\n\"+app.getNome()+\" è arrivato a destinazione!\\nPrezzo Corsa: \"+taxi[i].getPrezzoTotale()+\"€\");\r\n \r\n \r\n }catch(SQLException e){JOptionPane.showMessageDialog(null,e);}\r\n spazio.Prenota(taxi[i]); \r\n app.setPosPartenza();\r\n taxi[i].setPosizione(app.getPosArrivo());\r\n taxi[i].setStato(true);\r\n taxi[i].clear();\r\n lista.set(0,app);\r\n i=5;\r\n \r\n \r\n }\r\n }\r\n \r\n }", "@Override\n public void cantidad_Ataque(){\n ataque=5+2*nivel+aumentoT;\n }", "@Override\r\n\tpublic void action() {\n\t\tMessageTemplate mt=MessageTemplate.or(MessageTemplate.MatchContent(\"comida\"), MessageTemplate.MatchContent(\"bebida\"));\r\n ACLMessage msg = myAgent.receive(mt);\r\n if(msg!=null){\r\n \tif(msg.getContent().compareTo(\"comida\")==0){\r\n \t\tif(Comida>=5){\r\n \t\t\tACLMessage reply = msg.createReply();\r\n reply.setContent(\"Si\");\r\n System.out.println(myAgent.getLocalName()+\":Si, gracias tengo hambre todavia\"); \r\n myAgent.send(reply);\r\n Comida=Comida-5;\r\n \t\t}\r\n \t\telse{\r\n \t\t\tACLMessage reply = msg.createReply();\r\n reply.setContent(\"No\");\r\n System.out.println(myAgent.getLocalName()+\":No gracias\"); \r\n myAgent.send(reply);\r\n \t\t} \r\n \t}\r\n \telse if(msg.getContent().compareTo(\"bebida\")==0){\r\n \t\tif(Bebida>=5){\r\n \t\t\tACLMessage reply = msg.createReply();\r\n reply.setContent(\"Si\");\r\n System.out.println(myAgent.getLocalName()+\":Si, gracias tengo sed todavia\"); \r\n myAgent.send(reply);\r\n Bebida=Bebida-5;\r\n \t\t}\r\n \t\telse{\r\n \t\t\tACLMessage reply = msg.createReply();\r\n reply.setContent(\"No\");\r\n System.out.println(myAgent.getLocalName()+\":No gracias\"); \r\n myAgent.send(reply);\r\n \t\t} \r\n \t}\r\n }\r\n if (Comida==0 && Bebida==0){\r\n \tmyAgent.doDelete();\r\n }\r\n\t}", "public void atakuj() {\n\n System.out.println(\"to metoda atakuj z klasy Potwor \");\n\n }", "public abstract String dohvatiKontakt();", "public void reabrirContrato() {\n int i;\n if (hospedesCadastrados.isEmpty()) {\n System.err.println(\"Nao existe hospedes cadastrados\\n\");\n } else {\n listarHospedes();\n int cpf = verifica();\n for (i = 0; i < hospedesCadastrados.size(); i++) {\n if (hospedesCadastrados.get(i).getCpf() == cpf) {//hospede\n if (hospedesCadastrados.get(i).getContrato().isSituacao()) {//verifica se o contrato já estpa aberto\n System.err.println(\"O contrado desse hospede já encontra-se aberto\");\n\n } else {//caso o contrato encontre-se fechado\n hospedesCadastrados.get(i).getContrato().setSituacao(true);\n System.err.println(\"Contrato reaberto, agora voce pode reusufruir de nossos servicos!\");\n }\n }\n }\n }\n }", "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 void Ordenamiento() {\n\n\t}", "public void faiLavoro(){\n System.out.println(\"Scrivere 1 per Consegna lunga\\nSeleziona 2 per Consegna corta\\nSeleziona 3 per Consegna normale\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n soldiTam += 500;\n puntiVita -= 40;\n puntiFame -= 40;\n puntiFelicita -= 40;\n }\n case 2 -> {\n soldiTam += 300;\n puntiVita -= 20;\n puntiFame -= 20;\n puntiFelicita -= 20;\n }\n case 3 -> {\n soldiTam += 100;\n puntiVita -= 10;\n puntiFame -= 10;\n puntiFelicita -= 10;\n }\n }\n checkStato();\n }", "@Override\n\tpublic void concentrarse() {\n\t\tSystem.out.println(\"Se centra en sacar lo mejor del Equipo\");\n\t\t\n\t}", "public void sacarPaseo(){\r\n\t\t\tSystem.out.println(\"Por las tardes me saca de paseo mi dueño\");\r\n\t\t\t\r\n\t\t}", "private void suono(int idGioc) {\n\t\tpartita.effettoCasella(idGioc);\n\t}", "private void iniciarNovaVez() {\n this.terminouVez = false;\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tgetControleur(). saisirParution() ;}", "public void setContrasena(String contrasena) {this.contrasena = contrasena;}", "private void esqueceu() {\n\n //Declaração de Objetos\n Veterinario veterinario = new Veterinario();\n\n //Declaração de Variaveis\n int crmv;\n String senha;\n\n //Atribuição de Valores\n try {\n crmv = Integer.parseInt(TextCrmv.getText());\n senha = TextSenha.getText();\n \n //Atualizando no Banco\n veterinario.Vdao.atualizarAnimalSenhaPeloCrmv(senha, crmv);\n \n } catch (NumberFormatException ex) {\n JOptionPane.showMessageDialog(null, \"APENAS NUMEROS NO CRMV!\");\n }\n JOptionPane.showMessageDialog(null, \"SUCESSO AO ALTERAR SENHA!\");\n\n }", "public void ciudad(){\n System.out.println(\"ciudad londres\");\n }", "public void action() {\n\t\t\ttreinador.Correu();\r\n\t\t\ttreinador.Perdeu();\r\n\t\t\treturn;\r\n\t\t}", "public String soumettreRv(){\n\t\t// Traitement ici ...\n\t\t// Un exemple d'utilisation du service\n\t\tserviceRv.ajouterRendezVous(this.getRv());\n\t\treturn REDIRECT;\n\t}", "public void vlozNaUcet(int ciastka, TerminovanyUcet terminovanyUcet) {\r\n\t\tcislo += ciastka;\r\n\t\tterminovanyUcet.setVklad(ciastka);\r\n\t\tSporiaciUcet.super.setVyber(ciastka);\r\n\t}", "private String elaboraIncipit() {\n String testo = VUOTA;\n\n if (usaHeadIncipit) {\n testo += elaboraIncipitSpecifico();\n testo += A_CAPO;\n }// fine del blocco if\n\n return testo;\n }", "public Result homeEst() {\n String correo = ctx().session().get(\"correo\");\n // System.out.println(\"correo\" + correo);\n if (correo!=null) {\n // System.out.println(\"entra aqui 2\");\n RegistroUsuario user = RegistroUsuario.findByUsername(correo);//busca el coreo\n // System.out.println(\"user\"+user);\n if (user != null) {\n // System.out.println(\"entra aqui 3\");\n return redirect(routes.ControllerEstudiante.listarFormularioEstudiante());//revisar este render\n //linea 34 error de anios silvia ya lo arreglo :v\n } else {\n // System.out.println(\"entra aqui 4\");\n session().clear();\n }\n }\n // session().clear();\n // System.out.println(\"entra aqui 5\");\n return ok(iniciarSesionEstudiante.render(\"Error\",form(ApplicationEstudiante.Login.class)));\n }", "public void comer(){\r\n\t\tSystem.out.println(\"He comido\");\r\n\t}", "public void podaj_cene() {\n\t\tdo{System.out.print(\"Podaj cene średniej pizzy:\");\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner odczyt= new Scanner(System.in);\n\t\tcena= odczyt.nextInt();\n\t\tif(cena<6){\n\t\t\tSystem.out.println(\"Zbyt niska cena!\");\n\t\t }\n\t\t}while(cena<6);\n\t\t}", "public static void traduitSiteAnglais() {\n\t\t\n\t}", "public void pridejNovePivo ()\n\t{\n\t\n\t\tpivo = pivo + PRODUKCE;\n\t\t\n\t}", "@Override\r\n\t/**\r\n\t * Actionne l'effet de la carte.\r\n\t * \r\n\t * @param listejoueur\r\n\t * \t\t\tLa liste des joueurs de la partie.\r\n\t * @param cible\r\n\t * \t\t\tLa joueur contre qui l'effet sera joué.\r\n\t * @param table\r\n\t * \t\t\tCollection de cartes situées au centre de la table de jeu.\r\n\t * @param carte\r\n\t * \t\t\tLa carte qui joue l'effet.\r\n\t * @param j\r\n\t * \t\t\tLe joueur qui joue la carte.\r\n\t * @param collection\r\n\t * \t\t\tLe deck de cartes.\r\n\t * @param tourjoueur\r\n\t * \t\t\tLa liste des joueurs selon l'ordre de jeu.\r\n\t */\r\n\tpublic void utiliserEffet(ArrayList<Joueur> listejoueur, int cible, ArrayList<Carte> table, Carte carte,\r\n\t\t\tint j, ArrayList<Carte> collection,ArrayList<Joueur> tourjoueur) {\n\t\tcont = Controller.getInstance();\r\n\t\tint id = carte.getIdentifiantCarte();\r\n\t\tif (id ==9 || id ==10 || id==22 || id==23){\r\n\t\t\tif (tourjoueur.get(j) == listejoueur.get(0)){\r\n\t\t\t\tSystem.out.println(\"Choisissez le Divinité qui sera forcer de sacrifier un croyant\");\r\n\t\t\t\t\r\n\t\t\t\tcont.setChoisirCible(true);\r\n\t\t\t\t\r\n\t\t\t\twhile(cont.getChoixCible()==-1){\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(200);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" à sacrifier un Croyant\");\r\n\t\t\t\t\r\n\t\t\t\tif (listejoueur.get(cont.getChoixCible()).getNombreCroyantTotal()>0){\r\n\t\t\t\t\tfor(int i=0;i<listejoueur.get(cont.getChoixCible()).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor (int k=0;k<listejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true); // On rend possible l'utilisation de la carte\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).setDoitSacrifierCroyant(true);\r\n\t\t\t\ttourjoueur.get(j).forcerAction(cont.getChoixCible(),listejoueur.get(cont.getChoixCible()).isDoitSacrifierCroyant(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" n'a aucun croyant a sacrifier \");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t max = 0;\r\n\t\t\t\t\tjoueurCible =-1;;\r\n\t\t\t\tfor (int i=0; i<listejoueur.size();i++){\r\n\t\t\t\t\r\n\t\t\t\t\tif (listejoueur.get(i).getGuidePossede().size() > max){\r\n\t\t\t\t\tmax = listejoueur.get(i).getGuidePossede().size();\r\n\t\t\t\t\tjoueurCible = i;\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\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(joueurCible).getNom() + \" à sacrifier un Croyant\");\r\n\t\t\tif (listejoueur.get(joueurCible).getNombreCroyantTotal()>0){\r\n\t\t\t\t\r\n\t\t\t\t\tfor(int i=0;i<listejoueur.get(joueurCible).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor (int k=0;k<listejoueur.get(joueurCible).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(joueurCible).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true); // On rend possible l'utilisation de la carte\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\tlistejoueur.get(joueurCible).setDoitSacrifierCroyant(true);\r\n\t\t\ttourjoueur.get(j).forcerAction(joueurCible,listejoueur.get(joueurCible).isDoitSacrifierCroyant(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun croyant à sacrifier\");\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ( id==11){\r\n\t\t\tif (tourjoueur.get(j) == listejoueur.get(0)){\r\n\t\t\t\tSystem.out.println(\"Choisissez le Divinité qui sera forcer de sacrifier un guide\");\r\n\t\t\t\twhile(cont.getChoixCible()==-1){\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(200);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" à sacrifier un Guide\");\r\n\t\t\t\t\r\n\t\t\t\tif(listejoueur.get(cont.getChoixCible()).getGuidePossede().size()>0){\r\n\t\t\t\t\tfor (int i=0;i<listejoueur.get(cont.getChoixCible()).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor(int k=0;k<listejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).setDoitSacrifierGuide(true);\r\n\t\t\t\t\ttourjoueur.get(j).forcerAction(cont.getChoixCible(),listejoueur.get(cont.getChoixCible()).isDoitSacrifierGuide(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun guide à sacrifier\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t max = 0;\r\n\t\t\t\t\tjoueurCible =-1;;\r\n\t\t\t\tfor (int i=0; i<listejoueur.size();i++){\r\n\t\t\t\t\r\n\t\t\t\t\tif (listejoueur.get(i).getGuidePossede().size() > max){\r\n\t\t\t\t\tmax = listejoueur.get(i).getGuidePossede().size();\r\n\t\t\t\t\tjoueurCible = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(joueurCible).getNom() + \" à sacrifier un Guide\");\r\n\t\t\t\tif (listejoueur.get(joueurCible).getGuidePossede().size()>0){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tfor(int i=0;i<listejoueur.get(joueurCible).getGuidePossede().size();i++){\r\n\t\t\t\t\t\t\tlistejoueur.get(joueurCible).getGuidePossede().get(i).setSelectionnee(true); // On rend possible l'utilisation de la carte\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tlistejoueur.get(joueurCible).setDoitSacrifierGuide(true);\r\n\t\t\t\ttourjoueur.get(j).forcerAction(joueurCible,listejoueur.get(joueurCible).isDoitSacrifierGuide(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun guide à sacrifier\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di cuocere il pollo\";\r\n }", "public void enviarValoresCabecera(){\n }", "@RequestMapping(value=\"/vueResponsableQcmsNonValides\")\r\n\tpublic String vueResponsableQcmsNonValides(Model model){\r\n\t\t\r\n\t\tString messageListeQcmResponsable;\r\n\t\t\r\n\t\tList<Qcm> liste_Qcm = services.consulterQcmEnCours();\t\r\n\t\tif (liste_Qcm.isEmpty()) messageListeQcmResponsable = \"Tous les qcm ont �t� valid�s\";\r\n\t\telse messageListeQcmResponsable = \"Liste des Qcm � valider\";\r\n\t\tmodel.addAttribute(\"messageListeQcmResponsable\", messageListeQcmResponsable);\t\r\n\t\tmodel.addAttribute(\"listeQcms\", liste_Qcm);\t\r\n\t\t\r\n\t\tmodel.addAttribute(\"user\", this.user);\t\t\r\n\t\tmodel.addAttribute(\"bonjour\", this.bonjour);\r\n\t\tmodel.addAttribute(\"espace\", this.espace);\r\n\t\treturn \"Responsable/vue-qcm-non-valides-formulaire\";\r\n\t}", "@FXML\r\n void doCercaPonti(ActionEvent event) {\r\n \ttxtResult.clear();\r\n \tCitta c1 = cmbCitta1.getValue();\r\n \tCitta c2 = cmbCitta2.getValue();\r\n \t\r\n \tif(c1==null||c2==null){\r\n \t\ttxtResult.appendText(\"Errore. Selezionare una citta.\");\r\n \t\treturn;\r\n \t}else if(c1.equals(c2)){\r\n \t\ttxtResult.appendText(\"Errore. Selezionare citta diverse.\");\r\n \t\treturn;\r\n \t}\r\n \t\r\n \ttxtResult.appendText(\"Ponti in comune: \\n\");\r\n \tfor(Ponte p : model.cercaPonti(c1, c2)){\r\n \t\ttxtResult.appendText(p+\"\\n\");\r\n \t}\r\n \t\r\n\r\n }", "public void changerJoueur() {\r\n\t\t\r\n\t}", "@RequestMapping(value = \"/about\")\n\tpublic String mostrarAcerca() {\t\t\t\n\t\treturn \"acerca\";\n\t}", "@RequestMapping(value = \"/profile_buscar\")\r\n public String verPerfil(BusquedaFiltro busquedaFiltro, HttpSession session, Model model) {\n PersonaDTO personaDTO = (PersonaDTO) session.getAttribute(\"personaDTO\");\r\n //session.setAttribute(\"ciclito\", busquedaFiltro.getCiclo());\r\n //System.out.println(\"holaaaaaaaaaaaaa naaaaaada\" + personaDTO.getCodigo() );\r\n AlumnoDTO p = alumnoDAO.get(personaDTO.getCodigo());\r\n\r\n List<HistorialDTO> his = alumnoDAO.gethis(p.getCodigo());\r\n\r\n model.addAttribute(\"historial\", his);\r\n model.addAttribute(\"busquedaFiltro\", busquedaFiltro);\r\n if (busquedaFiltro.getCiclo() == \"\") {\r\n return \"redirect:/alumno/profile\";\r\n } else {\r\n\r\n BusquedaFiltro nuevoFiltro = new BusquedaFiltro();\r\n\r\n model.addAttribute(\"nuevoFiltro\", nuevoFiltro);\r\n //session.setAttribute(\"cursito\",nuevoFiltro.getIdCurso());\r\n model.addAttribute(\"persona\", p);\r\n model.addAttribute(\"ListaCursos\", alumnoDAO.listarCursos(personaDTO.getIdPersona(), busquedaFiltro.getCiclo()));\r\n //System.out.println(busquedaFiltro.getCiclo() + \" naaaaaada\");\r\n model.addAttribute(\"ListaCiclos\", alumnoDAO.listarCiclos(personaDTO.getIdPersona()));\r\n\r\n return \"alumno/alumnoprofile\";\r\n }\r\n }", "@RequestMapping(\"/spyrjaNotanda\")\r\n public String spyrjaNotandi () {\r\n \treturn \"demo/hvadaNotandi\";\r\n }", "public void xuLyThemPhieuThanhToan(){\n //Ngat chuoi\n String strTongTien = txtTongTien.getText().trim();\n String[] tongTien = strTongTien.split(\"\\\\s\");\n String strTienPhaiTra = txtTienPhaiTra.getText().trim();\n String[] tienPhaiTra = strTienPhaiTra.split(\"\\\\s\");\n\n //xu ly them vao data base\n PhieuThanhToanSevice phieuThanhToanSevice = new PhieuThanhToanSevice();\n int x = phieuThanhToanSevice.themPhieuThanhToan(txtMaPTT.getText().trim(),\n cbbMaPDK.getSelectedItem().toString(),\n Integer.valueOf(txtSoThang.getText().trim()),\n txtNgayTT.getText().trim(), Float.valueOf(tongTien[0]), Float.valueOf(tienPhaiTra[0]));\n\n if (x > 0) {\n JOptionPane.showMessageDialog(null, \"Thanh toán thành công\");\n } else {\n JOptionPane.showMessageDialog(null, \"Thanh toán thất bại\");\n return;\n }\n\n }", "public void recibir_estado_partida(){\n\n }", "private void tallennaTiedostoon() {\n viitearkisto.tallenna();\n }", "@RequestMapping(value = \"/chuyenthemlichsunql\", method = RequestMethod.GET, produces = \"application/x-www-form-urlencoded;charest=UTF-8\")\n\tprivate String chuyenThemLichSuNQL(@RequestParam(name = \"id\", required = false) int maXuat, Model model) {\n\t\tmodel.addAttribute(\"maXuatThemLSNQL\", baoTriDAO.layMaXuat(maXuat));\n\t\tmodel.addAttribute(\"formThem\", new TbLichSuNguoiQuanLy());\n\t\tmodel.addAttribute(\"danhsachnguoidung\", nhanVienDAO.layDanhSachNguoiDung());\n\t\treturn \"bt-lich-su-nguoi-them\";\n\t}", "public void mostrarFatura() {\n\n int i;\n System.err.println(\"Fatura do contrato:\\n\");\n\n if (hospedesCadastrados.isEmpty()) {//caso nao existam hospedes\n System.err.println(\"Nao existe hospedes cadastrados\\n\");\n\n } else {\n System.err.println(\"Digite o cpf do hospede:\\n\");\n\n listarHospedes();\n int cpf = verifica();\n for (i = 0; i < hospedesCadastrados.size(); i++) {//roda os hospedes cadastrados\n if (hospedesCadastrados.get(i).getCpf() == cpf) {//pega o hospede pelo cpf\n if (hospedesCadastrados.get(i).getContrato().isSituacao()) {//caso a situacao do contrato ainda estaja ativa\n\n System.err.println(\"Nome do hospede:\" + hospedesCadastrados.get(i).getNome());\n System.err.println(\"CPF:\" + hospedesCadastrados.get(i).getCpf() + \"\\n\");\n System.err.println(\"Servicos pedidos:\\nCarros:\");\n if (!(hospedesCadastrados.get(i).getContrato().getCarrosCadastrados() == null)) {\n System.err.println(hospedesCadastrados.get(i).getContrato().getCarrosCadastrados().toString());\n System.err.println(\"Total do serviço de aluguel de carros R$:\" + hospedesCadastrados.get(i).getContrato().getContaFinalCarros() + \"\\n\");//;\n } else {\n System.err.println(\"\\nO hospede nao possui carros cadastrados!\\n\");\n }\n System.err.println(\"Quartos:\");\n if (!(hospedesCadastrados.get(i).getContrato().getQuartosCadastrados() == null)) {\n System.err.println(hospedesCadastrados.get(i).getContrato().getQuartosCadastrados().toString());\n System.err.println(\"Total do servico de quartos R$:\" + hospedesCadastrados.get(i).getContrato().getContaFinalQuartos() + \"\\n\");//;\n } else {\n System.err.println(\"\\nO hospede nao possui Quartos cadastrados!\\n\");\n }\n System.err.println(\"Restaurante:\");\n System.err.println(\"Total do servico de restaurante R$: \" + hospedesCadastrados.get(i).getContrato().getValorRestaurante() + \"\\n\");\n System.err.println(\"Total de horas de BabySitter contratatas:\" + hospedesCadastrados.get(i).getContrato().getHorasBaby() / 45 + \"\\n\"\n + \"Total do servico de BabySitter R$:\" + hospedesCadastrados.get(i).getContrato().getHorasBaby() + \"\\n\");\n System.err.println(\"Total Fatura final: R$\" + hospedesCadastrados.get(i).getContrato().getContaFinal());\n //para limpar as disponibilidades dos servicos\n //carros, quarto, contrato e hospede\n //é necessario remover o hospede?\n// \n\n } else {//caso o contrato esteja fechado\n System.err.println(\"O hospede encontra-se com o contrato fechado!\");\n }\n }\n\n }\n }\n }", "public void displayPhieuXuatKho() {\n\t\tlog.info(\"-----displayPhieuXuatKho()-----\");\n\t\tif (!maPhieu.equals(\"\")) {\n\t\t\ttry {\n\t\t\t\tDieuTriUtilDelegate dieuTriUtilDelegate = DieuTriUtilDelegate.getInstance();\n\t\t\t\tPhieuTraKhoDelegate pxkWS = PhieuTraKhoDelegate.getInstance();\n\t\t\t\tCtTraKhoDelegate ctxWS = CtTraKhoDelegate.getInstance();\n\t\t\t\tDmKhoa dmKhoaNhan = new DmKhoa();\n\t\t\t\tdmKhoaNhan = (DmKhoa)dieuTriUtilDelegate.findByMa(IConstantsRes.KHOA_KC_MA, \"DmKhoa\", \"dmkhoaMa\");\n\t\t\t\tphieuTra = pxkWS.findByPhieutrakhoByKhoNhan(maPhieu, dmKhoaNhan.getDmkhoaMaso());\n\t\t\t\tif (phieuTra != null) {\n\t\t\t\t\tmaPhieu = phieuTra.getPhieutrakhoMa();\n\t\t\t\t\tresetInfo();\n\t\t\t\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\t\t\tngayXuat = df.format(phieuTra.getPhieutrakhoNgay());\n\t\t\t\t\tfor (CtTraKho ct : ctxWS.findByphieutrakhoMa(phieuTra.getPhieutrakhoMa())) {\n\t\t\t\t\t\tCtTraKhoExt ctxEx = new CtTraKhoExt();\n\t\t\t\t\t\tctxEx.setCtTraKho(ct);\n\t\t\t\t\t\tlistCtKhoLeTraEx.add(ctxEx);\n\t\t\t\t\t}\n\t\t\t\t\tcount = listCtKhoLeTraEx.size();\n\t\t\t\t\tisFound=\"true\";\n\t\t\t\t\t// = null la chua luu ton kho -> cho ghi nhan\n\t\t\t\t\t// = 1 da luu to kho -> khong cho ghi nhan\n\t\t\t\t\tif(phieuTra.getPhieutrakhoNgaygiophat()==null)\n\t\t\t\t\tisUpdate = \"1\";\n\t\t\t\t\telse\n\t\t\t\t\t\tisUpdate = \"0\";\n\t\t\t\t} else {\n\t\t\t\t\tFacesMessages.instance().add(IConstantsRes.PHIEUXUATKHO_NULL, maPhieu);\n\t\t\t\t\treset();\n\t\t\t\t}\n\t\t\t\ttinhTien();\n\t\t\t} catch (Exception e) {\n\t\t\t\tFacesMessages.instance().add(IConstantsRes.PHIEUXUATKHO_NULL, maPhieu);\n\t\t\t\treset();\n\t\t\t\tlog.error(String.format(\"-----Error: %s\", e));\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@FXML\n void doCerca(ActionEvent event) {\n \ttxtresult.clear();\n \t\n \tmodel.buildGraph();\n \t\n \tStop partenza = stazionePartenza.getValue();\n \tStop arrivo = stazioneArrivo.getValue();\n \t\n \tif(!partenza.equals(arrivo)){\n\t\t \tList<Stop> sequenza = model.cercaPercorso(partenza, arrivo);\n\t\t \tif(sequenza!=null){\n\t\t \ttxtresult.appendText(model.stampaSequenza(sequenza));\n\t\t \t}else{\n\t\t \t\ttxtresult.appendText(String.format(\"Spiacente, non vi sono percorsi possibili da %s a %s\", partenza.getName(), arrivo.getName()));\n\t\t \t}\n \t}else{\n \t\ttxtresult.appendText(\"Spiacente, le stazioni devono essere differenti per calcolare un percorso\");\n \t}\n\n }", "public void daiGioco() {\n System.out.println(\"Scrivere 1 per giocare al PC, al costo di 200 Tam\\nSeleziona 2 per a Calcio, al costo di 100 Tam\\nSeleziona 3 per Disegnare, al costo di 50 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiFelicita += 60;\n puntiVita -= 30;\n soldiTam -= 200;\n }\n case 2 -> {\n puntiFelicita += 40;\n puntiVita -= 20;\n soldiTam -= 100;\n }\n case 3 -> {\n puntiFelicita += 30;\n puntiVita -= 10;\n soldiTam -= 50;\n }\n }\n checkStato();\n }", "@Override\n\tpublic String hablar() {\n\t\treturn \"Hola, soy un Buitre y sť volar\";\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 ABTemaPropioController(){\n }", "@PostConstruct\n\tpublic void view() {\n\t\tif (log.isDebugEnabled()) {\n log.debug(\"Entering 'ConsultaHIPCuentaCorrientesAction - view' method\");\n }\n\t\tMap<String, String> parametros = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();;\n\t\tthis.parametrosPantalla = new HashMap<String, String>();\n\t\tthis.parametrosPantalla.putAll(parametros);\n\t\ttry {\n\t\t\tthis.formBusqueda = this.devuelveFormBusqueda();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\t\n\t\t}\n\t}", "private void juego(){\r\n boolean ind=false,ind2=true;\r\n System.out.println(\"Comencemos\");\r\n initReloj();\r\n System.out.println(\"Cada Carta esta\");\r\n while(ind==false && this.ind==true){\r\n visualizarm();\r\n usuario();\r\n System.out.println(\"\");\r\n System.out.println(\"\");\r\n if(comprobar()==true){\r\n ind=true;\r\n this.ind=true;\r\n }\r\n }\r\n if(this.ind==true){\r\n ResultadoR res = new ResultadoR();\r\n res.resultado(\"Jugador Gana\",pj);\r\n }\r\n else{\r\n ResultadoR res= new ResultadoR();\r\n res.resultado(\"Jugador Pierde\", pj);\r\n }\r\n }", "@GetMapping(\"/afficher-contenu\")\r\n\tpublic List<PanierItem> afficherContenu(){\r\n\t\t\r\n\t\ttry{\r\n\t\t\treturn panierService.listerTout();\r\n\t\t}catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "protected void elaboraPagina() {\n testoPagina = VUOTA;\n\n //header\n testoPagina += this.elaboraHead();\n\n //body\n testoPagina += this.elaboraBody();\n\n //footer\n //di fila nella stessa riga, senza ritorno a capo (se inizia con <include>)\n testoPagina += this.elaboraFooter();\n\n //--registra la pagina principale\n if (dimensioniValide()) {\n testoPagina = testoPagina.trim();\n\n if (pref.isBool(FlowCost.USA_DEBUG)) {\n testoPagina = titoloPagina + A_CAPO + testoPagina;\n titoloPagina = PAGINA_PROVA;\n }// end of if cycle\n\n //--nelle sottopagine non eseguo il controllo e le registro sempre (per adesso)\n if (checkPossoRegistrare(titoloPagina, testoPagina) || pref.isBool(FlowCost.USA_DEBUG)) {\n appContext.getBean(AQueryWrite.class, titoloPagina, testoPagina, summary);\n logger.info(\"Registrata la pagina: \" + titoloPagina);\n } else {\n logger.info(\"Non modificata la pagina: \" + titoloPagina);\n }// end of if/else cycle\n\n //--registra eventuali sottopagine\n if (usaBodySottopagine) {\n uploadSottoPagine();\n }// end of if cycle\n }// end of if cycle\n\n }", "@Override\n\tpublic void pausaParaComer() {\n\n\t}", "public void ordenaPontos(){\r\n\t\tloja.ordenaPontos();\r\n\t}", "public String accionemergencia(){\n\t\tString resp=\"\";\n\t\tif(puntosvida<=5 && acc!=1){\n\t\t\tpuntosvida=puntosvida+15;\n\t\t\tresp=\"\\nAccion de emergencia \"+ tipo +\"activada vida +15\";\n\t\t\tacc=1;\n\t\t}\n\t\treturn resp;\n\t}", "@GetMapping(\"/formuQue\") \n\tpublic String verInico(Model model) {\n\t\treturn \"PQR/formQuejas\";\n\t}", "public void datos_elegidos(){\n\n\n }", "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}", "protected void caricaListaContoTesoreria() throws WebServiceInvocationFailureException {\n\t\tList<ContoTesoreria> listaInSessione = sessionHandler.getParametro(BilSessionParameter.LISTA_CONTO_TESORERIA);\n\t\tif(listaInSessione == null) {\n\t\t\tLeggiContiTesoreria request = model.creaRequestLeggiContiTesoreria();\n\t\t\tlogServiceRequest(request);\n\t\t\tLeggiContiTesoreriaResponse response = preDocumentoSpesaService.leggiContiTesoreria(request);\n\t\t\tlogServiceResponse(response);\n\t\t\t\n\t\t\t// Controllo gli errori\n\t\t\tif(response.hasErrori()) {\n\t\t\t\t//si sono verificati degli errori: esco.\n\t\t\t\taddErrori(response);\n\t\t\t\tthrow new WebServiceInvocationFailureException(\"caricaListaContoTesoreria\");\n\t\t\t}\n\t\t\t\n\t\t\tlistaInSessione = response.getContiTesoreria();\n\t\t\tsessionHandler.setParametro(BilSessionParameter.LISTA_CONTO_TESORERIA, listaInSessione);\n\t\t}\n\t\t\n\t\tmodel.setListaContoTesoreria(listaInSessione);\n\t}", "public void tampilKarakterC(){\r\n System.out.println(\"Saya adalah binatang \");\r\n }", "public void notificaAlgiocatore(int azione, Giocatore g) {\n\r\n }", "public void encerrarJogo(){\n if (isAndamento()) {\n situacao = SituacaoJogoEnum.ENCERRADO;\n }\n }", "public void enviaMotorista() {\n\t\tConector con = new Conector();\r\n\t\tString params[] = new String[2];\r\n\r\n\t\tparams[0] = \"op=4\";\r\n\t\tparams[1] = \"email=\" + usuario;\r\n\r\n\t\tcon.sendHTTP(params);\r\n\t}", "protected void accionUsuario() {\n\t\t\r\n\t}", "private void xuLyThemDV(){\n if (checkMaDV(txtMaDV.getText())==false){\n JOptionPane.showMessageDialog(null, \"Mã dịch vụ phải thuộc dạng [DV+Số].\\n Vui lòn kiểm tra lại!\");\n txtMaDV.requestFocus();\n return;\n }//Kiem tra maDV \n \n if(checkTenDV(txtTenDV.getText())==false){\n JOptionPane.showMessageDialog(null, \"Tên dịch vụ không được bỏ trống!\");\n txtTenDV.requestFocus();\n return;\n }//Kiem tra tenDV\n \n DichVuService dichVuService = new DichVuService();\n if (dichVuService.kiemTraDichVuDaTonTai(txtMaDV.getText())==false){\n int x = dichVuService.themDV(txtMaDV.getText(), txtTenDV.getText());\n if(x>0){\n hienThiDichVu();\n JOptionPane.showMessageDialog(null, \"Đã thêm!\");\n }else{\n JOptionPane.showMessageDialog(null, \"Thêm thất bại!\");\n txtMaDV.requestFocus();\n return;\n }\n }else{\n JOptionPane.showMessageDialog(null, \"Dịch vụ đã tồn tại. Vui lòng kiểm tra lại!\");\n txtMaDV.requestFocus();\n return;\n }\n \n }", "public void recibeOrden() {\r\n\t\tSystem.out.println(\"Ordene mi General\");\r\n\t}", "public String suaTaiKhoan(){\n\t\ttaiKhoanDao.suaTaiKhoan(ttCaNhan);\r\n\t\t\r\n\t\t//kiem tra quyen dang nhap\r\n\t\tint kt=kiemTraquyenDN();\r\n\t\tif(kt==1){\r\n\t\t\treturn \"QLTaiKhoan_Admin?faces-redirect=true\";\r\n\t\t}else if(kt==3){\r\n\t\t\treturn \"QLTaiKhoan_NV?faces-redirect=true\";\r\n\t\t}else{\r\n\t\t\treturn \"QLTaiKhoan_NVDH?faces-redirect=true\";\r\n\t\t}\r\n\t}", "public ConversorVelocidad() {\n //setTemperaturaConvertida(0);\n }", "public String llenar(){\r\n HttpServletRequest request= (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\r\n String idCliente= request.getParameter(\"idCliente\");\r\n cliente= modelo.encontrarCliente(idCliente);\r\n return \"cliente\";\r\n }", "public String recuperaCultivoByEstadoAsigCA(){\n\t\tlstCultivo = iDAO.recuperaCultivoByInicilizacionEsquema(idInicializacionEsquema,idEstado);\n\t\t\n\t\treturn SUCCESS;\t\t\n\t}", "private static void etapa3Urna() {\n\t\t\n\t\turna.contabilizarVotosPorCandidato(enderecoCandidatos);\n\t\t\n\t}", "public RequisitoController(Livro livro,MainController mainController) {\r\n\t\t name = livro.getName();\r\n\t\t barcode = livro.getBarcode();\r\n\t\t reservado = livro.isReservado();\r\n\t\t this.mainController = mainController;\r\n\t}", "public Coup coupIA() {\n\n int propriete = TypeCoup.CONT.getValue();\n int bloque = Bloque.NONBLOQUE.getValue();\n Term A = intArrayToList(plateau1);\n Term B = intArrayToList(plateau2);\n Term C = intArrayToList(piecesDispos);\n Variable D = new Variable(\"D\");\n Variable E = new Variable(\"E\");\n Variable F = new Variable(\"F\");\n Variable G = new Variable(\"G\");\n Variable H = new Variable(\"H\");\n org.jpl7.Integer I = new org.jpl7.Integer(co.getValue());\n q1 = new Query(\"choixCoupEtJoue\", new Term[] {A, B, C, D, E, F, G, H, I});\n\n\n if (q1.hasSolution()) {\n Map<String, Term> solution = q1.oneSolution();\n int caseJ = solution.get(\"D\").intValue();\n int pion = solution.get(\"E\").intValue();\n Term[] plateau1 = listToTermArray(solution.get(\"F\"));\n Term[] plateau2 = listToTermArray(solution.get(\"G\"));\n Term[] piecesDispos = listToTermArray(solution.get(\"H\"));\n for (int i = 0; i < 16; i++) {\n if (i < 8) {\n this.piecesDispos[i] = piecesDispos[i].intValue();\n }\n this.plateau1[i] = plateau1[i].intValue();\n this.plateau2[i] = plateau2[i].intValue();\n }\n\n int ligne = caseJ / 4;\n int colonne = caseJ % 4;\n\n if (pion == 1 || pion == 5) {\n pion = 1;\n }\n if (pion == 2 || pion == 6) {\n pion = 0;\n }\n if (pion == 3 || pion == 7) {\n pion = 2;\n }\n if (pion == 4 || pion == 8) {\n pion = 3;\n }\n\n\n Term J = intArrayToList(this.plateau1);\n q1 = new Query(\"gagne\", new Term[] {J});\n System.out.println(q1.hasSolution() ? \"Gagné\" : \"\");\n if (q1.hasSolution()) {\n propriete = 1;\n }\n return new Coup(bloque,ligne, colonne, pion, propriete);\n }\n System.out.println(\"Bloqué\");\n return new Coup(1,0, 0, 0, 3);\n }", "public void mostrarCompra() {\n }", "public String thuchienAction(){\n\t\tXuatReport();\n\t\tresetFormB4135=null;\n\t\treturn \"B4160_Chonmenuxuattaptin\";\n\t}", "@Override\n\t@BreadCrumb(\"%{model.titolo}\")\n\tpublic String execute() throws Exception {\n\t\tdebug(\"execute\", \" codice voce mutuo \"+model.getMutuoSelezionato().getCodiceMutuo());\n\t\tdebug(\"execute\", \" numeroVoceMutuo \"+getNumeroVoceMutuo());\n\t\t\n\t\t//setto il numero voce mutuo selezionato:\n\t\tsetNumeroVoceMutuoSelezionato(getNumeroVoceMutuo());\n\t\n\t\treturn SUCCESS;\n\t}" ]
[ "0.67590266", "0.6414793", "0.6382561", "0.6376566", "0.63227504", "0.62508863", "0.62424475", "0.62408674", "0.62307084", "0.6110489", "0.6102347", "0.60683864", "0.60621893", "0.6047526", "0.6047526", "0.6046013", "0.60440904", "0.6043073", "0.60279924", "0.6024611", "0.6015539", "0.60133386", "0.6011254", "0.6008921", "0.59969056", "0.59891605", "0.59878904", "0.5985773", "0.59800196", "0.597412", "0.59732264", "0.596889", "0.59655464", "0.59594077", "0.59570926", "0.5955817", "0.59492844", "0.59454703", "0.5929752", "0.59225154", "0.5913924", "0.59134126", "0.5905124", "0.5902554", "0.59006", "0.58960086", "0.5888145", "0.58845276", "0.5883819", "0.5883349", "0.58761156", "0.5876109", "0.58631617", "0.5859834", "0.5852767", "0.5846324", "0.5845845", "0.58438915", "0.58436954", "0.5837349", "0.58326083", "0.58320427", "0.58310866", "0.582855", "0.5825227", "0.5820307", "0.5816259", "0.58148676", "0.58119625", "0.58026206", "0.58017766", "0.5801171", "0.57912767", "0.5788181", "0.5788156", "0.57837594", "0.5781214", "0.57796866", "0.5777508", "0.57774895", "0.5776484", "0.5768782", "0.5762873", "0.57610387", "0.5758506", "0.5754692", "0.5754332", "0.57536036", "0.57514167", "0.57458764", "0.57446253", "0.57443446", "0.57343876", "0.57311976", "0.5730681", "0.5725986", "0.5724147", "0.572104", "0.5718511", "0.57171726", "0.5716717" ]
0.0
-1
Se il giocatore vuole fare una seconda scommessa,viene lanciato il metodo per scommettere. Altrimenti setta il paramentro vincente/piazzato a valore nullo (N)
String[] chiediSecondaScommessa();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void pridejNovePivo ()\n\t{\n\t\n\t\tpivo = pivo + PRODUKCE;\n\t\t\n\t}", "PrimitivaComunicacion(String simbolo){\r\n this.simbolo = simbolo;\r\n }", "public void carroNoAgregado(){\n System.out.println(\"No hay un parqueo para su automovil\");\n }", "public void limpiarProcesoBusqueda() {\r\n parametroEstado = 1;\r\n parametroNombre = null;\r\n parametroApellido = null;\r\n parametroDocumento = null;\r\n parametroTipoDocumento = null;\r\n parametroCorreo = null;\r\n parametroUsuario = null;\r\n parametroEstado = 1;\r\n parametroGenero = 1;\r\n listaTrabajadores = null;\r\n inicializarFiltros();\r\n }", "public cola_de_un_banco(){// se crea nuestro metodo costructor \r\n primero=null;//se crea el tipo de indicaciones con valor a null\r\n ultimo=null;\r\n}", "public void iniciarNovaPartida(Integer posicao);", "public void Nodo(){\r\n this.valor = \"\";\r\n this.siguiente = null;\r\n }", "@Override\n\tpublic void muestraInfo() {\n\t\tSystem.out.println(\"Adivina un número par: Es un juego en el que el jugador\" +\n\t\t\t\t\" deberá acertar un número PAR comprendido entre el 0 y el 10 mediante un número limitado de intentos(vidas)\");\n\t}", "public String comunica() {\r\n// ritorna una stringa\r\n// posso usare il metodo astratto \r\n return msg + AggiungiQualcosa();\r\n }", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di friggere un uovo\";\r\n }", "public void codigo(String cadena, String codigo,int codigos,Reserva2 reserva,JDateChooser dateFechaIda,JDateChooser dateFechaVuelta,JTextField DineroFaltante) {\n\t\tcadena=codigo.split(\",\")[1];\n\t\tubicacion=codigo.split(\",\")[5];\n\t\tnombre=codigo.split(\",\")[3];\n\t\tprecio=codigo.split(\",\")[8];\n\t\tcodigos=Integer.parseInt(cadena);\n\t\tSystem.out.println(\"hola\");\n\t\tSystem.out.println(Modelo1.contador);\n\t\t\n\t\tif(Modelo1.contador==1) {\n\t\t\treserva.setUbicacion(ubicacion);\n\t\t\treserva.setCodigohotel(codigos);\n\t\t\treserva.setNombreAlojamiento(nombre);\n\t\t\t\n\t\t}\n\t\telse if(Modelo1.contador==2) {\n\t\t\t\n\t\t\totroprecio=Double.parseDouble(precio);\n\t\t\treserva.setUbicacion(ubicacion);\n\t\t\treserva.setCodigocasa(codigos);\n\t\t\treserva.setNombreAlojamiento(nombre);\n\t\t\tpreciofinal=metodos.preciototal(dateFechaIda, dateFechaVuelta, otroprecio);\n\t\t\treserva.setPrecio(preciofinal);\n\t\t\tSystem.out.println(reserva.getUbicacion());\n\t\t\tSystem.out.println(reserva.getCodigocasa());\n\t\t\tSystem.out.println(reserva.getNombreAlojamiento());\n\t\t\tSystem.out.println(reserva.getPrecio());\n\t\t\tDineroFaltante.setText(reserva.getPrecio()+\" \\u20ac\");\n\t\t\tModelo1.total_faltante = reserva.getPrecio();\n\t\t\t\n\t\t}\n\t\telse if(Modelo1.contador==3) {\n\t\t\t\n\t\t\totroprecio=Double.parseDouble(precio);\n\t\t\treserva.setUbicacion(ubicacion);\n\t\t\treserva.setCodigoapatamento(codigos);\n\t\t\treserva.setNombreAlojamiento(nombre);\n\t\t\tpreciofinal=metodos.preciototal(dateFechaIda, dateFechaVuelta, otroprecio);\n\t\t\treserva.setPrecio(preciofinal);\n\t\t\tSystem.out.println(reserva.getUbicacion());\n\t\t\tSystem.out.println(reserva.getCodigoapatamento());\n\t\t\tSystem.out.println(reserva.getNombreAlojamiento());\n\t\t\tSystem.out.println(reserva.getPrecio());\n\t\t\tDineroFaltante.setText(reserva.getPrecio()+\" \\u20ac\");\n\t\t\tModelo1.total_faltante = reserva.getPrecio();\n\t\t}\n\t\t\n\t}", "public void AtualizaPassageiro(String nome, String NovoCpf, String cpfPrimario) {\n\n\t\ttry {\n\n\t\t\t// Meu cpf é a chjave\n\t\t\t// setando nome\n\n\t\t\tstmt = con.prepareStatement(\" update Passageiro set nome= ? where cpf= ? \");\n\t\t\tstmt.setString(1, nome);\n\t\t\tstmt.setString(2, cpfPrimario);\n\t\t\tstmt.executeUpdate();\n\n\t\t\t// setando cpf\n\n\t\t\tstmt = con.prepareStatement(\" update Passageiro set cpf= ? where cpf= ? \");\n\t\t\tstmt.setString(1, NovoCpf);\n\t\t\tstmt.setString(2, cpfPrimario);\n\t\t\tstmt.executeUpdate();\n\n\t\t\tJOptionPane.showMessageDialog(null, \"Passageiro Alterado com sucesso!!\");\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\n\t\t\tSystem.out.println(\"Erro ao atualizar passageiro!\");\n\t\t\tJOptionPane.showMessageDialog(null, \"-Erro ao atualizar o passageiro \");\n\t\t\tJOptionPane.showMessageDialog(null, \"certifique se de inserir um CPF VALIDO(15 CARACTERES)\t \");\n\t\t}\n\n\t}", "public CensoCCVnoREMExcluidos() {\n this.nombre = \"\";\n this.apellidom = \"\";\n this.apellidop = \"\";\n this.rut = \"\";\n this.edad = 0;\n this.razon_exclusion = \"\";\n }", "private void esqueceu() {\n\n //Declaração de Objetos\n Veterinario veterinario = new Veterinario();\n\n //Declaração de Variaveis\n int crmv;\n String senha;\n\n //Atribuição de Valores\n try {\n crmv = Integer.parseInt(TextCrmv.getText());\n senha = TextSenha.getText();\n \n //Atualizando no Banco\n veterinario.Vdao.atualizarAnimalSenhaPeloCrmv(senha, crmv);\n \n } catch (NumberFormatException ex) {\n JOptionPane.showMessageDialog(null, \"APENAS NUMEROS NO CRMV!\");\n }\n JOptionPane.showMessageDialog(null, \"SUCESSO AO ALTERAR SENHA!\");\n\n }", "public Cliente(int codCliente, String nome, String nomeCurto, String nif, byte codPartePropio) {\t\t\n\t\tthis(codCliente, nome, nomeCurto, nif, true);\n\t\tif(codPartePropio==0) {\n\t\t\tthis.codPartePropio = false;\n\t\t}\n\t}", "public Mensaje (int valor, int peso, int porcentaje) {\n this.respuesta = false;\n this.valor = valor;\n this.porcentaje = porcentaje;\n this.peso = peso;\n }", "public void nastaviIgru() {\r\n\t\t// nastavi igru poslije pobjede\r\n\t\tigrajPoslijePobjede = true;\r\n\t}", "public void naplnVrcholy() {\r\n System.out.println(\"Zadajte pocet vrcholov: \");\r\n pocetVrcholov = skener.nextInt();\r\n for (int i=0; i < pocetVrcholov; i++) {\r\n nekonecno = (int)(Double.POSITIVE_INFINITY);\r\n if(i==0) { //pre prvy vrchol potrebujeme nastavit vzdialenost 0 \r\n String menoVrcholu = Character.toString((char)(i+65)); //pretipovanie int na String, z i=0 dostanem A\r\n Vrchol vrchol = new Vrchol(menoVrcholu, 0, \"\"); //vrcholu nastavim vzdialenost a vrcholPrichodu \r\n vrcholy.add(vrchol);\r\n } else { //ostatne budu mat nekonecno alebo v tomto pripade 9999 (lebo tuto hodnotu v mensich grafoch nepresiahnem)\r\n String menoVrcholu = Character.toString((char)(i+65)); //pretipovanie int na String, z i=0 dostanem A\r\n Vrchol vrchol = new Vrchol(menoVrcholu,nekonecno, \"\"); //vrcholu nastavim vzdialenost a vrcholPrichodu \r\n vrcholy.add(vrchol);\r\n }\r\n }\r\n }", "public final void nonRedefinissableParEnfant(){\n\n }", "private void gestionPriseEnCompte() {\r\n\t\tString raison = new String(\"\");\r\n\t\tDate now = new Date();\r\n\t\tString strSql = \"\";\r\n\t\r\n if (tbAlarme.getRowCount() > 0) {\r\n \tif (tbAlarme.getSelectedRowCount() > 0) {\r\n\t\t int[] selection = tbAlarme.getSelectedRows();\r\n\t\t int indexSelection = selection[0];\r\n\t\t int idCapteur = mdlTpsReelAlarme.getIdCapteur(indexSelection); \r\n\t\t String strTypeAlarme = \"\";\r\n\t\t \r\n\t\t\t\t// Motif Prise En Compte seulement si appel Alert\r\n\t\t strTypeAlarme = (String) mdlTpsReelAlarme.getValueAt(indexSelection, JTABLE_ALARME_TYPE_ALARME);\r\n\t\t if (strTypeAlarme.equals(\"Alarme\")) {\r\n\t\t\t\t\tint idPriseEnCompte = 0;\r\n\t\t \tdo {\r\n\t\t\t\t\t\tObject [] possibilites = new Object[tbPriseEnCompte.size()];\r\n\t\t\t\t\t\tfor(int i = 0; i < tbPriseEnCompte.size(); i++) {\r\n\t\t\t\t\t\t\tpossibilites[i] = tbPriseEnCompte.get(i).getNom();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tString strReponse = (String)JOptionPane.showInputDialog(this, \"Choisir un motif de prise en compte : \", \"Prise en compte\", JOptionPane.QUESTION_MESSAGE, null, possibilites, null);\r\n\t\t\t\t\t\tidPriseEnCompte = 1;\r\n\t\t\t\t\t\tif (strReponse != null) {\r\n\t\t\t\t\t\t\tfor(int i = 0; i < tbPriseEnCompte.size(); i++) {\r\n\t\t\t\t\t\t\t\tif(strReponse.equals(tbPriseEnCompte.get(i).getNom())) {\r\n\t\t\t\t\t\t\t\t\tidPriseEnCompte = (int) tbPriseEnCompte.get(i).getId();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} // fin for\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\traison = \"En attente\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// idPriseEncompte == 1 (Autres)\r\n\t\t\t\t\t\tif(idPriseEnCompte == 1) {\r\n\t\t\t\t\t\t\t// Demande de commentaire\r\n\t\t\t\t\t\t\traison = AE_Fonctions.saisieTexte(\"Veuillez entrer une raison : \", \"Raison commentaire ...\");\r\n\t\t\t\t\t\t\tif (raison == null) raison = \"\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\traison = \"---\";\r\n\t\t\t\t\t\t}\r\n\t\t \t} while(raison == \"\");\r\n\t\t \t\r\n\t\t\t\t\tstrSql = \"UPDATE V2_AlarmeEnCours SET idPriseEnCompte = \" + idPriseEnCompte\r\n\t\t\t\t\t\t\t + \" , idUtilisateur = \" + EFS_Client_Variable.idUtilisateur\r\n\t\t\t\t\t\t\t + \" , CommentairePriseEnCompte = '\" + raison + \"'\"\r\n\t\t\t\t\t\t\t + \" WHERE idCapteur = \" + idCapteur;\r\n\t\t\t\t\tctn.fonctionSql(strSql);\r\n\t\t\t\t\tmdlTpsReelAlarme.setMotifIdPriseEncompte(indexSelection, idPriseEnCompte);\r\n\t\t } // fin if appelAlert\r\n\r\n\t\t if(mdlTpsReelAlarme.getValueAt(indexSelection, JTABLE_ALARME_PRISE_EN_COMPTE) == null) {\r\n\t\t\t\t\t// Date prise en compte\r\n\t\t\t\t\tstrSql = \"UPDATE V2_AlarmeEnCours SET DatePriseEnCompte = sysdate, blPriseEnCompte = 1 WHERE idCapteur = \" + idCapteur;\r\n\t\t\t\t\tctn.fonctionSql(strSql);\r\n\t\t\t\t\tmdlTpsReelAlarme.setValueAt(now, indexSelection, JTABLE_ALARME_PRISE_EN_COMPTE);\r\n\t\t } // fin if datePrsieEnCompte\r\n\t\r\n\t\t // Prevenir le programme maitre\r\n\t\t AE_Fonctions.modifierMaitreViaClient(idCapteur, VIA_API_PRISE_EN_COMPTE);\r\n\t\t \r\n\t\t\t\t// Arret klaxon et Alert\r\n//\t\t\t\tgestionKlaxon(false);\r\n//\t\t\t\tgestionAlert(false);\r\n\t\t\t\t\r\n \t} else {\r\n \t JOptionPane.showMessageDialog(this, \"Vous devez sélectionner une ligne pour prendre en compte ...\",\r\n \t \t\t \"GTC Visualize - Programme Maitre\", JOptionPane.WARNING_MESSAGE);\r\n \t}\r\n } else {\r\n//\t\t\tgestionKlaxon(false);\r\n//\t\t\tgestionAlert(false);\r\n }\r\n\t}", "public static String EncontrarCamino(int Inicio, int[] Predecesor, Grafo Grafo, Double[] Costo){\n /*Inicializa las variables necesarias para el metodo*/\n int Pred = Predecesor[Inicio];\n String Camino = String.valueOf(Grafo.ListaVertices.get(Inicio).getId());\n int NumLados = 1;\n DecimalFormat numberFormat = new DecimalFormat(\"0.0#\");\n\n while(true){\n if(Pred!=Predecesor[Pred]){ //Si el predecesor del vertice no es el mismo\n Camino = String.valueOf(Grafo.ListaVertices.get(Pred).getId())+ \"->\"+Camino;\n Pred = Predecesor[Pred];\n NumLados++;\n }\n else{ //Si el predecesor del vertice es el mismo, entonces este vertice es\n break; //el vertice inicial del camino\n }\n }\n Camino = String.valueOf(Grafo.ListaVertices.get(Pred).getId())+ \"->\"+Camino; //Agrega el Vertice inicial a el String con el camino.\n Camino = \"Nodo \"+String.valueOf(Inicio)+\": \"+Camino+\" \"+\"\\t\"+String.valueOf(NumLados)+\" Lados\"+\" (Costo \"+String.valueOf(numberFormat.format(Costo[Inicio]))+\")\";\n return Camino;\n }", "public static void bestFit(PCB processo, PCB novoprocesso) {\n\n int endereco_pai = processo.getEnderecoInicial();\n int endereco = -1;\n int melhor_espaco = processo.getMemoriaOcupada();\n for (int i = 0; i < tamanho_processos_acabados.size(); i++) {\n if (melhor_espaco <= tamanho_processos_acabados.get(i)) {\n melhor_espaco = tamanho_processos_acabados.get(i);\n endereco = enderecos_processos_acabados.get(i);\n }\n }\n novoprocesso.setEnderecoInicial(endereco);\n for (Pagina pagina : Paginas) {\n if (pagina.getEndereco_inicial() == endereco) {\n pagina.setDados(StageRun.procura_processo_pagina(endereco_pai));\n pagina.setPagina_pid(novoprocesso.getPid());\n pagina.setAlocado(true);\n pagina.setEspacoVazio(pagina.getTamanho() - pagina.getDados().length);\n novoprocesso.setMemoriaOcupada(novoprocesso.getMemoriaOcupada() + tamanho_pagina);\n endereco_pai = endereco_pai + tamanho_pagina;\n } else if (pagina.getEndereco_inicial() > endereco && pagina.getEndereco_inicial() < endereco + processo.getMemoriaOcupada()) {\n pagina.setDados(StageRun.procura_processo_pagina(endereco_pai));\n pagina.setPagina_pid(novoprocesso.getPid());\n pagina.setAlocado(true);\n pagina.setEspacoVazio(pagina.getTamanho() - pagina.getDados().length);\n novoprocesso.setMemoriaOcupada(novoprocesso.getMemoriaOcupada() + tamanho_pagina);\n endereco_pai = endereco_pai + tamanho_pagina;\n } else {\n\n }\n }\n\n }", "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 Coup coupIA() {\n\n int propriete = TypeCoup.CONT.getValue();\n int bloque = Bloque.NONBLOQUE.getValue();\n Term A = intArrayToList(plateau1);\n Term B = intArrayToList(plateau2);\n Term C = intArrayToList(piecesDispos);\n Variable D = new Variable(\"D\");\n Variable E = new Variable(\"E\");\n Variable F = new Variable(\"F\");\n Variable G = new Variable(\"G\");\n Variable H = new Variable(\"H\");\n org.jpl7.Integer I = new org.jpl7.Integer(co.getValue());\n q1 = new Query(\"choixCoupEtJoue\", new Term[] {A, B, C, D, E, F, G, H, I});\n\n\n if (q1.hasSolution()) {\n Map<String, Term> solution = q1.oneSolution();\n int caseJ = solution.get(\"D\").intValue();\n int pion = solution.get(\"E\").intValue();\n Term[] plateau1 = listToTermArray(solution.get(\"F\"));\n Term[] plateau2 = listToTermArray(solution.get(\"G\"));\n Term[] piecesDispos = listToTermArray(solution.get(\"H\"));\n for (int i = 0; i < 16; i++) {\n if (i < 8) {\n this.piecesDispos[i] = piecesDispos[i].intValue();\n }\n this.plateau1[i] = plateau1[i].intValue();\n this.plateau2[i] = plateau2[i].intValue();\n }\n\n int ligne = caseJ / 4;\n int colonne = caseJ % 4;\n\n if (pion == 1 || pion == 5) {\n pion = 1;\n }\n if (pion == 2 || pion == 6) {\n pion = 0;\n }\n if (pion == 3 || pion == 7) {\n pion = 2;\n }\n if (pion == 4 || pion == 8) {\n pion = 3;\n }\n\n\n Term J = intArrayToList(this.plateau1);\n q1 = new Query(\"gagne\", new Term[] {J});\n System.out.println(q1.hasSolution() ? \"Gagné\" : \"\");\n if (q1.hasSolution()) {\n propriete = 1;\n }\n return new Coup(bloque,ligne, colonne, pion, propriete);\n }\n System.out.println(\"Bloqué\");\n return new Coup(1,0, 0, 0, 3);\n }", "@Override\n\tpublic void procesar() throws WrongValuesException, ExcEntradaInconsistente {\n\n\t}", "public String procesarPrestamo(int carneEstudiante, String codigoLibro, Date fechaPrestamo, boolean validarCantidadCopias) {\n //PASO 1----------------------------------------------------------------------------------------------------\n if (!buscarEstudiante(carneEstudiante)) {\n return \"El estudiante no se encuentra registrado en el sistema\";\n } \n //PASO 2----------------------------------------------------------------------------------------------------\n else {\n if (comprobarLibrosPrestados(estudiante)) {\n return \"Se ha llegado al limite de prestamos por estudiante\";\n }\n //PASO 3---------------------------------------------------------------------------------------------------- \n else {\n if (!buscarLibro(codigoLibro)) {\n return \"El libro no se encuentra registrado en el sistema\";\n }\n //PASO 4---------------------------------------------------------------------------------------------------- \n else {\n if(validarCantidadCopias){\n \n if (!comprobarExistencias(libro)) {\n return \"Se han agotado las existencias del libro solicitado\"; \n }\n }\n //PASO 5---------------------------------------------------------------------------------------------------- \n fechaLimitePrestamo = manejadorFechas.sumarDias(fechaPrestamo,2); \n prestamo = new Prestamo(0,libro.getCodigo(), estudiante.getCarne(), fechaPrestamo, fechaLimitePrestamo,true, 0,0);\n guardarPrestamo(prestamo);\n agregarListado(estudiante, prestamo);\n if(validarCantidadCopias){\n disminuirCantidad(libro);\n }\n return \"Prestamo Realizado Exitosamente\"; \n } \n }\n }\n }", "private void moverJogadorDaVez(int dado1, int dado2) throws Exception {\n // System.out.println(\"moverJogadorDaVez\" + dado1 + \" , \" + dado2);\n\n print(\"\\ttirou nos dados: \" + dado1 + \" , \" + dado2);\n int valorDados = dado1 + dado2;\n\n int jogador = this.jogadorAtual();\n\n boolean ValoresIguais = false;\n\n\n //preciso saber se o jogador vai passar pela posição 40, o que significa\n //ganhar dinheiro\n this.completouVolta(jogador, valorDados);\n\n if (dado1 == dado2) {\n ValoresIguais = true;\n } else {\n ValoresIguais = false;\n }\n\n //movendo à posição\n this.moverJogadorAPosicao(jogador, valorDados, ValoresIguais);\n this.print(\"\\tAtual dinheiro antes de ver a compra:\" + this.listaJogadores.get(jogador).getDinheiro());\n this.print(\"\\tVai até a posição \" + this.posicoes[jogador]);\n\n //vendo se caiu na prisao\n if (this.posicoes[this.jogadorAtual()] == 30 && this.prisao == true) {\n adicionaNaPrisao(listaJogadores.get(jogadorAtual()));\n DeslocarJogador(jogador, 10);\n listaJogadores.get(jogadorAtual()).adicionarComandoPay();\n }\n\n\n\n Lugar lugar = this.tabuleiro.get(this.posicoes[jogador] - 1);//busca em -1, pois eh um vetor\n\n\n if (this.isCompraAutomatica()) {\n this.realizarCompra(jogador, lugar);\n }\n\n if (!this.posicaoCompravel(this.posicoes[jogador])) {\n this.print(\"\\t\" + lugar.getNome() + \" não está à venda!\");\n\n\n String nomeDono = (String) Donos.get(this.posicoes[jogador]);\n //não cobrar aluguel de si mesmo\n if (!nomeDono.equals(this.listaJogadores.get(this.jogadorAtual()).getNome())) {\n\n if (this.isUmJogador(nomeDono)) {\n Jogador possivelDono = this.getJogadorByName(nomeDono);\n\n if (this.isPosicaoFerrovia(this.posicoes[jogador])) {\n this.print(\"\\tO dono eh \" + possivelDono.getNome());\n if (!lugar.estaHipotecada()) {\n this.pagarFerrovia(possivelDono.getId(), jogador, 25, lugar.getNome());\n }\n } else {\n\n this.print(\"\\tO dono eh \" + possivelDono.getNome());\n int valorAluguel = 0;\n if (this.posicoes[this.jogadorAtual()] != 12 && this.posicoes[this.jogadorAtual()] != 28) {\n valorAluguel = this.tabuleiro.getLugarPrecoAluguel(this.posicoes[jogador]);\n\n } else {\n if (possivelDono.getQuantidadeCompanhias() == 1) {\n valorAluguel = 4 * valorDados;\n\n }\n if (possivelDono.getQuantidadeCompanhias() == 2) {\n valorAluguel = 10 * valorDados;\n\n }\n }\n if (!lugar.estaHipotecada()) {\n this.pagarAluguel(possivelDono.getId(), jogador, valorAluguel, lugar.getNome());\n }\n\n }\n\n }\n }\n\n }\n\n\n this.pagarEventuaisTaxas(jogador);\n\n if ((this.posicoes[this.jogadorAtual()] == 2 || this.posicoes[jogadorAtual()] == 17 || this.posicoes[jogadorAtual()] == 33) && cards == true) {\n realizaProcessamentoCartaoChest();\n }\n\n if ((this.posicoes[this.jogadorAtual()] == 7 || this.posicoes[jogadorAtual()] == 22 || this.posicoes[jogadorAtual()] == 36) && cards == true) {\n realizaProcessamentoCartaoChance();\n }\n\n\n\n\n this.print(\"\\tAtual dinheiro depois:\" + this.listaJogadores.get(jogador).getDinheiro());\n\n\n\n }", "public ReformaTributariaOutput getComporConv(boolean comportamiento, ReformaTributariaInput reformaTributaria)throws Exception {\n Connection conn = null;\n CallableStatement call = null;\n int inComportamiento=0; \n int inTipoConvenio=0;\n int inEmbargo=0;\n int inPyme=0;\n String ContextoAmbienteParam = null;\n ReformaTributariaOutput reformaTributariaOut = new ReformaTributariaOutput();\n try {\n\n conn = this.getConnection();\n String beneficio = this.getBeneficio();\n \n System.out.println(\"Estoy adentro con parametro beneficio---------------------->\"+beneficio);\n \n if (beneficio.equalsIgnoreCase(\"S\")){\n\t if (reformaTributaria.getContextoAmbienteParam().endsWith(\"CNV_INTRA\")){\n\t \t ContextoAmbienteParam=\"CNV_INTRA\";\n\t }else{\n\t \t ContextoAmbienteParam=\"CNV_BENEFICIO_INTER\";\n\t }\n }else{\n \t ContextoAmbienteParam=reformaTributaria.getContextoAmbienteParam(); \n }\n //Deudas que forman parte de la propuesta, pero no son propias del contribuyente\n /*\n --------------------------------------------------------------\n ------- Las variables determinantes --------------------\n ------- para condiciones de convenios --------------------\n --------------------------------------------------------------\n ------- v_tipo_valor\n ------- v_tipo_convenio\n ------- v_comportamiento\n ------- v_embargo\n ------- v_canal\n --------------------------------------------------------------\n -------------------------------------------------------------- \n */\n if (comportamiento){\n \t inComportamiento=1;\n }else{\n \t inComportamiento=2;\n }\n \n //String parametros=reformaTributaria.pagoTotalConvenio()+\";\"+reformaTributaria.comportamiento()+\";\"+reformaTributaria.garantia()+\";\"+reformaTributaria.canal();\n String parametros=reformaTributaria.pagoTotalConvenio()+\";\"+reformaTributaria.comportamiento()+\";\"+reformaTributaria.garantia();\n \n //System.out.println(\"tipo reforma condonacion--->\"+reformaTributaria.getCodConvenios());\n //System.out.println(\"***************************estoy en comportamiento****************************************\");\n //System.out.println(\"reformaTributaria.garantia()--->\"+reformaTributaria.garantia());\n //System.out.println(\"param getComporConv---> \"+parametros);\n //call = conn.prepareCall(\"{call PKG_REFORMA_TRIBUTARIA.consulta_tabla_valores_conv(?,?,?,?,?,?)}\");\n call = conn.prepareCall(\"{call PKG_REFORMA_TRIBUTARIA.consulta_tabla_valores_conv(?,?,?,?,?,?,?,?)}\");\n call.setLong(1,inComportamiento);/*tipo comporamiento � condonaci�n */\n call.setString(2,parametros);/*tipo convenio */\n call.registerOutParameter(3, OracleTypes.INTEGER);/*max_cuotas*/\n call.registerOutParameter(4, OracleTypes.INTEGER);/*min_pie*/\n call.registerOutParameter(5, OracleTypes.INTEGER);/*por_condonacion*/ \n call.registerOutParameter(6, OracleTypes.INTEGER);/*error*/ \n /*se agrega nueva forma de servicio*/\n if (reformaTributaria.getCodConvenios()!=null){//si no es nulo quiere decir que es transitoria\n \t call.setLong(7,reformaTributaria.getCodConvenios().intValue());/*codigo condonacion si es transitoria*/\n }else{//si es null quiere decir que es convenio permanente\n \t call.setNull(7, OracleTypes.INTEGER);\n }\n //call.setString(8,reformaTributaria.getContextoAmbienteParam());/*ambiente Intranet � internet*/ \n System.out.println(\"ContextoAmbienteParam---> \"+ContextoAmbienteParam);\n call.setString(8,ContextoAmbienteParam);/*ambiente Intranet � internet*/\n call.execute();\n \n int maxCuotas = Integer.parseInt(call.getObject(3).toString());\n int minCuotaContado = Integer.parseInt(call.getObject(4).toString());\n \n\n int codError = Integer.parseInt(call.getObject(6).toString());\n \n reformaTributariaOut.setCodError(new Integer(codError));\n reformaTributariaOut.setMaxCuota(new Integer(maxCuotas));\n reformaTributariaOut.setMinCuotaContado(new Integer(minCuotaContado));\n call.close(); \n \n }catch (Exception e) {\n \te.printStackTrace();\n \t//throw new RemoteException(\"No tiene valor de comportamiento convenios:\" + e.getMessage());\n }\n finally{\n this.closeConnection();\n }\n\t\treturn reformaTributariaOut;\n }", "@Override\n\tpublic void doit() {\n\t\tafficher_texte(UtilitaireChainesCommunes.demande_saisie_nombre);\n\t\tint i = saisie_entier();\n\t\tafficher_texte(UtilitaireChainesCommunes.demande_saisie_nombre);\n\t\tint j = saisie_entier();\n\t\t// tous deux strictements positifs ou strictement négatifs? \n\t\t// vrai => produit positif\n\t\t// faux => produit negatif ou nul\n\t\tboolean Truth = TrueIfSameTruthValue(i,j,this.estposit);\n if (Truth){afficher_texte(UtilitaireChainesCommunes.resultat_positif);}\n else{ \n \t// l un des deux est soit de signe différent soit nul.\n \t// on vire le cas \"est de signe différent\" (on aurait pu faire l autre)\n \tboolean Truth2 = ((i < 0 && j > 0) || (i > 0 && j < 0));\n \tif (Truth2){afficher_texte(UtilitaireChainesCommunes.resultat_negatif);}\n \telse {afficher_texte(UtilitaireChainesCommunes.nombre_nul);}\n }\n\n\t}", "public void setComentario (String val) {\n this.comentario = val;\n }", "@Override\r\n public String AggiungiQualcosa() {\r\n// ritorna una stringa\r\n// perché qui ho informazioni in più\r\n return \"\\ne capace di cuocere il pollo\";\r\n }", "@Override\n\tpublic void pausaParaComer() {\n\n\t}", "public static void korisnikNijeUneoIspravnuSifru() {\r\n\t\tJOptionPane.showMessageDialog(teretanaGui.getContentPane(), \"Niste uneli ispravnu sifru!\", \"Obavestenje\",\r\n\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t}", "private void accionIngresar() {\n\n\t\tString fieldCodigo = this.textCodigo.getText();\n\t\tString fieldNombre = this.textNombre.getText();\n\t\tString fieldDescripcion = this.textDescripcion.getText();\n\t\tString fieldTelefono = this.textTelefono.getText();\n\n\t\t// Si alguno es vacío, mostramos una ventana de mensaje\n\t\tif (fieldNombre.equals(\"\") || fieldCodigo.equals(\"\") || fieldDescripcion.equals(\"\") || fieldTelefono.equals(\"\")) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"Debe completar todos los datos marcados con (*).\", \"Datos incompletos!\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\n\t\t\treturn; }\n\t\t\n\t\t// Controlo el maximo de caracteres\n\t\tif (fieldCodigo.length() > 5) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"El código puede contener máximo 5 caracteres\", \"Datos inválidos!\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\treturn;\n\t\t} else if (fieldNombre.length() > 20) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"El nombre puede contener máximo 20 caracteres\", \"Datos inválidos!\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\treturn;\n\t\t} else if (fieldDescripcion.length() > 100) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"La descripción puede contener máximo 100 caracteres\", \"Datos inválidos!\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\treturn;\n\t\t} else if (fieldTelefono.length() > 20) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"El teléfono puede contener máximo 20 caracteres\", \"Datos inválidos!\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Controlo que el fenomeno no exista ya\n\t\t\n\t\tboolean existe;\n\t\t\n\t\ttry{\n\t\t\texiste = ClienteGeoPosUy.ExisteFenomeno(fieldNombre);\n\t\t} catch (Exception e){\n\t\t\tJOptionPane.showMessageDialog(frame, \"Error de conexión con el servidor. Intente más tarde.\",\n\t\t\t\t\t\"Error de conexión!\", JOptionPane.WARNING_MESSAGE);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (existe) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"Ya existe un fenómeno con ese nombre\",\n\t\t\t\t\t\"Fenómeno existente!\", JOptionPane.WARNING_MESSAGE);\n\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Si todo va bien lo doy de alta\n\t\t\n\t\tboolean almacenado = false;\n\t\ttry {\n\t\t\talmacenado = ClienteGeoPosUy.crearFenomeno(fieldCodigo, fieldNombre, fieldDescripcion, fieldTelefono);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tif (almacenado) {\n\t\t\tJOptionPane.showMessageDialog(frame, \"El fenómeno ha sido registrado con éxito.\",\n\t\t\t\t\t\"Cliente Registrado!\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\n\t\t\t// cerramos la ventanta\n\t\t\tthis.frame.dispose();\n\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tJOptionPane.showMessageDialog(frame, \"Hubo un error al almacenar. Intente nuevamente más tarde\",\n\t\t\t\t\t\"Error al registrar!\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t\t\n\t\t\n}", "public void abrir(String name, String rfc, Double sueldo, Double aguinaldo2,// Ya esta hecho es el vizualizador\r\n\t\t\tDouble primav2, Double myH2, Double gF, Double sGMM2, Double hip, Double donat, Double subR,\r\n\t\t\tDouble transp, String NivelE, Double colegiatura2) {\r\n\t\tthis.nombre=name;//\r\n\t\tthis.RFC=rfc;//\r\n\t\tthis.SueldoM=sueldo;//\r\n\t\tthis.Aguinaldo=aguinaldo2;//\r\n\t\tthis.PrimaV=primav2;//\r\n\t\tthis.MyH=myH2;//\r\n\t\tthis.GatsosFun=gF;//\r\n\t\tthis.SGMM=sGMM2;//\r\n\t\tthis.Hipotecarios=hip;//\r\n\t\tthis.Donativos=donat;//\r\n\t\tthis.SubRetiro=subR;//\r\n\t\tthis.TransporteE=transp;//\r\n\t\tthis.NivelE=NivelE;//\r\n\t\tthis.Colegiatura=colegiatura2;//\r\n\t\t\r\n\t\tthis.calculo(this.nombre, this.RFC, this.SueldoM, this.Aguinaldo, this.PrimaV,this.MyH,this.GatsosFun,\r\n\t\t\t\tthis.SGMM,this.Hipotecarios,this.Donativos,this.SubRetiro,this.TransporteE,this.NivelE,this.Colegiatura);\r\n\t\t\r\n\t\tpr.Imprimir(this.nombre, this.RFC, this.SueldoM,this.IngresoA,this.Aguinaldo,this.PrimaV,this.MyH,this.GatsosFun,this.SGMM,this.Hipotecarios,this.Donativos,this.SubRetiro,this.TransporteE,this.NivelE,this.Colegiatura,this.AguinaldoE,this.AguinaldoG,this.PrimaVE,this.PrimaVG,this.TotalIngresosG,this.MaxDedColeg,this.TotalDedNoRetiro,this.DedPerm,this.MontoISR,this.CuotaFija,this.PorcExced,this.PagoEx,this.Total);\r\n\t\t\r\n\t}", "@Override\n public void paso0() {\n n = graph.getNodeIndices().indexOf(actual);\n nodo = graph.getNodes().get(n);\n nodo.setEstado(Node.State.CURRENT);\n nodo.pintarNodo(g);\n // comprueba si es objetivo\n if (nodo.getEsObjetivo()) {\n // establece el objetivo encontrado\n miObjetivo = nodo.toString();\n // termina con exito\n Step = 4;\n } else {\n // se prepara para explorar los sucesores\n m = nodo.maxSucesores();\n j = 0;\n // siguiente paso\n Step = 1;\n }\n }", "@Override\n protected void carregaObjeto() throws ViolacaoRegraNegocioException {\n entidade.setNome( txtNome.getText() );\n entidade.setDescricao(txtDescricao.getText());\n entidade.setTipo( txtTipo.getText() );\n entidade.setValorCusto(new BigDecimal((String) txtCusto.getValue()));\n entidade.setValorVenda(new BigDecimal((String) txtVenda.getValue()));\n \n \n }", "public Papagaj(String meno, int pocetKoncatin, double vaha, String farba) {\r\n super(\"Papagaj\", \"Voliera\", pocetKoncatin); // volanie konstruktora predka\r\n this.meno = meno; // nastavenie nazvu zivocicha\r\n this.farba = farba; // nastavenie farby\r\n this.vaha = vaha; // nastavenie vahy\r\n }", "@Override\n protected void elaboraParametri() {\n super.elaboraParametri();\n titoloPagina = TITOLO_PAGINA;\n }", "private void iniciarNovaVez() {\n this.terminouVez = false;\n }", "public void setMontoDescuento(double param){\n \n this.localMontoDescuento=param;\n \n\n }", "private void procedureBasePrDessin(){\n if(courante == null){\n reset();\n courante = new Tortue(simpleLogo.getFeuille(), true);\n simpleLogo.setBarreOutilsVisible(true);\n }\n }", "public SuperRodada(){\n this.pontos_em_disputa=0;\n this.truco=false;\n this.Desafiante=null;\n this.addPontosEmDisputa(2);\n Game game = Game.getGame();\n DonoDoBaralho=(DonoDoBaralho==null)?game.getDupla(1).getJogadorA():this.proximoAJogar(DonoDoBaralho);\n \n }", "public static String switchNumeriPosizioni(int numero, String pariOrDispari) {\n\t\tString valoreCorrispondente = \"\";\n\t\tswitch (numero) {\n\t\tcase 0:\n\t\t\tif (pariOrDispari.equals(\"pari\")) {\n\t\t\t\tvaloreCorrispondente = \"0\";\n\t\t\t} else valoreCorrispondente = \"1\";\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tif (pariOrDispari.equals(\"pari\")) {\n\t\t\t\tvaloreCorrispondente = \"1\";\n\t\t\t} else valoreCorrispondente = \"0\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tif (pariOrDispari.equals(\"pari\")) {\n\t\t\t\tvaloreCorrispondente = \"2\";\n\t\t\t} else valoreCorrispondente = \"5\";\n\t\t\tbreak;\n\t\tcase 3:\t\n\t\t\tif (pariOrDispari.equals(\"pari\")) {\n\t\t\t\tvaloreCorrispondente = \"3\";\n\t\t\t} else valoreCorrispondente = \"7\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tif (pariOrDispari.equals(\"pari\")) {\n\t\t\t\tvaloreCorrispondente = \"4\";\n\t\t\t} else valoreCorrispondente = \"9\";\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tif (pariOrDispari.equals(\"pari\")) {\n\t\t\t\tvaloreCorrispondente = \"5\";\n\t\t\t} else valoreCorrispondente = \"13\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tif (pariOrDispari.equals(\"pari\")) {\n\t\t\t\tvaloreCorrispondente = \"6\";\n\t\t\t} else valoreCorrispondente = \"15\";\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tif (pariOrDispari.equals(\"pari\")) {\n\t\t\t\tvaloreCorrispondente = \"7\";\n\t\t\t} else valoreCorrispondente = \"17\";\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tif (pariOrDispari.equals(\"pari\")) {\n\t\t\t\tvaloreCorrispondente = \"8\";\n\t\t\t} else valoreCorrispondente = \"19\";\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tif (pariOrDispari.equals(\"pari\")) {\n\t\t\t\tvaloreCorrispondente = \"9\";\n\t\t\t} else valoreCorrispondente = \"21\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn valoreCorrispondente;\n\t}", "public void sincronizza() {\n boolean abilita;\n\n super.sincronizza();\n\n try { // prova ad eseguire il codice\n\n /* abilitazione bottone Esegui */\n abilita = false;\n if (!Lib.Data.isVuota(this.getDataInizio())) {\n if (!Lib.Data.isVuota(this.getDataFine())) {\n if (Lib.Data.isSequenza(this.getDataInizio(), this.getDataFine())) {\n abilita = true;\n }// fine del blocco if\n }// fine del blocco if\n }// fine del blocco if\n this.getBottoneEsegui().setEnabled(abilita);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "void prosegui(String messaggio);", "public void setStatoCorrente(Stato prossimo)\r\n\t{\r\n\t\tif(!(corrente==null))\r\n\t\t\tfor(int i=0;i<corrente.getTransazioniUscenti().size();i++)\r\n\t\t\t{\r\n\t\t\t\t//System.out.println(\"Imposto NON attiva la \"+corrente.getTransazioniUscenti().get(i));\r\n\t\t\t\tcorrente.getTransazioniUscenti().get(i).setAttiva(false);\r\n\t\t\t}\r\n\t\t\r\n\t\t//System.out.println(\"Imposto lo stato corrente: \"+prossimo.toString());\r\n\t\tcorrente=prossimo;\r\n\t\tif(!(corrente==null))\r\n\t\t{\r\n\t\t\t//System.out.println(\"Attivo le transazioni \"+corrente.getTransazioniUscenti().size());\r\n\t\t\tfor(int i=0;i<corrente.getTransazioniUscenti().size();i++)\r\n\t\t\t{\r\n\t\t\t\t//System.out.println(\"Imposto ATTIVA la \"+corrente.getTransazioniUscenti().get(i));\r\n\t\t\t\tcorrente.getTransazioniUscenti().get(i).setAttiva(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public SigalPeticion reativarUsuario ( AccountTO usuario ) throws Exception {\n \n // Tratamento para controle de campos opicionais\n int totalParams = 11;\n boolean possuiCenttra = true;\n boolean possuiCodPerfil = true;\n\n if ( usuario.getCenttra() == null || usuario.getCenttra().trim().equals(\"\") ) {\n --totalParams;\n possuiCenttra = false;\n }\n\n if ( usuario.getCodperfil() == null || usuario.getCodperfil().trim().equals(\"\") ) {\n --totalParams;\n possuiCodPerfil = false;\n }\n\n SigalPeticion msgEnvio = SigalPeticion.getInstance( totalParams );\n\n msgEnvio.addParametro( --totalParams, new Parametro( \"FUNCION\", \"RE\" ) );\n\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.USUARIO,\n usuario.getUsuario() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.OFICINA,\n usuario.getOficina() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.NOMBREUSU,\n usuario.getNombreusu() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.PASSWORD,\n usuario.getPassword() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.NIVSEGUSU,\n usuario.getNivsegusu() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.CODIDIOMA,\n usuario.getCodidioma() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.FECACTIVA,\n usuario.getFecactivaForEASE() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.FECDESACT,\n usuario.getFecdesactForEASE() ) );\n\n // CAMPO OPICIONAL, alteração feita na especificação v. 5.0\n if ( possuiCenttra )\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.CENTTRA,\n usuario.getCenttra() ) );\n\n // CAMPO OPICIONAL, alteração feita na especificação v. 5.0\n if ( possuiCodPerfil ) {\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.CODPERFIL,\n usuario.getCodperfil() ) );\n }\n\n msgEnvio.setTipoOperacion( \"update\" );\n msgEnvio.setTransaccion( \"SGREUSU\" );\n\n return msgEnvio; \n }", "public Mensaje (double monto) {\n this.respuesta = true;\n this.monto = monto;\n }", "public void distribuirAportes1(){\n\n if(null == comprobanteSeleccionado.getAporteuniversidad()){\n System.out.println(\"comprobanteSeleccionado.getAporteuniversidad() >> NULO\");\n }\n\n if(null == comprobanteSeleccionado.getAporteorganismo()){\n System.out.println(\"comprobanteSeleccionado.getAporteorganismo() >> NULO\");\n }\n\n if(null == comprobanteSeleccionado.getMontoaprobado()){\n System.out.println(\"comprobanteSeleccionado.getMontoaprobado() >> NULO\");\n }\n\n try{\n if(comprobanteSeleccionado.getAporteuniversidad().floatValue() > 0f){\n comprobanteSeleccionado.setAporteorganismo(comprobanteSeleccionado.getMontoaprobado().subtract(comprobanteSeleccionado.getAporteuniversidad()));\n comprobanteSeleccionado.setAportecomitente(BigDecimal.ZERO);\n }\n } catch(NullPointerException npe){\n System.out.println(\"Error de NullPointerException\");\n npe.printStackTrace();\n }\n\n }", "public void renovarBolsa() {\n\t\tSystem.out.println(\"Bolsa renovada com suceso!\");\n\t}", "@Override\n\tpublic void preparar() {\n\t\tSystem.out.println(\"massa, presunto, queijo, calabreza e cebola\");\n\t\t\n\t}", "@Override\n\tpublic void initialisation_type_exercice() {\n\t\tthis.setEnnonce_exo(\"Ecrire un algorithme qui demande deux nombres à l’utilisateur et l’informe ensuite si le produit est négatif ou positif (on inclut cette fois le traitement du cas où le produit peut être nul). Attention toutefois, on ne doit pas calculer le produit !\");\n\n\t}", "@Override\n protected void eventoUscitaCampo(Campo campo) {\n\n try { // prova ad eseguire il codice\n\n if (campo.getNomeInterno().equals(nomeConto)) {\n this.setCodConto((Integer)campo.getValore());\n this.regolaCamera();\n }// fine del blocco if\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n }", "public DialogoAggiungiFissiConto(int codConto) {\n /* rimanda al costruttore della superclasse */\n super();\n\n try { // prova ad eseguire il codice\n\n /* regola le variabili di istanza coi parametri */\n this.setCodConto(codConto);\n\n /* regolazioni iniziali di riferimenti e variabili */\n this.inizia();\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n }", "public void xuLyThemPhieuThanhToan(){\n //Ngat chuoi\n String strTongTien = txtTongTien.getText().trim();\n String[] tongTien = strTongTien.split(\"\\\\s\");\n String strTienPhaiTra = txtTienPhaiTra.getText().trim();\n String[] tienPhaiTra = strTienPhaiTra.split(\"\\\\s\");\n\n //xu ly them vao data base\n PhieuThanhToanSevice phieuThanhToanSevice = new PhieuThanhToanSevice();\n int x = phieuThanhToanSevice.themPhieuThanhToan(txtMaPTT.getText().trim(),\n cbbMaPDK.getSelectedItem().toString(),\n Integer.valueOf(txtSoThang.getText().trim()),\n txtNgayTT.getText().trim(), Float.valueOf(tongTien[0]), Float.valueOf(tienPhaiTra[0]));\n\n if (x > 0) {\n JOptionPane.showMessageDialog(null, \"Thanh toán thành công\");\n } else {\n JOptionPane.showMessageDialog(null, \"Thanh toán thất bại\");\n return;\n }\n\n }", "public void notificaAlgiocatore(int azione, Giocatore g) {\n\r\n }", "public void validarPostagem() {\n\t\t// validando se o nome motorista ou carona foram preenchidos\n\t\tint verif = 0;\n\t\ttry {\n\t\t\tif (txtCarona.getText() == null\n\t\t\t\t\t|| txtCarona.getText().trim().equals(\"\")) {\n\n\t\t\t\tverif++;\n\n\t\t\t}\n\t\t\tif (txtMotorista.getText() == null\n\t\t\t\t\t|| txtMotorista.getText().trim().equals(\"\")) {\n\n\t\t\t\tverif++;\n\n\t\t\t}\n\t\t\tif (verif == 2) {\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t}\n\n\t\t\tif (txtDestino.getText() == null\n\t\t\t\t\t|| txtDestino.getText().trim().equals(\"\")) {\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t}\n\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tJOptionPane\n\t\t\t\t\t.showMessageDialog(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\"Para postar no quadro é necessário informar nome (motorista ou passageiro) \"\n\t\t\t\t\t\t\t\t\t+ \"\t\t\t\t\t\t\te local. \\n Por favor certifique se os campos foram preenchidos e tente novamente.\");\n\t\t}\n\n\t}", "public void preguntarDespegue(){\n String respuesta = this.mediador.preguntarDespegue(this);\n System.out.println(respuesta);\n if (respuesta==\"SI\"){\n this.setPosicion(1);\n this.indicarEstado(\"Preparando para el despegue\");\n }\n }", "public SrvINFONEGOCIO(AgregarInfoNegocio view) {//C.P.M Tendremos un constructor con la vista de agregar informacion de negocio\r\n this.vista = view;//C.P.M Se la agregamos a la variable para tener acceso a la vista \r\n }", "void autofinanciarPoliza(AutofinanciarPolizaCancelCommand datosPoliza);", "private void funcaoTotalPedido() {\n\n ClassSale.paymentCoupon(codeCoupon);\n BigDecimal smallCash = PaymentCoupon.getSmallCash();\n\n jTextValueTotalCoupon.setText(v.format(PaymentCoupon.getTotalCoupon()));\n \n jTextSmallCash.setText(v.format(smallCash.setScale(2, BigDecimal.ROUND_HALF_UP)));\n //jTextValueTotalDiscontCoupon.setText(v.format(PagamentoPedido.getDesconto_pagamento()));\n\n if (smallCash.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() < 0) {\n valor_devido = smallCash.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();\n jTextCash.setText(\"0,00\");\n jTextValueDiscontCoupon.setText(\"0,00\");\n jTextCash.requestFocus(true);\n } else {\n\n if (last_cod_tipo_pagamento != null && smallCash.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() > 0) {\n\n if (JOptionPane.showConfirmDialog(this, \"Não é permitido troco para pagamento com cartão.\\nDeseja emitir um contra vale?\", \"Mensagem\", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, icon) == 0) {\n\n JOptionPane.showMessageDialog(this, \"Emitindo contra vale...\");\n\n fechouVenda = true;\n //BeanConsulta.setVenda_fechada(fechouVenda);\n this.dispose();\n\n } else {\n\n funcaoLimpaPag();\n }\n } else {\n \n \n valor_devido = smallCash.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); \n jButtonFinalizaCalculoPagameto.setEnabled(true);\n jButtonFinalizaCalculoPagameto.requestFocus(true);\n\n }\n }\n\n }", "private void xuLyThanhToanDichVu() {\n if(checkGia(txtThanhToanDVSoLuongCu.getText())== false){\n JOptionPane.showMessageDialog(null, \"Số lượng không hợp lệ. Vui lòng kiểm tra lại!\");\n txtThanhToanDVSoLuongCu.requestFocus();\n return;\n }//Kiem tra so luong cu\n \n if(checkGia(txtThanhToanDVSoLuongMoi.getText())== false){\n JOptionPane.showMessageDialog(null, \"Số lượng không hợp lệ. Vui lòng kiểm tra lại!\");\n txtThanhToanDVSoLuongMoi.requestFocus();\n return;\n }//kiem tra so luong moi\n \n float soLuongCu = Float.valueOf(txtThanhToanDVSoLuongCu.getText().trim());\n float soLuongMoi = Float.valueOf(txtThanhToanDVSoLuongMoi.getText().trim());\n float soLuong = soLuongMoi - soLuongCu;\n txtThanhToanDVSoLuong.setText(soLuong+\"\");\n tongCong += soLuong * Float.valueOf(txtThanhToanDVGiaDV.getText().trim());\n txtThanhToanTongCong.setText(tongCong+\" VNĐ\");\n \n }", "private void inizia() throws Exception {\n /* variabili e costanti locali di lavoro */\n Dati dati;\n\n try { // prova ad eseguire il codice\n\n this.setMessaggio(\"Analisi in corso\");\n this.setBreakAbilitato(true);\n\n /* recupera e registra i dati delle RMP da elaborare */\n dati = getDatiRMP();\n this.setDati(dati);\n\n /* regola il fondo scala dell'operazione */\n this.setMax(dati.getRowCount());\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "public void cargarSecuencia(FacturaProveedorSRI facturaProveedorSRI, PuntoDeVenta puntoDeVenta)\r\n/* 277: */ throws ExcepcionAS2\r\n/* 278: */ {\r\n/* 279:280 */ AutorizacionDocumentoSRI autorizacionDocumentoSRI = null;\r\n/* 280:283 */ if (puntoDeVenta != null) {\r\n/* 281:284 */ autorizacionDocumentoSRI = this.servicioDocumento.cargarDocumentoConAutorizacion(getFacturaProveedorSRI().getDocumento(), puntoDeVenta, facturaProveedorSRI\r\n/* 282:285 */ .getFechaEmisionRetencion());\r\n/* 283: */ }\r\n/* 284:287 */ if ((Integer.parseInt(facturaProveedorSRI.getNumeroRetencion()) == 0) || (\r\n/* 285:288 */ (facturaProveedorSRI.getDocumento() != null) && (facturaProveedorSRI.getDocumento().isIndicadorDocumentoElectronico()) && \r\n/* 286:289 */ (!facturaProveedorSRI.isTraCorregirDatos())))\r\n/* 287: */ {\r\n/* 288:290 */ String numero = this.servicioSecuencia.obtenerSecuencia(getFacturaProveedorSRI().getDocumento().getSecuencia(), facturaProveedorSRI\r\n/* 289:291 */ .getFechaEmisionRetencion());\r\n/* 290: */ \r\n/* 291:293 */ facturaProveedorSRI.setNumeroRetencion(numero);\r\n/* 292:294 */ facturaProveedorSRI.setAutorizacionRetencion(autorizacionDocumentoSRI.getAutorizacion());\r\n/* 293: */ }\r\n/* 294: */ }", "public void cambioEstadAvaluo() {\r\n try {\r\n if (\"\".equals(mBRadicacion.Radi.getObservacionAvaluo()) || \"\".equals(mBRadicacion.Radi.getEstadoAvaluo())) {\r\n mbTodero.setMens(\"Falta informacion por Llenar\");\r\n mbTodero.warn();\r\n } else {\r\n mBRadicacion.Radi.CambioEstRad(mBsesion.codigoMiSesion());\r\n mbTodero.setMens(\"La informacion ha sido guardada correctamente\");\r\n mbTodero.info();\r\n mbTodero.resetTable(\"FRMSeguimiento:SeguimientoTable\");\r\n RequestContext.getCurrentInstance().execute(\"PF('DlgEstAvaluo').hide()\");\r\n ListSeguimiento = Seg.ConsulSeguimAvaluos(mBsesion.codigoMiSesion());//VARIABLES DE SESION\r\n }\r\n } catch (Exception e) {\r\n mbTodero.setMens(\"Error en el metodo '\" + this.getClass() + \".cambioEstadAvaluo()' causado por: \" + e.getMessage());\r\n mbTodero.error();\r\n }\r\n }", "public ResultBusca(int pontFolha, int pos, boolean encontrou) {\n this.pontFolha = pontFolha;\n this.pos = pos;\n this.encontrou = encontrou;\n }", "public void setMontoSolicitado(double param){\n \n this.localMontoSolicitado=param;\n \n\n }", "public void seleccionarTipoComprobante() {\r\n if (com_tipo_comprobante.getValue() != null) {\r\n tab_tabla1.setCondicion(\"fecha_trans_cnccc between '\" + cal_fecha_inicio.getFecha() + \"' and '\" + cal_fecha_fin.getFecha() + \"' and ide_cntcm=\" + com_tipo_comprobante.getValue());\r\n tab_tabla1.ejecutarSql();\r\n tab_tabla2.ejecutarValorForanea(tab_tabla1.getValorSeleccionado());\r\n } else {\r\n tab_tabla1.limpiar();\r\n tab_tabla2.limpiar();\r\n }\r\n tex_num_transaccion.setValue(null);\r\n calcularTotal();\r\n utilitario.addUpdate(\"gri_totales,tex_num_transaccion\");\r\n }", "public void NopagaImpuestos(){\n\t\tif(sueldoBruto<BASE_MINIMA_IMPUESTOS){\n\t\tsueldoNeto=sueldoBruto;\n\t\ttipoImpuesto=\"En esta ocasión no paga impuestos\";\n\t\t}\n\t}", "public Final_parametre() {\r\n\t}", "public Cliente(int codCliente, String nome, String nomeCurto, String nif, boolean codPartePropio) {\n\t\tsuper();\n\t\tthis.codCliente = codCliente;\n\t\tthis.nome = nome;\n\t\tthis.nomeCurto = nomeCurto;\n\t\tthis.nif = nif;\n\t\tthis.codPartePropio = codPartePropio;\n\t}", "public KlijentPovezanaOsobaRs procitajSvePovezaneOsobePOVIJEST(KlijentPovezanaOsobaVo value) {\r\n return null;\r\n }", "@Override\r\n\tpublic void hacerSonido() {\n\t\tSystem.out.print(\"miau,miau -- o depende\");\r\n\t\t\r\n\t}", "public String validarAsociacion(String nombre, String dpi, String codigo_cuenta, String codigo_cliente) {\n String mensaje = \"\";\n DM_Cliente dmcli = new DM_Cliente();\n DM_Solicitud dmsol = new DM_Solicitud();\n try {\n Cliente cliente = dmcli.validarCliente(nombre, dpi);\n PreparedStatement PrSt;\n ResultSet rs = null;\n String Query = \"SELECT * FROM Cuenta WHERE Codigo = ?\";\n PrSt = conexion.prepareStatement(Query);\n PrSt.setString(1, codigo_cuenta);\n if (cliente != null) {\n rs = PrSt.executeQuery();\n if (rs.next()) {\n java.util.Date d = new java.util.Date();\n java.sql.Date fecha = new java.sql.Date(d.getTime());\n Solicitud solicitud = new Solicitud();\n solicitud.setEmisor(codigo_cliente);\n solicitud.setReceptor(cliente.getCodigo());\n solicitud.setCodigo_cuenta(codigo_cuenta);\n solicitud.setEstado(\"Pendiente\");\n solicitud.setFecha(fecha);\n mensaje = dmsol.agregarSolicitud(solicitud);\n } else {\n mensaje = \"La cuenta no existe\";\n }\n } else {\n mensaje = \"El dueño de la cuenta no existe\";\n }\n PrSt.close();\n rs.close();\n } catch (SQLException e) {\n System.out.println(e.toString());\n }\n return mensaje;\n }", "public void asignarPedido(Pedido pedido){\n\t\tdouble costeMin=100000;\n\t\tint pos=0;\n\t\t\n\t\tif (pedido.getPeso()<PESOMAXMOTO) {\n\t\tif(motosDisponibles.size()!=0){\n\t\t \n\t\t\tpos=0;\n\t\t\t//Damos como primer valor el de primera posición\n\t\t\t\n\t\t\tcosteMin=pedido.coste(motosDisponibles.get(0));\n\t\t\t\n\t\t\t//Ahora vamos a calcular el min yendo uno por uno\n\t\t\t\n\t\t\tfor(int i=0; i<motosDisponibles.size(); i++){\n\t\t\t\tif(costeMin>pedido.coste(motosDisponibles.get(i))){\n\t\t\t\t\tcosteMin=pedido.coste(motosDisponibles.get(i));\n\t\t\t\t\tpos=i;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Una vez hallada la moto de menor coste la asignamos\n\t\t\tpedido.setTransporte(motosDisponibles.get(pos));\n\t\t\tmotosDisponibles.removeElementAt(pos);\n\t\t\t\n\t\t \n\t\t}\n\t\telse {\n\t\t\tpedidosEsperandoMoto.add(pedidosEsperandoMoto.size(),pedido);\n\t\t}\n\t\t}\n\t\t\n\t\telse {\n\t\t\tif (furgonetasDisponibles.size()!=0){\n\t\t\tcosteMin = pedido.coste(furgonetasDisponibles.get(0));\n\t\t\tfor(int i=0; i<furgonetasDisponibles.size(); i++){\n\t\t\t\tif(costeMin>pedido.coste(furgonetasDisponibles.get(i))){\n\t\t\t\t\tcosteMin=pedido.coste(furgonetasDisponibles.get(i));\n\t\t\t\t\tpos=i;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpedido.setTransporte(furgonetasDisponibles.get(pos));\n\t\t\tfurgonetasDisponibles.removeElementAt(pos);\n\t\t}\n\t\t\telse{\n\t\t\t\tpedidosEsperandoFurgoneta.add(pedidosEsperandoFurgoneta.size(),pedido);\n\t\t\t}\n\t\t}\n\t}", "public void pedirCantidadProducto(String codBarra){\n this.productoSeleccionado = codBarra;\n }", "Object obtenerPolizasPorFolioSolicitudNoCancelada(int folioSolicitud,String formatoSolicitud);", "public void coMina(){\n espM=true;\r\n }", "private void enviarRequisicaoPalpite() {\n if (servidor.verificarPalpitar(nomeJogador)) {\n String palpite = NomeDialogo.nomeDialogo(null, \"Informe o seu palpite\", \"Digite o seu palpite:\", false);\n if (palpite != null && !servidor.palpitar(nomeJogador, Integer.parseInt(palpite))) {\n JanelaAlerta.janelaAlerta(null, \"Este palpite já foi dado!\", null);\n }\n }\n }", "public void setObjetivo( String novoObjetivo)\n\t{\n\t\tthis.objetivo = novoObjetivo;\n\t\tSystem.out.printf(\"Modificado o objetivo do curso %s\\n\", inicioCurso.getHoraAtual());\n\t}", "public void pedirValoresCabecera(){\n \r\n \r\n \r\n \r\n }", "public void controllore() {\n if (puntiVita > maxPunti) puntiVita = maxPunti;\n if (puntiFame > maxPunti) puntiFame = maxPunti;\n if (puntiFelicita > maxPunti) puntiFelicita = maxPunti;\n if (soldiTam < 1) {\n System.out.println(\"Hai finito i soldi\");\n System.exit(3);\n }\n //controlla che la creatura non sia morta, se lo è mette sonoVivo a false\n if (puntiVita <= minPunti && puntiFame <= minPunti && puntiFelicita <= minPunti) sonoVivo = false;\n }", "public void aumentarMinas(){\n\r\n if(espM==false){\r\n minascerca++;\r\n }\r\n }", "public void prepararPago(){\n pago = (float) 0.00;\n nuevoSaldo = (float) 0.00;\n intereses = (float) 0.00;\n mora = (float) 0.00;\n pagoValido = false;\n }", "public synchronized void ProvjeriPreuzimanje() {\n dopustenoPreuzimanje = true;\n if (dopustenoPreuzimanje) {\n SveFunkcijeDretve();\n } else {\n //sleep\n }\n }", "private static String mensagemProvavel(String nuvemVista[]) {\n\t\tString padraoClimas[][] = {\r\n\t\t\t\t{\"tempestade\", \"1\", \"1\", \"1\", \"1\", \"1\"},\r\n\t\t\t\t{\"chuva\",\t \"1\", \"0\", \"1\", \"0\", \"0\"},\r\n\t\t\t\t{\"nublado\",\t \"0\", \"1\", \"0\", \"1\", \"0\"},\r\n\t\t\t\t{\"sol\", \t \"0\", \"0\", \"0\", \"0\", \"1\"}\r\n\t\t};\r\n\t\t\r\n\t\tint iguais[][] = new int[padraoClimas.length][1];\r\n\t\t\r\n\t\t// Realiza comparação das nuvens \"vistas\" com os padroes de nuvens e contaquantas igualdades em cada clima padrao\r\n\t\tfor(int i = 0; i < padraoClimas.length; i++) {\r\n\t\t\tfor(int x = 1; x < padraoClimas[i].length; x++) {\r\n\t\t\t\tif(padraoClimas[i][x] == nuvemVista[x-1]) {\r\n\t\t\t\t\tiguais[i][0]++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tint maiorIgualdade = iguais[0][0];\r\n\t\tString clima = padraoClimas[0][0];\r\n\t\t\r\n\t\t// Checa qual dos climas tem maior igualdades e define o clima\r\n\t\tfor(int l = 0; l < iguais.length; l++) {\r\n\t\t\tif(iguais[l][0] == 5) {\r\n\t\t\t\tclima = padraoClimas[l][0];\r\n\t\t\t} else if (iguais[l][0] > maiorIgualdade) {\r\n\t\t\t\tmaiorIgualdade = iguais[l][0];\r\n\t\t\t\tclima = padraoClimas[l][0];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn clima;\r\n\t}", "public void PoblarINFO(String llamado) {//C.P.M Aqui llega como argumento llamado\r\n try {\r\n rs = modelo.Obteninfo();//C.P.M Mandamos a poblar la informacion de negocio\r\n if (llamado.equals(\"\")) {//C.P.M si el llamado llega vacio es que viene de la interface\r\n while (rs.next()) {//C.P.M recorremos el resultado para obtener los datos\r\n vista.jTNombreempresa.setText(rs.getString(1));//C.P.M los datos los enviamos a la vista de la interface\r\n vista.jTDireccion.setText(rs.getString(2));\r\n vista.jTTelefono.setText(rs.getString(3));\r\n vista.jTRFC.setText(rs.getString(4));\r\n }\r\n }\r\n if (llamado.equals(\"factura\")) {//C.P.M de lo contrario es llamado de factura y los valores se van a la vista de vactura \r\n while (rs.next()) {//C.P.M recorremos el resultado \r\n vistafactura.jTNombreempresa.setText(rs.getString(1));//C.P.M enviamos los datos a la vista de factura\r\n vistafactura.jTDireccion.setText(rs.getString(2));\r\n vistafactura.jTTelefono.setText(rs.getString(3));\r\n vistafactura.jTRFC.setText(rs.getString(4));\r\n }\r\n }\r\n } catch (SQLException ex) {//C.P.M Notificamos a el usuario si ocurre algun error\r\n JOptionPane.showMessageDialog(null,\"Ocurio un error al intentar consultar la informacion del negocio\");\r\n }\r\n }", "public void verComprobante() {\r\n if (tab_tabla1.getValorSeleccionado() != null) {\r\n if (!tab_tabla1.isFilaInsertada()) {\r\n Map parametros = new HashMap();\r\n parametros.put(\"ide_cnccc\", Long.parseLong(tab_tabla1.getValorSeleccionado()));\r\n parametros.put(\"ide_cnlap_debe\", p_con_lugar_debe);\r\n parametros.put(\"ide_cnlap_haber\", p_con_lugar_haber);\r\n vpdf_ver.setVisualizarPDF(\"rep_contabilidad/rep_comprobante_contabilidad.jasper\", parametros);\r\n vpdf_ver.dibujar();\r\n } else {\r\n utilitario.agregarMensajeInfo(\"Debe guardar el comprobante\", \"\");\r\n }\r\n\r\n } else {\r\n utilitario.agregarMensajeInfo(\"No hay ningun comprobante seleccionado\", \"\");\r\n }\r\n }", "public void setPriInicio (String val) {\n this.PriInicio = val;\n }", "public void setCantidadCUVErrado(java.math.BigInteger param){\n \n this.localCantidadCUVErrado=param;\n \n\n }", "private void moverJogadorAPosicao(int jogador, int valorDados, boolean iguais) {\n int tentativasDeSairDaPrisao = this.listaJogadores.get(jogadorAtual()).getTentativasSairDaPrisao();\n //Analisando se o cara esta preso, se a prisao ta ativada e se o cara tentou um numero de vezes menos que tres\n //ou se a funcao prisao esta falsa\n //ou se o jogador nao esta preso\n if ((JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && iguais && this.prisao == true && tentativasDeSairDaPrisao <= 2) || this.prisao == false || (!JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && this.prisao == true)) {\n if (JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && iguais && this.prisao == true && tentativasDeSairDaPrisao < 2);\n {\n this.sairdaPrisao(this.listaJogadores.get(jogadorAtual()));\n this.listaJogadores.get(jogadorAtual()).setTentativasSairDaPrisao(0);\n }\n this.posicoes[jogador] = (this.posicoes[jogador] + valorDados);\n if (posicoes[jogador] > 40) {\n posicoes[jogador] = posicoes[jogador] - 40;\n }\n }\n\n //analisando se o jogador esta preso e lanca numeros diferentes nos dados\n if (JogadorEstaPreso(this.listaJogadores.get(jogadorAtual()).getNome()) && !iguais && this.prisao == true) {\n //analisa se estourou as tentativas\n //se estourou\n if (this.listaJogadores.get(jogadorAtual()).getTentativasSairDaPrisao() == 2) {\n this.sairdaPrisao(this.listaJogadores.get(jogadorAtual()));\n this.listaJogadores.get(jogadorAtual()).retirarDinheiro(50);\n this.listaJogadores.get(jogadorAtual()).setTentativasSairDaPrisao(0);\n this.posicoes[jogador] = (this.posicoes[jogador] + valorDados);\n if (posicoes[jogador] > 40) {\n posicoes[jogador] = posicoes[jogador] - 40;\n }\n\n } //se nao estourou\n else if (this.listaJogadores.get(jogadorAtual()).getTentativasSairDaPrisao() < 2) {\n this.listaJogadores.get(jogadorAtual()).addTentativasSairDaPrisao();\n }\n\n\n }\n\n\n }", "private void esegui() {\n /* variabili e costanti locali di lavoro */\n OperazioneMonitorabile operazione;\n\n try { // prova ad eseguire il codice\n\n /**\n * Lancia l'operazione di analisi dei dati in un thread asincrono\n * al termine il thread aggiorna i dati del dialogo\n */\n operazione = new OpAnalisi(this.getProgressBar());\n operazione.avvia();\n\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n }", "public void ingresarproducto() {\r\n String Error;//C.P.M Creamos una variable para obtener algun error \r\n /*Preguntamos si todos los campos estan llenos sino lo notificamos*/\r\n if (vistaaltaproducto.jTnombre.getText().equals(\"\") || vistaaltaproducto.jTyyyy.getText().equals(\"\") || vistaaltaproducto.jTprecio.getText().equals(\"\")\r\n || vistaaltaproducto.jTexistencia.getText().equals(\"\") || vistaaltaproducto.jTdescripcion.getText().equals(\"\") || vistaaltaproducto.jTespecificaciones.getText().equals(\"\")) {\r\n JOptionPane.showMessageDialog(null, \"Faltan datos: No puede dejar cuadros en blanco\");\r\n } else {\r\n modelo.setCodigobarras(vistaaltaproducto.jTcodigobarras.getText());//C.P.M enviamos todos los datos a el modelo\r\n modelo.setNombre(vistaaltaproducto.jTnombre.getText());\r\n modelo.setCaducidad(vistaaltaproducto.jTyyyy.getText() + \"-\" + vistaaltaproducto.jTmm.getText() + \"-\" + vistaaltaproducto.jTdd.getText());\r\n modelo.setExistencia(vistaaltaproducto.jTexistencia.getText());\r\n modelo.setPrecio(vistaaltaproducto.jTprecio.getText());\r\n modelo.setDescripcion(vistaaltaproducto.jTdescripcion.getText());\r\n modelo.setEspecifica(vistaaltaproducto.jTespecificaciones.getText());\r\n Error = modelo.insertar();//C.P.M ejecutamos el metodo del modelo para insertar y esperamos algn error\r\n if (Error.equals(\"\")) {//C.P.M si error llega vacio es que todo salio bien\r\n JOptionPane.showMessageDialog(null, \"Producto: \" + vistaaltaproducto.jTnombre.getText() + \" agregado.\");//C.P.M lo notificamos\r\n vistaaltaproducto.jTnombre.setText(\"\");//C.P.M limpiamos los campos \r\n vistaaltaproducto.jTcodigobarras.setText(\"\");\r\n vistaaltaproducto.jTprecio.setText(\"\");\r\n vistaaltaproducto.jTyyyy.setText(\"\");\r\n vistaaltaproducto.jTmm.setText(\"\");\r\n vistaaltaproducto.jTdd.setText(\"\");\r\n vistaaltaproducto.jTexistencia.setText(\"\");\r\n vistaaltaproducto.jTdescripcion.setText(\"\");\r\n vistaaltaproducto.jTespecificaciones.setText(\"\");\r\n vistaaltaproducto.jTnombre.requestFocus();//C.P.M y ponemos el foco en el primer componente\r\n } else {\r\n JOptionPane.showMessageDialog(null, Error);//C.P.M de lo contrario notificamos el error\r\n }\r\n }\r\n }", "@Override\r\n\tpublic boolean seLanceSurServiteurProprietaire() {\n\t\treturn false;\r\n\t}", "public void estiloAcierto() {\r\n\t\t /**Bea y Jose**/\t\t\r\n \r\n\t}", "public Fogon (String cocineroActual){\n Cocinero = cocineroActual;\n grados = 0; \n }", "public static void eventoArticuloClienteDistribuidor(boolean preguntar) {\n if (preguntar) {\n if (Logica.Cuadros_Emergentes.confirmacionDefinida(\"\"\n + \"-Se borraran todos los datos escritos del nuevo distribuidor.\\n\\n\") == 0) {\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldCodigo.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldNombre.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldContacto.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldDireccion.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_botonHistorialDeDistribuidor.setVisible(false);\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldCodigo.setEditable(true);\n Diseño.Facturacion.paneles_base.panelBase_inventarioClientesDistribuidores.reestablecerComponentes();\n }\n } else {\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldCodigo.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldNombre.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldContacto.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldDireccion.setText(\"\");\n panel_nuevoDistribuidor.panelNuevoDistribuidor_botonHistorialDeDistribuidor.setVisible(false);\n panel_nuevoDistribuidor.panelNuevoDistribuidor_textFieldCodigo.setEditable(true);\n Diseño.Facturacion.paneles_base.panelBase_inventarioClientesDistribuidores.reestablecerComponentes();\n }\n }", "private String nalozZvieraNaVozidlo() {\r\n if (zoo.getPracovneVozidlo() == null) {\r\n return \"Pracovne vozidlo nie je pristavene\";\r\n }\r\n\r\n Integer pozicia = MojeMetody.vlozInt(\"Vloz cislo zvierata\");\r\n if (pozicia == null) return \"\";\r\n\r\n try {\r\n Prepravitelny z = (Prepravitelny) zoo.getZvierataZOO(pozicia - 1);\r\n zoo.nalozZivocicha(z);\r\n zoo.odstranZivocicha(pozicia - 1);\r\n return \"Zviera \" + z + \"\\n\\tbolo nalozene na prepravne vozidlo\";\r\n } catch (ClassCastException exCC) {\r\n return \"Zviera c. \" + pozicia + \" nemozno prepravit\\n\\t\";\r\n } catch (NullPointerException exNP) {\r\n return \"Zviera c. \" + pozicia + \" nie je v ZOO\";\r\n } catch (Exception ex) {\r\n return \"Neznama chyba:\\n\\t\" + ex;\r\n }\r\n }", "public static void viaggia(List<Trasporto> lista,Taxi[] taxi,HandlerCoR h) throws SQLException\r\n {\n Persona app = (Persona) lista.get(0);\r\n /* ARGOMENTI handleRequest\r\n 1° Oggetto Request\r\n 2° Array Taxi per permettere la selezione e la modifica della disponibilità\r\n */\r\n h.handleRequest(new RequestCoR(app.getPosPartenza(),app.getPosArrivo(),taxi),taxi); \r\n SceltaPercorso tempo = new SceltaPercorso();\r\n SceltaPercorso spazio = new SceltaPercorso();\r\n tempo.setPercorsoStrategy(new timeStrategy());\r\n spazio.setPercorsoStrategy(new lenghtStrategy());\r\n for(int i=0;i<5;i++)\r\n if(!taxi[i].getLibero())\r\n {\r\n if(Scelta.equals(\"veloce\"))\r\n {\r\n JOptionPane.showMessageDialog(null,\"Hai Scelto il Percorso più Veloce...\");\r\n Connessione conn;\r\n conn = Connessione.getConnessione();\r\n String query = \"Delete from CRONOCORSE where PASSEGGERO = ? \";\r\n try (PreparedStatement ps = conn.connect.prepareStatement(query)) {\r\n ps.setString(1, app.getNome());\r\n ps.executeUpdate();\r\n ps.close();\r\n JOptionPane.showMessageDialog(null,\"Cliente in viaggio...\\n\"+app.getNome()+\" è arrivato a destinazione!\\nPrezzo Corsa: \"+taxi[i].getPrezzoTotale()+\"€\");\r\n \r\n \r\n }catch(SQLException e){JOptionPane.showMessageDialog(null,e);}\r\n tempo.Prenota(taxi[i]); \r\n app.setPosPartenza();\r\n taxi[i].setPosizione(app.getPosArrivo());\r\n taxi[i].setStato(true);\r\n taxi[i].clear();\r\n lista.set(0,app);\r\n i=5;\r\n \r\n } else\r\n \r\n {\r\n JOptionPane.showMessageDialog(null,\"Hai Scelto il Percorso più Breve...\");\r\n Connessione conn;\r\n conn = Connessione.getConnessione();\r\n String query = \"Delete from CRONOCORSE where PASSEGGERO = ? \";\r\n try (PreparedStatement ps = conn.connect.prepareStatement(query)) {\r\n ps.setString(1, app.getNome());\r\n ps.executeUpdate();\r\n ps.close();\r\n JOptionPane.showMessageDialog(null,\"Cliente in viaggio...\\n\"+app.getNome()+\" è arrivato a destinazione!\\nPrezzo Corsa: \"+taxi[i].getPrezzoTotale()+\"€\");\r\n \r\n \r\n }catch(SQLException e){JOptionPane.showMessageDialog(null,e);}\r\n spazio.Prenota(taxi[i]); \r\n app.setPosPartenza();\r\n taxi[i].setPosizione(app.getPosArrivo());\r\n taxi[i].setStato(true);\r\n taxi[i].clear();\r\n lista.set(0,app);\r\n i=5;\r\n \r\n \r\n }\r\n }\r\n \r\n }", "public void primerTicketDisponibleEncontrado() {\n\t\tprimerTicketDisponible();\n\t\tint f; int c;\n\t\tString ticket = primerTicketDisponible();\n\t\tString[] dividir = ticket.split(\" \");\n\t\tString fila = dividir[0];\n\t\tString columna = dividir[1];\n\t\tSystem.out.println(fila);\n\t\tSystem.out.println(columna);\n\t\tf = Integer.parseInt(fila);\n\t\tc = Integer.parseInt(columna);\n\t\tactualizarPlazas(f, c);\n\t}" ]
[ "0.6692232", "0.6545629", "0.64959", "0.62777704", "0.6235652", "0.6116787", "0.6100717", "0.6080742", "0.60790265", "0.60545075", "0.6050223", "0.60495037", "0.59880817", "0.5973789", "0.596958", "0.5969554", "0.59562194", "0.59005326", "0.589959", "0.58990383", "0.5895133", "0.5894943", "0.58579254", "0.5855775", "0.5851359", "0.5851202", "0.58498716", "0.58411115", "0.58389187", "0.5838684", "0.58364785", "0.58232754", "0.5818564", "0.58139086", "0.5807175", "0.5800195", "0.578458", "0.578342", "0.5777649", "0.5771064", "0.5758716", "0.5752882", "0.5751644", "0.5747278", "0.57452726", "0.57449204", "0.5743519", "0.5737622", "0.5736826", "0.5724562", "0.5720797", "0.5720218", "0.5714414", "0.57024103", "0.5696467", "0.56948876", "0.56930417", "0.5689892", "0.56877494", "0.56868976", "0.5685394", "0.56849194", "0.5679726", "0.567427", "0.56405133", "0.5639934", "0.5638505", "0.5637031", "0.56269884", "0.56197166", "0.56124204", "0.5609826", "0.56096715", "0.5604604", "0.5598726", "0.55930126", "0.55922824", "0.5588678", "0.558554", "0.55851895", "0.55832833", "0.5581019", "0.55715764", "0.5570865", "0.5568812", "0.5565935", "0.5564934", "0.5560481", "0.5559375", "0.55571014", "0.5553162", "0.55488956", "0.5548806", "0.55448514", "0.55435294", "0.5543431", "0.5542621", "0.5542313", "0.55413103", "0.5531276", "0.55294174" ]
0.0
-1
Stampa a video una stringa generica
void stampaMessaggio(String messaggio);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void printOut(String s)\n {\n outVideo.println(s);\n outVideo.flush();\n }", "public void recordVideo() {\n\n }", "@Override\n\tprotected Object doInBackground() throws Exception {\n\t\tString cmd=\"ffmpeg -y -i \"+videoFile+ \" -vf \\\"drawtext=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:text=\"+message+\":fontsize=15:fontcolor=black:x=10:y=450\\\" \" +outputFile;\n\t\tProcessBuilder builder= new ProcessBuilder(\"/bin/bash\",\"-c\", cmd);\n\t\tProcess process= builder.start();\n\t\tpublish();\n\t\tInputStream stdout = process.getInputStream();\n\t\tBufferedReader stdoutBuffered = new BufferedReader( new InputStreamReader(stdout));\n\t\t//Get input from the terminal output of ffmpeg, when no more output is print means the video is complete.\n\t\twhile (stdoutBuffered.readLine() != null) {\n\t\t}\n\t\tprocess.waitFor();\n\t\tprocess.destroy();\n\t\treturn null;\n\t}", "@Override\n\t\t\t\t\t\t\t\tpublic void onLoadVideo(String result) {\n\n\t\t\t\t\t\t\t\t}", "@Override\n\tvoid postarVideo() {\n\n\t}", "public void takevideo() {\nSystem.out.println(\"take a video\");\r\n}", "@Override\n public void run() {\n if (data.isStreaming()) {\n // if (frame < list.size()) {\n try {\n // BufferedImage image = list.get(frame);\n enc.encodeImage(videoImage);\n // frame++;\n } catch (Exception ex) {\n System.out.println(\"Error encoding frame: \" + ex.getMessage());;\n }\n }\n\n }", "@Override\n\t\t\t\t\tpublic void onLoadVideo(String result) {\n\n\t\t\t\t\t}", "@Override\n\t\t\tpublic void onLoadVideo(String result) {\n\t\t\t}", "private static VideoHolder getAllVideo(String ligne) throws IOException {\n String[] vid = ligne.split(\" \");\n VideoHolder videoHolder = new VideoHolder();\n for (int i = 0; i < vid.length; i++) {\n videoHolder.add(new Video(i, Integer.parseInt(vid[i])));\n }\n return videoHolder;\n }", "public void playVideo() {\n \t\t try {\n \t\t\t videoView.setOnPreparedListener(new OnPreparedListener() {\n \n \t\t\t\t @Override\n \t\t\t\t public void onPrepared(MediaPlayer mp) {\n \t\t\t\t\t mp.setLooping(true); \n \t\t\t\t }\n \t\t\t });\n \t\t\t videoView.setVideoPath(SAVE_PATH);\n \t\t\t videoView.start();\n \t\t } catch (Exception e) {\n \t\t\t Log.e(\"Video\", \"error: \" + e.getMessage(), e);\n \t\t }\n \t }", "@Override\n\tpublic void videoStart() {\n\t\t\n\t}", "@Override\n\tpublic void videoComplete() {\n\t\t\n\t}", "@SuppressLint(\"DefaultLocale\")\n public void executeFFmpeg() {\n realPatch = FileUtils.getFilePath(TrimmingActivity.this, videoUri);\n scale = videoView.getScale();\n viewWidth = videoView.getWidth();\n viewHeight = videoView.getHeight();\n width = (int)(viewWidth * scale);\n height = (int)(viewHeight * scale);\n positionX = (int) videoView.getRealPositionX();\n positionY = (int) videoView.getRealPositionY();\n videoWidth = videoView.getVideoWidth();\n videoHeight = videoView.getVideoHeight();\n rotate = videoView.getRotate();\n\n start = String.format(\"00:%02d:%02.2f\", trimStartTime, trimEndTime/1000f);\n dur = String.format(\"00:00:%02.2f\", videoDuration/1000f);\n\n // When need crop\n // FIXME\n if(mRatioWidth != 0) {\n // FIXME\n String filterScale = \"setsar=1:1\";\n if(mRatioWidth == 4) {\n filterScale = \"scale=640:480, setsar=1:1\";\n } else if(mRatioWidth == 3) {\n filterScale = \"scale=480:640, setsar=1:1\";\n } else if(mRatioWidth == 1) {\n filterScale = \"scale=640:640, setsar=1:1\";\n }\n\n if(rotate == 0) {\n filter = \"crop=\"+width+\":\"+height+\":\"+positionX+\":\"+positionY+ \", \" + filterScale;\n } else if(rotate == 90) {\n filter = \"crop=\"+height+\":\"+width+\":\"+positionY+\":\"+positionX + \", \" + filterScale;\n } else if(rotate == 180) {\n filter = \"crop=\"+width+\":\"+height+\":\"+(videoWidth - positionX - width)+\":\"+positionY + \", \" + filterScale;\n } else if(rotate == 270) {\n filter = \"crop=\"+height+\":\"+width+\":\"+(videoHeight - positionY - height)+\":\"+positionX + \", \" + filterScale;\n } else {\n filter = \"crop=\"+width+\":\"+height+\":\"+positionX+\":\"+positionY + \", \" + filterScale;\n }\n }\n\n\n String[] commandParams = new String[20];\n commandParams[0] = \"-y\";\n commandParams[1] = \"-i\";\n commandParams[2] = realPatch;\n commandParams[3] = \"-vcodec\";\n commandParams[4] = \"libx264\";\n commandParams[5] = \"-profile:v\";\n commandParams[6] = \"baseline\";\n commandParams[7] = \"-level\";\n commandParams[8] = \"3.1\";\n commandParams[9] = \"-b:v\";\n commandParams[10] = \"1000k\";\n commandParams[11] = \"-ss\";\n commandParams[12] = start;\n commandParams[13] = \"-t\";\n commandParams[14] = dur;\n commandParams[15] = \"-c:a\";\n commandParams[16] = \"copy\";\n commandParams[17] = outputPatch;\n commandParams[18] = \"-vf\";\n commandParams[19] = filter;\n\n try {\n fFmpeg.execute(commandParams, new ExecuteBinaryResponseHandler(){\n @Override\n public void onSuccess(String message) {\n super.onSuccess(message);\n }\n\n @Override\n public void onProgress(String message) {\n Log.e(\"VideoCronProgress\", message);\n }\n\n @Override\n public void onFailure(String message) {\n Log.e(\"VideoCompressor\", message);\n }\n\n @Override\n public void onStart() {\n super.onStart();\n }\n\n @Override\n public void onFinish() {\n super.onFinish();\n Log.e(\"VideoCronProgress\", \"finnished\");\n }\n });\n } catch (FFmpegCommandAlreadyRunningException e) {\n e.printStackTrace();\n }\n\n }", "private void liveStreaming() throws IOException, InterruptedException {\n\n CamStreaming camStreaming = new CamStreaming();\n VideoDataStream vds = new VideoDataStream(true);\n byte[] frame;\n\n if (camStreaming.prepareStream(in)) {\n\n while (camStreaming.isTargetConnected()) {\n try {\n\n if (dis.available() > 0) {\n frame = vds.processFrame(dis);\n camStreaming.sendData(frame);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n break;\n }\n sleep(20);\n }\n \n dos.writeInt(END_OF_STREAM_CODE);\n dos.flush();\n \n// CamRegister.removeCamClient(camClient);\n \n RecordStorage recordStorage = new RecordStorage();\n\n recordStorage.saveVideo(vds.getBuffer(), camClient.getCamCode());\n\n vds.cleanBuffer();\n\n }\n\n }", "public void playVideo() {\n }", "public abstract void videoMessage(Message m);", "public void convert_video_commands()\n {\n //Loads the ffmpeg library\n FFmpeg ffmpeg = FFmpeg.getInstance(this);\n try {\n ffmpeg.loadBinary(new LoadBinaryResponseHandler() {\n\n @Override\n public void onStart() {\n }\n\n @Override\n public void onFailure() {\n }\n\n @Override\n public void onSuccess() {\n }\n\n @Override\n public void onFinish() {\n }\n });\n } catch (FFmpegNotSupportedException e) {\n // Handle if FFmpeg is not supported by device\n }\n\n // If the .mpjep files exist it deletes the older file\n File newfile = new File(folder_path + mpjeg_name);\n\n if (newfile.exists()) {\n newfile.delete();\n }\n\n try {\n // to execute \"ffmpeg -version\" command you just need to pass \"-version\"\n ffmpeg.execute(new String[]{\"-i\", folder_path + vid_name, \"-vcodec\", \"mjpeg\", folder_path + mpjeg_name}, new ExecuteBinaryResponseHandler() {\n\n @Override\n public void onStart()\n {\n showProgressDialogWithTitle(\"Converting to AVI and Measuring Heart Rate\");\n }\n\n @Override\n public void onProgress(String message)\n {\n\n }\n\n @Override\n public void onFailure(String message) {\n }\n\n @Override\n public void onSuccess(String message)\n {\n\n }\n\n @Override\n public void onFinish()\n {\n\n }\n });\n } catch (FFmpegCommandAlreadyRunningException e) {\n // Handle if FFmpeg is already running\n }\n\n // If the .avi file exist it deletes the older file\n File avi_newfile = new File(folder_path + avi_name);\n\n if (avi_newfile.exists()) {\n avi_newfile.delete();\n }\n try {\n // to execute \"ffmpeg -version\" command you just need to pass \"-version\"\n ffmpeg.execute(new String[]{\"-i\", folder_path + mpjeg_name, \"-vcodec\", \"mjpeg\", folder_path + avi_name}, new ExecuteBinaryResponseHandler() {\n\n @Override\n public void onStart()\n {\n\n }\n\n @Override\n public void onProgress(String message)\n {\n\n }\n\n @Override\n public void onFailure(String message) {\n }\n\n @Override\n public void onSuccess(String message)\n {\n\n\n }\n\n @Override\n public void onFinish()\n {\n\n while(true)\n {\n\n // Calculate the heart rate\n VideoCapture videoCapture = new VideoCapture();\n\n if(new File(folder_path + avi_name).exists()) {\n Log.d(TAG, \"AVI file exists!\");\n videoCapture.open(folder_path + avi_name);\n if (videoCapture.isOpened()) {\n Log.d(TAG, \"isOpened() works!\");\n\n Mat current_frame = new Mat();\n Mat next_frame = new Mat();\n Mat diff_frame = new Mat();\n\n List<Double> extremes = new ArrayList<Double>();\n\n\n int video_length = (int) videoCapture.get(Videoio.CAP_PROP_FRAME_COUNT);\n Log.d(TAG, \"Video Length: \" + video_length);\n int frames_per_second = (int) videoCapture.get(Videoio.CAP_PROP_FPS);\n Log.d(TAG, \"Frames per second: \" + frames_per_second);\n\n List<Double> list = new ArrayList<Double>();\n\n videoCapture.read(current_frame);\n for (int k = 0; k < video_length - 1; k++) {\n videoCapture.read(next_frame);\n Core.subtract(next_frame, current_frame, diff_frame);\n next_frame.copyTo(current_frame);\n list.add(Core.mean(diff_frame).val[0] + Core.mean(diff_frame).val[1] + Core.mean(diff_frame).val[2]);\n }\n\n List<Double> new_list = new ArrayList<Double>();\n for (int i = 0; i < (Integer) (list.size() / 5) - 1; i++) {\n List<Double> sublist = list.subList(i * 5, (i + 1) * 5);\n double sum = 0.0;\n for (int j = 0; j < sublist.size(); j++) {\n sum += sublist.get(j);\n }\n\n new_list.add(sum / 5);\n }\n\n int mov_period = 50;\n\n List<Double> avg_data = algos.calc_mov_avg(mov_period, new_list);\n int peak_counts = algos.count_peak_points(avg_data);\n\n double fps_to_sec = (video_length / frames_per_second);\n double count_heart_rate = (peak_counts / 2) * (60) / fps_to_sec;\n String heart_rate = \"\" + count_heart_rate;\n if (heart_rate != \"\") {\n // Display the heart rate\n hr_val = Double.parseDouble(heart_rate);\n TextView ins = (TextView) findViewById(R.id.instructions);\n //String start_display = \"User Guide: \\n 1. Press Heart Rate Button \\n 2. Turn on Flash Light \\n\" + \"3. Keep Fingertip on camera\";\n ins.append(\"\\n Heart Rate: \" + hr_val);\n hideProgressDialogWithTitle();\n break;\n }\n }\n }\n }\n\n\n }\n });\n\n } catch (FFmpegCommandAlreadyRunningException e) {\n // Handle if FFmpeg is already running\n }\n\n }", "public String mo1736b() {\n return \"video\";\n }", "public String getVideo() {\n return video;\n }", "private void showOST(int position) {\n\t\tString youtubeUrl = \"\";\n\t\tString youtubeId = \"\";\n\t\tString rtsp_link = \"\";\n\t\t\n\t\t//urlYoutube = ost_links[position];\n\t\t//youtubeUrl = \"http://www.youtube.com/watch?v=MV5qvrxmegY\";\n\t\t//rtsp_link = getUrlVideoRTSP(youtubeUrl);\n\t\t//rtsp_link = \"rtsp://r1---sn-a5m7zu7e.c.youtube.com/CiILENy73wIaGQkGema8vmpeMRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\";\n\t\t//rtsp_link = \"https://archive.org/download/Pbtestfilemp4videotestmp4/video_test_512kb.mp4\";\n\t\t//rtsp_link = \"rtsp://r3---sn-a5m7zu7d.c.youtube.com/CiILENy73wIaGQn061BlwOVsxRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\";\n\t\trtsp_link = ost_links[position];\t\t\n\t\tVideoView videoView = (VideoView) this.findViewById(R.id.videoView1);\n\t\tLog.v(\"Video\", \"***Video to Play:: \" + rtsp_link);\n\t\t\n\t\t// add controls to a MediaPlayer like play, pause.\n\t\tMediaController mc = new MediaController(this);\n\t\tvideoView.setMediaController(mc);\n\t\n\t\t// Set the path of Video or URI\n\t\tmc.setAnchorView(videoView);\n\t\tUri videoPath = null;\n\t\tvideoPath = Uri.parse(rtsp_link);\n\t\t\n\t\tvideoView.setVideoURI(videoPath);\n\t\tvideoView.requestFocus();\n\t\tvideoView.start();\t\n\t\tmc.show();\n\t}", "public VideoEncoder(Data data) {\n try {\n startTime = LocalDateTime.now();\n String minute, hour, day, month, year;\n if (startTime.getMinute() < 10) {\n minute = \"0\" + Integer.toString(startTime.getMinute());\n } else {\n minute = Integer.toString(startTime.getMinute());\n }\n if (startTime.getHour() < 10) {\n hour = \"0\" + Integer.toString(startTime.getHour());\n } else {\n hour = Integer.toString(startTime.getHour());\n }\n if (startTime.getDayOfMonth() < 10) {\n day = \"0\" + Integer.toString(startTime.getDayOfMonth());\n } else {\n day = Integer.toString(startTime.getDayOfMonth());\n }\n if (startTime.getMonthValue() < 10) {\n month = \"0\" + Integer.toString(startTime.getMonthValue());\n } else {\n month = Integer.toString(startTime.getMonthValue());\n }\n year = Integer.toString(startTime.getYear());\n\n File dir = null;\n try {\n dir = new File(\"C:\\\\TowedROV\\\\ROV_Video\\\\\");\n if (!dir.exists() || !dir.isDirectory()) {\n System.out.println(\"No directory found, creating a new one at C://TowedROV/ROV_Video/\");\n dir.mkdir();\n }\n } catch (Exception e) {\n System.out.println(\"No directory found, creating a new one at C://TowedROV/ROV_Video/\");\n dir.mkdir();\n }\n\n String fileName = dir.getPath() + \"\\\\ROV Video\" + hour + minute + \" \" + day + \".\"\n + month + \".\" + year + \".mp4\";\n enc = AWTSequenceEncoder.create24Fps(new File(fileName));\n this.data = data;\n } catch (Exception ex) {\n System.out.println(\"Exception while starting video encoder: \" + ex.getMessage());\n }\n }", "public void convertor(String videoInputPath, String videoOutputPath) throws Exception {\n\t\tList<String> command = new ArrayList<>();\n\t\tcommand.add(ffmpegEXE);\n\t\t\n\t\tcommand.add(\"-i\");\n\t\tcommand.add(videoInputPath);\n\t\tcommand.add(\"-y\");\n\t\tcommand.add(videoOutputPath);\n\t\t\n\t\tfor (String c : command) {\n\t\t\tSystem.out.print(c + \" \");\n\t\t}\n\t\t\n\t\tProcessBuilder builder = new ProcessBuilder(command);\n\t\tProcess process = builder.start();\n\t\t\n\t\tInputStream errorStream = process.getErrorStream();\n\t\tInputStreamReader inputStreamReader = new InputStreamReader(errorStream);\n\t\tBufferedReader br = new BufferedReader(inputStreamReader);\n\t\t\n\t\tString line = \"\";\n\t\twhile ( (line = br.readLine()) != null ) {\n\t\t}\n\t\t\n\t\tif (br != null) {\n\t\t\tbr.close();\n\t\t}\n\t\tif (inputStreamReader != null) {\n\t\t\tinputStreamReader.close();\n\t\t}\n\t\tif (errorStream != null) {\n\t\t\terrorStream.close();\n\t\t}\n\t\t\n\t}", "public void run() {\n\t\ttry {\n if (prot == TransmissionProtocol.UDP) {\n \tgrabber.setOption(\"rtsp_transport\", \"udp\");\n } else if (prot == TransmissionProtocol.TCP) {\n \tgrabber.setOption(\"rtsp_transport\", \"tcp\");\n }\n if (codec == VideoCodec.H264) {\n \tgrabber.setVideoCodec(avcodec.AV_CODEC_ID_H264);\n } else if (codec == VideoCodec.MPEG4) {\n \tgrabber.setVideoCodec(avcodec.AV_CODEC_ID_MPEG4);\n }\n grabber.start();\n AudioFormat audioFormat = new AudioFormat(grabber.getSampleRate(), 16, grabber.getAudioChannels(), true, true);\n\n DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);\n SourceDataLine soundLine = (SourceDataLine) AudioSystem.getLine(info);\n soundLine.open(audioFormat);\n volume = (FloatControl) soundLine.getControl(FloatControl.Type.MASTER_GAIN);\n soundLine.start();\n\n Java2DFrameConverter converter = new Java2DFrameConverter();\n \n ExecutorService executor = Executors.newSingleThreadExecutor(InterfaceController.ntfInstance);\n view.setImage(null);\n view.setScaleX(1);\n view.setScaleY(1);\n Thread.currentThread().setName(\"FSCV-VPT\");\n isProcessing = true;\n while (!Thread.interrupted()) {\n frame = grabber.grab();\n if (frame == null) {\n break;\n }\n if (frame.image != null) {\n currentFrame = SwingFXUtils.toFXImage(converter.convert(frame), null);\n Platform.runLater(() -> {\n view.setImage(currentFrame);\n });\n } else if (frame.samples != null) {\n channelSamplesShortBuffer = (ShortBuffer) frame.samples[0];\n channelSamplesShortBuffer.rewind();\n\n outBuffer = ByteBuffer.allocate(channelSamplesShortBuffer.capacity() * 2);\n \n for (int i = 0; i < channelSamplesShortBuffer.capacity(); i++) {\n short val = channelSamplesShortBuffer.get(i);\n outBuffer.putShort(val);\n }\n\n /**\n * We need this because soundLine.write ignores\n * interruptions during writing.\n */\n try {\n executor.submit(() -> {\n soundLine.write(outBuffer.array(), 0, outBuffer.capacity());\n outBuffer.clear();\n }).get();\n } catch (InterruptedException interruptedException) {\n Thread.currentThread().interrupt();\n }\n }\n }\n isProcessing = false;\n executor.shutdownNow();\n executor.awaitTermination(10, TimeUnit.SECONDS);\n soundLine.stop();\n grabber.stop();\n grabber.release();\n grabber.close();\n } catch (Exception e) {\n \te.printStackTrace();\n }\n\t}", "Builder addVideo(String value);", "public void generateVideoFilename(int outputFileFormat) {\n long dateTaken = System.currentTimeMillis();\n String title = createName(dateTaken);\n String filename = new StringBuilder();\n filename.append(title);\n filename.append(convertOutputFormatToFileExt(outputFileFormat));\n filename = filename.toString();\n String mime = convertOutputFormatToMimeType(outputFileFormat);\n String path = new StringBuilder();\n path.append(Storage.DIRECTORY);\n path.append('/');\n path.append(filename);\n path = path.toString();\n String tmpPath = path;\n if (!(this.mNeedGLRender || isSupportEffects())) {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(path);\n stringBuilder.append(VIDEO_TEMP_SUFFIXES);\n tmpPath = stringBuilder.toString();\n }\n this.mCurrentVideoValues = new ContentValues(9);\n this.mCurrentVideoValues.put(\"title\", title);\n this.mCurrentVideoValues.put(\"_display_name\", filename);\n this.mCurrentVideoValues.put(\"datetaken\", Long.valueOf(dateTaken));\n this.mCurrentVideoValues.put(InfoTable.DATE_MODIFIED, Long.valueOf(dateTaken / MIN_VIDEO_RECODER_DURATION));\n this.mCurrentVideoValues.put(InfoTable.MIME_TYPE, mime);\n this.mCurrentVideoValues.put(\"_data\", path);\n this.mCurrentVideoValues.put(InfoTable.WIDTH, Integer.valueOf(this.mProfile.videoFrameWidth));\n this.mCurrentVideoValues.put(InfoTable.HEIGHT, Integer.valueOf(this.mProfile.videoFrameHeight));\n ContentValues contentValues = this.mCurrentVideoValues;\n String str = InfoTable.RESOLUTION;\n StringBuilder stringBuilder2 = new StringBuilder();\n stringBuilder2.append(Integer.toString(this.mProfile.videoFrameWidth));\n stringBuilder2.append(\"x\");\n stringBuilder2.append(Integer.toString(this.mProfile.videoFrameHeight));\n contentValues.put(str, stringBuilder2.toString());\n Location loc = this.mLocationManager.getCurrentLocation();\n if (loc != null) {\n this.mCurrentVideoValues.put(InfoTable.LATITUDE, Double.valueOf(loc.getLatitude()));\n this.mCurrentVideoValues.put(InfoTable.LONGITUDE, Double.valueOf(loc.getLongitude()));\n }\n this.mVideoFilename = tmpPath;\n Tag tag = TAG;\n stringBuilder2 = new StringBuilder();\n stringBuilder2.append(\"New video filename: \");\n stringBuilder2.append(this.mVideoFilename);\n Log.v(tag, stringBuilder2.toString());\n }", "public void startStreaming() {\n// phoneCam.setViewportRenderingPolicy(OpenCvCamera.ViewportRenderingPolicy.OPTIMIZE_VIEW);\n phoneCam.startStreaming(320, 240, OpenCvCameraRotation.SIDEWAYS_RIGHT);\n }", "public void setVideo(String video) {\n this.video = video;\n }", "public void onVideoStarted () {}", "@Override\n public void onVideoEnd() {\n super.onVideoEnd();\n }", "public void crearVideojuego(){\n String titulo;\n String autor;\n Multimedia.FORMATO formato;\n GregorianCalendar anyo;\n Videojuego.PLATAFORMA plataforma = Videojuego.PLATAFORMA.ERROR;\n\n int opcion = -1;\n boolean validado = false;\n\n\n titulo = pedirString(\"titulo\"); // Pido el titulo\n autor = pedirString(\"autor\"); // Pido el autor\n formato = pedirFormato(); // Pido el formato\n anyo = pedirAnyo(); // Pido el anyo\n\n\n do{\n\n System.out.println(\"Elige la plataforma:\");\n System.out.println(\"1. PLAYSTATION\");\n System.out.println(\"2. XBOX\");\n System.out.println(\"3. NINTENDO\");\n\n try {\n opcion = Integer.parseInt(lector.nextLine());\n validado = true;\n if (opcion > 3 || opcion < 1) {\n validado = false;\n System.out.println(\"Por favor, introduce un numero entre el 1 y el 3\");\n }\n }catch (NumberFormatException nfe){\n System.out.println(\"Introduce un valor numerico entre el 1 y el 3\");\n }\n }while(!validado);\n\n switch (opcion){\n case 1:\n plataforma = Videojuego.PLATAFORMA.PLAYSTATION;\n break;\n case 2:\n plataforma = Videojuego.PLATAFORMA.XBOX;\n break;\n case 3:\n plataforma = Videojuego.PLATAFORMA.NINTENDO;\n break;\n default:\n break;\n }\n\n //Creo el videojuego y lo anyado a la tienda:\n\n tienda.getVideojuegos().add(new Videojuego(titulo,autor,formato,anyo,plataforma));\n System.out.println(\"Videojuego creado con exito\");\n Lib.pausa();\n\n\n\n }", "public String getVideoBufferCharacters()\n\t{\n\t\tint maxRows, maxCols, index;\n\t\tStringBuffer text;\n\t\t\n\t\t// Retrieve screen dimension in text mode\n\t\tmaxRows = screen.getScreenRows();\n\t\tmaxCols = screen.getScreenColumns();\n\t\t\n\t\t// Create initial stringbuffer\n\t\ttext = new StringBuffer(maxRows * maxCols);\n\t\t\n\t\t// Convert each character in textSnapshot into Unicode character\n\t\tfor (int row = 0; row < maxRows; row++)\n\t\t{\n\t\t\tfor (int col = 0; col < maxCols; col++)\n\t\t\t{\n\t\t\t\tindex = videocard.textSnapshot[(row * maxCols * 2) + (col * 2)] & 0xFF;\n\t\t\t\tif (index < 255)\n\t\t\t\t{\n\t\t\t\t\ttext.append(textTranslation.asciiToUnicode[index]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Add a newline at the end of row\n\t\t\ttext.append(\"\\n\");\n\t\t}\n\t\t\n\t\treturn text.toString();\n\t}", "public Video(String nombre) {\n super(nombre);\n }", "public static void setVideoSource(String source){\r\n\r\n editor.putString(\"VideoMode\", source);\r\n editor.commit();\r\n }", "@Override\n public void onServerStart(String videoStreamUrl)\n {\n\n\n\n Log.d(\"Activity\",\"URL: \"+ videoStreamUrl);\n\n\n video = (VideoView)findViewById(R.id.video);\n\n Uri uri = Uri.parse(videoStreamUrl);\n video.setVideoURI(uri);\n video.start();\n\n\n\n }", "public void verVideo(View v) {\n ViewVideo.setVideoURI(Uri.parse(getExternalFilesDir(null) + \"/\" + txtNombreArchivo.getText().toString()));\n /*Ejecutamos el video*/\n ViewVideo.start();\n }", "public void grabarVideo(View v) {\n Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);\n /*Creamos un archivo que contendra el video, mandanto el path (null es para indicar que no\n va en un directorio interno, solo en la raiz) ---- nombre del video*/\n /*RECORDAR QUE ESTE ARCHIVO QUEDA EN LA CARPETA ANDROID, EN LA CARPETA CON EL NOMBRE DEL\n * PAQUETE DEL PROYECTO, ESA ES LA RAIZ*/\n File video = new File(getExternalFilesDir(null), txtNombreArchivo.getText().toString());\n /*Mandamos el permiso para almacenar, y la ruta del video donde quedara*/\n intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(video));\n /*Ejecutamos la actividad*/\n startActivity(intent);\n }", "@Override\n public void releaseVideoFrames() {\n\n }", "@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tout.append(\" total time is taken to upload the video is\"+\",\"+String.valueOf(dif_upload)+\"ms\"+\",\"+Scenario);\n\t\t\t\t\t\t\t out.newLine();\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t try {\n\t\t\t\t\t\t\t\t\tout.flush();\n\t\t\t\t\t\t\t\t\t out.close();\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "public void captureVideo(String element) {\r\n\t\tvideoUtil.startVideoTool(getView(), element);\r\n\t}", "public void run()\r\n/* 41: */ {\r\n/* 42: */ try\r\n/* 43: */ {\r\n/* 44: 40 */ Connections.getPorts(MovieManager.this).transmit(\"switch tab\", \"Video annotation\");\r\n/* 45: 41 */ MovieManager.this.movieDescriptions = new ArrayList();\r\n/* 46: */ \r\n/* 47: 43 */ List<URL> fileNames = PathFinder.listFiles(\"visualmemory/annotations\", \".txt\");\r\n/* 48: 44 */ List<URL> movieURLs = PathFinder.listFiles(\"visualmemory/videos\", \"mov\");\r\n/* 49: 45 */ movieURLs.addAll(PathFinder.listFiles(\"visualmemory/videos\", \"mpg\"));\r\n/* 50: */ BufferedReader reader;\r\n/* 51: */ String line;\r\n/* 52: 47 */ for (Iterator localIterator = fileNames.iterator(); localIterator.hasNext(); (line = reader.readLine()) != null)\r\n/* 53: */ {\r\n/* 54: 47 */ URL annotationURL = (URL)localIterator.next();\r\n/* 55: 48 */ String txtFileName = FilenameUtils.getBaseName(URLDecoder.decode(annotationURL.toString(), \"utf-8\"));\r\n/* 56: 49 */ URL movieURL = PathFinder.lookupURL(\"visualmemory/videos/\" + txtFileName + \".mov\");\r\n/* 57: 50 */ if (movieURL == null) {\r\n/* 58: 51 */ movieURL = PathFinder.lookupURL(\"visualmemory/videos/\" + txtFileName + \".mpg\");\r\n/* 59: */ }\r\n/* 60: 53 */ if (movieURL == null) {\r\n/* 61: 54 */ Mark.say(new Object[] {\"No movie named \", txtFileName });\r\n/* 62: */ }\r\n/* 63: 56 */ Mark.say(new Object[] {\"MovieURL is \" + movieURL });\r\n/* 64: 57 */ Connections.getPorts(MovieManager.this).transmit(Html.h1(\"Annotations of \" + txtFileName + \":\"));\r\n/* 65: */ \r\n/* 66: 59 */ MovieDescription movieDescription = new MovieDescription(movieURL);\r\n/* 67: 60 */ MovieManager.this.movieDescriptions.add(movieDescription);\r\n/* 68: 61 */ Mark.say(new Object[] {\"Now movie count is\", Integer.valueOf(MovieManager.this.movieDescriptions.size()), annotationURL, \"-->\", movieURL });\r\n/* 69: 62 */ reader = new BufferedReader(new InputStreamReader(annotationURL.openStream()));\r\n/* 70: */ \r\n/* 71: 64 */ continue;\r\n/* 72: */ String line;\r\n/* 73: 65 */ String prefix = \"summary:\";\r\n/* 74: 66 */ boolean test = line.toLowerCase().startsWith(prefix);\r\n/* 75: 67 */ MovieLink movieLink = null;\r\n/* 76: 68 */ if (test)\r\n/* 77: */ {\r\n/* 78: 69 */ line = line.substring(prefix.length()).trim();\r\n/* 79: */ \r\n/* 80: */ \r\n/* 81: 72 */ movieLink = new MovieLink(line, movieDescription);\r\n/* 82: 73 */ movieDescription.addSummary(movieLink);\r\n/* 83: */ }\r\n/* 84: 75 */ else if (line.indexOf(\":\") > 0)\r\n/* 85: */ {\r\n/* 86: 76 */ int index = line.indexOf(\":\");\r\n/* 87: 77 */ String frames = line.substring(0, index);\r\n/* 88: 78 */ line = line.substring(index + 1).trim();\r\n/* 89: */ \r\n/* 90: */ \r\n/* 91: 81 */ movieLink = new MovieLink(line, movieDescription, frames);\r\n/* 92: 82 */ movieDescription.addEvent(movieLink);\r\n/* 93: */ }\r\n/* 94: 84 */ if (movieLink != null)\r\n/* 95: */ {\r\n/* 96: 85 */ String phrase = movieLink.getPhrase();\r\n/* 97: 86 */ Sequence sequence = null;\r\n/* 98: 87 */ Entity instantiation = null;\r\n/* 99: */ \r\n/* 100: 89 */ sequence = MovieManager.this.gauntlet.getStartParser().parse(phrase);\r\n/* 101: 90 */ if (sequence != null) {\r\n/* 102: 91 */ instantiation = MovieManager.this.gauntlet.getNewSemanticTranslator().interpret(sequence);\r\n/* 103: */ }\r\n/* 104: 93 */ if (instantiation.isA(\"semantic-interpretation\"))\r\n/* 105: */ {\r\n/* 106: 94 */ if (instantiation.sequenceP())\r\n/* 107: */ {\r\n/* 108: 95 */ Sequence s = (Sequence)instantiation;\r\n/* 109: 96 */ if (!s.getElements().isEmpty()) {\r\n/* 110: 97 */ instantiation = s.getElement(0);\r\n/* 111: */ }\r\n/* 112: */ }\r\n/* 113: */ }\r\n/* 114:107 */ else if (instantiation != null)\r\n/* 115: */ {\r\n/* 116:108 */ movieLink.setRepresentation(instantiation);\r\n/* 117:109 */ Connections.getPorts(MovieManager.this).transmit(Html.normal(Punctuator.addPeriod(phrase)));\r\n/* 118: */ }\r\n/* 119: */ else\r\n/* 120: */ {\r\n/* 121:112 */ System.out.println(\"No parse for \" + phrase + \"!!!\");\r\n/* 122: */ }\r\n/* 123: */ }\r\n/* 124: */ }\r\n/* 125: */ }\r\n/* 126: */ catch (Exception e)\r\n/* 127: */ {\r\n/* 128:121 */ e.printStackTrace();\r\n/* 129: */ }\r\n/* 130: */ finally\r\n/* 131: */ {\r\n/* 132:124 */ if (MovieManager.this.gauntlet != null) {\r\n/* 133:125 */ MovieManager.this.gauntlet.openInterface();\r\n/* 134: */ }\r\n/* 135: */ }\r\n/* 136:128 */ Connections.getPorts(MovieManager.this).transmit(\"switch tab\", \"silence\");\r\n/* 137: */ \r\n/* 138:130 */ System.out.println(\"Loaded: \" + MovieManager.this.movieDescriptions.size());\r\n/* 139: */ }", "public void saveAndTransferVideoComplexObs(){\n\n try{\n List<Encounter> encounters = Context.getEncounterService().getEncounters(null, null, null, null, null, null, true);\n Encounter lastEncounter = encounters.get(encounters.size()-1);\n\n Person patient = lastEncounter.getPatient();\n ConceptComplex conceptComplex = Context.getConceptService().getConceptComplex(14);\n Location location = Context.getLocationService().getDefaultLocation();\n Obs obs = new Obs(patient, conceptComplex, new Date(), location) ;\n\n String mergedUrl = tempMergedVideoFile.getCanonicalPath();\n InputStream out1 = new FileInputStream(new File(mergedUrl));\n\n ComplexData complexData = new ComplexData(\"mergedFile1.flv\", out1);\n obs.setComplexData(complexData);\n obs.setEncounter(lastEncounter);\n\n Context.getObsService().saveObs(obs, null);\n tempMergedVideoFile.delete();\n\n }catch (Exception e){\n log.error(e);\n }\n }", "@Override\n public void onVideoStarted() {\n }", "public ABLVideo Video() {\r\n \treturn new ABLVideo(BrickFinder.getDefault().getVideo());\r\n }", "public VideoStream(String a_strStream) {\n\t\tString[] arrStrArg = a_strStream.split(\"&\");\n\t\tMap<String, String> mapArg = new HashMap<String, String>();\n\t\tfor (int i = 0; i < arrStrArg.length; i++) {\n\t\t\tString[] arrStrArgVal = arrStrArg[i].split(\"=\");\n\t\t\tif (arrStrArgVal != null) {\n\t\t\t\tif (arrStrArgVal.length >= 2)\n\t\t\t\t\tmapArg.put(arrStrArgVal[0], arrStrArgVal[1]);\n\t\t\t}\n\t\t}\n\t\tm_strUrl = mapArg.get(\"url\") + \"&signature=\" + mapArg.get(\"sig\");\n\t}", "private void requestLiveStreaming() throws IOException {\n\n String targetCamCode = dis.readUTF();\n\n Cam targetCam = CamRegister.findRegisteredCam(targetCamCode);\n\n try {\n DataOutputStream targetDos = new DataOutputStream(targetCam.getCamSocket().getOutputStream());\n\n targetDos.writeInt(LIVE_STREAMING_COMMAND);\n targetDos.writeUTF(camClient.getCamCode());\n targetDos.flush();\n\n dos.writeInt(SUCCESS_CODE);\n dos.flush();\n\n } catch (Exception e) {\n e.printStackTrace();\n dos.writeInt(NOT_FOUND_CODE);\n dos.flush();\n }\n }", "public String toString() {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tbuffer.append(video);\n\t\tbuffer.append(\" [\");\n\t\tbuffer.append(numOwned);\n\t\tbuffer.append(\",\");\n\t\tbuffer.append(numOut);\n\t\tbuffer.append(\",\");\n\t\tbuffer.append(numRentals);\n\t\tbuffer.append(\"]\");\n\t\treturn buffer.toString();\n\t}", "public void setVideoPort(int port);", "@Override\n\t\t\t\tpublic void onPrepared(MediaPlayer mediaPlayer) {\n\t\t\t\t\tmediaPlayer.setPlaybackSpeed(1.0f);\n\t\t\t\t\tmVideoView.addTimedTextSource(subtitle_path);\n\t\t\t\t\tmVideoView.setTimedTextShown(true);\n\t\t\t\t\tmVideoView.setVideoLayout(VideoView.VIDEO_LAYOUT_STRETCH, 0);\n\n\t\t\t\t}", "public void mo63047b(String str) {\n String str2;\n String str3;\n String str4;\n String str5;\n super.mo63047b(str);\n if (C25352e.m83221d(this.f77546j)) {\n this.f89203a.mo65916c();\n C24961b e = C24958f.m81905a().mo65273b(this.f77546j).mo65266a(\"result_ad\").mo65276b(\"play_over\").mo65283e(\"video\");\n Aweme aweme = this.f77546j;\n C7573i.m23582a((Object) aweme, \"mAweme\");\n Video video = aweme.getVideo();\n C7573i.m23582a((Object) video, \"mAweme.video\");\n e.mo65271b((long) video.getVideoLength()).mo65270a(mo75261ab());\n this.f89214bh++;\n C28418f a = C28418f.m93413a();\n C7573i.m23582a((Object) a, \"FeedSharePlayInfoHelper.inst()\");\n a.f74936f = this.f89214bh;\n if (this.f89214bh >= this.f89215bi) {\n C28418f a2 = C28418f.m93413a();\n C7573i.m23582a((Object) a2, \"FeedSharePlayInfoHelper.inst()\");\n if (!a2.f74934d) {\n Aweme aweme2 = this.f77546j;\n C7573i.m23582a((Object) aweme2, \"mAweme\");\n AwemeRawAd awemeRawAd = aweme2.getAwemeRawAd();\n if (awemeRawAd != null) {\n str3 = awemeRawAd.getWebUrl();\n } else {\n str3 = null;\n }\n if (TextUtils.isEmpty(str3)) {\n C24961b b = C24958f.m81905a().mo65273b(this.f77546j).mo65266a(\"result_ad\").mo65276b(\"play\");\n if (!C25352e.m83224g(this.f77546j) || !TextUtils.equals(mo75290r(), \"general_search\")) {\n str4 = \"\";\n } else {\n str4 = \"video\";\n }\n b.mo65283e(str4).mo65270a(mo75261ab());\n return;\n } else if (mo75314al()) {\n mo75311ai();\n return;\n } else {\n this.f89215bi++;\n C24961b b2 = C24958f.m81905a().mo65273b(this.f77546j).mo65266a(\"result_ad\").mo65276b(\"play\");\n if (!C25352e.m83224g(this.f77546j) || !TextUtils.equals(mo75290r(), \"general_search\")) {\n str5 = \"\";\n } else {\n str5 = \"video\";\n }\n b2.mo65283e(str5).mo65270a(mo75261ab());\n return;\n }\n }\n }\n C24961b b3 = C24958f.m81905a().mo65273b(this.f77546j).mo65266a(\"result_ad\").mo65276b(\"play\");\n if (!C25352e.m83224g(this.f77546j) || !TextUtils.equals(mo75290r(), \"general_search\")) {\n str2 = \"\";\n } else {\n str2 = \"video\";\n }\n b3.mo65283e(str2).mo65270a(mo75261ab());\n }\n }", "void avRecorderSetup() {\n\r\n\t\t \r\n imw = ToolFactory.makeWriter(file.getAbsolutePath());//or \"output.avi\" or \"output.mov\"\r\n imw.open();\r\n imw.setForceInterleave(true);\r\n imw.addVideoStream(0, 0, IRational.make((double)vidRate), widthCapture, heightCapture);\r\n audionumber = imw.addAudioStream(audioStreamIndex, audioStreamId, channelCount, sampleRate);\r\n isc = imw.getContainer().getStream(0).getStreamCoder();\r\n bgr = new BufferedImage(widthCapture, heightCapture, BufferedImage.TYPE_3BYTE_BGR);\r\n sTime = fTime = System.nanoTime();\r\n }", "@Override\n public void onResponse(String response) {\n response = response.substring(response.indexOf(\"og:video:url\\\" content=\\\"\") + 23);\n response = response.substring(0, response.indexOf(\".mp4\") + 4);\n UrlFilm = response;\n Log.i(\"HTML\", \" \" + response);\n }", "@Override\n public void onResponse(String response) {\n response = response.substring(response.indexOf(\"og:video:url\\\" content=\\\"\") + 23);\n response = response.substring(0, response.indexOf(\".mp4\") + 4);\n UrlFilm = response;\n Log.i(\"HTML\", \" \" + response);\n }", "public void setVideoJittcomp(int milliseconds);", "public TiendaVideojuegos(String datos)\n {\n listaDeVideojuegos = new ArrayList<Videojuegos>();\n codVideojuego = 0;\n try{\n File archivo = new File(datos);\n Scanner sc = new Scanner(archivo);\n while (sc.hasNextLine()) {\n String[] datosVideojuego = sc.nextLine().split(\"#\");\n String titulo = datosVideojuego[0];\n String plataforma = datosVideojuego[1];\n int dia = Integer.parseInt(datosVideojuego[2]);\n int mes = Integer.parseInt(datosVideojuego[3]);\n int anyo = Integer.parseInt(datosVideojuego[4]);\n addVideojuego(titulo, dia, mes, anyo, plataforma);\n }\n \n sc.close();\n }\n catch (FileNotFoundException a) {\n a.printStackTrace();\n }\n \n }", "public final void mo61580c(boolean z, String str, int i) {\n boolean z2;\n int i2 = 1;\n AppMethodBeat.m2504i(131589);\n this.iad = i;\n this.bkJ = z;\n PString pString = new PString();\n pString.value = str;\n if (C5046bo.isNullOrNil(pString.value) || pString.value.indexOf(\"file://\") != 0) {\n z2 = false;\n } else {\n pString.value = pString.value.substring(7);\n z2 = true;\n }\n this.iae = z2;\n this.url = pString.value;\n if (this.hZY == null) {\n if (m81322a(this.bkJ, this.url, \"\")) {\n C4990ab.m7417i(\"MicroMsg.AppBrandVideoWrapper\", \"%d use common video view !\", Integer.valueOf(hashCode()));\n this.hZY = aFT();\n } else {\n C4990ab.m7417i(\"MicroMsg.AppBrandVideoWrapper\", \"%d use mm video view !\", Integer.valueOf(hashCode()));\n this.hZY = aFU();\n }\n } else if (m81322a(this.bkJ, this.url, \"\")) {\n if (this.hZY instanceof MMVideoView) {\n this.hZY.stop();\n this.hZY.cpU();\n removeView((View) this.hZY);\n C4990ab.m7417i(\"MicroMsg.AppBrandVideoWrapper\", \"%d use common video view !\", Integer.valueOf(hashCode()));\n this.hZY = aFT();\n } else {\n C4990ab.m7417i(\"MicroMsg.AppBrandVideoWrapper\", \"%d use last common video view !\", Integer.valueOf(hashCode()));\n this.hZY.stop();\n i2 = 0;\n }\n } else if (this.hZY instanceof CommonVideoView) {\n this.hZY.stop();\n this.hZY.cpU();\n removeView((View) this.hZY);\n C4990ab.m7417i(\"MicroMsg.AppBrandVideoWrapper\", \"%d use mm video view !\", Integer.valueOf(hashCode()));\n this.hZY = aFU();\n } else {\n C4990ab.m7417i(\"MicroMsg.AppBrandVideoWrapper\", \"%d use last mm video view !\", Integer.valueOf(hashCode()));\n this.hZY.stop();\n i2 = 0;\n }\n setScaleType(this.iab);\n mo61579as(this.iac);\n setMute(this.fdh);\n if (i2 != 0) {\n setVideoFooterView(this.iaa);\n addView((View) this.hZY, new LayoutParams(-1, -1));\n }\n this.hZY.mo9063c(this.bkJ, this.url, this.iad);\n C7305d.post(new C383972(), \"AppBrandVideo_checkVideoUrl\");\n AppMethodBeat.m2505o(131589);\n }", "@Override\n\tpublic void ingresarFicha(VideoJuego juego) {\n\t\t\n\t}", "private void initVideo(String videoPath) {\n JCVideoPlayerStandard.startFullscreen(this, JCVideoPlayerStandard.class,\n videoPath,\"\");\n\n\n\n\n\n }", "public interface VideoConsumer {\n public void onVideoStart(int width, int height) throws IOException;\n\n public int onVideo(byte []data, int format);\n\n public void onVideoStop();\n}", "public void mo8815a(final String str, final String str2) {\n C3720a.this._cameraUtil.mo6032a((Runnable) new Runnable() {\n public void run() {\n if (C3720a.this.f12125b != null) {\n boolean z = false;\n if (str != null && str.equalsIgnoreCase(\"mp4_4k\")) {\n C3720a.this.f12125b.f12308w.mo3216a(\"mp4_4kPhoto\");\n z = true;\n }\n if (!z) {\n C3720a.this.f12125b.f12308w.mo3216a(str2);\n }\n }\n }\n });\n }", "public void recordVideosName(){\n File file=new File(\"/sdcard/\",\"DateRecording.txt\");\n try {\n FileOutputStream fileOutputStream = new FileOutputStream(file,true);//追加方式打开\n OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream);\n BufferedWriter bufferedWriter = new BufferedWriter(outputStreamWriter);\n bufferedWriter.write(videosName[0]+\" \"+videosName[1]+\" \"+videosName[2]+\" \"+videosName[3]+\" \"+videosName[4]+\" \"+videosName[5]+\"\\r\\n\");\n bufferedWriter.write(\"u_1 u_2 u_3\"+\"\\r\\n\");\n bufferedWriter.close();\n outputStreamWriter.close();\n }catch (Exception e){\n e.printStackTrace();\n }\n }", "public static String getVideoSource(){\r\n\r\n return pref.getString(\"VideoMode\", \"MP4\");\r\n }", "private File createVideoFileName() throws IOException {\n String timestamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n //there are two types of SimpleDateFormat and Date()\n String prepend = \"VIDEO_\" + timestamp + \"_\";\n File videoFile = File.createTempFile(prepend, \".mp4\", mVideoFolder);\n mVideoFileName = videoFile.getAbsolutePath();\n return videoFile;\n\n }", "public void setVideourl(String videourl) {\n this.videourl = videourl;\n }", "private void printOut(String[] printerMakerResult)\n {\n //shows user the printerMaker result\n\n for(int i=0;i<printerMakerResult.length;i++)\n {\n outVideo.println(printerMakerResult[i]);\n outVideo.flush();\n }\n }", "public Video( ) { \n\t\tsuper( );\n\t}", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tmVideoContrl.seekTo((int) time);\r\n\r\n\t\t\t\t\t\t}", "private String getVideofilename() {\n String mFileName;\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n String audioFileName = \"mp4_\" + timeStamp + \"_\";\n\n // Save a file: path for use with ACTION_VIEW intents\n mFileName = getExternalFilesDir(\"DIRECTORY_VIDEO\").getAbsolutePath();\n mFileName += \"/\" +audioFileName + \".mp4\";\n return mFileName;\n }", "@Override\r\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tmVideoContrl.playNext();\r\n\r\n\t\t\t\t\t\t\t}", "public int getVideoJittcomp();", "@DISPID(1093) //= 0x445. The runtime will prefer the VTID if present\n @VTID(13)\n void media(\n java.lang.String p);", "public void cambiarTitulo(int codVideojuego, String tituloNuevo)\n {\n if(codVideojuego>=0 && codVideojuego<=listaDeVideojuegos.size()) {\n Videojuegos Videojuego = listaDeVideojuegos.get(codVideojuego - 1);\n Videojuego.setTitulo(tituloNuevo);\n }\n else if(codVideojuego<=0 && codVideojuego>listaDeVideojuegos.size()){\n System.out.println(\"No hay videojuegos con ese codigo, introduce otro existente.\");\n }\n }", "@Override\n public void onClick(View v) {\n Intent it = new Intent(Intent.ACTION_VIEW);\n Uri uri = Uri.parse(\"http://\"+ PostUrl.Media+\":8080/upload/\"+item.getMediaPath().get(0).split(\"\\\\.\")[0]+\".mp4\");\n it.setDataAndType(uri, \"video/mp4\");\n context.startActivity(it);\n\n }", "public void runner() {\n\t\ttry {\n\t\t\tRuntime r = Runtime.getRuntime();\n\t\t\tString path = \"cmd /c cd D:\\\\\\\\AA三下\\\\\\\\java精灵\\\\ffmpeg-20190513-dcc9998-win64-static\\\\bin\";\n\t\t\tr.exec(\"cmd /c d:\");\n\t\t\t// r.exec(\"cd D:\\\\AA三下\\\\java精灵\\ffmpeg-20190513-dcc9998-win64-static\\bin\");\n\t\t\t//r.exec(path);\n\t\t\tr.exec(\"D:\\\\\\\\\\\\\\\\AA三下\\\\\\\\\\\\\\\\java精灵\\\\\\\\ffmpeg-20190513-dcc9998-win64-static\\\\\\\\bin\\\\\\\\ffmpeg.exe -i E:\\\\recordyin\\\\1.wav -i E:\\\\recordAVI\\\\out2.avi E:\\\\recorder\\\\a11.avi\");\n\t\t\tSystem.out.println(\"over\");\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}", "public void createVideo(Context context, AugmentedImage image, int augmentedImageIndex) {\n this.image = image;\n\n\n\n CompletableFuture.allOf(AugmentedImageActivity.videoRenderable)\n .handle((notUsed, throwable) -> {\n // When you build a Renderable, Sceneform loads its resources in the background while\n // returning a CompletableFuture. Call handle(), thenAccept(), or check isDone()\n // before calling get().\n\n if (throwable != null) {\n return null;\n }\n\n try {\n // Sets the texture to the texture defined using (new ExternalTexture()) -> the video's surface is on that texture.\n AugmentedImageActivity.videoPlacedRenderable = AugmentedImageActivity.videoRenderable.get();\n AugmentedImageActivity.videoPlacedRenderable.getMaterial().setExternalTexture(\"videoTexture\", texture);\n AugmentedImageActivity.videoPlacedRenderable.getMaterial().setFloat4(\"keyColor\", CHROMA_KEY_COLOR);\n\n // Everything finished loading successfully.\n } catch (InterruptedException | ExecutionException ex) {\n }\n\n return null;\n });\n\n if (!frame_lr.isDone() || !frame_ll.isDone() || !frame_ur.isDone() || !frame_ul.isDone()) {\n CompletableFuture.allOf(frame_ll, frame_lr, frame_ul, frame_ur)\n .thenAccept((Void aVoid) -> setImage(image, augmentedImageIndex))\n .exceptionally(\n throwable -> {\n Log.e(TAG, \"Exception loading\", throwable);\n return null;\n });\n }\n\n Node fullnode;\n\n fullnode = new Node();\n fullnode.setParent(this);\n fullnode.setWorldPosition(new Vector3(-0.5f * image.getExtentX(), 0.0f, 0.5f * image.getExtentZ()));\n fullnode.setLocalScale(new Vector3(0.1f, 0.1f, 0.1f));\n Quaternion lowerLeft = Quaternion.axisAngle(new Vector3(nodeRotation[augmentedImageIndex].x, nodeRotation[augmentedImageIndex].y, nodeRotation[augmentedImageIndex].z), nodeRotation[augmentedImageIndex].q);\n fullnode.setLocalRotation(Quaternion.multiply(fullnode.getLocalRotation(), lowerLeft));\n fullnode.setRenderable(frame_ll.getNow(null));\n\n fullnode = new Node();\n fullnode.setParent(this);\n fullnode.setWorldPosition(new Vector3(0.5f * image.getExtentX(), 0.0f, 0.5f * image.getExtentZ()));\n fullnode.setLocalScale(new Vector3(0.1f, 0.1f, 0.1f));\n Quaternion lowerRight = Quaternion.axisAngle(new Vector3(nodeRotation[augmentedImageIndex].x, nodeRotation[augmentedImageIndex].y, nodeRotation[augmentedImageIndex].z), nodeRotation[augmentedImageIndex].q);\n fullnode.setLocalRotation(Quaternion.multiply(fullnode.getLocalRotation(), lowerRight));\n fullnode.setRenderable(frame_lr.getNow(null));\n\n fullnode = new Node();\n fullnode.setParent(this);\n fullnode.setWorldPosition(new Vector3(-0.5f * image.getExtentX(), 0.0f, -0.5f * image.getExtentZ()));\n fullnode.setLocalScale(new Vector3(0.1f, 0.1f, 0.1f));\n Quaternion upperLeft = Quaternion.axisAngle(new Vector3(nodeRotation[augmentedImageIndex].x, nodeRotation[augmentedImageIndex].y, nodeRotation[augmentedImageIndex].z), nodeRotation[augmentedImageIndex].q);\n fullnode.setLocalRotation(Quaternion.multiply(fullnode.getLocalRotation(), upperLeft));\n fullnode.setRenderable(frame_ul.getNow(null));\n\n fullnode = new Node();\n fullnode.setParent(this);\n fullnode.setWorldPosition(new Vector3(0.5f * image.getExtentX(), 0.0f, -0.5f * image.getExtentZ()));\n fullnode.setLocalScale(new Vector3(0.1f, 0.1f, 0.1f));\n Quaternion upperRight = Quaternion.axisAngle(new Vector3(nodeRotation[augmentedImageIndex].x, nodeRotation[augmentedImageIndex].y, nodeRotation[augmentedImageIndex].z), nodeRotation[augmentedImageIndex].q);\n fullnode.setLocalRotation(Quaternion.multiply(fullnode.getLocalRotation(), upperRight));\n fullnode.setRenderable(frame_ur.getNow(null));\n\n // augmentedImageIndex is taken from the arguments of this method - (setImage)\n AugmentedImageActivity.augmentedImageVideoPlayerIndex = augmentedImageIndex;\n // Set the anchor based on the center of the image.\n setAnchor(image.createAnchor(image.getCenterPose()));\n\n\n // videoNode is created and will be placed on the image, directly parallel to the image.\n videoNode = new Node();\n videoNode.setParent(this);\n\n\n float videoWidth = nodeMediaPlayer.getVideoWidth();\n float videoHeight = nodeMediaPlayer.getVideoHeight();\n\n videoNode.setLocalScale(\n new Vector3(\n VIDEO_HEIGHT_METERS * (videoWidth / videoHeight), VIDEO_HEIGHT_METERS, 1.4f));\n\n\n // Sets the video's position from perpendicular to the image to parallel to the detected image.\n Quaternion q1 = videoNode.getLocalRotation();\n Quaternion q2 = Quaternion.axisAngle(new Vector3(1.0f, 0f, 0f), -90f);\n videoNode.setLocalPosition(new Vector3(0.0f, 0.0f, 0.07f)); // x, z, y\n videoNode.setLocalRotation(Quaternion.multiply(q1, q2));\n\n // If the video is not playing, it will be started.\n if (!nodeMediaPlayer.isPlaying()) {\n nodeMediaPlayer.start();\n // Wait to set the renderable until the first frame of the video becomes available.\n // This prevents the renderable from briefly appearing as a black quad before the video\n // plays.\n texture\n .getSurfaceTexture()\n .setOnFrameAvailableListener(\n (SurfaceTexture surfaceTexture) -> {\n videoNode.setRenderable(AugmentedImageActivity.videoPlacedRenderable);\n texture.getSurfaceTexture().setOnFrameAvailableListener(null);\n\n });\n } else {\n videoNode.setRenderable(AugmentedImageActivity.videoPlacedRenderable);\n }\n\n Log.d(\"node\", \"creating!!!\");\n\n }", "void restartVideo();", "public int getVideoDscp();", "MovieVideo getMovieVideoByVideoid(String videoid);", "public void runMultiWebcam()\n\t{\n\t\tString pipeline=\"gst-launch-1.0 -v v4l2src device=\"+webcamSource+\" ! 'video/x-raw,width=640,height=480' ! x264enc pass=qual quantizer=20 tune=zerolatency ! rtph264pay ! multiudpsink clients=\"+client.getInetAddress().getHostAddress()+\":\"+port1+\",\"+client.getInetAddress().getHostAddress()+\":\"+port2;\n\n\t\tString[] args1 = new String[] {\"/bin/bash\", \"-c\", pipeline+\">src/output.txt\"};\n\t\ttry {\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tProcess proc = new ProcessBuilder(args1).start();\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\ttry {\n\t\t\tThread.sleep(2000);\n\t\t} catch (InterruptedException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t}", "public static void main( String[] args ) throws Exception\n { \t\n \tFile inputFile = new File(args[0]);\n \tByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); \t\n \tString outputAudiosFolder = args[3]; \t \t \t \t\n \tint audioStreams = Integer.parseInt(args[5]);\n \tint selectedStream = Integer.parseInt(args[6]);\n \tlong halfSegmentSize = Integer.parseInt(args[7]);\n \t\n \t//Read shot boundaries and keyframe positions \t\n \tShotList shotList = ShotReader.readFromCSV(args[1]);\n \tArrayList<IntLongPair> keyframes = KeyframeReader.readFromCSV(args[2]); \t \t \t \t \t\n \t\n \t//Create a millisecond map to the audio segments\n \tXuggleVideo inputVideo = new XuggleVideo(inputFile); \t\n \tdouble videoFPS = inputVideo.getFPS();\n \tinputVideo.close();\n \tlong lastBoundary = 0;\n \tArrayList<AuralSegment> auralSegments = new ArrayList<AuralSegment>(); \n \tint lastShot = 0;\n \tint segmentIndex = 0;\n \tfor(IntLongPair keyframe : keyframes)\n \t{ \t\t\n \t\t\n \t\tlong keyframeTime = Math.round((keyframe.getSecond() / videoFPS) * 1000);\n \t\tShot shot = shotList.getList().get(keyframe.getFirst());\n \t\tlong shotBeginTime = Math.round((shot.getStartBoundary() / videoFPS) * 1000);\n \t\tlong shotEndTime = Math.round((shot.getEndBoundary() / videoFPS) * 1000);\n \t\t\n \t\t//Compute segment boundaries\n \t\tlong segmentStartTime, segmentEndTime;\n \t\t\n \t\t\n \t\t//Compute start boundary\n \t\t//Check if the new segment overlaps with last segment.\n \t\tif( (keyframeTime - halfSegmentSize) > lastBoundary)\n \t\t{\n \t\t\tsegmentStartTime = keyframeTime - halfSegmentSize;\n \t\t}\n \t\telse\n \t\t{\n \t\t\tsegmentStartTime = lastBoundary + 1;\n \t\t}\n \t\t//Check if the start boundary happens inside the shot\n \t\tif(segmentStartTime < shotBeginTime)\n \t\t{\n \t\t\tsegmentStartTime = shotBeginTime;\n \t\t}\n \t\t\n \t\t//Compute end boundary\n \t\t//If end boundary isn't greater than start boundary do nothing \n \t\tif( (keyframeTime + halfSegmentSize) > segmentStartTime )\n \t\t{\n \t\t\tif((keyframeTime + halfSegmentSize) < shotEndTime)\n \t\t\t{\n \t\t\t\tsegmentEndTime = (keyframeTime + halfSegmentSize); \t\t\t\t\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tsegmentEndTime = shotEndTime;\n \t\t\t}\n \t\t\t\n \t\t\tif(segmentStartTime < segmentEndTime)\n \t\t\t{\n \t\t\t\tif(keyframe.getFirst() != lastShot)\n \t\t\t\t{\n \t\t\t\t\tlastShot = keyframe.getFirst();\n \t\t\t\t\tsegmentIndex = 0;\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tsegmentIndex++;\n \t\t\t\t}\n \t\t\t\tauralSegments.add(new AuralSegment(keyframe.getFirst(),segmentIndex, segmentStartTime, segmentEndTime));\n \t\t\t}\n \t\t}\n \t} \t\n\n \t//Generate and write MFCC descriptors\n\t\tXuggleAudio inputAudioMFCCRaw = new XuggleAudio(inputFile); \t\n\t\n\t\t//If there is more than one stream (dual audio videos for example) choose one\n\t\tif(audioStreams > 1)\n\t\t{\n\t\t\tinputAudioMFCCRaw = AudioStreamSelector.separateAudioStream(inputAudioMFCCRaw, audioStreams, selectedStream);\n\t\t} \n\t\n\t\t//Calculate how many audio samples must be in a millisecond\n\t\tdouble samplesInAMillisecond = inputAudioMFCCRaw.getFormat().getSampleRateKHz();\n\t\t//30ms Audio frames\n\t\tint frameSizeInSamples = (int)(samplesInAMillisecond * 30);\n\t\t//10ms Overlap between frames\n\t\tint overlapSizeInSamples = (int)(samplesInAMillisecond *10);\n\t\t//Fixes the audio processor to work with 30ms windows and 10ms overlap between adjacent windows\n\t\tFixedSizeSampleAudioProcessor inputAudioMFCC = new FixedSizeSampleAudioProcessor(inputAudioMFCCRaw, \n\t\t\tframeSizeInSamples, overlapSizeInSamples);\n\t\n\t\tMFCC mfcc = new MFCC( inputAudioMFCC );\n\t\tSampleChunk scMFCC = null;\n\t\tIterator<AuralSegment> auralSegmentsIterator = auralSegments.iterator();\n\t\tAuralSegment actualSegment;\n\t\tFileWriter mfccWriter = new FileWriter(args[4]);\n\t\tscMFCC = mfcc.nextSampleChunk();\n\t\tlong chunkIndex = 0;\n\t\tlong sampleStartTime = scMFCC.getStartTimecode().getTimecodeInMilliseconds()/scMFCC.getFormat().getNumChannels();\n\t\tlong sampleEndTime = sampleStartTime + 30;\n\t\twhile( auralSegmentsIterator.hasNext() && (actualSegment = auralSegmentsIterator.next()) != null ) \n\t\t{\n\t\t\t//I don't know why, but getTimecodeInMilliseconds when using window overlap returns two times the correct timecode.\n\t\t\t\n\t\t\t//Look for the audio correspoinding to the segment\n\t\t\twhile(scMFCC != null && sampleStartTime < actualSegment.getStartTime())\n\t\t\t{\n\t\t\t\tscMFCC = mfcc.nextSampleChunk();\n\t\t\t\tchunkIndex++;\n\t\t\t\tsampleStartTime = scMFCC.getStartTimecode().getTimecodeInMilliseconds()/scMFCC.getFormat().getNumChannels();\n\t\t\t\tsampleEndTime = sampleStartTime + 30;\n\t\t\t}\n\t\t\t//Write it down while\n\t\t\twhile(scMFCC != null && sampleEndTime < actualSegment.getEndTime())\n\t\t\t{\n\t\t\t\tsampleStartTime = scMFCC.getStartTimecode().getTimecodeInMilliseconds()/scMFCC.getFormat().getNumChannels();\n\t\t\t\tsampleEndTime = sampleStartTime + 30;\n\t\t\t\t\n\t\t\t\tdouble[][] mfccs = mfcc.getLastCalculatedFeature();\n\t\t\t\tmfccWriter.write(Long.toString(actualSegment.getShotIndex()));\n\t\t\t\tfor(int i = 0; i < mfccs[0].length; i++)\n\t\t\t\t{\n\t\t\t\t\tmfccWriter.write(\" \" + mfccs[0][i]);\n\t\t\t\t}\n\t\t\t\tmfccWriter.write(\"\\n\");\n\t\t\t\t\n\t\t\t\t//Write output stream not including overlapped chunks \n\t\t\t\tif(chunkIndex % 3 == 0)\n\t\t\t\t{\n\t\t\t\t\tbyteArrayOutputStream.flush();\n\t\t\t\t\tbyteArrayOutputStream.write(scMFCC.getSamples());\n\t\t\t\t\tbyteArrayOutputStream.flush(); \n\t\t\t\t}\t\n\t\t\t\tscMFCC = mfcc.nextSampleChunk();\n\t\t\t\tchunkIndex++;\n\t\t\t}\n\t\t\t\n\t\t\t//Write file on disk\n\t\t\tByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());\n\t\t\tAudioInputStream audioInputStream = new AudioInputStream(byteArrayInputStream, inputAudioMFCC.getFormat().getJavaAudioFormat(), byteArrayOutputStream.size());\n\t\t\tString audioSampleName = \"shot\" + String.format(\"%04d\", actualSegment.getShotIndex()) + \"seg\" + String.format(\"%04d\", actualSegment.getSegIndex()) + \".wav\";\n\t\t\tAudioSystem.write(audioInputStream, AudioFileFormat.Type.WAVE, new File(outputAudiosFolder + audioSampleName));\t\t\t\n\t\t\t//Clear the byteArrayOutputStream\n\t\t\tbyteArrayOutputStream.reset();\t\t\t\t\n\t\t\t\n\t\t}\n\t\tmfccWriter.close();\n\t \t\n\t System.exit(0); \t \n }", "public int getVideoPort();", "public void pararMusica() {\r\n if (player != null) {\r\n player.close();\r\n player = null;\r\n musica.stop(); //Utilizamos un metodo deprecado porque no hay alternativas.\r\n }\r\n loop = false;\r\n }", "void closeVideo();", "public static native void speexEchoPlayback(short[] echoFrame);", "@SuppressWarnings(\"static-access\")\r\n\t@Test\r\n\tpublic void testVideoTesting() throws Exception {\r\n\t\tRegUserAndChangePass.RegisterToComcastAppAndChangePassword(driver);\r\n\r\n\t\tThread.sleep(7000);\r\n\t\tdriver.findElement(By.linkText(\"My Dog Eve\")).click();\r\n\r\n\t\tThread.sleep(7000);\r\n\t\tdriver.findElement(By.cssSelector(\"button.pause\")).click();\r\n\t\tThread.sleep(7000);\r\n\t\t// driver.findElement(By.cssSelector(\"button.play\")).click();\r\n\r\n\t\tThread.currentThread().sleep(7000);\r\n\t\t// String a=\r\n\t\t// driver.findElement(By.id(\"scrubber\")).getAttribute(\"Position update\");\r\n\t\t// driver.findElement(By.id(\"scrubber\")).sendKeys(\"Position update\",\"9.765\");\r\n\r\n\t\t// Mouse mouse = ((HasInputDevices) driver).getMouse();\r\n\t\tWebElement myElement = driver.findElement(By.id(\"scrubber\"));\r\n\r\n\t\t// mouse.mouseDown((Coordinates) myElement.getLocation());\r\n\r\n\t\tWebElement source = driver.findElement(By.id(\"scrubber\"));\r\n\t\tWebElement target = driver.findElement(By.id(\"scrubber\"));\r\n\t\tnew Actions(driver).dragAndDrop(source, target).build().perform();\r\n\r\n\t\tThread.sleep(7000);\r\n\t\tdriver.findElement(By.cssSelector(\"button.pause\")).click();\r\n\t\tThread.sleep(7000);\r\n\t\tdriver.findElement(By.cssSelector(\"button.play\")).click();\r\n\r\n\t\tThread.currentThread().sleep(7000);\r\n\t\tdriver.findElement(By.id(\"scrubber\")).click();\r\n\r\n\t\tdriver.findElement(By.linkText(\"Log Out\")).click();\r\n\r\n\t\t/*\r\n\t\t * \r\n\t\t * In Video Response we are getting spaces between the text so test case\r\n\t\t * is failing Below commented lines will execute by taking xpath.\r\n\t\t * \r\n\t\t * String VideoTitle=driver.findElement(By.xpath(\r\n\t\t * \".//*[@id='content-wrap']/article/section/article/div/div/section/ul/li[1]/article/h1/a\"\r\n\t\t * )).getText(); Thread.sleep(sleepTime);\r\n\t\t * driver.findElement(By.linkText(VideoTitle)).click();\r\n\t\t * \r\n\t\t * \r\n\t\t * Thread.sleep(sleepTimeForVideoPlay); String\r\n\t\t * currentPosition=flashApp.callFlashObject(\"getCurrentPosition\");\r\n\t\t * \r\n\t\t * double videoSleepTime=(double)Math.round(sleepTimeForVideoPlay);\r\n\t\t * double latestCurrentPosition=(double)Math.round(Double.parseDouble(\r\n\t\t * currentPosition));\r\n\t\t * \r\n\t\t * if(latestCurrentPosition>20) {\r\n\t\t */\r\n\t\t/*\r\n\t\t * } else assertEquals(currentPosition,\r\n\t\t * driver.findElement(By.id(\"display\")).getText());\r\n\t\t */\r\n\t}", "@Override\n\tpublic void videoError(int arg0) {\n\t\t\n\t}", "public void getCover(String videoInputPath, String coverOutputPath) throws IOException, InterruptedException {\n String command = \"/usr/bin/ffmpeg -ss 00:00:02 -y -i \" + videoInputPath + \" -vframes 1 \" + coverOutputPath;\n ProcessBuilder builder = new ProcessBuilder(command);\n Process process = builder.start();\n\n InputStream errorStream = process.getErrorStream();\n InputStreamReader inputStreamReader = new InputStreamReader(errorStream);\n BufferedReader br = new BufferedReader(inputStreamReader);\n// OutputStream outputStream = new FileOutputStream(\"/home/zyl/imooc-video-dev/error.log\");\n// OutputStreamWriter osw = new OutputStreamWriter(outputStream);\n// BufferedWriter bw = new BufferedWriter(osw);\n String line = \"\";\n while ( (line = br.readLine()) != null ) {\n// bw.write(line);\n// bw.flush();\n }\n\n if (br != null) {\n br.close();\n }\n if (inputStreamReader != null) {\n inputStreamReader.close();\n }\n if (errorStream != null) {\n errorStream.close();\n }\n }", "@Override\n\t\t\t\tpublic void onVideoFrame(byte[] data, long timestampUs) {\n\t\t\t\t\tByteBuffer byteBuffer = ByteBuffer.allocate(mDummyOffset + data.length);\n\t\t\t\t\tbyteBuffer.position(mDummyOffset);\n\n\t\t\t\t\tbyteBuffer.put(data);\n\t\t\t\t\tbyteBuffer.flip();\n\t\t\t\t\tbyteBuffer.position(mDummyOffset);\n\n\t\t\t\t\tmListener.sendFrame(byteBuffer, timestampUs);\n\t\t\t\t\tmDummyOffset++;\n\t\t\t\t}", "@Override\n public void run(){\n\n String datas = Uploader.doImageCheck(bmp, session);\n if (datas != \"NULL\" && datas != \"\") {\n\n String fileURL=\"\";\n int lastnum=1;\n String filename=\"\";\n String ext=\"\";\n\n JSONObject job = null;\n try {\n job = new JSONObject(datas);\n fileURL = (String) job.get(\"fileDir\");\n lastnum = Integer.parseInt((String) job.get(\"lastnum\"));\n filename = (String) job.get(\"filename\");\n ext = (String) job.get(\"ext\");\n } catch (JSONException e) {\n return;\n }\n\n final File sdCard = Environment.getExternalStorageDirectory();\n\n File dir = new File(sdCard.getAbsolutePath() + \"/Verrapel/Video/\" + filename);\n\n if (!dir.exists()) {\n dir.mkdirs();\n }\n for (int i = 1; i <= lastnum; i++) {\n String filePath = sdCard.getAbsolutePath() + \"/Verrapel/Video/\" + filename + \"/\" + i + ext;\n File f = new File(filePath);\n if (!f.exists()) {\n String fileUrl = fileURL + \"/\" + i + ext;\n\n String localPath = filePath;\n\n try {\n URL imgUrl = new URL(fileUrl);\n //서버와 접속하는 클라이언트 객체 생성\n HttpURLConnection conn = (HttpURLConnection) imgUrl.openConnection();\n int response = conn.getResponseCode();\n\n File file = new File(localPath);\n\n InputStream is = conn.getInputStream();\n OutputStream outStream = new FileOutputStream(file);\n\n byte[] buf = new byte[1024];\n int len = 0;\n\n while ((len = is.read(buf)) > 0) {\n outStream.write(buf, 0, len);\n }\n\n outStream.close();\n is.close();\n conn.disconnect();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n\n ArrayList<Mat> videoArray = new ArrayList<Mat>();\n\n for (int i = 1; i <= lastnum; i++) {\n String filePath = sdCard.getAbsolutePath() + \"/Verrapel/Video/\" + filename + \"/\" + i + ext;\n\n File file = new File(filePath);\n if (file.exists()) {\n Bitmap bm = BitmapFactory.decodeFile(filePath);\n Mat tmp = new Mat();\n\n Matrix matrix = new Matrix();\n matrix.postRotate(270);\n Bitmap resizedBitmap = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), matrix, true);\n Utils.bitmapToMat(resizedBitmap, tmp);\n videoArray.add(tmp);\n /*\n mmr.setDataSource(filePath);\n String time = mmr.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_DURATION);\n int VideoDuration = Integer.parseInt(time) * 1000;// This will give time in millesecond\n for (int ftime = 0; ftime < VideoDuration; ftime += 120000) {\n Bitmap b = mmr.getFrameAtTime(ftime, FFmpegMediaMetadataRetriever.OPTION_CLOSEST); // frame at 2 seconds\n byte[] artwork = mmr.getEmbeddedPicture();\n ftime = (ftime + 120000) % VideoDuration;\n\n Mat result = new Mat();\n Utils.bitmapToMat(b, result);\n videoArray.add(result);\n }\n //p.setDownloadFinish(true);\n\n */\n }\n }\n p.setVideoArray(videoArray);\n }\n }", "public final void mo39053am(String str, boolean z) {\n AppMethodBeat.m2504i(131615);\n C4990ab.m7417i(\"MicroMsg.AppBrandVideoWrapper\", \"%d onDownloadFinish path [%s] isPlayNow [%b]\", Integer.valueOf(hashCode()), str, Boolean.valueOf(z));\n if (z) {\n AppMethodBeat.m2505o(131615);\n return;\n }\n int i;\n if (m81322a(false, \"\", str)) {\n if (this.hZY instanceof MMVideoView) {\n this.hZY.stop();\n this.hZY.cpU();\n removeView((View) this.hZY);\n C4990ab.m7417i(\"MicroMsg.AppBrandVideoWrapper\", \"%d onDownloadFinish use common video view !\", Integer.valueOf(hashCode()));\n this.hZY = aFT();\n i = 1;\n }\n i = 0;\n } else {\n if (this.hZY instanceof CommonVideoView) {\n this.hZY.stop();\n this.hZY.cpU();\n removeView((View) this.hZY);\n C4990ab.m7417i(\"MicroMsg.AppBrandVideoWrapper\", \"%d onDownloadFinish use mm video view !\", Integer.valueOf(hashCode()));\n this.hZY = aFU();\n i = 1;\n }\n i = 0;\n }\n setScaleType(this.iab);\n mo61579as(this.iac);\n setMute(this.fdh);\n if (i != 0) {\n setVideoFooterView(this.iaa);\n addView((View) this.hZY, new LayoutParams(-1, -1));\n this.hZY.mo9063c(this.bkJ, this.url, this.iad);\n this.hZY.start();\n }\n AppMethodBeat.m2505o(131615);\n }", "@Override\n\t\t\t\tpublic void onVideoFrame(byte[] data, long timestampUs) {\n\t\t\t\t\tByteBuffer byteBuffer = ByteBuffer.allocateDirect(mDummyOffset + data.length);\n\t\t\t\t\tbyteBuffer.position(mDummyOffset);\n\n\t\t\t\t\tbyteBuffer.put(data);\n\t\t\t\t\tbyteBuffer.flip();\n\t\t\t\t\tbyteBuffer.position(mDummyOffset);\n\n\t\t\t\t\tmListener.sendFrame(byteBuffer, timestampUs);\n\t\t\t\t\tmDummyOffset++;\n\t\t\t\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n Toast.makeText(VideoDetailsActivity.this,\"Reciever fot the result. Do some processing bro\",Toast.LENGTH_LONG).show();\n mVideoView.setVideoURI();\n }", "private File getOutputMediaFile(int type) {\n File mediaStorageDir = new File(Environment.getExternalStorageDirectory(), \"NDS videos\");\n\n\n // Create the storage directory(MyCameraVideo) if it does not exist\n if (!mediaStorageDir.exists()) {\n\n if (!mediaStorageDir.mkdirs()) {\n\n //output.setText(\"Failed to create directory MyCameraVideo.\");\n\n Toast.makeText(Suggestion_box_suggest.this, \"Failed to create directory Boo_videos.\",\n Toast.LENGTH_LONG).show();\n\n Log.d(\"MyCameraVideo\", \"Failed to create directory Boo_videos.\");\n return null;\n }\n }\n\n// For unique file name appending current timeStamp with file name\n java.util.Date date = new java.util.Date();\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\")\n .format(date.getTime());\n\n File mediaFile;\n\n if (type == MEDIA_TYPE_VIDEO) {\n\n // For unique video file name appending current timeStamp with file name\n String filename_video = \"NDS_video_\" + timeStamp + \".mp4\";\n videoFileName = filename_video;\n mediaFile = new File(mediaStorageDir.getPath() + File.separator +\n filename_video);\n final String path_0 = Environment.getExternalStorageDirectory() + File.separator\n + \"NDS videos/\" + filename_video;\n String filename_to_up = path_0.substring(path_0.lastIndexOf(\"/\") + 1);\n //addCaptionToSuggestionMedia(path_0, filename_to_up, \"video\", MYRemoteId, (editText.getTag().toString().isEmpty()) ? \"0\" : editText.getTag().toString());\n //addCaptionToSuggestionMedia(path_0, filename_to_up, \"audio\", MYRemoteId, (editText.getTag().toString().isEmpty()) ? \"0\" : editText.getTag().toString());\n path_000 = path_0;\n filename_000 = filename_to_up;\n myRemoteId_000 = MYRemoteId;\n SuggestionBoxId_000 = (editText.getTag().toString().isEmpty()) ? \"0\" : editText.getTag().toString();\n//-------0--------------------------the video send--\n mediaType_000 = \"video\";\n image_tag.setVisibility(View.GONE);\n video_tag.setVisibility(View.VISIBLE);\n audio_tag.setVisibility(View.GONE);\n textSuggestion.setVisibility(View.GONE);\n video_tag.setTag(filename_to_up);\n String videoFile = path_0;\n Bitmap thumbnail = ThumbnailUtils.createVideoThumbnail(videoFile,\n MediaStore.Images.Thumbnails.FULL_SCREEN_KIND);\n//BitmapDrawable bitmapDrawable = new BitmapDrawable(thumbnail);\n // edixt_image_video.setImageBitmap(thumbnail);\n edixt_image_video.setVideoURI(Uri.parse(path_0));\n\n edixt_image_video.seekTo(100);\n///-------------\n edixt_image_video.setTag(path_0);\n///-------------\n edixt_image_video.setTag(path_0);\n//----\n edixt_image_video.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n }\n });\n edixt_image_video.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(path_0));\n intent.setDataAndType(Uri.parse(path_000), \"video/mp4\");\n startActivity(intent);\n\n return false;\n }\n });\n\n//------------0000000000000000000000000000000000000000000-dufhhhhhhhhhhhhhhhhhhhhh\n\n //-------------------\n\n } else {\n return null;\n }\n\n return mediaFile;\n }", "public java.lang.String getVid() {\r\n return localVid;\r\n }", "public final String mo102948e() {\n return \"shoot-video\";\n }", "public void saveVideo() {\n if (this.mVideoFileDescriptor == null) {\n long duration = SystemClock.uptimeMillis() - this.mRecordingStartTime;\n try {\n MediaMetadataRetriever mmr = new MediaMetadataRetriever();\n mmr.setDataSource(this.mCurrentVideoFilename);\n String durationStr = mmr.extractMetadata(9);\n mmr.release();\n duration = (long) Integer.parseInt(durationStr);\n } catch (Exception e) {\n Log.e(TAG, \"MediaMetadataRetriever error, use estimated duration\", e);\n }\n if (duration <= 0) {\n Tag tag = TAG;\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"Video duration <= 0 : \");\n stringBuilder.append(duration);\n Log.w(tag, stringBuilder.toString());\n }\n if (this.mCurrentVideoValues == null) {\n generateVideoFilename(this.mProfile.fileFormat);\n }\n if (this.mCurrentVideoValues != null) {\n this.mCurrentVideoValues.put(\"_size\", Long.valueOf(new File(this.mCurrentVideoFilename).length()));\n this.mCurrentVideoValues.put(InfoTable.DURATION, Long.valueOf(duration));\n if (needAddToMediaSaver()) {\n getServices().getMediaSaver().addVideo(this.mCurrentVideoFilename, this.mCurrentVideoValues, getVideoSavedListener(), this.mContentResolver);\n }\n logVideoCapture(duration);\n } else {\n return;\n }\n }\n this.mCurrentVideoValues = null;\n }", "private void initVideoView(Context context) {\n IjkMediaPlayer.loadLibrariesOnce(null);\n IjkMediaPlayer.native_profileBegin(\"libijkplayer.so\");\n\n mAppContext = context.getApplicationContext();\n mActivity = (Activity) context;\n if (mActivity != null) {\n this.mBrightness = mActivity.getWindow().getAttributes().screenBrightness;\n }\n this.mAudioManager = (AudioManager) mAppContext.getSystemService(Context.AUDIO_SERVICE);\n this.mVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);\n if (mMediaController != null) {\n mMediaController.setVideoView(this);\n }\n screenWidthPixels = getScreenWidth(context);\n\n setRender(mCurrentRender);\n\n mVideoWidth = 0;\n mVideoHeight = 0;\n // REMOVED: getHolder().addCallback(mSHCallback);\n // REMOVED: getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);\n setFocusable(true);\n setFocusableInTouchMode(true);\n requestFocus();\n // REMOVED: mPendingSubtitleTracks = new Vector<Pair<InputStream, MediaFormat>>();\n setCurrentState(STATE_IDLE);\n mTargetState = STATE_IDLE;\n\n subtitleDisplay = new TextView(context);\n subtitleDisplay.setTextSize(16);\n subtitleDisplay.setShadowLayer(3, 5, 5, getResources().getColor(R.color.black));\n subtitleDisplay.setGravity(Gravity.CENTER);\n subtitleDisplay.setTextColor(getResources().getColor(R.color.white));\n// subtitleDisplay.setBackgroundResource(R.color.red);\n LayoutParams layoutParams_txt = new LayoutParams(\n LayoutParams.MATCH_PARENT,\n LayoutParams.WRAP_CONTENT,\n Gravity.BOTTOM);\n addView(subtitleDisplay, layoutParams_txt);\n }", "public void run() {\n for (int i = videoStart; i >= 0 && i < al.size() && playVideo; i += videoIncrement) {\r\n if (!pauseVideo) {\r\n currentVideoIndex = i;\r\n repaint();\r\n try {\r\n Thread.sleep(videoSleep);\r\n } catch (InterruptedException ignore) {\r\n }\r\n } else {\r\n // System.out.println(\"Pausing video at \" + i);\r\n videoStart = i;\r\n break;\r\n }\r\n }\r\n if (!pauseVideo) {\r\n parent.videoCompleted();\r\n videoStart = 0;\r\n playVideo = false; // If it finishes by itself\r\n }\r\n// System.out.println(\"Video \" + (pauseVideo?\"paused\":\"completed\"));\r\n }", "public static String m18353a(VideoHttpHeaderInfo aVar, int i) {\n StringBuilder sb = new StringBuilder();\n if (i <= 0) {\n sb.append(\"HTTP/1.1 200 OK\");\n sb.append(\"\\r\\n\");\n } else {\n sb.append(\"HTTP/1.1 206 Partial Content\");\n sb.append(\"\\r\\n\");\n }\n sb.append(\"Accept-Ranges: bytes\");\n sb.append(\"\\r\\n\");\n sb.append(\"Content-Type: \");\n sb.append(aVar.f16233b);\n sb.append(\"\\r\\n\");\n if (i <= 0) {\n sb.append(\"Content-Length: \");\n sb.append(aVar.f16234c);\n sb.append(\"\\r\\n\");\n } else {\n sb.append(\"Content-Range: bytes \");\n sb.append(i);\n sb.append(Constants.ACCEPT_TIME_SEPARATOR_SERVER);\n sb.append(aVar.f16234c - 1);\n sb.append(MqttTopic.TOPIC_LEVEL_SEPARATOR);\n sb.append(aVar.f16234c);\n sb.append(\"\\r\\n\");\n sb.append(\"Content-Length: \");\n sb.append(aVar.f16234c - i);\n sb.append(\"\\r\\n\");\n }\n sb.append(\"Connection: close\");\n sb.append(\"\\r\\n\");\n sb.append(\"\\r\\n\");\n String sb2 = sb.toString();\n if (Proxy.f16280c) {\n Log.i(\"TAG_PROXY_WRITE_TO_MP\", sb2);\n }\n return sb2;\n }", "private void doConvert(String path) throws IOException {\n\n MediaMetadataRetriever retriever = new MediaMetadataRetriever();\n retriever.setDataSource(path);\n String rotation = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);\n// Log.d(\"Metadata\", \"doConvert: \" + rotation);\n\n //extract frames\n extractFrames(path, rotation);\n\n //extract faces in each frames\n extractFaces();\n\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Utils.hideLoadingIndicator();\n }\n });\n }" ]
[ "0.6206718", "0.6034032", "0.60005367", "0.59344983", "0.588379", "0.5819913", "0.5790428", "0.57777065", "0.5772725", "0.5769684", "0.5727721", "0.57247007", "0.5687637", "0.56848735", "0.56477547", "0.55813354", "0.5570483", "0.556895", "0.55607456", "0.5539935", "0.55345845", "0.548298", "0.545035", "0.5445027", "0.5433807", "0.5415913", "0.5407096", "0.5401082", "0.5382772", "0.53328264", "0.5318205", "0.52996856", "0.5295237", "0.52940977", "0.5290959", "0.52662915", "0.5252643", "0.5231086", "0.522272", "0.52117604", "0.5210524", "0.5210483", "0.52014774", "0.51939607", "0.5188351", "0.51858735", "0.51804566", "0.5174377", "0.51568335", "0.5144981", "0.5139036", "0.51339626", "0.51339626", "0.5129405", "0.5129233", "0.5128035", "0.5126843", "0.5125507", "0.5114871", "0.51080745", "0.5107711", "0.50975806", "0.509278", "0.5089069", "0.5084024", "0.5067976", "0.5065275", "0.5065059", "0.5061056", "0.5053208", "0.5051106", "0.5049779", "0.5049479", "0.50488365", "0.504846", "0.50443506", "0.50431836", "0.5038195", "0.5036736", "0.50294363", "0.5027111", "0.50142175", "0.49903667", "0.49867532", "0.4983621", "0.4969095", "0.49614364", "0.49415094", "0.49402377", "0.49356103", "0.49345538", "0.49297565", "0.49254087", "0.4924017", "0.49230665", "0.49203652", "0.49181637", "0.49153736", "0.49144828", "0.49122325" ]
0.5168625
48
Metodo per bloccare la logica in attesa di un comando dell'utente
void prosegui(String messaggio);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void logUser() {\n }", "public void logincredentials() {\n\t\tutil.entertext(prop.getValue(\"locators.text.uname\"), \"admin\");\n\t\tutil.entertext(prop.getValue(\"locators.text.password\"), \"Admin123\");\n\t\tutil.ClickElement(prop.getValue(\"locators.button.regdesk\"));\n\t\tutil.ClickElement(prop.getValue(\"locators.button.login\"));\n\t\tlogreport.info(\"logged into the application\");\n\n\t}", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tString mensagemFinal = \"<Servidor> \" + this.hostName; \n\t\tmensagemFinal = mensagemFinal + \" <ID> \" + idProcesso;\n\t\tmensagemFinal = mensagemFinal + \" <CL> \" + aClasse;\n\t\tmensagemFinal = mensagemFinal + \" <ME> \" + aMetodo;\n\t\tmensagemFinal = mensagemFinal + \" <Mensagem> \" + aMensagem;\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal);\n\t}", "public void zalogujSkonci() {\n PrintWriter pw;\n try {\n pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(\"logClient.txt\"), true)));\n pw.println(\"Odeslano bytu: \" + main.odeslanoZprav);\n pw.println(\"Prijato bytu: \" + main.prijatoBytu);\n pw.println(\"Odeslano zprav: \" + main.odeslanoZprav);\n pw.println(\"Prijato zprav: \" + main.prijatoZprav);\n pw.println(\"Odehrano her: \" + main.odehranoHer);\n pw.println(\"Doba behu: \" + (System.currentTimeMillis() - main.start) / 1000 + \" sekund.\");\n pw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n System.exit(0);\n }", "public static void ulogujSeKaoAdmin() {\r\n\t\tprikazIProveraSifre(-2, 'a');\r\n\t}", "public void executarLogica() {\n\t\tchecarTarefaValida();\n\t\texecutar();\n\t\texecutandoTarefa();\n\t\tfinalizarTarefa();\n\t}", "public void log(long idProcesso, int aTipo, String aClasse, String aMetodo, String aMensagem)\n\t{\n\t\tStringBuffer mensagemFinal = new StringBuffer(\"<Servidor> \").append(getHostName()); \n\t\tmensagemFinal.append(\" <ID> \").append(idProcesso);\n\t\tmensagemFinal.append(\" <Metodo> \").append(aMetodo);\n\t\tmensagemFinal.append(\" <Mensagem> \").append(aMensagem);\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal.toString());\n\t\tmensagemFinal = null;\n\t}", "public void bienvenida(){\n System.out.println(\"Bienvenid@ a nuestro programa de administracion de parqueos\");\n }", "public void executeCommandsForHost2Tier(String logName) throws Exception {\n\t\tSession session2 = this.host2;\n\t\tChannel channel2 = session2.openChannel(\"shell\");\n\n\t\t/* Output and Command list definition */\n\t\tops2 = channel2.getOutputStream();\n\t\tps2 = new PrintStream(ops2, true);\n\n\t\t/* Start to command burning */\n\t\tchannel2.connect();\n\n\t\tInputStream input2 = channel2.getInputStream();\n\n\t\t/** Host4 log collection side */\n\n\t\tThread.sleep(1000);\n\t\tps2.println(\"host2\");\n\t\t// command lists\n\t\tThread.sleep(1000);\n\n\t\tThread.sleep(500);\n\t\tps2.println(\"./logcap.sh -c \" + logName + \"_host2\"\n\t\t\t\t+ \" -z\"); /* run script for log collection */\n\t\t/* logcap.sh ı durdurma */\n\n\t\t/*\n\t\t * stop buttonunun methoduna aktarılacaktır gerek yok da olabilir de???\n\t\t */\n\n\t\tprintResult(input2, channel2);\n\n\t}", "protected void accionUsuario() {\n\t\t\r\n\t}", "private void verificar_comando(String comando, InterfazRemota interfaz, int puerto) {\n\tString cmd[] = comando.split(\"[\\\\s]+\");\n\tString aux[];\n\tString servidor;\n\tString archivo;\n\n\tif (cmd[0].equalsIgnoreCase(\"C\") && cmd.length == 3){\n\t if (cmd[1].equalsIgnoreCase(\"-t\") || cmd[1].equalsIgnoreCase(\"-k\")){\n\t\ttry {\n\t\t SalidaDFS salida = interfaz.dfs_distribuido(cmd[1] + \" \" + cmd[2], new Vector<String>());\n\t\t if ((salida.resultado).equals(\"\")){\n\t\t\tSystem.out.println(\"No hubo resultados \\n\");\n\t\t }\n\t\t else {\n\t\t\tSystem.out.println(salida.resultado);\n\t\t }\n\t\t \n\t\t}\n\t\tcatch (java.rmi.RemoteException r) {\n\t\t System.err.println(\"No se pudo establecer conexion con el servidor\");\n\t\t}\n\t\tfinally {\n\t\t return;\n\t\t}\n\t }\n\t /* Comando invalido */\n\t else System.out.println(\"Codigo Invalido\");\n\t}\n\t/* Solicitar una foto */\n\telse if (cmd[0].equalsIgnoreCase(\"D\") && cmd.length == 2 && cmd[1].matches(\"[\\\\S]+[:][\\\\S]+jpg\")){\n\t aux = cmd[1].split(\":\");\n\t servidor = aux[0];\n\t archivo = aux[1];\n\t try {\n\t\tInterfazRemota transferencia = null;\n\t\t\n\t\ttry {\n\t\t transferencia = (InterfazRemota)java.rmi.Naming.lookup(\"//\" + servidor + \":\" + puerto + \"/fotop2p\");\n\t\t}\n\t\tcatch (NotBoundException e) {\n\t\t System.err.println(\"No existe el servicio solicitado en \" + servidor + \":\" + puerto);\n\t\t System.exit(-1);\n\t\t}\n\t\tcatch (MalformedURLException m) {\n\t\t System.err.println(\"No se pudo establecer conexion con el servidor: URL incorrecta\");\n\t\t System.exit(-1);\n\t\t}\n\t\tcatch (java.rmi.RemoteException r) {\n\t\t System.err.println(\"No se pudo establecer conexion con el servidor\");\n\t\t System.exit(-1);\n\t\t}\n\n\t\tbyte [] foto = transferencia.archivo_a_bytes(archivo);\n\t\t\n\t\tif (foto == null) {\n\t\t System.out.println(\"Foto no encontrada o error al abrirla en el servidor\");\n\t\t}\n\t\telse {\n\t\t FileOutputStream fos = new FileOutputStream(\"./\" + archivo);\n\t\t BufferedOutputStream bos = new BufferedOutputStream(fos);\n\t\t bos.write(foto,0,foto.length);\n\t\t System.out.println(\"Foto recibida exitosamente \\n\");\n\n\t\t}\n\t }\n\t catch (java.rmi.RemoteException r) {\n\t\tSystem.err.println(\"No se pudo establecer conexion con el servidor\");\n\t }\n\t catch(IOException i) {\n\t\tSystem.err.println(\"Error al escribir el archivo\");\n\t }\n\t finally {\n\t\treturn;\n\t }\n\t}\n\t/* obterner numero de alcanzables */\n\telse if (cmd[0].equalsIgnoreCase(\"A\") && cmd.length == 1){\n\t try {\n\t\tVector<String> alc = interfaz.alcanzables(new Vector<String>());\n\t\tSystem.out.println(\"Alcanzables: \" + alc.size());\n\t }\n\t catch (java.rmi.RemoteException r) {\n\t\tSystem.out.println(\"No se pudo establecer conexion con el servidor\");\n\t\t\n\t\tSystem.out.println(r.getMessage());\n\t\tr.printStackTrace();\n\t }\n\t finally {\n\t\treturn;\n\t }\n\t}\n\t/* Salir */\n\telse if (cmd[0].equalsIgnoreCase(\"Q\") && cmd.length == 1 ){\n\t System.out.println(\"Chao\");\n\t System.exit(0);\n\t}\n \telse {\n\t System.out.println(\"Comando Invalido\");\n\t return;\n\t}\n }", "private Log() {\r\n readFile(\"Save.bin\",allLogs);\r\n readFile(\"Tag.bin\", allTags);\r\n readFile(\"Password.bin\", userInfo);\r\n }", "public static void main(String[] args){\n EmisorAcciones ea = new EmisorAcciones();\n ea.emitirAcciones();\n }", "@Override\n\tpublic void EjecutaGui() {\n\t\tSystem.out.println(\"Ejecucion en ventana del ejercicio 2 del grupo 3\");\n\t}", "public User_Log() throws Exception {\n initComponents();\n MyConnection();\n setSize(1010,680);\n setResizable(false);\n Koureio kour =new Koureio();\n usern.setText(kour.getUserLogIn());\n FirstSecond();\n }", "private void logika_rozpocznij(){\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n if(e.getActionCommand() == \"Iniciar sesión\" ){\n this.mostrarDatosUsuario();\n this.entrar();\n }\n if(e.getActionCommand() == \"Registrate\" ){\n JOptionPane.showMessageDialog(null, \"Oprimió botón registrarse\" , \"Advertencia\", 1);\n }\n if(e.getActionCommand() == \"¿Olvidaste tu contraseña?\" ){\n JOptionPane.showMessageDialog(null, \"Oprimió botón recuperar contraseña\" , \"Advertencia\", 1);\n }\n if(e.getSource() == logintemplate.getBVerContraseña()){\n JOptionPane.showMessageDialog(null, \"Oprimido botón ver contraseña\" , \"Advertencia\", 1);\n }\n if(e.getSource() == logintemplate.getBVerMas()){\n JOptionPane.showMessageDialog(null, \"Oprimido botón ver mas\" , \"Advertencia\", 1);\n }\n }", "public void actionPerformed(ActionEvent e) {\n\t\tString cmd=e.getActionCommand().toString();\n\t\tif(cmd.equals(ControladorAdmin.OFF)){\n\t\t\tif(aux1!=null)\n\t\t\t\taux1.dispose();\n\t\t\tif(help!=null)\n\t\t\t\thelp.dispose();\n\t\t\ta.dispose();\n\t\t\tVentanaLogin ven=new VentanaLogin();\n\t\t\tControladorLogin con=new ControladorLogin(ven);\n\t\t\tven.asignarControlador(con);\n\t\t\tven.ver();\n\t\t} else if(cmd.equals(ControladorAdmin.HELP)){\n\t\t\tif(help!=null)\n\t\t\t\thelp.dispose();\n\t\t\tif(aux1!=null)\n\t\t\t\taux1.dispose();\n\t\t\t\n\t\t\t File fileH = new File(\"Resource/Usuarios/3.txt\");\n\t\t\t help=new VentanaHelp(3);\n\t\t\t help.setAlwaysOnTop(true);\n\t\t try(BufferedReader read = new BufferedReader(new FileReader(fileH))) {\n\t\t \n\t\t String line = read.readLine();\n\t\t \n\t\t while(line !=null){\n\t\t help.getText().append(line+\" \"+\"\\n\");\n\t\t line =read.readLine();\n\t\t }\n\t\t \n\t\t } catch (Exception ex) {\n\t\t \n\t\t }\n\t\t} else if(cmd.equals(CREARME)){\n\t\t\tif(aux1!=null)\n\t\t\t\taux1.dispose();\n\t\t\tif(help!=null)\n\t\t\t\thelp.dispose();\n\t\t\taux1=new Formulario();\n\t\t\taux1.medico(this);\n\t\t\taux1.ver();\n\t\t} else if(cmd.equals(CREARTEC)){\n\t\t\tif(aux1!=null)\n\t\t\t\taux1.dispose();\n\t\t\tif(help!=null)\n\t\t\t\thelp.dispose();\n\t\t\t aux1=new Formulario();\n\t\t\t aux1.tecnico(this);\n\t\t\t aux1.ver();\n\t\t} else if(cmd.equals(CANCEL)){\n\t\t\tif(aux1!=null)\n\t\t\t\taux1.dispose();\n\t\t} else if(cmd.equals(ENVIARME)){\n\t\t\tboolean bien=true;\n\t\t\tboolean dni=true;\n\t\t\tboolean comprobar = Conexion.dniMedico(aux1);\n\t\t\tif(aux1.getNombre().getText().isEmpty()){\n\t\t\t\taux1.getNombre().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getNombre().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(aux1.getApellido1().getText().isEmpty()){\n\t\t\t\taux1.getApellido1().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getApellido1().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(aux1.getApellido2().getText().isEmpty()){\n\t\t\t\taux1.getApellido2().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getApellido2().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(aux1.getDni().getText().isEmpty()){\n\t\t\t\taux1.getDni().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\tif(!aux1.getLetra().getSelectedItem().toString().toLowerCase().equals(Utilidades.letraDNI(Integer.parseInt(aux1.getDni().getText())).toLowerCase())) {\n\t\t\t\t\taux1.getDni().setBackground(Color.red);\n\t\t\t\t\taux1.getLetra().setBackground(Color.RED);\n\t\t\t\t\tdni=false;\n\t\t\t\t} else {\n\t\t\t\t\taux1.getDni().setBackground(Color.WHITE);\n\t\t\t\t\taux1.getLetra().setBackground(Color.WHITE);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(aux1.getLugar().getText().isEmpty()){\n\t\t\t\taux1.getLugar().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getLugar().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(aux1.getTelefono().getText().isEmpty()){\n\t\t\t\taux1.getTelefono().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getTelefono().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(aux1.getNumero().getText().isEmpty()){\n\t\t\t\taux1.getNumero().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getNumero().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tString pss=\"\";\n\t\t\tfor(int i=0;i<aux1.getContrasena1().getPassword().length;i++) {\n\t\t\t\tpss=pss+aux1.getContrasena1().getPassword()[i];\n\t\t\t}\n\t\t\tString pss2=\"\";\n\t\t\tfor(int i=0;i<aux1.getContrasena2().getPassword().length;i++) {\n\t\t\t\tpss2=pss2+aux1.getContrasena2().getPassword()[i];\n\t\t\t}\n\t\t\tif(pss.equals(\"\")){\n\t\t\t\taux1.getContrasena1().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getContrasena1().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(pss.equals(\"\")){\n\t\t\t\taux1.getContrasena2().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getContrasena2().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(comprobar == false){\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Ya existe un mecnico con dni \" + aux1.getDni().getText()\n\t\t\t\t\t\t+ \". Porfavor introduzca el dni correcto\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\tbien = false;\n\t\t\t}\n\t\t\t\n\t\t\tif(bien==true){\n\t\t\t\tif(!dni) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"El dni es erroneo\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else\n\t\t\t\t\n\t\t\t\tif(!(pss.equals(pss2))){\n\t\t\t\t\taux1.getContrasena2().setBackground(Color.RED);\n\t\t\t\t\taux1.getContrasena1().setBackground(Color.RED);\n\t\t\t\t\tJOptionPane.showMessageDialog(aux1, \"Las passwords no coinciden\", \"error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tint i=0;\n\t\t\t\t\telimi=new Vector<Usuario>();\n\t\t\t\t\tusuario=Conexion.consultarUsuarios();\n\t\t\t\t\tString st=aux1.getNombre().getText()+aux1.getApellido1().getText();\n\t\t\t\t\tVector<String> aux=new Vector<String>();\n\t\t\t\t\tfor(int j=0;j<usuario.size();j++) {\n\t\t\t\t\t\taux.add(usuario.get(i).getUser().toLowerCase());\n\t\t\t\t\t}\n\t\t\t\t\tif(aux.contains(st.toLowerCase())){\n\t\t\t\t\t\twhile(aux.contains(st.toLowerCase()+i)){\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tst=st+i;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//escribirMedico(st,con1, aux1.getNombre().getText(), aux1.getApellido1().getText(), aux1.getApellido2().getText(), aux1.getDni().getText(), aux1.getTelefono().getText(), aux1.getLugar().getText(), aux1.getNumero().getText());\n\t\t\t\t\tString sentencia=\" insert into Medico ( dni, nColegiado, nTelefono) values (\"+aux1.getDni().getText()+\",\"+aux1.getNumero().getText()+\",\"+aux1.getTelefono().getText()+\");\";\n\t\t\t\t\tConexion.sentenciaSQL(sentencia);\n\t\t\t\t\tsentencia=\" insert into Usuario(dni, rol, apellido, nombre, nick, contrasena, ubicacion) values (\"+aux1.getDni().getText()+\",\"+Constantes.MEDICO+\",'\"+aux1.getApellido1().getText()+\" \"+aux1.getApellido2().getText()+\"','\"+aux1.getNombre().getText()+\"','\"+st+\"','\"+pss+\"','\"+aux1.getLugar().getText()+\"');\";\n\t\t\t\t\tConexion.sentenciaSQL(sentencia);\n\t\t\t\t\tusuario.add(new Usuario(st,\"medico\",pss,Integer.parseInt(aux1.getDni().getText())));\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Medico creado con usuario: \"+st, \"Creado\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t\taux1.dispose();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(dni) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Por favor, rellene todos los campos\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"El DNI es erronea y por favor, rellene todos los campos\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(cmd.equals(ENVIARTEC)){\n\t\t\tboolean bien=true;\n\t\t\tboolean dni=true;\n\t\t\tboolean comprobar = Conexion.dniTecnico(aux1);\n\t\t\tif(aux1.getNombre().getText().isEmpty()){\n\t\t\t\taux1.getNombre().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getNombre().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(aux1.getApellido1().getText().isEmpty()){\n\t\t\t\taux1.getApellido1().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getApellido1().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(aux1.getApellido2().getText().isEmpty()){\n\t\t\t\taux1.getApellido2().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getApellido2().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(aux1.getDni().getText().isEmpty()){\n\t\t\t\taux1.getDni().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\tif(!aux1.getLetra().getSelectedItem().toString().toLowerCase().equals(Utilidades.letraDNI(Integer.parseInt(aux1.getDni().getText())).toLowerCase())) {\n\t\t\t\t\taux1.getDni().setBackground(Color.red);\n\t\t\t\t\taux1.getLetra().setBackground(Color.RED);\n\t\t\t\t\tdni=false;\n\t\t\t\t} else {\n\t\t\t\t\taux1.getDni().setBackground(Color.WHITE);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(aux1.getLugar().getText().isEmpty()){\n\t\t\t\taux1.getLugar().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getLugar().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tString pss=\"\";\n\t\t\tfor(int i=0;i<aux1.getContrasena1().getPassword().length;i++) {\n\t\t\t\tpss=pss+aux1.getContrasena1().getPassword()[i];\n\t\t\t}\n\t\t\tString pss2=\"\";\n\t\t\tfor(int i=0;i<aux1.getContrasena2().getPassword().length;i++) {\n\t\t\t\tpss2=pss2+aux1.getContrasena2().getPassword()[i];\n\t\t\t}\n\t\t\tif(pss.equals(\"\")){\n\t\t\t\taux1.getContrasena1().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getContrasena1().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(pss.equals(\"\")){\n\t\t\t\taux1.getContrasena2().setBackground(Color.RED);\n\t\t\t\tbien=false;\n\t\t\t} else {\n\t\t\t\taux1.getContrasena2().setBackground(Color.WHITE);\n\t\t\t}\n\t\t\tif(comprobar == false){\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Ya existe un tecnico con dni \" + aux1.getDni().getText()\n\t\t\t\t\t\t+ \". Porfavor introduzca el dni correcto\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\tbien = false;\n\t\t\t}\n\t\t\tif(bien==true){\n\t\t\t\tif(!dni) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"El dni es erroneo\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else\n\t\t\t\t\n\t\t\t\tif(!(pss.equals(pss2))){\n\t\t\t\taux1.getContrasena2().setBackground(Color.RED);\n\t\t\t\taux1.getContrasena1().setBackground(Color.RED);\n\t\t\t\tJOptionPane.showMessageDialog(aux1, \"Las passwords no coinciden\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t} else{\n\t\t\t\telimi=new Vector<Usuario>();\n\t\t\t\tusuario=Conexion.consultarUsuarios();\n\t\t\t\tint i=0;\n\t\t\t\tString st=aux1.getNombre().getText()+aux1.getApellido1().getText();\n\t\t\t\tVector<String> aux=new Vector<String>();\n\t\t\t\tfor(int j=0;j<usuario.size();j++) {\n\t\t\t\t\taux.add(usuario.get(i).getUser().toLowerCase());\n\t\t\t\t}\n\t\t\t\tif(aux.contains(st.toLowerCase())){\n\t\t\t\t\twhile(aux.contains(st.toLowerCase()+i)){\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\tst=st+i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//sql\n\t\t\t\t//escribirTecnico(st,con1, aux1.getNombre().getText(), aux1.getApellido1().getText(), aux1.getApellido2().getText(), aux1.getDni().getText(), aux1.getLugar().getText());\n\t\t\t\tString sentencia=\" insert into Tecnico ( dni, turno) values (\"+aux1.getDni().getText()+\",\"+Constantes.turno+\");\";\n\t\t\t\tConexion.sentenciaSQL(sentencia);\n\t\t\t\tsentencia=\" insert into Usuario(dni, rol, apellido, nombre, nick, contrasena, ubicacion) values (\"+aux1.getDni().getText()+\",\"+Constantes.TECNICO+\",'\"+aux1.getApellido1().getText()+\" \"+aux1.getApellido2().getText()+\"','\"+aux1.getNombre().getText()+\"','\"+st+\"','\"+pss+\"','\"+aux1.getLugar().getText()+\"');\";\n\t\t\t\tConexion.sentenciaSQL(sentencia);\n\t\t\t\tusuario.add(new Usuario(st,\"tecnico\",pss,Integer.parseInt(aux1.getDni().getText())));\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Tecnico creado con usuario: \"+st, \"Creado\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\taux1.dispose();\n\t\t\t\t\n\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(dni) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Por favor, rellene todos los campos\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t} else {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"El DNI es erronea y por favor, rellene todos los campos\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t} else if(cmd.equals(USUARIOS)){\n\t\t\telimi=new Vector<Usuario>();\n\t\t\tusuario=Conexion.consultarUsuarios();\n\t\t\taux=a.getCentro().getComponents();\n\t\t\ta.getCentro().setVisible(false);\n\t\t\ta.getCentro().removeAll();\n\t\t\t//usuario=this.obtenerUsuarios();\n\t\t\tVector<Usuario>medi=new Vector<Usuario>();\n\t\t\tVector<Usuario>tec=new Vector<Usuario>();\n\t\t\t\n\t\t\tfor(int i=0;i<usuario.size();i++){\n\t\t\t\tif(usuario.get(i).getRol().equals(\"medico\")){\n\t\t\t\t\tmedi.add(usuario.get(i));\n\t\t\t\t} else {\n\t\t\t\t\ttec.add(usuario.get(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t//drop usuario\n\t\t\ta.getCentro().add(a.paneldeusuarios(this,medi,tec,elimi),BorderLayout.CENTER);\n\t\t\t\n\t\t\ta.getCentro().setVisible(true);\n\n\t\t} else if(cmd.equals(BACK)){\n\t\t\tif(!elimi.isEmpty()) {\n\t\t\t\tint resp = JOptionPane.showConfirmDialog(a, \"Seguro que desea mantener los cambios? Serán permanentes\", \"Guardar cambios\",JOptionPane.YES_NO_OPTION);\n\t\t\t\tif(resp==JOptionPane.NO_OPTION) {\n\t\t\t\t\telimi.removeAllElements();\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 0; i < querys.size();i++){\n\t\t\t\tConexion.sentenciaSQL(querys.get(i));\n\t\t\t\tSystem.out.println(querys.get(i));\n\t\t\t}\n\t\t\tquerys.clear();\n\t\t\twhile(!elimi.isEmpty()) {\n\t\t\t\tif(elimi.get(0).getRol().equals(\"medico\")) {\n//\t\t\t\t\tConexion.sentenciaSQL(\"delete from Medico where dni=\"+elimi.get(0).getDni());\n\t\t\t\t\t\n\t\t\t\t} else if(elimi.get(0).getRol().equals(\"tecnico\")){\n//\t\t\t\t\tConexion.sentenciaSQL(\"delete from tecnico where dni=\"+elimi.get(0).getDni());\n\t\t\t\t} else {\n//\t\t\t\t\tConexion.sentenciaSQL(\"delete from administrador where dni=\"+elimi.get(0).getDni());\n\t\t\t\t}\n//\t\t\t\tConexion.sentenciaSQL(\"delete from Usuario where dni=\"+elimi.get(0).getDni());\n\t\t\t\tusuario.remove(elimi.get(0));\n\t\t\t\telimi.remove(0);\n\t\t\t}\n\t\t\ta.getCentro().setVisible(false);\n\t\t\ta.getCentro().removeAll();\n\t\t\tfor(int i=0;i<aux.length;i++){\n\t\t\t\ta.getCentro().add(aux[i]);\t\n\t\t\t}\n\t\t\t\n\t\t\ta.getCentro().setVisible(true);\n//\t\t\tString sentencia=\" insert into Tecnico ( dni, turno) values (\"+aux1.getDni().getText()+\",\"+Constantes.turno+\");\";\n//\t\t\tString sentencia = \"drop turno from Tecnico where Tecnico.dni = 98;\";\n//\t\t\tConexion.sentenciaSQL(sentencia);\n\t\t}\n\t}", "@Override\n public void run(String... args) {\n if (!infoUsuarioRepo.existsByUsernameIgnoreCase(userAdmin)) {\n log.info(\"Creando usuario administrador {}\", userAdmin);\n InfoUsuario admin = new InfoUsuario();\n admin.setUsername(userAdmin);\n admin.setPassword(bcryptEncoder.encode(passAdmin));\n admin.setCorreo(correoAdmin);\n admin.setEstado(Estado.Activo.toString());\n admin.setFeCreacion(new Date());\n infoUsuarioRepo.save(admin);\n }\n /* Creacion de apiKey */\n if (!admiApiRepos.existsByValor(apiKeyAdmi)) {\n log.info(\"Creando apiKey administrador xxxxxxxxxxxxxxxxxxxx\");\n AdmiApi api = new AdmiApi();\n api.setValor(apiKeyAdmi);\n api.setEstado(Estado.Activo.toString());\n admiApiRepos.save(api);\n }\n }", "public telalogin() {\n initComponents();\n conexao = ModuloConexao.conector();\n // a linha abaixo serve de apoio ao status da conexao\n // System.out.println(conexao);\n\n }", "private void abrirVentanaChatPrivada() {\n\t\tthis.chatPublico = new MenuVentanaChat(\"Sala\", this, false);\n\t}", "public String interpretador(String comando){\n\t\tif(comando.equals(\"list\")){\n\t\t\t\n\t\t\tStringBuffer usuariosOnline = new StringBuffer();\n\t\t\t\n\t\t\tfor (User u : Servidor.users) {\n\t\t\t\tusuariosOnline.append(\"\\n -\" + u.getNome());\n\t\t\t}\n\t\t\t\n\t\t\treturn \"\\n======================\\n\"\n\t\t\t\t\t+ \"Usuarios online: \" + usuariosOnline\n\t\t\t\t\t+ \"\\n======================\";\n\t\t}\n\t\t\n\t\t// envia uma mensagem para todos que estao online\n\t\telse if(comando.contains(\"send -all\")){\n\t\t\tString mensagem = comando.substring(9);\n\t\t\t\n\t\t\tString emitente = null;\n\t\t\tfor (User u : Servidor.users) {\n\t\t\t\tif(u.getSocket() == socket){\n\t\t\t\t\temitente = u.getNome();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tbroadcast(mensagem, emitente);\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\t\t// envia uma mensagem para apenas um usuario especifico (mensagem privada)\n\t\telse if(comando.contains(\"send -user\")){\n\t\t\tString temp = comando.substring(11);\n\t\t\tString user = temp.substring(0, temp.indexOf(\" \"));\n\t\t\tString msg = temp.substring(temp.indexOf(\" \"));\n\t\t\t\n\t\t\tUser remetente = null;\n\t\t\tfor (User u : Servidor.users) {\n\t\t\t\tif (u.getNome().equals(user)) {\n\t\t\t\t\tremetente = u;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tString emitente = null;\n\t\t\tfor (User u : Servidor.users) {\n\t\t\t\tif (u.getSocket() == socket) {\n\t\t\t\t\temitente = u.getNome();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tsendTo(remetente, emitente, msg);\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\t\t// renomeia o nome do usuario atual\n\t\telse if(comando.contains(\"rename\")){\n\t\t\tString novonome = comando.substring(7);\n\t\t\tboolean usado = false;\n\t\t\t\n\t\t\tfor (User u : Servidor.users) {\n\t\t\t\tif(novonome.equals(u.getNome())){\n\t\t\t\t\tusado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(usado == true){\n\t\t\t\treturn \"\\n**Nome de usuario ja em uso.\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthis.user.setNome(novonome);\n\t\t\t\treturn \"\\n**Renomeado com sucesso.\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t// remove o usuario do chat e encerra a comunicacao com o mesmo (fechando o socket)\n\t\telse if(comando.equals(\"bye\")){\n\t\t\t\n\t\t\tbroadcastInfo(\"** \" + this.user.getNome() + \" saiu.\");\n\t\t\tServidor.users.remove(user);\n\t\t\tThreadCliente.this.stop();\n\t\t\t\n\t\t\ttry {\n\t\t\t\tsocket.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\t\telse{\n\t\t\treturn \"** Comando não reconhecido pelo servidor.\";\n\t\t}\n\t}", "public static void main(String[] args) throws SQLException, ClassNotFoundException {\n CtrlUsuarios us = new CtrlUsuarios(); \n //instancia de un objeto Usuario, para almacenar el usuario obtenido\n Usuarios user = null;\n //Para probar el código solo deben mandar a llamar al método correspondiente creado para la funcionalidad\n //En este caso imprimo el resultado obtenido y el código creado es correcto\n user = us.obtenerPorId(Conexion.conectar(),1);\n System.out.println(user.toString());\n \n //de aquí en seguida podemos seguir agragando las demas prubas...\n }", "private void registraLog(int aTipo, String aMensagem)\n\t{\n\t\tArquivoConfiguracaoGPP arqConf = ArquivoConfiguracaoGPP.getInstance();\n\t\tif (aTipo == Definicoes.FATAL)\n\t\t\tlogger.fatal(aMensagem);\n\t\telse if (aTipo == Definicoes.ERRO)\n\t\t\t\tlogger.error(aMensagem);\n\t\telse if (aTipo == Definicoes.WARN)\n\t\t\t\tlogger.warn(aMensagem);\n\t\telse if (aTipo == Definicoes.INFO)\n\t\t\t\tlogger.info(aMensagem);\n\t\telse if (aTipo == Definicoes.DEBUG)\n\t\t{\n\t\t\t\tif (arqConf.getSaidaDebug())\n\t\t\t\t\tlogger.debug(aMensagem);\n\t\t}\n\t\telse logger.warn(\"SEVERIDADE NAO DEFINIDA - \" + aMensagem);\n\t}", "String ejecutarAccion();", "public void imprimir(String log){\n System.out.println(log);\n\n }", "@Override\r\n\tpublic void hacerSonido() {\n\t\tSystem.out.print(\"miau,miau -- o depende\");\r\n\t\t\r\n\t}", "@Override \n public void commandLogin(String userName, String password)\n {\n }", "public void ligar() {\n\t\t\n\t\ttry {\n\t\t\tthis.sistemaOperacional.iniciarSistema();\n\t\t} catch(Exception e) {\n\t\t\tSystem.out.println(\"Nao foi possivel iniciar o sistema:\");\n\t\t\tSystem.out.println(\"\\t\" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "public void salir() {\n LoginManager.getInstance().logOut();\n irInicio();\n }", "protected String getCommand() {\n\treturn \"USER_LOGIN\";\n }", "public static void main(String[] args) {\n\t\tUsuario u = registro();\n\t\tSystem.out.println(\"Bienvenido \"+ u.getNombre()+\" \" + u.getApellido());\n\t}", "public static void saludo(){\n System.out.println(\"Bienvenido al Sistema\");\n }", "public void showMenuforUser(String path, Storage s) {\n\t\tint cnt;\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(System.in));\n\t\tStringBuilder sb=new StringBuilder();\n\t\t\n\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------------------------\");\n\t\tsb.append(\"**********Trenutna lokacija:\" + path+\"**********\\n\");\n\t\tif(privileges.contains(\"add_user\")) {\n\t\t\tcnt=1;\n\t\t\t\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje novog korisnika\");\n\t\t\t\n\t\t}\n\t\tif(privileges.contains(\"add_directory\")) {\n\t\t\tcnt=2;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje novog foldera\");\n\t\t}\n\t\tif(privileges.contains(\"add_file\")) {\n\t\t\tcnt=3;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje novog fajla\");\n\t\t}\n\t\tif(privileges.contains(\"download\")) {\n\t\t\tcnt=4;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za preuzimanje fajla\");\n\t\t}\n\t\tif(privileges.contains(\"upload\")) {\n\t\t\tcnt=5;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+ \" za upload fajla\");\n\t\t}\n\t\tif(privileges.contains(\"search_repository\")) {\n\t\t\tcnt=6;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za pretragu repozitorijuma\");\n\t\t}\n\t\tif(privileges.contains(\"delete_file\")) {\n\t\t\tcnt=7;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za brisanje fajla\");\n\t\t}\n\t\tif(privileges.contains(\"add_user\")) {\n\t\t\tcnt=8;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za dodavanje zabranjenih ekstenzija\");\n\t\t}\n\t\tif(privileges.contains(\"download\") && s.getType().equals(\"local\")) {\n\t\t\tcnt=9;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za zipovnje fajlova\");\n\t\t}\n\t\tif(privileges.contains(\"upload\") && s.getType().equals(\"local\")) {\n\t\t\tcnt=10;\n\t\t\tsb.append(\"\\n\");\n\t\t\tsb.append(\"Izaberite \"+cnt+\" za anzipovanje fajlova\");\n\t\t}\n\t\t\n\t\tsb.append(\"\\n\");\n\t\tsb.append(\"Izaberite 'ls' za prikaz sadrzine trenutnog foldera\");\n\t\tsb.append(\"\\n\");\n\t\tsb.append(\"Izaberite 'cd' <folder name> ili <..> za kretanje po fajlu\");\n\t\t//sb.append(\"\\n\"+path+\" >\");\n\t\tSystem.out.print(sb.toString());\n\t\t\n\t}", "public void ejecutaMetodo() {\n\t\r\n}", "public void fechar() {\n\n try {\n geraLog.criaLog(codigoUsuario, \"Principal\", \"Fez Logoff do Sistema\");\n } catch (IOException ex) {\n Logger.getLogger(JfLogin.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);\n this.dispose();\n\n }", "public static void main(String[] args) {\n\t\tHamburger cheeseBurger = new Hamburger(\"CheeseBurger\");\r\n\t\tHamburger maxiBurger = new Hamburger(\"MaxiBurger\");\r\n\t\tAccompagnement accompagnement = new Accompagnement(\"Frites\");\r\n\t\tBoisson boissonCoca = new Boisson(\"Coca\");\r\n\t\tBoisson boissonOrange = new Boisson(\"Orange\");\r\n\r\n\t\t// Mise en place de l'environnement\r\n\t\tControlCreerProfil controlCreerProfil = new ControlCreerProfil();\r\n\t\tcontrolCreerProfil.creerProfil(ProfilUtilisateur.PERSONNEL, \"Dupond\", \"Jacques\", \"jdu\");\r\n\r\n\t\t// Connexion du cuisinier\r\n\t\tControlSIdentifier controlSIdentifier = new ControlSIdentifier();\r\n\t\tint numCuisinier = controlSIdentifier.sIdentifier(ProfilUtilisateur.PERSONNEL, \"Jacques.Dupond\", \"jdu\");\r\n\r\n\t\t// Initialisation controleur du cas & cas Inclus/etendu\r\n\t\tControlVerifierIdentification controlVerifierIdentification = new ControlVerifierIdentification();\r\n\t\tcontrolVerifierIdentification.verifierIdentification(ProfilUtilisateur.PERSONNEL, numCuisinier);\r\n\r\n\t\t// cas visualiser commande du jour\r\n\t\tControlVisualiserCommandeJour controlVisualiserCommandeJour = new ControlVisualiserCommandeJour(\r\n\t\t\t\tcontrolVerifierIdentification);\r\n\t\tBoundaryVisualiserCommandeJour boundaryVisualiserCommandeJour = new BoundaryVisualiserCommandeJour(\r\n\t\t\t\tcontrolVisualiserCommandeJour);\r\n\t\tboundaryVisualiserCommandeJour.visualiserCommandeJour(numCuisinier);\r\n\r\n\t\ttry {\r\n\t\t\tThread.sleep(1500);\r\n\t\t\tSystem.out.println(\"Ecriture des commandes dans le fichier\");\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// extrait cas commander\r\n\t\tBDCommande bdCommande = BDCommande.getInstance();\r\n\t\tbdCommande.enregistrerCommande(1, cheeseBurger, accompagnement, boissonCoca);\r\n\t\tbdCommande.enregistrerCommande(1, maxiBurger, accompagnement, boissonOrange);\r\n\r\n\t\t// Ecriture des commandes dans le fichier\r\n\t\t// Commande n°1 : CheeseBurger, Frites, Coca\r\n\t\t// Commande n°2 : MaxiBurger, Frites, Orange\r\n\t}", "private void registraLog(int aTipo, String aMensagem)\n\t{\n\t\tif (aTipo == Definicoes.FATAL)\n\t\t\tlogger.fatal(aMensagem);\n\t\telse if (aTipo == Definicoes.ERRO)\n\t\t\t\tlogger.error(aMensagem);\n\t\telse if (aTipo == Definicoes.WARN)\n\t\t\t\tlogger.warn(aMensagem);\n\t\telse if (aTipo == Definicoes.INFO)\n\t\t\t\tlogger.info(aMensagem);\n\t\telse if (aTipo == Definicoes.DEBUG)\n\t\t{\n\t\t\t\tif (arqConfig.getSaidaDebug())\n\t\t\t\t\tlogger.debug(aMensagem);\n\t\t}\n\t\telse logger.warn(\"SEVERIDADE NAO DEFINIDA - \" + aMensagem);\n\t}", "public static void helpCommand(){\n\n System.out.println(\"--------list of controls-------\");\n System.out.println(\"'help' : display the list of control\");\n System.out.println(\"'exit' : for quit the app /n\");\n System.out.println(\"'adduser' : you can add user with this command,<fistname>,<lastname>,<country>,<departement>,<age>\");\n System.out.println(\"'edituser' : you can edit an user with this command, <firstname>,<lastname>\");\n System.out.println(\"'removeuser' : you can remove an user with this command, <firstanme>,<lastname>\");\n System.out.println(\"'listusers' : display all of users\");\n System.out.println(\"'addcar' : add a car to the list, <brand>,<model>,<ref>,<year>\");\n System.out.println(\"'editcar' : use this command for edit a car, <ref>\");\n System.out.println(\"'removecar' : use this command for remove a car\");\n System.out.println(\"'listcars' : display all the cars\");\n System.out.println(\"'rentcar' : command for rent a car\");\n System.out.println(\"'returncar' : command for return a car\");\n System.out.println(\"'listrent' : display the list of rents\");\n System.out.println(\"'saveusers' : use this command for save your users file\");\n System.out.println(\"'restoreusers' : use this command open your save users file\");\n System.out.println(\"'serialusers' : use this command serialize object users\");\n System.out.println(\"'saverents' : use this command save the list of rents in file\");\n System.out.println(\"'loadrents' : use this command load the list from file\");\n System.out.println(\"'savecars' : use this command for save the list of cars in a file\");\n System.out.println(\"'loadcars' : use this command for import the list from file \");\n System.out.println(\"'saveall' : use this command for save all the list in a file\");\n System.out.println(\"'loadall' : use this command for import all the list from file\");\n System.out.println(\"----------------------------------\");\n\n }", "public void recibeOrden() {\r\n\t\tSystem.out.println(\"Ordene mi General\");\r\n\t}", "void crearAuditoria(String emailUsuario, String observacion, String dirIP, String hostName);", "public static void tener_Usuario_activo() {\n\t\t\t\tdesktop.<DomTextField>find(\"//BrowserApplication//BrowserWindow//input[@id='username']\").typeKeys(\"ocastro\");\n\t\t\t\tdesktop.<DomTextField>find(\"//BrowserApplication//BrowserWindow//input[@id='password']\").setText(\"bogota2016\");\n\t\t\t\tdesktop.<DomButton>find(\"//BrowserApplication//BrowserWindow//input[@id='loginbtn']\").click();\n\t\t\t\t//end recording\n\t\t\t\tSerenity.takeScreenshot();\n\t}", "public void subeUsuario() {\n\t\tEditText nicknameText = (EditText) findViewById(R.id.nicknameEditText);\n\t\tstrNickname = nicknameText.getText().toString().trim();\n\t\t\n\t\tif (strNickname.equals(\"\")) {\n\t\t\tToast.makeText(this, \"Nickname no puede estar vacío\",Toast.LENGTH_LONG).show();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tguardarPreferences();\n\t\t\n\t\t//lanzamos un uploadService\n\t\tIntent uploadService = new Intent(getApplicationContext(),UploadUserService.class);\n\t\t\n\t\tuploadService.putExtra(\"id\", userId);\n\t\tuploadService.putExtra(\"nickname\", strNickname);\n\t\tuploadService.putExtra(\"mail\", strEmail);\n\t\tuploadService.putExtra(\"dob\", dayOfBirth);\n\t\tuploadService.putExtra(\"pass\", strPassword);\n\t\tuploadService.putExtra(\"genero\", gender);\n\t\tuploadService.putExtra(\"avatar\", strAvatar);\n\t\t\n\t\tstartService(uploadService);\n\t}", "public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}", "public static void status(){\n System.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n System.out.printf(\"\\nNOMBRE:\\t\\t\\t\"+nombrePersonaje);\n\tSystem.out.printf(\"\\nPuntos De Vida (HP):\\t\"+puntosDeVida);\n\tSystem.out.printf(\"\\nPuntos De mana (MP):\\t\"+puntosDeMana);\n System.out.printf(\"\\nNivel: \\t\\t\\t\"+nivel);\n\tSystem.out.printf(\"\\nExperiencia:\\t\\t\"+experiencia);\n\tSystem.out.printf(\"\\nOro: \\t\\t\"+oro);\n System.out.printf(\"\\nPotion:\\t\\t\\t\"+articulo1);\n System.out.printf(\"\\nHi-Potion:\\t\\t\"+articulo2);\n System.out.printf(\"\\nM-Potion:\\t\\t\"+articulo3);\n System.out.printf(\"\\n\\tEnemigos Vencidos:\\t\");\n\tSystem.out.printf(\"\\nNombre:\\t\\t\\tNo.Derrotas\");\n System.out.printf(\"\\nDark Wolf:\\t\\t\"+enemigoVencido1);\n\tSystem.out.printf(\"\\nDragon:\\t\\t\\t\"+enemigoVencido2);\n System.out.printf(\"\\nMighty Golem:\\t\\t\"+enemigoVencido3);\t\n }", "public void logComponente (int aTipo, String aComponente, String aMensagem )\n\t{\n\t\tlogComponente(0,aTipo,aComponente,aMensagem,\" \");\n\t}", "private void loginPluginExecutor(Object userInfo, String cmd)\n/* */ {\n/* 537 */ if (ToolKit.notNull(getLoginPlugins())) {\n/* 538 */ for (IUserLoginPlugin ex : getLoginPlugins()) {\n/* 539 */ boolean isBefore = \"before\".equals(cmd);\n/* */ try {\n/* 541 */ if (isBefore) {\n/* 542 */ ex.beforeLogin((AuthenticationUserVO)userInfo);\n/* */ } else\n/* 544 */ ex.afterLogin((PtSessionBean)userInfo);\n/* */ } catch (BreakPortalLoginException e) {\n/* 546 */ PortalLogger.error(e.getMessage(), e);\n/* 547 */ if (isBefore) {\n/* 548 */ getUserBill().doLoginErrorLog((AuthenticationUserVO)userInfo, e.getHint());\n/* */ } else\n/* 550 */ getUserBill().doLoginLog((LfwSessionBean)userInfo, UFBoolean.FALSE, e.getHint());\n/* 551 */ throw new LfwRuntimeException(e.getHint());\n/* */ } catch (Throwable a) {\n/* 553 */ PortalLogger.error(LfwResBundle.getInstance().getStrByID(\"pserver\", \"PortalLoginHandler-000027\") + a.getMessage(), a);\n/* */ }\n/* */ }\n/* */ }\n/* */ }", "private static void mostrarMenu() {\n\t\tSystem.out.println(\"------------------------------\");\n\t\tSystem.out.println(\"-----------OPCIONES-----------\");\n\t\tSystem.out.println(\"------------------------------\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\n\\t1) Mostrar los procesos\");\n\t\tSystem.out.println(\"\\n\\t2) Parar un proceso\");\n\t\tSystem.out.println(\"\\n\\t3) Arrancar un proceso\");\n\t\tSystem.out.println(\"\\n\\t4) A�adir un proceso\");\n\t\tSystem.out.println(\"\\n\\t5) Terminar ejecucion\");\n\t\tSystem.out.println(\"\\n------------------------------\");\n\t}", "public static void main(String[] args) {\n\r\n\t\tlog.error(\"Demo1 Unable to click on button\");\r\n\t\tlog.fatal(\"Demo1 Fatal error displayed\");\r\n\t\tlog.info(\"Demo1 successfully entered username and password\");\r\n\t\tlog.debug(\"Demo1 debug information displayed\");\r\n\t}", "static void menuPrincipal() {\n System.out.println(\n \"\\nPizzaria o Rato que Ri:\" + '\\n' +\n \"1 - Novo pedido\" + '\\n' +\n \"2 - Mostrar pedidos\" + '\\n' +\n \"3 - Alterar estado do pedido\" + '\\n' +\n \"9 - Sair\"\n );\n }", "private void consultadadosUtilizador(String username){\n Scanner s = new Scanner(System.in); int opcao = 0;\n try{\n do{\n System.out.println(\"Informações de Conta \");\n System.out.println(b_dados.getUtilizadores().get(username).toString());\n System.out.println(\"1-Mudar localizacao\");\n System.out.println(\"0 - Retroceder\");\n\n opcao = s.nextInt();\n System.out.print(\"\\n\");\n\n switch(opcao){\n case 1:\n mudarLocalizacaoUtilizador(username);\n break;\n default:\n System.out.print(\"Opção inválida\\n\\n\");\n break;\n\n }\n }while(opcao != 0);\n }\n catch(InputMismatchException e){\n System.out.println(\"Entrada inválida\");\n menuCliente(username);\n\n }\n }", "public static void main(String[] args) {\n\t\tUsuario u = new UsuarioDAO().buscaDadosUsuario(\"[email protected]\");\n\t\tSystem.out.println(\"->\"+u.getNome());\n\t\tSystem.out.println(\"-->\"+u.getMedicacoes().size());\n\t}", "public static void printMensagemSaidaSistema() {\n System.out.println(\"Obrigado por utilizar nosso sistema.\\nVolte Sempre!\");\n }", "@Override\n public void comunicar() {\n System.out.println(\"miauuuu\");\n\n }", "@Override\n\tpublic void concentrarse() {\n\t\tSystem.out.println(\"Se centra en sacar lo mejor del Equipo\");\n\t\t\n\t}", "@Override\r\n\tprotected void verificaUtentePrivilegiato() {\n\r\n\t}", "public FiltroRaEncerramentoComando() {\r\n }", "public void carroAgregado(){\n System.out.println(\"Su carro fue agregado con exito al sistema\");\n }", "public String getUserCommand();", "public void printCommand() {\n System.out.println(\"Cette commande n'est pas supportee\");\n System.out.println(\"Quitter : \\\"quit\\\", Total: \\\"total\\\" , Liste: \\\"list\\\" ou Time: \\\"time\\\"\");\n System.out.println(\"--------\");\n }", "public static void main(String args[]) {\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(User_Log.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(User_Log.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(User_Log.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(User_Log.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //</editor-fold>\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n try {\n new User_Log().setVisible(true);\n } catch (Exception ex) {\n Logger.getLogger(User_Log.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n });\n }", "public void emitirSaludoConGui()\n {\n JOptionPane.showMessageDialog(null, \n\t\t\t\t\t\"<html><p style ='color: red'>Saludo en modo gráfico </p></html>\" + \n\t\t\t\t\t\"\\n\\nBienvenido/a al curso de programación orientada a objetos\\n en Java utilizando BlueJ\",\n\t\t\t\t\t\"Ejemplo de prueba\", JOptionPane.INFORMATION_MESSAGE);\n }", "void logSystemDetails() throws CometApiException {\n sendSynchronously(restApiClient::logSystemDetails, SystemUtils.readSystemDetails());\n }", "@Override\n\tpublic void onCommand(CommandSender sender, String[] args) {\n\t\t\n\t}", "@Override\n\tpublic void onCommand(CommandSender sender, String[] args) {\n\t\t\n\t}", "private static void printFirstOp(){\n\t\tSystem.out.println(\"Welcome to SimpleSocial!\\n\"\n\t\t\t\t+ \"Type:\\n\"\n\t\t\t\t+ \"- register\\n\"\n\t\t\t\t+ \"- login\\n\"\n\t\t\t\t+ \"- exit\");\n\t}", "public static void main(String args[]){\n\t\tString nomi[] = {\"Lucia\", \"Marco\", \"Alessandra\", \"Mario\", \"Paola\", \"Giovanni\", \"Rosa\", \"Filippo\"};\r\n\t\tint eta[] = {19, 24, 20, 20, 18, 21, 22, 19};\r\n\r\n\t\tStudente studenti[] = new Studente[nomi.length];\r\n\t\tfor(int i = 0; i < nomi.length; i++){\r\n\t\t\tstudenti[i] = new Studente(nomi[i], eta[i]);\r\n\t\t}\r\n\r\n\t\tEsse3 scriviEsse3 = new Esse3(\"Password\");\r\n\t\tfor(int i = 0; i < studenti.length; i++){\r\n\t\t\tscriviEsse3.inserisciStudente(studenti[i]);\r\n\t\t}\r\n\r\n\t\t//salvo sul file\r\n\t\tscriviEsse3.salva();\r\n\r\n\t\tEsse3 leggiEsse3 = new Esse3(\"Password2\");\r\n\t\tleggiEsse3 = scriviEsse3.carica();\r\n\r\n\t\t//stampo ciò che è stato caricato dal file\r\n\t\tleggiEsse3.stampaElenco();\r\n\r\n\t}", "public void jugar_con_el() {\n System.out.println(nombre + \" esta jugando contigo :D\");\n }", "private void logIt(String msg) {\n\tSystem.out.println(\"PLATINUM-SYNC-LOG: \" + msg);\n}", "public AgregarMedidaComando(Entidad _pm) {\n this._pm = _pm;\n }", "private void remplirUtiliseData() {\n\t}", "public String logon() {\n\n if (log.isDebugEnabled()) {\n log.debug(\"logon()\");\n }\n return \"logon\";\n\n }", "public void ejecucion() throws Exception {\n\t\t//Activamos las trazas\n\t\tsetTrazaFichero();\n\t\n\t\ttry{\n\t\t\t//Sacamos la acción a realizar y ejecutamos la acción correspondiente\n\t\t\tString accion = conectorParametro(PARAMETRO_GENERICO_ACCION);\n\t\t\tString origen = conectorParametro(PARAMETRO_GENERICO_ORIGEN);\n\t\t\t\n\t\t\t//Caragamos los elemetnos en la pagina\n\t\t\tasignar(\"VAR\",PARAMETRO_GENERICO_ACCION,accion);\n\t\t\tasignar(\"VAR\",PARAMETRO_GENERICO_ORIGEN,origen);\n\t\n\t\t\t//Ejecutamos la acción indicada\n\t\t\tif(accion.equals(ACCION_CREATE)) cmdCreate();\n\t\t\tif(accion.equals(ACCION_UPDATE)) cmdUpdate();\n\t\t\tif(accion.equals(ACCION_REMOVE)) cmdRemove();\n\t\t}catch(Exception e){\n\t\t\thandleException(e);\n\t\t}\n }", "public void ejecucion() throws Exception {\n\t\t//Activamos las trazas\n\t\tsetTrazaFichero();\n\t\n\t\ttry{\n\t\t\t//Sacamos la acción a realizar y ejecutamos la acción correspondiente\n\t\t\tString accion = conectorParametro(PARAMETRO_GENERICO_ACCION);\n\t\t\tString origen = conectorParametro(PARAMETRO_GENERICO_ORIGEN);\n\t\t\t\n\t\t\t//Caragamos los elemetnos en la pagina\n\t\t\tasignar(\"VAR\",PARAMETRO_GENERICO_ACCION,accion);\n\t\t\tasignar(\"VAR\",PARAMETRO_GENERICO_ORIGEN,origen);\n\t\n\t\t\t//Ejecutamos la acción indicada\n\t\t\tif(accion.equals(ACCION_CREATE)) cmdCreate();\n\t\t\tif(accion.equals(ACCION_UPDATE)) cmdUpdate();\n\t\t\tif(accion.equals(ACCION_REMOVE)) cmdRemove();\n\t\t}catch(Exception e){\n\t\t\thandleException(e);\n\t\t}\n }", "public void menu(){\n System.out.println(\"---------------------------Login------------------------------------\");\n \n System.out.println(\"Usuario:\");\n respuesta = scanner.nextLine();\n System.out.println(\"Contraseña:\");\n respuesta2 = scanner.nextLine();\n Usuario user = new Usuario();\n user.setNombre(respuesta);\n user.setPassword(respuesta2);\n idUser=modelo.validarUsuario(user);\n if(idUser<0){\n System.err.println(\"Usuario invalido\");\n \n }else{\n \n menuInterno();\n \n }\n//\n// menuInterno();\n// \n }", "public static void main(String[] args) {\n\t\tList<String> accountList = readFileByLines(FILE_DIR+\"baidu_account.txt\");\n\t\tfor(String account:accountList) {\n\t\t\tinit();\n\t\t\tlogin(account.split(\":\")[1], \"yjy840101\");\n\t\t\ttransfer();\n\t\t}\n\t\t\t\n\t}", "protected GerentePoolLog(Class ownerClass)\n {\n\t\tArquivoConfiguracaoGPP arqConf = ArquivoConfiguracaoGPP.getInstance();\n\t\t//Define o nome e a porta do servidor q serao utilizados no LOG\n\t\thostName = arqConf.getEnderecoOrbGPP() + \":\" + arqConf.getPortaOrbGPP();\n\n\t\t/* Configura o LOG4J com as propriedades definidas no arquivo\n\t\t * de configuracao do GPP\n\t\t */\n\t\t\n\t\tPropertyConfigurator.configure(arqConf.getConfiguracaoesLog4j());\n\t\t//Inicia a instancia do Logger do LOG4J\n\t\tlogger = Logger.getLogger(ownerClass);\n\t\tlog(0,Definicoes.DEBUG,\"GerentePoolLog\",\"Construtor\",\"Iniciando escrita de Log do sistema GPP...\");\n }", "public void executeCommandsForHost4Tier(String logName) throws Exception {\n\t\tSession session4 = this.host4;\n\t\tChannel channel4 = session4.openChannel(\"shell\");\n\n\t\t/* Output and Command list definition */\n\t\tops4 = channel4.getOutputStream();\n\t\tps4 = new PrintStream(ops4, true);\n\n\t\t/* Start to command burning */\n\t\tchannel4.connect();\n\n\t\tInputStream input4 = channel4.getInputStream();\n\n\t\t/** Host4 log collection side */\n\n\t\t// command lists\n\t\tThread.sleep(1000);\n\t\tps4.println(\"host4\"); /* Connect to host4 */\n\n\t\tThread.sleep(1000);\n\n\t\tThread.sleep(500);\n\n\t\tps4.println(\"./logcap.sh -c \" + logName + \"_host4\"\n\t\t\t\t+ \" -z\"); /* run script for log collection */\n\t\t/* logcap.sh ı durdurma */\n\n\t\t// sftpHost3(ps3, session3, channel3, logName);\n\n\t\tprintResult(input4, channel4);\n\n\t}", "private void commandCheck() {\n\t\t//add user command\n\t\tif(cmd.getText().toLowerCase().equals(\"adduser\")) {\n\t\t\t/*\n\t\t\t * permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\t * There will be more user level commands added in version 2, like changing rename to allow a\n\t\t\t * user to rename themselves, but not any other user. Admins can still rename all users.\n\t\t\t */\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\taddUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//delete user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"deluser\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdelUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t};\n\t\t}\n\t\t//rename user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"rename\")) {\n\t\t\t//permissions check: if user is an admin, allow the user o chose a user to rename.\n\t\t\t//If not, allow the user to rename themselves only.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\trename(ALL);\n\t\t\t}\n\t\t\telse {\n\t\t\t\trename(SELF);\n\t\t\t}\n\t\t}\n\t\t//promote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"promote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tpromote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//demote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"demote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdemote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//the rest of the commands are user level, no permission checking\n\t\telse if(cmd.getText().toLowerCase().equals(\"ccprocess\")) {\n\t\t\tccprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"cprocess\")) {\n\t\t\tcprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opentill\")) {\n\t\t\topenTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"closetill\")) {\n\t\t\tcloseTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opendrawer\")) {\n\t\t\topenDrawer();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"sale\")) {\n\t\t\tsale();\n\t\t}\n\t\t//if the command that was entered does not match any command, return an error.\n\t\telse {\n\t\t\terror(CMD_NOT_FOUND);\n\t\t}\n\t}", "public void executeCommandsForHost1Tier(String logName) throws Exception {\n\t\tSession session1 = this.host1;\n\t\tChannel channel1 = session1.openChannel(\"shell\");\n\n\t\t/* Output and Command list definition */\n\t\tops1 = channel1.getOutputStream();\n\t\tps1 = new PrintStream(ops1, true);\n\n\t\t/* Start to command burning */\n\t\tchannel1.connect();\n\n\t\tInputStream input1 = channel1.getInputStream();\n\n\t\t/** Host1 log collection side */\n\n\t\t// command lists\n\n\t\tThread.sleep(500);\n\t\tps1.println(\"./logcap.sh -c \" + logName + \"_host1\"\n\t\t\t\t+ \" -z\"); /* run script for log collection */\n\n\t\tprintResult(input1, channel1);\n\n\t}", "public void atakuj() {\n\n System.out.println(\"to metoda atakuj z klasy Potwor \");\n\n }", "public static void main(String[] args) {\n\t\tString rut;\r\n\t\tString nacionalidad;\r\n\t\tSystem.out.println(\"La clase hija esta caminando\");\r\n\t}", "public S2C verificarMensajeEjecutable(S2C usuario, String orden) {\n if (orden != null) {\n\n //cambia el nombre de usuario\n if (orden.startsWith(\"/usuario \") && !orden.equalsIgnoreCase(\"/usuario server\")) {\n String[] mensajeDescompuesto = orden.split(\" \");\n String res = \"\";\n String usuarioAntiguo = usuario.getName();\n for (int i = 0; i + 1 < mensajeDescompuesto.length; i++) {\n if (i + 1 < mensajeDescompuesto.length - 1) {\n res = res.concat(mensajeDescompuesto[i + 1] + \" \");\n\n } else {\n res = res.concat(mensajeDescompuesto[i + 1]);\n }\n }\n\n usuario.setName(res);\n return null;\n }\n //envia mensaje privado\n if (orden.startsWith(\"/privado \")) {\n String receptor;\n String[] mensajeDescompuesto = orden.split(\"\\\"\");\n System.out.println(mensajeDescompuesto[1]);\n receptor = mensajeDescompuesto[1];\n for (int j = 0; j < ServerProperties.getConexiones().length; j++) {\n if (ServerProperties.getConexiones()[j].getName().equals(receptor)) {\n return ServerProperties.getConexiones()[j];\n }\n\n }\n\n return usuario;\n }\n\n //envia un archivo\n if (orden.startsWith(ServerProperties.getNombre() + \" > /archivo \")) {\n\n if (usuario == null) {\n String[] mensajeDescompuesto = orden.split(\" \");\n String res = \"\";\n for (int i = 3; i < mensajeDescompuesto.length; i++) {\n if (i != mensajeDescompuesto.length - 1) {\n res = res.concat(mensajeDescompuesto[i] + \" \");\n } else {\n res = res.concat(mensajeDescompuesto[i]);\n }\n\n }\n System.out.println(\"----\");\n System.out.println(res);\n System.out.println(\"----\");\n this.subirArchivo(ServerProperties.getIpFtp(), Integer.parseInt(ServerProperties.getPuertoFtp()), ServerProperties.getUserFtp(), ServerProperties.getPswFtp(), ServerProperties.getRutaFtp(), res);\n }\n return null;\n\n }\n //activa cosas, lo prometo!!!\n if (orden.equalsIgnoreCase(\"/camON\")) {\n System.out.println(\"INICIA VIDEOCONFERENCIA LO PROMETO!!!!\");\n return null;\n }\n if (orden.equalsIgnoreCase(\"/camOFF\")) {\n System.out.println(\"DESACTIVA VIDEOCONFERENCIA LO PROMETO!!!!\");\n return null;\n }\n if (orden.equalsIgnoreCase(\"/micON\")) {\n System.out.println(\"INICIA LLAMADA LO PROMETO!!!!\");\n return null;\n }\n if (orden.equalsIgnoreCase(\"/micOFF\")) {\n System.out.println(\"DESACTIVA LLAMADA LO PROMETO!!!!\");\n return null;\n }\n //termina la conexion por voluntad propia\n if (orden.equalsIgnoreCase(\"/salir\")) {\n usuario.cerrarConexion();\n return null;\n\n }\n//desconexion inesperada del cliente\n } else {\n usuario.cerrarConexion();\n return null;\n\n }\n return null;\n }", "public void executeCommandsForHost6Tier(String logName) throws Exception {\n\t\tSession session6 = this.host6;\n\t\tChannel channel6 = session6.openChannel(\"shell\");\n\n\t\t/* Output and Command list definition */\n\t\tops6 = channel6.getOutputStream();\n\t\tps6 = new PrintStream(ops6, true);\n\n\t\t/* Start to command burning */\n\t\tchannel6.connect();\n\n\t\tInputStream input6 = channel6.getInputStream();\n\n\t\t/** Host5 log collection side */\n\n\t\tThread.sleep(1000);\n\t\tps6.println(\"host6\");\n\t\t// command lists\n\t\tThread.sleep(1000);\n\n\t\tThread.sleep(500);\n\t\tps6.println(\"./logcap.sh -c \" + logName + \"_host6\"\n\t\t\t\t+ \" -z\"); /* run script for log collection */\n\n\t\tprintResult(input6, channel6);\n\n\t}", "static void montaMenu() {\n System.out.println(\"\");\r\n System.out.println(\"1 - Novo cliente\");\r\n System.out.println(\"2 - Lista clientes\");\r\n System.out.println(\"3 - Apagar cliente\");\r\n System.out.println(\"0 - Finalizar\");\r\n System.out.println(\"Digite a opcao desejada: \");\r\n System.out.println(\"\");\r\n }", "private void logKeytabStatus() throws IOException {\n // Check the UGI for the \"current user\"\n UserGroupInformation newUgi = UserGroupInformation.getCurrentUser();\n\n logKeytabStatus(newUgi);\n }", "private void logData(VinDevices data,String operation)\n\t\t{\n\t\t\tif (this.debug == true)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\tSystem.out.print(\"\\n >>>>>>>>>>>>>>> Operation:\" + operation+\"<<<<<<<<<<<<<<<<<<<\");\n\t\t\t\tSystem.out.print(\"\\n --- Begin Debug Hibernate data class ----\");\n\t\t\t\tSystem.out.print(\"\\n id_device :\"+ data.getIdDevice());\n\t\t\t\tSystem.out.print(\"\\n name :\"+ data.getName());\n\t\t\t\tSystem.out.print(\"\\n comment :\"+ data.getComment());\n\t\t\t\tSystem.out.print(\"\\n --- End Debug Hibernate data class ----\");\n\t\t\t\tSystem.out.print(\"\\n >>>>>>>>>>>>>>>>>>>><<<<>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\\n\\n\");\n\t\t\t\t*/\n\t\t\t}\n\t\t}", "public void mostraMesasVoto() {\n\t\tint check = 0;\n\t\tint tries = 0;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\trmiserver.printMesasVoto(this.idConsola);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\tcheck = 1;\n\t\t\t} catch (RemoteException e1) {\n\t\t\t\t// Tratamento da Excepcao da chamada RMI addCandidatos\n\t\t\t\tif(tries == 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(6000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries > 0 && tries < 24) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries >= 24) {\n\t\t\t\t\tSystem.out.println(\"Impossivel realizar a operacao devido a falha tecnica (Servidores RMI desligados).\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}while(check==0);\n\t\tcheck = 0;\n\t}", "void logPrgStateExec() throws FileNotFoundException, IOException;", "public void logComponente(long idProcesso, int aTipo, String aComponente, String aMensagem, String aStatus)\n\t{\n\t\tStringBuffer mensagemFinal = new StringBuffer(\"<Servidor> \").append( getHostName()); \n mensagemFinal.append(\" <ID> \" ).append(idProcesso);\n\t\tmensagemFinal.append(\" <Mensagem> \" ).append(aMensagem);\n\t\tmensagemFinal.append(\" <ST> \" ).append(aStatus);\n\t\t\n\t\tregistraLog(aTipo,mensagemFinal.toString());\n\t\tmensagemFinal = null;\n\t}", "public static void main(String[] args) {\n\t\tPropertyConfigurator.configure(\"src\\\\main\\\\resources\\\\log4j.properties\");\n\t\t\n\t\tUser user=new User();\n\t\tString ch=\"No\";\n\t\tdo \n\t\t{\n\t\t\tSystem.out.print(\"==========================\\t \\t==========================\"\n\t\t\t\t\t\t\t+\"\\n<><><><><><><><><><><><><>\\tInsurance Claim Registration System\\t<><><><><><><><><><><><><>\"\n\t\t\t\t\t\t\t+\"\\n==========================\\t \\t==========================\");\n\t\t\t\n\t\t\tSystem.out.println(\"\\n\\nLogin=>\");\n\t\t\tSystem.out.println(\"\\tUsername:\");\n\t\t\tString username=sc.next();\n\t\t\tSystem.out.println(\"\\tPassword:\");\n\t\t\tString password=sc.next();\n\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\tuser=userService.loginUser(username, password);\n\t\t\t\t\n\t\t\t\tswitch(user.getRoleCode())\n\t\t\t\t{\n\t\t\t\t\tcase 1:\t\tinsuredLogin(user);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tclaimHandlerLogin(user);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3: \n\t\t\t\t\t\t\t\tclaimAdjusterLogin(user);\n\t\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t}\n\t\t\t} \n\t\t\tcatch (CustomException e1) \n\t\t\t{\n\t\t\t\tSystem.out.println(e1.getMessage());\n\t\t\t\t\n\t\t\t\t System.out.println(\"Do u wish to Try Again(yes/no)\"); \n\t\t\t\t ch=sc.next();\n\t\t\t\t ch=ch.toLowerCase();\n\t\t\t\t \n\t\t\t}\n//\t\t\tSystem.out.println(\"Do u wish to Re-Login(yes/no)\");\n//\t\t\tch=sc.next();\n//\t\t\tch=ch.toLowerCase();\n\t\t}while(ch.equals(\"yes\"));\n\n\t\tsc.close();\n\t\tSystem.exit(0);\n\t}", "private void btnExecutarLabirinto(){\n log.setText(\"Log de erros\");\n botao[2].setEnabled(false);\n try{\n lab.encontrarAdj();\n lab.andadinha();\n info.setText(\" \");\n visor.setText(lab.toString());\n\n Pilha<Coordenada> caminho = lab.getCaminho();\n Pilha<Coordenada> inverso = new Pilha<Coordenada>();\n while(!caminho.isVazia())\n {\n inverso.guardeUmItem(caminho.recupereUmItem());\n caminho.removaUmItem();\n }\n\n log.setText(\"Caminho percorrido: \");\n while(!inverso.isVazia())\n {\n log.setText(log.getText() + inverso.recupereUmItem().toString() + \" \");\n inverso.removaUmItem();\n }\n }\n catch(Exception erro1){\n log.setText(erro1.getMessage());\n }\n\t\t}", "public HomeLogada(String userCPF, TipoPessoa tipoPessoa) {\n this.tipoFuncionario = tipoPessoa;\n this.userCPF = userCPF;\n initComponents();\n setModal(true);\n prepFieldsPanelsOnStart();\n }", "@Override\r\n\tpublic void command() {\n\t\tSystem.out.println(\"CommandAttack Process\");\r\n\t}", "private void cargarDatos()\n {\n // Pantalla carga\n showProgress(true, mView, mProgressView, getContext());\n Comando login = new LoginComando(KPantallas.PANTALLA_PERFIL);\n String email = UtilUI.getEmail(getContext());\n String password = UtilUI.getPassword(getContext());\n login.ejecutar(email,password);\n }", "public void executeCommandsForHost3Tier(String logName) throws Exception {\n\t\tSession session3 = this.host3;\n\t\tChannel channel3 = session3.openChannel(\"shell\");\n\n\t\t/* Output and Command list definition */\n\t\tops3 = channel3.getOutputStream();\n\t\tps3 = new PrintStream(ops3, true);\n\n\t\t/* Start to command burning */\n\t\tchannel3.connect();\n\n\t\tInputStream input3 = channel3.getInputStream();\n\n\t\t/** Host4 log collection side */\n\n\t\t// command lists\n\t\tThread.sleep(1000);\n\t\tps3.println(\"host3\"); /* Connect to host3 */\n\n\t\tThread.sleep(1000);\n\n\t\tps3.println(\"./logcap.sh -c \" + logName + \"_host3\"\n\t\t\t\t+ \" -z\"); /* run script for log collection */\n\t\tprintResult(input3, channel3);\n\n\t}", "private static void saluti() {\n\t\tUtilityIO.header(MSG_CHIUSURA, SIMBOLO_MESSAGGIO_BENV_USCITA);\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n\t\ttry {\n\t\t\tString status=Allow_log.chek_log();\n\t\t\tif(status.equals(\"active\")){\n\t\t\t\t\n\t\t\t\tLogin_view obj=new Login_view();\n\t\t\t\tobj.buildGUI();\n\t\t\t}\n\t\t\telse if(status.equals(\"inactive\")){\n\t\t\t\tMain_view.main(null);\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\tJOptionPane.showMessageDialog(null,\"Database Missing !!!\");\n\t\t}\n\t}", "@Override\n\tpublic void preparar() {\n\t\tSystem.out.println(\"massa, presunto, queijo, calabreza e cebola\");\n\t\t\n\t}", "public void run_v0(String clase){\n\t\t//aviso(\"Ejecutando \"+clase+\" Tipo V0\");\n\t\t\n\t\tObject\toc=null;\n\t\t\n\t\t\t\n\t\t\n\t\ttry {\n\t\t\tClass c=Class.forName(clase);\n\t\t\toc=c.newInstance();\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} catch (InstantiationException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} catch (IllegalAccessException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tif (oc!=null){\n\t\t\tvisual.Task_Model T=(visual.Task_Model) oc;\n\t\t\tint i=0;\n\t\t\tbeta.tools.connector.GTransfer GX=null;\n\t\t\t\n\t\t\twhile (i<this.getConstructor().getParametros().size() & GX==null){\n\t\t\t\tObject[] p=(Object[]) this.getConstructor().getParametros().get(i);\n\t\t\t\tString id=(String)p[0];\n\t\t\t\tObject o=p[1];\n\t\t\t\tif (id.compareTo(\"GX\")==0){\n\t\t\t\t\tGX=(beta.tools.connector.GTransfer)o;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif (GX==null){\n\t\t\t\tGX=new beta.tools.connector.GTransfer();\n\t\t\t\tGeneric _default=this.getConstructor().getConnectionHandler().getDefaultConnector();\n\t\t\t\tGX.setHost(_default.getHost());\n\t\t\t\tGX.setPort(_default.getPort());\n\t\t\t\tGX.setDatabase(_default.getDatabase());\n\t\t\t\tGX.setUser(_default.getUser());\n\t\t\t\tGX.setPassword(_default.getPassword());\n\t\t\t\tGX.setSucursal(_default.getId());\n\t\t\t\tGX.ConnectSQL(_default.getId());\n\t\t\t}\n\t\t\tboolean b=true;//esta_autorizado(iduser,clase);\n\t\t\tif (b){\n\t\t\t\tString NEW_LINE = System.getProperty(\"line.separator\");\n\t\t\t\t/*String msg=\"Esta es una aplicacion vieja.\"+NEW_LINE;\n\t\t\t\tmsg+=\"Hasta que no se reprograme. Esta aplicacion quedara inhabilitada por problemas de incompatibilida\";\n\t\t\t\terror(msg);*/\n\t\t\t\t\n\t\t\t\tT.setParameter(\"GX\", GX);\n\t\t\t\tT.setParameter(\"iduser\", this.getConstructor().getIduser());\n\t\t\t\tfor (i=0;i<this.getConstructor().getParametros().size();i++){\n\t\t\t\t\ttry {\n\t\t\t\t\tObject[] p=(Object[]) this.getConstructor().getParametros().get(i);\n\t\t\t\t\tString id=(String)p[0];\n\t\t\t\t\tObject o=p[1];\n\t\t\t\t\tT.setParameter(id, o);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.out.println(\"No se pudo Cargar el parametro \"+i+\" >\"+clase+\" \"+e.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (javax.swing.SwingUtilities.isEventDispatchThread()){\n\t\t\t\t\tT.run();\n\t\t\t\t}else{\n\t\t\t\t\tfinal visual.Task_Model _T=T;\n\t\t\t\t\tRunnable _execute=new Runnable(){\n\t\t\t\t\t\tpublic void run(){\n\t\t\t\t\t\t\t_T.run();\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tjavax.swing.SwingUtilities.invokeLater(_execute);\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\terror(\"(\"+this.getConstructor().getIduser()+\") No esta Autorizado\");\n\t\t\t\tT=null;\n\t\t\t}\t\n\t\t}\n\t}", "public static void main(String args[]) throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new FileReader(\"info\"));\n\t\temail = reader.readLine();\n\t\tpass = reader.readLine();\n\t\treader.close();\n\t\tSystem.out.println(\"[ListSystemContorl] Drawing Gui\");\n\t\tTextDisplay.drawGUI();\n\t\tSystem.out.println(\"[ListSystemContorl] Finished\");\n\t}" ]
[ "0.6162745", "0.6102149", "0.609986", "0.6029971", "0.601797", "0.59057975", "0.5869252", "0.584452", "0.58166957", "0.57912105", "0.57510525", "0.5735639", "0.56993777", "0.56914854", "0.5686074", "0.5660823", "0.56346387", "0.5615803", "0.5615061", "0.5606851", "0.5599192", "0.5594281", "0.5584307", "0.5583366", "0.5582489", "0.5571144", "0.5568076", "0.5567479", "0.55533916", "0.5540276", "0.553941", "0.55346113", "0.55277646", "0.55254847", "0.55251503", "0.5515741", "0.55102164", "0.55043834", "0.5498608", "0.5486523", "0.5463896", "0.54550743", "0.5452113", "0.5445171", "0.5437778", "0.542231", "0.5410203", "0.54061997", "0.5398772", "0.5394573", "0.53858435", "0.53835577", "0.53825355", "0.53805554", "0.5379857", "0.5376287", "0.537018", "0.536052", "0.53567064", "0.53554726", "0.5354084", "0.53379834", "0.53365314", "0.5332924", "0.5332924", "0.532537", "0.5308313", "0.5304502", "0.53021616", "0.5300766", "0.5298914", "0.5298618", "0.5294132", "0.5294132", "0.52717113", "0.52656174", "0.5259442", "0.5258118", "0.5255858", "0.52543706", "0.5251841", "0.5251647", "0.52501166", "0.52462465", "0.52427495", "0.523607", "0.52337325", "0.5228197", "0.5227903", "0.52193236", "0.521932", "0.5210227", "0.5207196", "0.52066654", "0.5206458", "0.5206042", "0.52044046", "0.51986945", "0.519719", "0.5195075", "0.51915234" ]
0.0
-1
chiamati dal model Metodo per gestire le notifiche in arrivo dal model
void notify(HorseFeverEvent e);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void paso0() {\n n = graph.getNodeIndices().indexOf(actual);\n nodo = graph.getNodes().get(n);\n nodo.setEstado(Node.State.CURRENT);\n nodo.pintarNodo(g);\n // comprueba si es objetivo\n if (nodo.getEsObjetivo()) {\n // establece el objetivo encontrado\n miObjetivo = nodo.toString();\n // termina con exito\n Step = 4;\n } else {\n // se prepara para explorar los sucesores\n m = nodo.maxSucesores();\n j = 0;\n // siguiente paso\n Step = 1;\n }\n }", "void stampaStatisticheNodo() {\r\n for(Object obj : this.nodes)\r\n {\r\n Nodo n = (Nodo)obj;\r\n \r\n TransportLayer tl = n.myTransportLayer;\r\n tl.stampaStatistiche();\r\n \r\n // System.out.println(\"=====STAMPA STATISTICHE NODO NETWORK LAYER====\");\r\n NetworkLayer nl = n.myNetLayer;\r\n // String s = nl.getStat();\r\n nl.stampaStatistiche();\r\n // System.out.println(s);\r\n // System.out.println(\"=====FINE====\");\r\n \r\n physicalLayer pl = n.myPhyLayer;\r\n pl.stampaStatistiche();\r\n }\r\n }", "public void muovi() {\n\n for (int i = punti; i > 0; i--) {\n x[i] = x[(i - 1)];\n y[i] = y[(i - 1)];\n }\n\n if (sinistra) {\n x[0] -= DIMENSIONE_PUNTO;\n }\n\n if (destra) {\n x[0] += DIMENSIONE_PUNTO;\n }\n\n if (su) {\n y[0] -= DIMENSIONE_PUNTO;\n }\n\n if (giu) {\n y[0] += DIMENSIONE_PUNTO;\n }\n }", "void MontaValores(){\r\n // 0;0;-23,3154166666667;-51,1447783333333;0 // Extrai os valores e coloca no objetos\r\n // Dis;Dir;Lat;Long;Velocidade\r\n // Quebra de Rota lat=-999.999 long=-999.999 ==> Marca ...\r\n \r\n int ind=0;\r\n NMEAS=NMEA.replace(\",\" , \".\");\r\n \r\n //1)\r\n dists=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind));\r\n Distancia=Double.valueOf(dists);\r\n ind=ind+dists.length()+1;\r\n \r\n //2)\r\n dirs=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Direcao=Double.valueOf(dirs);\r\n ind=ind+dirs.length()+1;\r\n \r\n //3)\r\n lats=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Lat=Double.valueOf(lats);\r\n ind=ind+lats.length()+1;\r\n \r\n //4)\r\n longs=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Long=Double.valueOf(longs);\r\n ind=ind+longs.length()+1;\r\n \r\n //5)\r\n vels=NMEAS.substring(ind,NMEAS.length());\r\n // Transforma de Knots para Km/h\r\n Velocidade=Double.valueOf(vels)/100*1.15152*1.60934;\r\n vels=String.valueOf(Velocidade);\r\n ind=ind+vels.length()+1;\r\n \r\n }", "public ConversorVelocidad() {\n //setTemperaturaConvertida(0);\n }", "@Override\n\tpublic void prossimo_stato(Model_context model, ArrayList<String> dati_input) {\n\t\tswitch(dati_input.get(0)) {\n\t\t\tcase \"1\":{\n\t\t\t\tmodel.set_stato_attuale(new Stato_inserisci_descrizione_libro_ricerca(get_attore()));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"2\":{\n\t\t\t\tmodel.set_stato_attuale(new Stato_inserisci_descrizione_film_ricerca(get_attore()));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:{\n\t\t\t\tmodel.set_stato_attuale(new Stato_errore(new Stato_ricerca_visualizza(get_attore()), this, \"inserisci un valore corretto\", get_attore()));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public ME_Model() {\n _nheldout = 0;\n _early_stopping_n = 0;\n _ref_modelp = null;\n }", "List<Model> minimize(Model model, int nMinima);", "@Override\n public void inicio() {\n // inicializa el objetivo\n miObjetivo = \"\";\n // inicializa variables para explorar sucesores\n j = 0;\n m = 0;\n nodo = null;\n suc = null;\n succ = null;\n // inicializa objetos\n actual = \"\";\n g = graph.getGraphics();\n // comienza por el primer nodo\n nodo = graph.getNodes().get(0);\n actual = nodo.toString();\n // siguiente paso\n Step = 0;\n }", "private void laskeMatkojenKesto() {\n matkojenkesto = 0.0;\n\n for (Matka m : matkat) {\n matkojenkesto += m.getKesto();\n }\n }", "public Nodo() {\n this.valor = 0;\n this.proximo=null;\n\n }", "@Override\n public synchronized void demarrer(){\n if(modele.getQuiterJeu()){return;}\n modele.getMoteurJeu().setEtapeJeu(this);\n // apercu dans le termial pour debuger\n System.out.println(\"-----------------nom joueur: \"+modele.getJoueurCourant().getNom());\n System.out.print(\" humain: \"+modele.getJoueurCourant().estHumain());\n System.out.print(\" stand: \"+modele.getJoueurCourant().getMainCourant().getStand());\n System.out.print(\" perdu: \"+modele.getJoueurCourant().getMainCourant().estPerdu());\n System.out.print(\" blackjack: \"+modele.getJoueurCourant().getMainCourant().estBlackJack());\n System.out.println(\" jeu: \"+modele.getJoueurCourant().getMainCourant().getJeu().toString());\n //-------------------------------------------------\n // On ne fait pas une boucle ici pour que l'observer\n // puisse acceder a son observé et se mettre a jour\n //-------------------------------------------------\n new Thread(){\n @Override\n public void run() {\n try {\n // si plus de carte\n if(modele.getPioche().getCartes().size() < 1){\n for(Carte carte:modele.getDefausse().getCartes()){\n carte.setFaceCarte(Face.VERSO);\n modele.getPioche().ajouterDessous(carte);\n }\n modele.getDefausse().vider();\n modele.getPioche().melanger();\n }\n \n \n // si il peut plus jouer\n if(modele.getJoueurCourant().getMainCourant().estBlackJack() || modele.getJoueurCourant().getMainCourant().estPerdu() \n || modele.getJoueurCourant().getMainCourant().getStand() || modele.getJoueurCourant().getMainCourant().est21()\n || modele.getJoueurCourant().getMainCourant().getAAbandonner() || modele.getJoueurCourant().getAPerduJeu()){\n \n // si le joueur a une autre main\n if(modele.getJoueurCourant().mainSuivant()){\n Thread.sleep(2000);\n demarrer();\n \n }\n // sinon si il y a un joueur suivant on fait joueur suivant\n else if(modele.joueurSuivant()){\n Thread.sleep(2000);\n demarrer();\n }else{\n modele.getMoteurJeu().setEtapeJeu(etapeSuivant);\n Thread.sleep(2000);\n modele.setMessage(modele.getCroupier().getNom()+\" plays\");\n // on affiche les carte du croupier\n for(Carte carte: modele.getCroupier().getMainCourant().getJeu().getCartes()){\n carte.setFaceCarte(Face.RECTO);\n }\n System.out.println(\"+++++++++++++++++++++++++++++++++++++++++++++++++\");\n Thread.sleep(3000);\n demarrerEtapeSuivant();\n\n }\n\n }\n // sinon\n else{\n modele.setMessage(modele.getJoueurCourant().getNom()+\" plays\");\n if(!modele.getJoueurCourant().estHumain()){\n modele.getJoueurCourant().jouer(modele.getPioche(),modele.getDefausse());\n Thread.sleep(3000);\n demarrer();\n }\n \n\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }.start();\n \n }", "public Controller (Salle salle) {\n double marge = 30;\n this.salle = salle;\n \n cSalle = salle.afficher();\n cSalle.setTranslateX(marge);\n cSalle.setTranslateY(marge);\n cSalle.setController(this);\n\n cPanel = new ControllerPanel();\n cPanel.setTranslateY(salle.getHauteur() + (3 * marge));\n\n creerObstacle = new ArrayList<>();\n pointObstacle = new ArrayList<>();\n ligneObstacle = new ArrayList<>();\n suppressionObstacle = false;\n \n // Event utilisé pour ajouter des Personnes, Obstacles en lors d'un clique.\n // Seulement lorsque la simulation n'est pas lancée\n cSalle.getSalleGraphique().setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n double rayon = new Personne().getRayon();\n double x = event.getX();\n double y = event.getY();\n if((x+marge > marge+rayon && x < salle.getLargeur()-rayon)){\n if(!salle.isRunning() && !creationObstacle && !suppressionObstacle){\n cSalle.afficherPersonne(cSalle.createPersonne(x,y));\n } else if(!salle.isRunning() && creationObstacle && !suppressionObstacle){\n Circle c = new Circle(x+marge, y+marge, 10);\n getChildren().add(c);\n pointObstacle.add(c);\n if(pointObstacle.size()>1){\n Line l = new Line(pointObstacle.get(pointObstacle.size()-2).getCenterX(),pointObstacle.get(pointObstacle.size()-2).getCenterY() , event.getX()+marge, event.getY()+marge);\n getChildren().add(l);\n ligneObstacle.add(l);\n }\n if(pointObstacle.size()>2){\n if(pointObstacle.size()>3) getChildren().remove(getChildren().get(getChildren().size()-3));\n Line l = new Line(event.getX()+marge, event.getY()+marge, pointObstacle.get(0).getCenterX(), pointObstacle.get(0).getCenterY());\n getChildren().add(l);\n ligneObstacle.add(l);\n }\n \n creerObstacle.add(new Point(event.getX(), event.getY()));\n }\n }\n }\n });\n\n // Event utilisé pour supprimer un obstacle en cliquant.\n // Seulement lorsque la simulation n'est pas lancée\n this.setOnMouseClicked(new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n if(!salle.isRunning() && suppressionObstacle){\n for(ControllerObstacle o : cSalle.getListObstacles()){\n if(o.contains(event.getX()-marge, event.getY()-marge)){\n salle.removeObstacle(o.getObstacle()); \n suppressionObstacle = false;\n cPanel.visibility(true);\n cPanel.getGroupeGraphe().getSelectedToggle().setSelected(false);\n cPanel.getEnleverGrapheRB().setSelected(true);\n cSalle.cacherGraphe();\n }\n }\n }\n }\n });\n\n // Event qui lance la simulation lorsque l'utilisateur appuie sur le bouton play.\n // Prends en compte les différents paramètres (checkbox) de gestion des collisions.\n cPanel.getPlayButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n salle.setVitessePersonnes(cPanel.getVitesseValue());\n if(cPanel.getCollisionStatus()){\n salle.play(true);\n }\n else\n salle.play(false);\n if(salle.isRunning())\n cPanel.setLoopTimer(0);\n }\n });\n\n // Event qui met en pause la simulation lorsque l'utilisateur clique sur le bouton pause.\n cPanel.getPauseButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n salle.pause();\n cPanel.setLoopTimer(1);\n }\n });\n\n // Event qui supprime toutes les personnes de la salle et stoppe la simulation lorsque l'utilisateur clique sur clear.\n cPanel.getClearButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n salle.removeAllPersonne();\n cPanel.setLoopTimer(2);\n }\n });\n\n // Event qui affiche ou cache le graphe des chemins les plus courts lorsque l'utilisateur active ou désactive la checkbox correspondante.\n cPanel.getGrapheRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"\");\n }\n });\n\n cPanel.getGrapheDiagonaleRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"Diagonale\");\n }\n });\n\n cPanel.getGrapheCartesienRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"Cartesien\");\n }\n });\n\n cPanel.getGraphePhysiqueRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n salle.initialisationGrapheAvecAffichage(\"Physique\");\n }\n });\n\n cPanel.getEnleverGrapheRB().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n cSalle.cacherGraphe();\n }\n });\n\n // Event qui ouvre un popup pour ajouter un nombre de personnes définis lorsque l'utilisateur clique sur le bouton correspondant.\n cPanel.getAddPersonButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n if(!salle.isRunning())\n createPopup(\"Personne\");\n }\n });\n\n // Event qui permet d'activer l'option de creation d'obstacle lorsque l'utilisateur clique sur le bouton correspondant.\n cPanel.getAddObstacleButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n if(!salle.isRunning()){\n creationObstacle = true;\n cPanel.visibility(false);\n }\n }\n });\n\n // Event qui permet de valider la creation d'un obstacle lorsque l'utilisateur clique sur le bouton valider.\n cPanel.getValiderObstacleButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n boolean intersec = false;\n double rayon = new Personne().getRayon();\n for(int i=0;i<pointObstacle.size() && !intersec;i++){\n Point A = new Point(pointObstacle.get(i).getCenterX()-marge,pointObstacle.get(i).getCenterY()-marge);\n Point B;\n if(i==pointObstacle.size()-1) B = new Point(pointObstacle.get(0).getCenterX()-marge,pointObstacle.get(0).getCenterY()-marge);\n else B = new Point(pointObstacle.get(i+1).getCenterX()-marge,pointObstacle.get(i+1).getCenterY()-marge);\n if(salle.intersecObstacle(A, B)) {\n intersec = true;\n }\n }\n creationObstacle = false;\n cPanel.visibility(true);\n if(!intersec){\n if(!creerObstacle.isEmpty() && creerObstacle.size()>2){\n Obstacle obstacle = new ObstaclePolygone(creerObstacle);\n ControllerObstacle obstacleGraphique = obstacle.afficher();\n salle.addObstacle(obstacle);\n cSalle.afficherControllerObstacle(obstacleGraphique);\n List<ControllerObstacle> obstacles = cSalle.getListObstacles();\n for(ControllerObstacle o : obstacles){\n if(!obstacleGraphique.equals(o)){\n if(obstacleGraphique.contains(o.getObstacle().getListePointsGraphiques().get(0).getX(),o.getObstacle().getListePointsGraphiques().get(0).getY())) salle.removeObstacle(o.getObstacle());\n }\n }\n cPanel.getGroupeGraphe().getSelectedToggle().setSelected(false);\n cPanel.getEnleverGrapheRB().setSelected(true);\n cSalle.cacherGraphe();\n }\n }\n creerObstacle.clear();\n for(Circle c : pointObstacle) getChildren().remove(c);\n for(Line l : ligneObstacle) getChildren().remove(l);\n pointObstacle.clear();\n ligneObstacle.clear();\n }\n });\n // Event qui permet d'activer l'option pour supprimer un obstacle lorsque l'utilisateur clique sur le bouton correspondant.\n cPanel.getSupprimerObstacleButton().setOnAction(new EventHandler<ActionEvent>() {\n @Override\n public void handle(ActionEvent e) {\n if(!salle.isRunning() && !salle.getListObstacles().isEmpty()){\n suppressionObstacle = true;\n cPanel.visibility(false);\n cPanel.getValiderObstacleButton().setVisible(false);\n }\n }\n });\n\n getChildren().addAll(cSalle, cPanel);\n }", "private Nodo cambiar (Nodo aux) {\n\t\tNodo n = aux;\r\n\t\tNodo m = aux.getHijoIzq(); \r\n\t\twhile (m.getHijoDer() != null) {//el while sirve para recorrer el lado derecho para encotrar el dato mayor. \r\n\t\t\tn = m; // se guarda el nodo.\r\n\t\t\tm = m.getHijoDer();\r\n\t\t}\r\n\t\taux.setDato(m.getDato()); // se establece el dato del nodo mayor para que de ese nodo se hagan los cambios. \r\n\t\tif(n == aux) { // Si el nodo igual a aux entonces el dato y nodo que se van a eliminar por lo tanto se hacen los comabios. \r\n\t\t\tn.setHijoIzq(m.getHijoIzq());\r\n\t\t}else {\r\n\t\t\tn.setHijoDer(m.getHijoIzq());\r\n\t\t}\r\n\t\treturn n;\r\n\t}", "@Override\n public Coup meilleurCoup(Plateau _plateau, Joueur _joueur, boolean _ponder) {\n \n _plateau.sauvegardePosition(0);\n \n /* On créé un noeud père, qui est le noeud racine de l'arbre. On définit arbitrairement le joueur associé (\n (0 ou 1, il importe peu de savoir quel joueur correspond à ce nombre, cette information étant déjà portée par \n j1 et j2 dans l'algorithme. Le tout est de faire alterner cette valeur à chaque niveau de l'arbre. */\n \n Noeud pere = new Noeud();\n pere.joueurAssocie = 0;\n \n // On définit ici c, le coefficient d'arbitrage entre exploration et exploitation. Ce dernier est théroquement optimal pour una valeur égale à sqrt(2).\n \n double c = 10 * Math.sqrt(2);\n double[] resultat = new double[2];\n \n // Conditions de fonctionnement par itération\n \n //int i = 1;\n //int nbTours = 10000;\n \n //while(i <= nbTours){\n \n // Conditions de fonctionnement en mode \"compétition\" (100 ms pour se décider au maximum).\n \n long startTime = System.currentTimeMillis();\n \n while((System.currentTimeMillis()-startTime) < 100){\n\n // La valeur résultat ne sert à rien fondamentalement ici, elle sert uniquement pour le bon fonctionnement de l'algorithme en lui même.\n // On restaure le plateau à chaque tour dans le MCTS (Sélection - Expension - Simulation - Backpropagation). \n \n resultat = MCTS(pere, _plateau, this.j_humain, this.j_ordi, c, this.is9x9, this.methodeSimulation);\n _plateau.restaurePosition(0);\n \n //i++;\n }\n\n // On doit maintenant choisir le meilleur coup parmi les fils du noeud racine, qui correspondent au coup disponibles pour l'IA.\n \n double maxValue = 0;\n int maxValueIndex = 0;\n \n for(int j = 0; j < pere.fils.length; j++){\n \n double tauxGain = ((double)pere.fils[j].nbPartiesGagnees / (double)pere.fils[j].nbPartiesJouees);\n\n // On choisirat le coup qui maximise le taux de gain des parties simulées.\n \n if(tauxGain >= maxValue){\n maxValueIndex = j;\n maxValue = tauxGain;\n \n }\n }\n \n // On retourne le coup associé au taux de gain le plus élevé.\n\n return pere.fils[maxValueIndex].coupAssocie;\n }", "protected void addFinishedData() throws ModelException {\n int i;\n \n //Harvest data\n ArrayList<Behavior> p_oBehs = m_oDisturbanceBehaviors.getBehaviorByParameterFileTag(\"Harvest\");\n if (mp_oHarvestData.size() == 0) {\n if (p_oBehs.size() > 0) {\n m_oDisturbanceBehaviors.removeBehavior(p_oBehs.get(0));\n }\n } else {\n Harvest oHarvest;\n if (p_oBehs.size() > 0) {\n oHarvest = (Harvest) p_oBehs.get(0);\n oHarvest.clearHarvestEvents();\n } else {\n oHarvest = (Harvest) m_oDisturbanceBehaviors.createBehaviorFromParameterFileTag(\"Harvest\");\n }\n for (i = 0; i < mp_oHarvestData.size(); i++) {\n oHarvest.addHarvestEvent(mp_oHarvestData.get(i));\n }\n }\n \n //Mortality episode data\n p_oBehs = m_oDisturbanceBehaviors.getBehaviorByParameterFileTag(\"EpisodicMortality\");\n if (mp_oMortEpisodeData.size() == 0) {\n if (p_oBehs.size() > 0) {\n m_oDisturbanceBehaviors.removeBehavior(p_oBehs.get(0));\n }\n } else {\n EpisodicMortality oEp;\n if (p_oBehs.size() > 0) {\n oEp = (EpisodicMortality) p_oBehs.get(0);\n oEp.clearMortalityEpisodes();\n } else {\n oEp = (EpisodicMortality) m_oDisturbanceBehaviors.createBehaviorFromParameterFileTag(\"EpisodicMortality\");\n }\n for (i = 0; i < mp_oMortEpisodeData.size(); i++) {\n oEp.addMortalityEpisode(mp_oMortEpisodeData.get(i));\n }\n }\n\n //Planting data\n p_oBehs = m_oPlantBehaviors.getBehaviorByParameterFileTag(\"Plant\");\n if (mp_oPlantingData.size() == 0) {\n if (p_oBehs.size() > 0) {\n m_oDisturbanceBehaviors.removeBehavior(p_oBehs.get(0));\n }\n } else {\n Planting oPlant;\n if (p_oBehs.size() > 0) {\n oPlant = (Planting) p_oBehs.get(0);\n oPlant.clearPlantingEvents();\n } else {\n oPlant = (Planting) m_oPlantBehaviors.createBehaviorFromParameterFileTag(\"Plant\");\n }\n for (i = 0; i < mp_oPlantingData.size(); i++) {\n oPlant.addPlantingEvent(mp_oPlantingData.get(i));\n }\n }\n }", "public MonteurDetailModel(Object[][] data) {\n\t\tsetAfsprakenHeader(new String[] { \"Start Tijd\", \"Eind Tijd\",\n\t\t\t\t\"Bezigheid\", \"ReparatieID\", \"Monteur\" });\n\t\tsetAutoHeader(new String[] { \"Auto nummer\", \"Kenteken\", \"BouwJaar\",\n\t\t\t\t\"Merk\", \"Model\" });\n\n\t\tgeplandeAfspraken = data;\n\t\tautos = data;\n\n\t\tvoorNaam = \"Voornaam\";\n\t\tachterNaam = \"Achternaam\";\n\t\tadres = \"Straatnaam etc\";\n\t\twoonplaats = \"Kutgat\";\n\t\tpostcode = \"Vage nummers\";\n\n\t\tuurLoon = 20.00;\n\t\tpersoonID = 1337;\n\t}", "public void aktualisiere(PhysicalObject po){\n\t\tthis.po=po;\n\t\tKipper kipperObj= (Kipper) po;\t\t\n\t\tx = kipperObj.getX();\n\t\ty = kipperObj.getY();\n\t\tbreite=kipperObj.getBreite();\n\t\tlaenge=kipperObj.getLaenge();\n\t\twinkel=kipperObj.getWinkel();\n\t\tlkwfahrt=kipperObj.isFahrt();\t\t\n\t\tif (kipperObj.getMaterialListe().size() == 1) {\n\t\t\tmatRatio=kipperObj.getMaterialListe().get(0).getVolumen()/kipperObj.getMaxVolumen();\t\n\t\t\tif(matRatio > 1)\n\t\t\t\tmatRatio=1;\n\t\t}\t\t\n\t}", "private void actualizeazaModel() {\n model.clear();\n listaContacte.forEach((o) -> {\n model.addElement(o);\n });\n }", "M getModel();", "public void changerTailleMotsEtCouleur(int tailleMin, int tailleMax, String couleur){\n ArrayList<Integer> listeFreqDuCorpus = new ArrayList<Integer>(); \r\n for (int i=0; i<this.corpus.getListeMot().size(); i++){\r\n int freqDuMotActuel = this.corpus.getListeMot().get(i).getFrequence();\r\n if (!listeFreqDuCorpus.contains(freqDuMotActuel)){\r\n listeFreqDuCorpus.add(freqDuMotActuel); //On change la taille du mot proportionnellement à sa fréquence d'apparition\r\n }\r\n }\r\n \r\n int freqMax = listeFreqDuCorpus.get(0);\r\n if (couleur.equals(\"ROUGE\")){\r\n this.corpusEnWordGraph.set(0, new WordGraph(this.corpus.getListeMot().get(0),this.font,this.g2d, tailleMax, new Color(255,0,0)));\r\n } else if (couleur.equals(\"VERT\")){\r\n this.corpusEnWordGraph.set(0, new WordGraph(this.corpus.getListeMot().get(0),this.font,this.g2d, tailleMax, new Color(0,255,0)));\r\n } else if (couleur.equals(\"BLEU\")) {\r\n this.corpusEnWordGraph.set(0, new WordGraph(this.corpus.getListeMot().get(0),this.font,this.g2d, tailleMax, new Color(0,0,255)));\r\n } else if (couleur.equals(\"NOIR\")) {\r\n this.corpusEnWordGraph.set(0, new WordGraph(this.corpus.getListeMot().get(0),this.font,this.g2d, tailleMax, new Color(0,0,0)));\r\n for (int i=1; i<this.corpus.getListeMot().size(); i++){\r\n Mot motActuel = this.corpus.getListeMot().get(i);\r\n int tailleDuMotActuel =(int) (((double)motActuel.getFrequence()/(double)freqMax)*(tailleMax-tailleMin) + tailleMin);\r\n this.corpusEnWordGraph.set(i, new WordGraph(motActuel, this.font, this.g2d, tailleDuMotActuel, new Color(0,0,0)));\r\n }\r\n }\r\n if (!couleur.equals(\"NOIR\")){ //Si la couleur n'est pas noir, on change la couleur des mots en nuance de la couleur choisie\r\n for (int i=1; i<this.corpus.getListeMot().size(); i++){\r\n Mot motActuel = this.corpus.getListeMot().get(i);\r\n int tailleDuMotActuel =(int) (((double)motActuel.getFrequence()/(double)freqMax)*(tailleMax-tailleMin) + tailleMin);\r\n this.corpusEnWordGraph.set(i, new WordGraph(motActuel, this.font, this.g2d, tailleDuMotActuel, this.nuanceCouleur(couleur)));\r\n }\r\n }\r\n \r\n }", "public void crearGloboMalo(int tiempo){\n GloboMalo globom = new GloboMalo();\n globoslista.add(globom); \n double posicionx = generarPosicionX();\n globom.fijarPosicion(posicionx);\n gpane.getChildren().addAll(globom);\n MoverGlobo mv = new MoverGlobo(globom,tiempo);\n mov= new Thread(mv);\n mov.start();\n }", "public RisultatiRicercaStampaAllegatoAttoModel() {\n\t\tsuper();\n\t\tsetTitolo(\"Risultati di ricerca stampe allegato atto\");\n\t}", "public interface ModelJeu {\n \n /**\n * indique le contenu de la case de coordonnees (i,j)\n * @param i le numero de la ligne\n * @param j le numero de la colonne\n * @return le contenu de la case de coordonnees (i,j)\n */\n String get(int i, int j);\n \n /**\n * indique le nombre de colonnes du modele\n * @return le nombre de colonnes du modele\n */\n int nbColonnes();\n \n /**\n * indique le nombre de lignes du modele\n * @return le nombre de lignes du modele\n */\n int nbLignes();\n \n /**\n * renvoie une liste de tous les joueurs du modele\n * @return la liste de tous les joueurs du modele\n */\n ArrayList<Player> getAllPlayer();\n}", "public void setMontoDescuento(double param){\n \n this.localMontoDescuento=param;\n \n\n }", "protected void initModel() throws CommandLineFormatException, NullCoordinateException\n\t{\n\t\t\n\t\tfinal Var vdt = command.get(CNFTCommandLine.DT); //default dt\n\t\t\n\t\tcortical = new NeighborhoodMap(CORTICAL, \n\t\t\t\tnew SomUM(inputSpace, vdt, extendedFramedSpace)){\n\t\t\tpublic void compute() throws NullCoordinateException{\n\t\t\t\tsuper.compute();\n\t\t\t\tpotential.resetState();\n\t\t\t}\n\t\t};\n\t\t\n\t\t\n\t\tpotential = getPotential(vdt);\n\t\t\n\t\t\n\t\tcortical.addParameters(input,potential,command.get(CNFTCommandLine.LEARNING_RATE));\n\t\tNeighborhood neigh = new V4Neighborhood2D( extendedFramedSpace, new UnitLeaf((UnitParameter) cortical));\n\t\tneigh.setNullUnit(new ConstantUnit(new Var(0)));\n\t\t((NeighborhoodMap)cortical).addNeighboors(neigh);\n\t\t\n\t\t\n\t\tthis.root = cortical;\n\t\t\n\t\tcorticalPot = new Map(CORTICAL_POT, new Sum(vdt, extendedFramedSpace, new Leaf(cortical)));\n\t\tthis.addParameters(corticalPot);\n\t\t\n\t\t\n\n\t}", "public Agnello prelevaMontone() {\n\t\tfor (int i=0; i<pecore.size(); i++)\n\t\t\tif ((pecore.get(i) instanceof PecoraAdulta)\n\t\t\t\t\t&& (((PecoraAdulta) pecore.get(i)).isMaschio())) {\n\t\t\t\tnumMontoni--;\n\t\t\t\treturn pecore.remove(i);\n\t\t\t}\n\t\treturn null;\n\t}", "private static void statistique(){\n\t\tfor(int i = 0; i<7; i++){\n\t\t\tfor(int j = 0; j<7; j++){\n\t\t\t\tfor(int l=0; l<jeu.getJoueurs().length; l++){\n\t\t\t\t\tif(jeu.cases[i][j].getCouleurTapis() == jeu.getJoueurs()[l].getNumJoueur()){\n\t\t\t\t\t\tjeu.getJoueurs()[l].setTapis(jeu.getJoueurs()[l].getTapisRest()+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tJoueur j;\n\t\tSystem.out.println(\"// Fin de la partie //\");\n\t\tfor(int i=0; i<jeu.getJoueurs().length; i++) {\n\t\t\tj =jeu.getJoueurs()[i];\n\t\t\tSystem.out.println(\"Joueur \"+ (j.getNumJoueur()+1) + \" a obtenue \"+j.getTapisRest()+j.getMonnaie()+\" points\" );\n\t\t}\n\t}", "public void opretMedlem(KassererController kassererController, Hold hold) {\n Scanner scan = new Scanner(System.in);\n Motionist motionist;\n KonkurrenceSvømmer konkurrenceSvømmer;\n\n //Alle medlemmer\n System.out.println(\"Opret det nye medlem herunder: \");\n System.out.print(\"Skal det nye medlem registreres som konkurrencesvømmer, 'ja' eller 'nej': \");\n String svømmeType = scan.nextLine();\n\n System.out.print(\"Fulde navn: \");\n String navn = scan.nextLine();\n System.out.print(\"Alder: \");\n int alder = scan.nextInt();\n System.out.print(\"Har medlemmet en aktiv aktivitetsform? (true eller false): \");\n boolean aktivitetsform = scan.nextBoolean();\n System.out.print(\"Har medlemmet betalt? (true eller false): \");\n boolean betalt = scan.nextBoolean();\n\n //Motionist\n if (svømmeType.equals(\"nej\")) {\n motionist = new Motionist(navn, alder, aktivitetsform, betalt);\n if (motionist.getAlder() < 18) {\n System.out.println(\"Medlemmet er motionist og i kategorien juniormedlem.\");\n } else if (motionist.getAlder() >= 18) {\n System.out.println(\"Medlemmet er motionist og i kategorien seniormedlem.\");\n }\n System.out.println();\n System.out.print(motionist.toString());\n medlemmer.add(motionist);\n kassererController.kontingentBetaling(motionist);\n filHåndtering.filSkrivning(motionist);\n\n //Konkurrencesvømmer\n } else if (svømmeType.equals(\"ja\")) {\n konkurrenceSvømmer = new KonkurrenceSvømmer(navn, alder, aktivitetsform, betalt);\n if (konkurrenceSvømmer.getAlder() < 18) {\n hold.tilføjJuniorKonkurrencesvømmere(konkurrenceSvømmer);\n System.out.println(\"Medlemmet er konkurrencesvømmer i kategorien juniormedlem, og dermed tildelt ungdomsholdet.\");\n } else if (konkurrenceSvømmer.getAlder() >= 18) {\n hold.tilføjSeniorKonkurrencesvømmere(konkurrenceSvømmer);\n System.out.println(\"Medlemmet er konkurrencesvømmer i kategorien seniormedlem, og dermed tildelt seniorholdet.\");\n }\n konkurrenceSvømmer.svømmeDisciplin(konkurrenceSvømmer);\n System.out.println();\n System.out.print(konkurrenceSvømmer.toString());\n medlemmer.add(konkurrenceSvømmer);\n kassererController.kontingentBetaling(konkurrenceSvømmer);\n filHåndtering.filSkrivning(konkurrenceSvømmer);\n }\n }", "private static Set<TipoLinkPartita> initModel() {\n\n Set<TipoLinkPartita> partite = new HashSet<TipoLinkPartita>();\n\n Squadra verdi = new Squadra(\"Verdi\");\n Squadra rossi = new Squadra(\"Rossi\");\n Squadra gialli = new Squadra(\"Gialli\");\n Squadra blu = new Squadra(\"Blu\");\n\n try {\n\n TipoLinkPartita p = new TipoLinkPartita(verdi, 2, rossi, 0);\n verdi.inserisciLinkPartita(p);\n partite.add(p);\n\n p = new TipoLinkPartita(verdi, 3, blu, 1);\n verdi.inserisciLinkPartita(p);\n partite.add(p);\n\n p = new TipoLinkPartita(blu, 2, rossi, 0);\n blu.inserisciLinkPartita(p);\n partite.add(p);\n\n p = new TipoLinkPartita(gialli, 1, rossi, 3);\n rossi.inserisciLinkPartita(p);\n partite.add(p);\n\n } catch (EccezionePrecondizioni e) {\n e.printStackTrace();\n }\n\n // Crea ed aggiunge giocatori alle squadre\n // eta' casuale tra 1970 e 1980\n // (Math.random() resituisce un double casuale tra 0.0 e 1.0)\n for (int i = 0; i < 20; i++) {\n\n Giocatore g = new Giocatore(\"verde-\" + i, 1970 + (int) (10 * Math.random()));\n verdi.insericiLinkGioca(g);\n\n g = new Giocatore(\"rosso-\" + i, 1970 + (int) (10 * Math.random()));\n rossi.insericiLinkGioca(g);\n\n g = new Giocatore(\"giallo-\" + i, 1970 + (int) (10 * Math.random()));\n gialli.insericiLinkGioca(g);\n\n g = new Giocatore(\"blu-\" + i, 1970 + (int) (10 * Math.random()));\n blu.insericiLinkGioca(g);\n }\n\n return partite;\n }", "@Override\npublic int mover() {\n\treturn posicaoTopoEscada;\n}", "public void compute2() {\n\n ILineString lsInitiale = this.geom;\n ILineString lsLisse = Operateurs.resampling(lsInitiale, 1);\n // ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 10, 1);\n // ILineString\n // lsLisse=LissageGaussian.AppliquerLissageGaussien((GM_LineString)\n // lsInitiale, 10, 1, false);\n\n logger.debug(\"Gaussian Smoothing of : \" + lsInitiale);\n\n // On determine les séquences de virages\n List<Integer> listSequence = determineSequences(lsLisse);\n\n // On applique le filtre gaussien\n\n // On crée une collection de points qui servira à découper tous les\n // virages\n\n if (listSequence.size() > 0) {\n List<Integer> listSequenceFiltre = filtrageSequences(listSequence, 1);\n DirectPositionList dplPointsInflexionLsLissee = determinePointsInflexion(\n lsInitiale, listSequenceFiltre);\n\n for (IDirectPosition directPosition : dplPointsInflexionLsLissee) {\n this.jddPtsInflexion.add(directPosition.toGM_Point().getPosition());\n // dplPtsInflexionVirages.add(directPosition);\n }\n\n // jddPtsInflexion.addAll(jddPtsInflexionLsInitiale);\n\n }\n // dplPtsInflexionVirages.add(lsInitiale.coord().get(lsInitiale.coord().size()-1));\n\n }", "Model minimize(Model model);", "public void ganarDineroPorAutomoviles() {\n for (Persona p : super.getMundo().getListaDoctores()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaAlbaniles()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaHerreros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n for (Vehiculo v : p.getVehiculos()) {\n v.puedeGanarInteres();\n v.setPuedeGanarInteres(false);\n }\n }\n }", "public logicaEnemigos(){\n\t\t//le damos una velocidad inicial al enemigo\n\t\tsuVelocidad = 50;\n\t\tsuDireccionActual = 0.0;\n\t\tposX = 500 ;\n\t\tposY = 10;\n\t}", "public AbstrJoueurModel retourneAbstrJoueurModel(){ return ajm;}", "@Override\n protected void elaboraMappaBiografie() {\n if (mappaCognomi == null) {\n mappaCognomi = Cognome.findMappaTaglioListe();\n }// end of if cycle\n }", "void establecerPuntoFM(int pos){\n this.emisoraFMActual = pos;\n }", "@Override\n\tprotected Mesure _resoudre(Unite probleme, Mesure source) {\n\t\tMesure g = null;\n\t\tUniteCompose u = (UniteCompose)probleme,\n\t\tsu = (UniteCompose) source.getUnite();\n\t\t\n\t\tMesure mf = new Mesure(1, su.getFirst());\n\t\tmf.setConvertisseur(new ConvertisseurDistance());\n\t\tmf = mf.convertir(u.getFirst());\n\t\t\n\t\tMesure ml = new Mesure(1, su.getLast());\n\t\tml.setConvertisseur(new ConvertisseurTemps());\n\t\tml = ml.convertir(u.getLast());\n\t\t\n\t\t//application selon la regle de grandeur\n\t\tGrandeur gr = source.getUnite().getGrandeur();\n\t\tHashMap<String, Double> val = new HashMap<String, Double>();\n\t\tval.put(Grandeur.Distance, mf.getValeur());\n\t\tval.put(Grandeur.Temps, ml.getValeur());\n\t\t\n\t\tg = new Mesure(source.getValeur() * gr.evaluer(val), probleme);\n\t\t\n\t\treturn g;\n\t}", "public void minimize() {\n MinimizationOperations.minimizeHopcroft(model);\n }", "public void onUpdateFeatures(ControllerEvent event) throws IOException {\n\n\t\tMapViewer viewer = getViewer();\n\t\tMapContext context = viewer.getConfiguration().getContext();\n\n\t\tGeometryListFeatureMapLayer layer = (GeometryListFeatureMapLayer) context\n\t\t\t\t.getLayer(GEOMETRY_LAYER_NAME);\n\n\t\tif (layer.isEditable()) {\n\t\t\t// Slechts 1 punt mag ingegeven worden\n\t\t\tif (layer.getGeometries().size() > 1) {\n\t\t\t\tlayer.getGeometries().remove(0);\n\t\t\t}\n\n\t\t\t// Precies 1 punt koppelen aan een Anderprobleem\n\t\t\tif (layer.getGeometries().size() == 1) {\n\n\t\t\t\tif (object.getProbleem() instanceof NetwerkAnderProbleem) {\n\n\t\t\t\t\t// Zoek het dichtstbijzijnde NetwerkSegment\n\t\t\t\t\tResourceIdentifier segmentId = Beans.getReference(\n\t\t\t\t\t\t\tOsyrisModelFunctions.class).getNearestSegment(\n\t\t\t\t\t\t\tlayer.getGeometries().iterator().next(),\n\t\t\t\t\t\t\ttrajectType.replace(\"netwerk\", \"Netwerk\"));\n\n\t\t\t\t\t// Koppel het dichtstbijzijnde NetwerkSegment bij het\n\t\t\t\t\t// Probleempunt\n\t\t\t\t\tif (segmentId != null) {\n\t\t\t\t\t\tobject.setTraject(segmentId);\n\t\t\t\t\t\t((AnderProbleem) object.getProbleem()).setGeom(layer\n\t\t\t\t\t\t\t\t.getGeometries().iterator().next());\n\t\t\t\t\t\t// FeatureMapLayer featureLayer = (FeatureMapLayer)\n\t\t\t\t\t\t// getViewer()\n\t\t\t\t\t\t// .getContext()\n\t\t\t\t\t\t// .getLayer(\n\t\t\t\t\t\t// LabelUtils.lowerCamelCase(trajectType\n\t\t\t\t\t\t// .replace(\"netwerk\", \"Netwerk\")));\n\t\t\t\t\t\t// List<String> ids = new ArrayList<String>(1);\n\t\t\t\t\t\t// ids.add(segmentId.getIdPart());\n\t\t\t\t\t\t// featureLayer.set(\"selectable\", true);\n\t\t\t\t\t\t// featureLayer.setSelection(ids);\n\t\t\t\t\t\t// getViewer().updateContext(null);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlayer.getGeometries().clear();\n\t\t\t\t\t}\n\n\t\t\t\t} else if (object.getProbleem() instanceof AnderProbleem) {\n\t\t\t\t\t((AnderProbleem) object.getProbleem()).setGeom(layer\n\t\t\t\t\t\t\t.getGeometries().iterator().next());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private Ente gestioneEnte() {\n\t\tList<Ente> enti = enteDad.getEntiByCodiceAndCodiceSistemaEsterno(req.getCodiceEnte(), SistemaEsterno.FEL);\n\t\tif(enti == null || enti.isEmpty()) {\n\t\t\tthrow new UnmappedEnteException(ErroreCore.ENTITA_NON_TROVATA.getErrore(\"Ente\", \"codice \" + req.getCodiceEnte()));\n\t\t}\n\t\t// Dovrebbe essercene solo uno. Per sicurezza prendo solo il primo\n\t\treturn enti.get(0);\n\t}", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "public void findTrack() {\n for (Node n : start_node.getLinks()) {\n precedenti.put(n, start_node);\n valori.put(n, calculator.calcDistance(n, start_node));\n }\n while (!da_collegare.isEmpty()) {\n Node piu_vicino = null;\n double min = Double.MAX_VALUE;\n for (Node n : da_collegare) {\n double dist = valori.get(n);\n if (dist - min < THRESHOLD) {\n min = dist;\n piu_vicino = n;\n }\n }\n double dist = valori.get(piu_vicino);\n for (Node n : piu_vicino.getLinks()) {\n double ricalc = dist + calculator.calcDistance(n, piu_vicino);\n if (ricalc - valori.get(n) < THRESHOLD) {\n precedenti.put(n, piu_vicino);\n valori.put(n, ricalc);\n }\n }\n da_collegare.remove(piu_vicino);\n }\n }", "public void sekvMetode(IntList m, IntList kohyll){\n int minX = x[0];\n int maxX = x[0];\n int minIndeks = 0, maxIndeks = 0;\n\n for(int i = 0; i < x.length; i++){\n\n if(minX > x[i]){\n minX = x[i];\n minIndeks = i;\n }\n if(maxX < x[i]){\n maxX = x[i];\n maxIndeks = i;\n }\n }\n\n\tSystem.out.println(minIndeks + \"\" + maxIndeks);\n //get all indexs\n IntList xcoords = drawLineBetweenPoints(maxIndeks, minIndeks, m);\n\n int xcoord = findPointWithMostNegativeDistance(maxIndeks, minIndeks, xcoords);\n\n\tkohyll.add(maxIndeks);\n sekvRek(maxIndeks, minIndeks, xcoord, xcoords, kohyll);\n\n //reset xcoords\n xcoords.clear();\n\n xcoords = drawLineBetweenPoints(minIndeks, maxIndeks, m);\n\n\t\n xcoord = findPointWithMostNegativeDistance(minIndeks, maxIndeks, xcoords);\n\n\t\n kohyll.add(minIndeks);\n\t\n sekvRek(minIndeks, maxIndeks, xcoord, xcoords, kohyll);\n }", "public void mou(){\n\n this.setY(getY() + getVelocitatY());\n this.setX(getX() + getVelocitatX());\n\n }", "public void ajouterMontant( double montant){\r\n\t\tthis.solde += montant;\r\n\t}", "public static void main(String[] args) {\n System.out.println(\"Test de la partie 1:\");\n System.out.println(\"--------------------\");\n\n Position position1 = new Position(0, 1);\n Position position2 = new Position(1, 0);\n Position position3 = new Position(1, 1);\n\n Neurone neuron1 = new Neurone(position1, 0.5);\n Neurone neuron2 = new Neurone(position2, 1.0);\n Neurone neuron3 = new Neurone(position3, 2.0);\n\n neuron1.connexion(neuron2);\n neuron2.connexion(neuron3);\n neuron1.recoitStimulus(10);\n\n System.out.println(\"Signaux : \");\n System.out.println(neuron1.getSignal());\n System.out.println(neuron2.getSignal());\n System.out.println(neuron3.getSignal());\n\n System.out.println();\n System.out.println(\"Premiere connexion du neurone 1\");\n System.out.println(neuron1.getConnexion(0));\n\n\n // FIN TEST DE LA PARTIE 1\n\n // TEST DE LA PARTIE 2\n System.out.println(\"Test de la partie 2:\");\n System.out.println(\"--------------------\");\n\n Position position5 = new Position(0, 0);\n NeuroneCumulatif neuron5 = new NeuroneCumulatif(position5, 0.5);\n neuron5.recoitStimulus(10);\n neuron5.recoitStimulus(10);\n System.out.println(\"Signal du neurone cumulatif -> \" + neuron5.getSignal());\n\n // FIN TEST DE LA PARTIE 2\n\n // TEST DE LA PARTIE 3\n System.out.println();\n System.out.println(\"Test de la partie 3:\");\n System.out.println(\"--------------------\");\n Cerveau cerveau = new Cerveau();\n\n // parametres de construction du neurone:\n // la position et le facteur d'attenuation\n cerveau.ajouterNeurone(new Position(0,0), 0.5);\n cerveau.ajouterNeurone(new Position(0,1), 0.2);\n cerveau.ajouterNeurone(new Position(1,0), 1.0);\n\n // parametres de construction du neurone cumulatif:\n // la position et le facteur d'attenuation\n cerveau.ajouterNeuroneCumulatif(new Position(1,1), 0.8);\n cerveau.creerConnexions();\n cerveau.stimuler(0, 10);\n\n System.out.println(\"Signal du 3eme neurone -> \" + cerveau.sonder(3));\n System.out.println(cerveau);\n // FIN TEST DE LA PARTIE 3\n }", "public void MieiOrdini()\r\n {\r\n getOrdini();\r\n\r\n }", "public void enleverlaDerniereObs() {\n\n\t\tobstaclesList.remove(obstaclesList.size()-1);\n\t}", "public void moverAbajo() {\n estado = EstadosPersonaje.QUIETO;\n mover(new Vector2(0, -1));\n }", "public Modello getModello() {\r\n\t\treturn mod;\r\n\t}", "@Override\n\tpublic void update(Observable o, Object arg) {\n\t\tJLabelNbMort.setText(\"Nb mort : \"+m.getMort());\n\t\tJLabelNbVivant.setText(\"Nb vivant : \"+m.getVivant());\n\t\t//JLabelTemps.setText(\"Temps : \"+m.getTemps());\n\t\tJLabelNbCoup.setText(\"Nb coups : \"+m.getCoup());\n\t}", "@FXML\n void doCerca(ActionEvent event) {\n \ttxtresult.clear();\n \t\n \tmodel.buildGraph();\n \t\n \tStop partenza = stazionePartenza.getValue();\n \tStop arrivo = stazioneArrivo.getValue();\n \t\n \tif(!partenza.equals(arrivo)){\n\t\t \tList<Stop> sequenza = model.cercaPercorso(partenza, arrivo);\n\t\t \tif(sequenza!=null){\n\t\t \ttxtresult.appendText(model.stampaSequenza(sequenza));\n\t\t \t}else{\n\t\t \t\ttxtresult.appendText(String.format(\"Spiacente, non vi sono percorsi possibili da %s a %s\", partenza.getName(), arrivo.getName()));\n\t\t \t}\n \t}else{\n \t\ttxtresult.appendText(\"Spiacente, le stazioni devono essere differenti per calcolare un percorso\");\n \t}\n\n }", "private void LeastMoviableItem() {\n DefaultTableModel dtm=(DefaultTableModel) leastmoviableitemtable.getModel();\n ArrayList<MoviableItem> findleastmoviableitem;\n try {\n findleastmoviableitem = LeastMoviableItemController.findleastmoviableitem();\n for (MoviableItem moviableItem : findleastmoviableitem) {\n Object[]rowdata={moviableItem.getItemcode(),moviableItem.getDescription(),moviableItem.getSalse()}; \n dtm.addRow(rowdata);\n }\n } catch (ClassNotFoundException | SQLException ex) {\n JOptionPane.showMessageDialog(null, ex.getMessage());\n }\n \n\n }", "public double getMontoDescuento(){\n return localMontoDescuento;\n }", "public void bougerObstacle (MouseEvent e) {\n\t\taddMouseMotionListener(new MouseMotionAdapter() {\n\t\t\t@Override\n\t\t\tpublic void mouseDragged(MouseEvent nouv) {\n\t\t\t\tif (interieur) {\n\t\t\t\t\t//\t\t\t\t\t\n\t\t\t\t\tgetObstaclesList().get(indiceObjetSelectionne).setPosition(new SVector3d(valeurEnReelleX(nouv.getX() - xPrecedent)- getPositionCam().x, valeurEnReelleY(nouv.getY() - yPrecedent)- getPositionCam().y));\n\t\t\t\t\trepaint();\n\t\t\t\t\tenClique= false;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t});\n\t}", "private void laskeMatkojenPituus() {\n matkojenpituus = 0.0;\n\n for (Matka m : matkat) {\n matkojenpituus += m.getKuljettumatka();\n }\n\n }", "public ConsultaMassivaCapitoloEntrataPrevisioneModel() {\n\t\tsuper();\n\t\tsetTitolo(\"Consulta Capitolo Entrata Previsione (Massivo)\");\n\t}", "public float montos(){\n\tDefaultTableModel modelo = vc.returnModelo();\r\n\tint numeroFilas=modelo.getRowCount();\r\n\tfloat monto=0;\r\n\t\tif(modelo.getRowCount()!=0){\r\n\t\t\r\n\t\t\tfor (int i = 0; i < numeroFilas; i++) {\r\n\t\t\t\t\r\n\t\t\t\tmonto = monto + Float.valueOf(modelo.getValueAt(i, 5).toString());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tmonto=0;\r\n\t\t}\r\n\t\treturn monto;\r\n\t}", "public void soin() {\n if (!autoriseOperation()) {\n return;\n }\n if (tamagoStats.getXp() >= 2) {\n incrFatigue(-3);\n incrHumeur(3);\n incrFaim(-3);\n incrSale(-3);\n incrXp(-2);\n\n if (tamagoStats.getPoids() == 0) {\n incrPoids(3);\n } else if (tamagoStats.getPoids() == TamagoStats.POIDS_MAX) {\n incrPoids(-3);\n }\n\n setEtatPiece(Etat.NONE);\n tamagoStats.setEtatSante(Etat.NONE);\n\n setChanged();\n notifyObservers();\n }\n }", "private void run(){\r\n\t\tArrayList<Integer> parcours = new ArrayList<Integer>();\r\n\t\tArrayList<Integer> sommets = new ArrayList<Integer>();\r\n\t\t\r\n\t\t//initialisation de la liste des sommets\r\n\t\tfor (int i=1; i<super.g.getDim();i++) {\r\n\t\t\tsommets.add(i);\r\n\t\t}\r\n\r\n\t\t//g�n�ration d'un parcours initial\r\n\t\tAlgo2opt algo = new Algo2opt(super.g);\r\n\t\tsuper.parcoursMin = algo.parcoursMin;\r\n\t\tsuper.dist = algo.dist;\r\n\r\n\t\tcheminMin(parcours,sommets,super.g.getDim(), 0);\r\n\t}", "public void calculEtatSuccesseur() { \r\n\t\tboolean haut = false,\r\n\t\t\t\tbas = false,\r\n\t\t\t\tgauche = false,\r\n\t\t\t\tdroite = false,\r\n\t\t\t\thautGauche = false,\r\n\t\t\t\tbasGauche = false,\r\n\t\t\t\thautDroit = false,\r\n\t\t\t\tbasDroit = false;\r\n\t\t\r\n\t\tString blanc = \" B \";\r\n\t\tString noir = \" N \";\r\n\t\tfor(Point p : this.jetonAdverse()) {\r\n\t\t\tString [][]plateau;\r\n\t\t\tplateau= copieEtat();\r\n\t\t\tint x = (int) p.getX();\r\n\t\t\tint y = (int) p.getY();\r\n\t\t\tif(this.joueurActuel.getCouleur() == \"noir\") { //dans le cas ou le joueur pose un pion noir\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(p.getY()>0 && p.getY()<plateau[0].length-1 && p.getX()>0 && p.getX()<plateau.length-1) { //on regarde uniquement le centre du plateaau \r\n\t\t\t\t\t//on reinitialise x,y et plateau a chaque étape\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tdroite = getDroite(x,y,blanc);\r\n\t\t\t\t\thaut = getHaut(x, y, blanc);\r\n\t\t\t\t\tbas = getBas(x, y, blanc);\r\n\t\t\t\t\tgauche = getGauche(x, y, blanc);\r\n\t\t\t\t\thautDroit = getDiagHautdroite(x, y, blanc);\r\n\t\t\t\t\thautGauche = getDiagHautGauche(x, y, blanc);\r\n\t\t\t\t\tbasDroit = getDiagBasDroite(x, y, blanc);\r\n\t\t\t\t\tbasGauche = getDiagBasGauche(x, y, blanc);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y-1]==noir) {//regarder si à gauche du pion blanc il y a un pion noir\r\n\r\n\t\t\t\t\t\t//on regarde si il est possible de poser un pion noir à droite\r\n\t\t\t\t\t\tif(droite) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//1\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x-1][y]==noir) {//regardre au dessus si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(bas) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tplateau[x][y]= noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//2\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y+1]==noir) { //regarde a droite si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(gauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y]= noir;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//3\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x+1][y] == noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(haut) {\r\n\t\t\t\t\t\t\t//System.out.println(\"regarde en dessous\");\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//4\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautgauche\r\n\t\t\t\t\tif(this.plateau[x+1][y+1]==noir) {\r\n\t\t\t\t\t\tif(hautGauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//5\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagbasGauche\r\n\t\t\t\t\tif(this.plateau[x-1][y+1]==noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(basGauche) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\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}//6\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautDroit : OK!\r\n\t\t\t\t\tif(this.plateau[x+1][y-1]==noir) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(hautDroit) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\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}//7\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagBasDroit\r\n\t\t\t\t\tif(this.plateau[x-1][y-1]==noir) {\r\n\t\t\t\t\t\tif(basDroit) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == blanc) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = noir;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=noir;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, noir, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t\t//System.out.println(\"ajouté!\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//8\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse {//si le joueur actuel a les pions blanc\r\n\t\t\t\tif(p.getY()>0 && p.getY()<plateau[0].length-1 && p.getX()>0 && p.getX()<plateau.length-1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x][y-1]==blanc) {//regarder si à gauche du pion blanc il y a un pion noir\r\n\t\t\t\t\t\t//on regarde si il est possible de poser un pion noir à droite\r\n\t\t\t\t\t\tif(getDroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\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\t}//1.1\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x-1][y]==blanc) {//regardre au dessus si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getBas(x, y, noir)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//2.2\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.plateau[x][y+1]==blanc) { //regarde a droite si le pion est noir\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getGauche(x, y, noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//3.3\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\tif(this.plateau[x+1][y] == blanc) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(getHaut(x, y, noir)) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//4.4\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautgauche\r\n\t\t\t\t\tif(this.plateau[x+1][y+1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagHautGauche(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]= blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//5.5\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagbasGauche\r\n\t\t\t\t\tif(this.plateau[x-1][y+1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagBasGauche(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty--;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//6.6\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diaghautDroit\r\n\t\t\t\t\tif(this.plateau[x+1][y-1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagHautdroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx--;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}//7.7\r\n\t\t\t\t\t\r\n\t\t\t\t\tx = (int) p.getX();\r\n\t\t\t\t\ty = (int) p.getY();\r\n\t\t\t\t\tplateau= copieEtat();\r\n\t\t\t\t\t//diagBasDroit\r\n\t\t\t\t\tif(this.plateau[x-1][y-1]==blanc) {\r\n\t\t\t\t\t\tif(getDiagBasDroite(x,y,noir)) {\r\n\t\t\t\t\t\t\twhile(plateau[x][y] == noir) {\r\n\t\t\t\t\t\t\t\tplateau[x][y] = blanc;\r\n\t\t\t\t\t\t\t\tx++;\r\n\t\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tplateau[x][y]=blanc;\r\n\t\t\t\t\t\t\tplateau=pionPosé(x, y, blanc, plateau);\r\n\t\t\t\t\t\t\tthis.setSuccesseur(new EtatReversi(this, plateau));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}//8.8\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void hienThiMaKHSuDungDV(){\n SuDungService suDungService = new SuDungService();\n suDungModels = suDungService.layMaKHSuDungDVLoaiBoTrungLap();\n \n cbbThanhToanMaKH.removeAllItems();\n for (SuDungModel suDungModel : suDungModels) {\n cbbThanhToanMaKH.addItem(suDungModel.getMaKH());\n }\n }", "public static void main(String[] args) {\r\n\t\t\t\r\n\t\t\tModel model = new Model();\r\n\t\t\tSeason s=new Season(2016);\r\n\t\t\tTeam team=new Team(\"Genoa\");\r\n\t\t\tTeam team2=new Team(\"Sampdoria\");\r\n\t\t\t\r\n\t\t\tmodel.creaGrafo(s) ;\r\n//\t\t\tmodel.creaGrafo2(s) ;\r\n\t\t\tList<Team> vc= model.trovaViciniConnessi(team,s);\t\t\r\n\t\t\tSystem.out.println(vc);\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\t\t\tList<TeamPunteggio> classifica= model.getClassifica(s);\t\t\r\n\t\t\tSystem.out.println(classifica);\r\n\t\t\tSystem.out.println(\" \\n ---CHI RETROCEDE?--- \\n\");\r\n\t\t\tSystem.out.println(classifica.subList(17, 20));\r\n\t\t\tSystem.out.println(\" \\n ---CHI Va in Champions?--- \\n\");\r\n\t\t\tSystem.out.println(classifica.subList(0, 3));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n//\t\t\tSystem.out.println(\"---------------GRAFO TEAM----------------------\");\r\n\r\n//\t\t\tmodel.creaGrafoTEAM() ;\r\n//\t\t\tList<Team> te= model.getRaggiungibiliInAmpiezza(team);\r\n//\t\t\tSystem.out.println(te);\r\n//\t\t\tList<TeamPunteggio> t= model.getDestinations(team);\t\t\r\n//\t\t\tSystem.out.println(t);\r\n\t\t\t\r\n//\t\t\tSystem.out.println(\"---------------GRAFO Season----------------------\");\r\n//\t\t\tmodel.creaGrafoSEASON() ;\r\n//\t\t\tList<Integer> ss= model.getRaggiungibiliInAmpiezza(2016);\r\n//\t\t\tSystem.out.println(ss);\r\n//\t\t\tList<IntegerPair> ips= model.getDestinations(2016);\t\t\r\n//\t\t\tSystem.out.println(ips);\r\n\t\t\t\r\n//\t\t\tSystem.out.println(\"-----------------GRAFO GOAL----------------------\");\r\n//\t\t\tmodel.creaGrafoGOAL() ;\r\n//\t\t\tList<Integer> te= model.getRaggiungibiliInAmpiezza(3);\r\n//\t\t\tSystem.out.println(te);\r\n//\t\t\tList<IntegerPair> t= model.getDestinations(3);\t\t\r\n//\t\t\tSystem.out.println(t);\r\n\r\n//\t\t\tSystem.out.println(\"---------------------VISITE----------------------\");\t\t\t\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n\");\r\n//\t\t\tList<TeamPunteggio> t= model.getDestinations(s, team);\t\t\r\n//\t\t\tSystem.out.println(t);\r\n\t\t\t\t\r\n//\t\t\tSystem.out.println(\" \\n----- successori------ \\n\");\r\n//\t\t\tList<Team> ss= model.trovaSucessori(team);\r\n//\t\t\tSystem.out.println(ss);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\" \\n-------predeccessori------ \\n \");\r\n//\t\t\tList<Team> pp= model.trovaPredecessori(team);\r\n//\t\t\tSystem.out.println(pp);\r\n//\r\n//\t\t\tSystem.out.println(\" \\n------ calcolo percorso e il suo tempo------- \\n\");\r\n//\t\t\tSystem.out.println(model.calcolaPercorso(team, team2));\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n -------Squadre che il eam ha affrontato in quella stagione------- \\n\");\r\n//\t\t\tList<Team> te= model.getRaggiungibiliInAmpiezza(team);\r\n//\t\t\tSystem.out.println(te);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n------- n raggiungibili------ \\n\");\r\n//\t\t\tint i= model.raggiungibili();\r\n//\t\t\tSystem.out.println(i);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n-------- percorso BELLMAN---> UGUALE A disktra ma tiene conto peso negativo------ \\n\");\r\n//\t\t\tSystem.out.println(model.BELLMANcalcolaPercorso(team));\r\n\r\n\t\t\t\r\n//\t\t\tSystem.out.println(\"-------------CONNECTIVITY INSPECTOR----------------------\");\t\t\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n\");\r\n//\t\t\r\n//\t\t\tSystem.out.println(\"\\n------ è fortemente connesso?------ \\n\");\t\t\t\r\n//\t\t\tSystem.out.println(model.isConnesso());\t\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n-------- connessioni grafo--------- \\n\");\r\n//\t\t\tint n=model.getNumberConn();\r\n//\t\t\tSystem.out.println(n);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n------ lista componenti connesse------ \\n\");\t\t\r\n//\t\t\tList<Set<Team>> l =model.getConn(); \r\n//\t\t\tSystem.out.println(l);\t\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n------- Arco max connesso------ \\n\");\t\t\t\r\n//\t\t\tSet<Team> t=model.MAXconnesso(); \r\n//\t\t\tSystem.out.println(t);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\" \\n ------n archi Arco max connesso------ \"\\n\");\t\t\t\r\n//\t\t\tint nc=model.MAXconnessioni(); \r\n//\t\t\tSystem.out.println(nc);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n--------- 5 Archi di max connesso------- \\n\");\r\n//\t\t\tList<EdgePeso>e= model.get5ArchiMinWeight(); \r\n//\t\t\tSystem.out.println(e);\r\n//\t\t\t\r\n//\t\t\t\t\t\r\n//\t\t\tSystem.out.println(\"--------------------- BEST & WORST-----------------------\");\r\n//\t\t\tSystem.out.println(\"\\n\");\r\n//\t\t\tSystem.out.println(\"\\n------ Best------ \\n\");\t\t\r\n//\t\t\tTeam winner=model.getBestTeam() ;\r\n//\t\t\tSystem.out.println(winner);\r\n//\t\t\tSystem.out.println(\"\\n------ Worst------ \\n\");\t\r\n//\t\t\tTeam loser=model.getWorstTeam() ;\r\n//\t\t\tSystem.out.println(loser);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n\");\r\n//\t\t\tSystem.out.println(\"---------------PIU VICINO & PIU LONTANO Al PUNTEGGIO DEL TEAM DI PARTENZA -----------------------\");\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n\");\r\n//\t\t\tSystem.out.println(\"\\n--------- Team Più Lontano come punti ---------\\n\");\r\n//\t\t\tTeam l =model.getPiLontano(\"Genoa\");\r\n//\t\t\tSystem.out.println(l);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n\");\r\n//\t\t\tSystem.out.println(\"-------- Team Più Vicino come punti ---------\");\r\n//\t\t\tSystem.out.println(\"\\n\");\r\n//\t\t\t\r\n//\t\t\tTeam v =model.getPiuVicino(\"Genoa\");\r\n//\t\t\tSystem.out.println(v);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"\\n\");\r\n//\t\t\tSystem.out.println(\"------- Team Più Lontano come punti per scontri diretti ----------\");\r\n//\t\t\tSystem.out.println(\"\\n\");\r\n//\t\t\t\r\n//\t\t\tTeam ld =model.getPiLontanoByVoloDiretto(\"Genoa\");\r\n//\t\t\tSystem.out.println(ld);\t\r\n\r\n\t}", "public void zpracujObjednavky()\n\t{\n\t\tint idtmp = 0;\n\t\tfloat delkaCesty = 0;\n\t\t\n\t\tif (this.objednavky.isEmpty())\n\t\t{\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\tNakladak nakl = (Nakladak) getVolneAuto();\n\t\t\n\t\tnakl.poloha[0] = this.poloha[0];\n\t\tnakl.poloha[1] = this.poloha[1];\n\t\tObjednavka ob = this.objednavky.remove();\n\n\t\t/*System.out.println();\n\t\tSystem.out.println(\"Objednavka hospody:\" + ob.id + \" se zpracuje pres trasu: \");\n\t\t */\n\t\tdelkaCesty += vyberCestu(this.id, ob.id, nakl);\n\t\t\n\t\twhile(nakl.pridejObjednavku(ob))\n\t\t{\n\t\t\tidtmp = ob.id;\n\t\t\t\n\t\t\tob = vyberObjednavku(ob.id);\n\t\t\tif (ob == null)\n\t\t\t{\n\t\t\t\tob=nakl.objednavky.getLast();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tobjednavky.remove(ob);\n\t\t\t\n\t\t\tdelkaCesty += vyberCestu(idtmp, ob.id, nakl);\n\t\t\t\n\t\t\tif((nakl.objem > 24)||(13-Simulator.getCas().hodina)*(nakl.RYCHLOST) + 100 < delkaCesty){\n\t\t\t\t//System.out.println(\"Nakladak ma \"+nakl.objem);\n\t\t\t\tnakl.kDispozici = false;\n\t\t\t\t//System.out.println(\"Auto jede \" + delkaCesty + \"km\");\n\t\t\t\tbreak;\t\t\n\t\t\t}\n\t\t\t/*\n\t\t\tif((Simulator.getCas().hodina > 12) && (delkaCesty > 80) ){\n\t\t\t\t//System.out.println(\"Nakladak ma \"+nakl.objem);\n\t\t\t\tnakl.kDispozici = false;\n\t\t\t\t//System.out.println(\"Auto jede \" + delkaCesty + \"km\");\n\t\t\t\tbreak;\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif((Simulator.getCas().hodina > 9) && (delkaCesty > 130) ){\n\t\t\t\t//System.out.println(\"Nakladak ma \"+nakl.objem);\n\t\t\t\tnakl.kDispozici = false;\n\t\t\t\t//System.out.println(\"Auto jede \" + delkaCesty + \"km\");\n\t\t\t\tbreak;\t\t\n\t\t\t}*/\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//cesta zpatky\n\t\tvyberCestu(ob.id, this.id, nakl);\n\t\tif (nakl.objem >= 1)\n\t\t{\n\t\t\tnakl.kDispozici = false;\n\t\t\tnakl.jede = true;\n\t\t\t//vytvoreni nove polozky seznamu pro statistiku\n\t\t\tnakl.novaStatCesta();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnakl.resetCesta();\n\t\t}\n\t}", "public void crearGloboRojo(int tiempo){ \n GloboRojo globor = new GloboRojo();\n double posicionx = generarPosicionX();\n globor.fijarPosicion(posicionx);\n globoslista.add(globor);\n gpane.getChildren().addAll(globor); \n MoverGlobo mv = new MoverGlobo(globor,tiempo);\n mov= new Thread(mv);\n mov.start(); \n }", "public void actualizarPantallaJuego(float delta)\r\n {\r\n //recuadroInfoJuego.actualizarTiempo(delta); // Con esto actualizamos el tiempo del HUD\r\n\r\n // Con el siguiente ciclo actualizamos el movimiento o posicion de los monstruos\r\n for (int i=0; i < enemigos.size(); i++)\r\n {\r\n // Metodo encargado de renovar las posiciones dado un diferencial de tiempo\r\n enemigos.get(i).actualizarPosicion(delta);\r\n\r\n // En caso que el enemigo haya muerto entonces\r\n if (enemigos.get(i).haMuerto())\r\n {\r\n // Se lo pasamos al jugador contrario de modo que\r\n try\r\n {\r\n // Le enviamos un mensaje sobre que tipo de enemigo debe generar de manera aleatoria\r\n String aux = \"Transferir enemigo: \" + enemigos.get(i).getTipo() + \"\\n\";\r\n socketCliente.getOutputStream().write(aux.getBytes());\r\n }\r\n catch (Exception e)\r\n {\r\n e.printStackTrace();\r\n }\r\n\r\n // Se suma su valor en puntaje al puntaje general obtenido por el usuario\r\n recuadroInfoJuego.agregarPuntaje(enemigos.get(i).getPuntaje());\r\n\r\n // Luego, se suma uno al numero total de enemigos eliminados por el jugador\r\n recuadroInfoJuego.anotarEnemigo();\r\n\r\n // Y se elimina el monstruo de la lista de enemigos\r\n enemigos.remove(i);\r\n i = i - 1;\r\n }\r\n }\r\n\r\n // Si ya se cumplio el tiempo para generar otro monstruo entonces\r\n if (contaTiempo >= tiempoParaGeneracion)\r\n {\r\n // Agregamos un nuevo enemigo aleatorio en coordenas generadas tambien de manera aleatoria\r\n enemigos.add(new Monstruo(MathUtils.random(0, MainGame.ANCHO_VIRTUAL), MathUtils.random(0, MainGame.ALTO_VIRTUAL), MathUtils.random(1,5), true));\r\n\r\n // Y reseteamos el contador de tiempo\r\n contaTiempo = 0;\r\n }\r\n\r\n // O si se detecto que me pasaron un monstruo entonces\r\n if (enemigoTransferido != -1)\r\n {\r\n // Genero el tipo de monstruo especificado en coordenadas aleatorias\r\n enemigos.add(new Monstruo(MathUtils.random(0, MainGame.ANCHO_VIRTUAL), MathUtils.random(0, MainGame.ALTO_VIRTUAL), enemigoTransferido, true));\r\n\r\n // Y reinicio el dectector de monstruos tranferidos\r\n enemigoTransferido = -1;\r\n }\r\n\r\n contaTiempo = contaTiempo + delta; // Por ultimo se cuenta el tiempo\r\n }", "@Override\r\n\tdouble getBonificacao() {\n\t\treturn 0;\r\n\t}", "public SiacDMovgestTsDetTipo() {\n\t}", "@Override\n public void affiche(){\n System.out.println(\"Loup : \\n points de vie : \"+this.ptVie+\"\\n pourcentage d'attaque : \"+this.pourcentageAtt+\n \"\\n dégâts d'attaque : \"+this.degAtt+\"\\n pourcentage de parade :\"+this.pourcentagePar+\n \"\\n position : \"+this.pos.toString());\n\n }", "private void ucitajPodatke() {\n \n DefaultListModel<Voznja> m = new DefaultListModel<>();\n obrada.getPodaci().forEach(s->m.addElement(s));\n lstPodaci.setModel(m);\n\n }", "public MatkaKokoelma() {\n tallentaja = new TXTTallentaja();\n matkat = new ArrayList<Matka>();\n matkojenkesto = 0.0;\n }", "@Override\n public void mergeModels(MusicOperation model) {\n int thisLength = this.getFinalBeat();\n int otherLength = model.getFinalBeat();\n int length;\n\n if (thisLength >= otherLength) {\n length = thisLength;\n } else {\n length = otherLength;\n }\n\n for (int i = 0; i < length; i++) {\n List<Note> currentNotes = model.getNotesAtBeat(i);\n\n for (int x = 0; x < currentNotes.size(); x++) {\n Note currentNote = currentNotes.get(x);\n this.addNote(currentNote);\n\n }\n\n }\n\n }", "public void modelChanged(DionaRapChangedEvent e) {\n if(gameRunning == true) {\n hauptfenster.getToolbar().updateToolbar(hauptfenster.getDionaRapModel().getShootAmount(), hauptfenster.getDionaRapModel().getScore(), hauptfenster.getProgress());\n hauptfenster.getSpielfeld().drawNew();\n }\n }", "public void moverIzquierda() {\n estado = EstadosPersonaje.IZQUIERDA;\n mover(new Vector2(-1, 0));\n }", "public Nodo dosNoSeguidos(Nodo nodo) throws IOException{\n System.out.println(\"----------------inicio heuristica dosnoseguidos--------------\");\n Operadores operadores = new Operadores();\n //variables de matriz\n int numFilas,numColumnas,numColores;\n \n numColumnas = nodo.getnColumnas();\n numFilas = nodo.getnFilas();\n numColores = nodo.getnColores();\n \n String [][] matriz = new String [numFilas][numColumnas];\n matriz = operadores.clonarMatriz(nodo.getMatriz());\n //-------------------\n \n //variables de filas y columnas\n ArrayList<ArrayListColumna> columnas = new ArrayList<ArrayListColumna>();\n columnas = (ArrayList<ArrayListColumna>)nodo.getColumnas();\n \n ArrayList<ArrayListFila> filas = new ArrayList<ArrayListFila>();\n filas = (ArrayList<ArrayListFila>)nodo.getFilas();\n //---------------------------\n \n ArrayListFila auxListFila = new ArrayListFila();\n ArrayListColumna auxListColumna = new ArrayListColumna();\n \n int cambio=1;\n \n while(cambio!=0){\n cambio=0;\n \n nodo.setCambio(0);\n for(int i = 0;i<numFilas;i++){\n if(operadores.isFilaVacia(nodo.getMatriz(), i) == true){\n //filas\n auxListFila = (ArrayListFila)filas.get(i);\n\n int contadorColores = 0;\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListFila.getColor(j);\n if(auxColor.getNumero() > 0){\n contadorColores++;\n }\n }//fin color\n\n\n if(contadorColores == 2){//esto quiere decir que hay dos colores disponibles para usar en la matriz\n //ahora hay que ver si uno de los dos es igual a 2 y false\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListFila.getColor(j1);\n\n if(auxColor1.getNumero() == 2 && auxColor1.isSeguido() == false){\n for(int j2=0;j2<numColores;j2++){\n Color auxColor2 = new Color();\n auxColor2 = auxListFila.getColor(j2);\n\n if(auxColor2.isSeguido() == true){\n cambio=1;\n nodo.setCambio(1);\n //pinta los extremos de la fila\n matriz = operadores.pintarPosicion(matriz,i, (numColumnas-1), auxColor1.getColor());\n \n matriz = operadores.pintarPosicion(matriz, i, 0, auxColor1.getColor());\n \n //pinta el resto de la fila\n matriz = operadores.pintarFilaCompleta(matriz, auxColor2.getColor(), i);\n //descuenta los colores en las filas\n auxColor1.setNumero(0);\n auxColor2.setNumero(0);\n \n //descontar colores en las columnas\n for(int c=0;c<numColumnas;c++){\n auxListColumna = (ArrayListColumna)columnas.get(c);\n \n if(c == 0){\n for(int c1=0;c1<numColores;c1++){\n Color auxColorc1 = new Color();\n auxColorc1 = auxListColumna.getColor(c1);\n \n if(auxColorc1.getColor().equals(auxColor1.getColor())){\n auxColorc1.setNumero(auxColorc1.getNumero()-1);\n }\n \n }\n }else if(c == (numColumnas-1)){\n for(int c1=0;c1<numColores;c1++){\n Color auxColorc1 = new Color();\n auxColorc1 = auxListColumna.getColor(c1);\n \n if(auxColorc1.getColor().equals(auxColor1.getColor())){\n auxColorc1.setNumero(auxColorc1.getNumero()-1);\n }\n }\n }else{\n for(int c1=0;c1<numColores;c1++){\n Color auxColorc1 = new Color();\n auxColorc1 = auxListColumna.getColor(c1);\n \n if(auxColorc1.getColor().equals(auxColor2.getColor())){\n auxColorc1.setNumero(auxColorc1.getNumero()-1);\n }\n }\n \n }\n \n }\n \n nodo.setMatriz(matriz.clone());\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n }\n }\n }\n }//fin color\n }\n }//fin isfilaVacia\n }//fin filas\n \n \n //---------columnas\n for(int i = 0;i<numColumnas;i++){\n if(operadores.isColumnaVacia(nodo.getMatriz(), i) == true){ \n //columnas\n auxListColumna = (ArrayListColumna)columnas.get(i);\n\n int contadorColores = 0;\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListColumna.getColor(j);\n if(auxColor.getNumero() > 0){\n contadorColores++;\n } \n }//fin color\n if(contadorColores == 2){//esto quiere decir que hay dos colores disponibles para usar en la matriz\n //ahora hay que ver si uno de los dos es igual a 2 y false\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n\n if(auxColor1.getNumero() == 2 && auxColor1.isSeguido() == false){\n for(int j2=0;j2<numColores;j2++){\n Color auxColor2 = new Color();\n auxColor2 = auxListColumna.getColor(j2);\n if(auxColor2.isSeguido() == true){\n cambio=1;\n nodo.setCambio(1);\n matriz = operadores.pintarPosicion(matriz,(numFilas-1), i, auxColor1.getColor());\n matriz = operadores.pintarPosicion(matriz, 0, i, auxColor1.getColor());\n \n matriz = operadores.pintarColumnaCompleta(matriz, auxColor2.getColor(), i);\n \n auxColor1.setNumero(0);\n auxColor2.setNumero(0);\n \n \n //descontar colores en las columnas\n for(int f=0;f<numFilas;f++){\n auxListFila = (ArrayListFila)filas.get(f);\n \n if(f == 0){\n for(int f1=0;f1<numColores;f1++){\n Color auxColorf1 = new Color();\n auxColorf1 = auxListFila.getColor(f1);\n \n if(auxColorf1.getColor().equals(auxColor1.getColor())){\n auxColorf1.setNumero(auxColorf1.getNumero()-1);\n }\n \n }\n }else if(f == (numColumnas-1)){\n for(int f1=0;f1<numColores;f1++){\n Color auxColorf1 = new Color();\n auxColorf1 = auxListFila.getColor(f1);\n \n if(auxColorf1.getColor().equals(auxColor1.getColor())){\n auxColorf1.setNumero(auxColorf1.getNumero()-1);\n }\n \n }\n }else{\n for(int f1=0;f1<numColores;f1++){\n Color auxColorf1 = new Color();\n auxColorf1 = auxListFila.getColor(f1);\n \n if(auxColorf1.getColor().equals(auxColor2.getColor())){\n auxColorf1.setNumero(auxColorf1.getNumero()-1);\n }\n }\n \n }\n \n }\n \n nodo.setMatriz(matriz.clone());\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n }\n }\n }\n }//fin color\n }\n }\n }//fin columnas\n }//fin while principal\n \n System.out.println(\"---------------final heuristica dosnoseguidos---------------\");\n return nodo;\n }", "@Override\n\tpublic Double addDinero(double monto) {\n\t\treturn null;\n\t}", "public void Semantica() {\r\n int var, etq;\r\n double marca, valor;\r\n double[] punto = new double[3];\r\n double[] punto_medio = new double[2];\r\n\r\n /* we generate the fuzzy partitions of the variables */\r\n for (var = 0; var < n_variables; var++) {\r\n marca = (extremos[var].max - extremos[var].min) /\r\n ((double) n_etiquetas[var] - 1);\r\n for (etq = 0; etq < n_etiquetas[var]; etq++) {\r\n valor = extremos[var].min + marca * (etq - 1);\r\n BaseDatos[var][etq].x0 = Asigna(valor, extremos[var].max);\r\n valor = extremos[var].min + marca * etq;\r\n BaseDatos[var][etq].x1 = Asigna(valor, extremos[var].max);\r\n BaseDatos[var][etq].x2 = BaseDatos[var][etq].x1;\r\n valor = extremos[var].min + marca * (etq + 1);\r\n BaseDatos[var][etq].x3 = Asigna(valor, extremos[var].max);\r\n BaseDatos[var][etq].y = 1;\r\n BaseDatos[var][etq].Nombre = \"V\" + (var + 1);\r\n BaseDatos[var][etq].Etiqueta = \"E\" + (etq + 1);\r\n }\r\n }\r\n }", "public void morir()\r\n\t{\r\n\t\tif(this.grafico != null)\t\r\n\t\t\tthis.mover(4);\r\n\t}", "void rozpiszKontraktyPart2EV(int index,float wolumenHandlu, float sumaKupna,float sumaSprzedazy )\n\t{\n\t\t//wektor z ostatecznie ustalona cena\n\t\t//rozpiszKontrakty() - wrzuca jako ostatnia cene cene obowiazujaa na lokalnym rynku \n\t\tArrayList<Float> priceVector = priceVectorsList.get(priceVectorsList.size()-1);\n\n\t\t\n\t\t//ograniczenia handlu prosumenta\n\t\tArrayList<DayData> constrainMarkerList = new ArrayList<DayData>();\n\t\t\n\t\t//ograniczenia handlu EV\n\t\tArrayList<DayData> constrainMarkerListEV = new ArrayList<DayData>();\n\t\t\n\t\t//print(listaFunkcjiUzytecznosci.size());\n\t\t//getInput(\"rozpiszKontraktyPart2EV first stop\");\n\t\t\n\t\tint i=0;\n\t\twhile(i<listaFunkcjiUzytecznosci.size())\n\t\t{\n\t\t\t\n\t\t\t//lista funkcji uzytecznosci o indeksie i\n\t\t\tArrayList<Point> L1\t=listaFunkcjiUzytecznosci.get(i);\n\t\t\t\n\t\t\t//point z cena = cena rynkowa\n\t\t\tPoint point = L1.get(index);\n\t\t\t\n\t\t\t\n\t\t\tDayData d =rozpiszKontraktyPointToConstrainMarker(point, wolumenHandlu, sumaKupna, sumaSprzedazy, i);\n\t\t\t\n\t\t\tif (i<Stale.liczbaProsumentow)\n\t\t\t{\n\t\t\t\tconstrainMarkerList.add(d);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconstrainMarkerListEV.add(d);\n\t\t\t\t\n\t\t\t\t/*print(d.getKupuj());\n\t\t\t\tprint(d.getConsumption());\n\t\t\t\tprint(d.getGeneration());\n\t\t\t\t\n\t\t\t\tgetInput(\"rozpiszKontraktyPart2EV - Ostatni kontrakt\");*/\n\t\t\t}\n\n\t\t\t\n\t\t\t//print(\"rozpiszKontraktyPart2EV \"+i);\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tArrayList<Prosument> listaProsumentow =listaProsumentowWrap.getListaProsumentow();\n\n\t\t//wyywolaj pobranie ontraktu\n\t\ti=0;\n\t\twhile (i<Stale.liczbaProsumentow)\n\t\t{\n\t\t\tif (i<constrainMarkerListEV.size())\n\t\t\t{\n\t\t\t\t((ProsumentEV)listaProsumentow.get(i)).getKontrakt(priceVector,constrainMarkerList.get(i),constrainMarkerListEV.get(i));\n\t\t\t\t//print(\"constrainMarkerListEV \"+i);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlistaProsumentow.get(i).getKontrakt(priceVector,constrainMarkerList.get(i));\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//getInput(\"rozpiszKontraktyPart2EV -end\");\n\t}", "com.google.ortools.linearsolver.MPModelDeltaProto getModelDelta();", "public void crearGloboVerde(int tiempo){ \n GloboVerde globov = new GloboVerde();\n globoslista.add(globov);\n double posicionx = generarPosicionX();\n globov.fijarPosicion(posicionx);\n \n gpane.getChildren().addAll(globov);\n MoverGlobo mv = new MoverGlobo(globov,tiempo);\n mov= new Thread(mv);\n mov.start(); \n }", "private void populatePreviousODOReading() {\n\n fuelViewModel.getAllFuel()\n .observe(getActivity(), new Observer<List<Fuel>>() {\n @Override\n public void onChanged(List<Fuel> fuels) {\n\n // if list is not empty\n if (!fuels.isEmpty()){\n\n Log.d(TAG, \"onChanged: fuels.size() = \" + fuels.size());\n\n // fuels.size()-1 displayed last item in the list, so I tested and found that 0 item is the first item\n Fuel mostRecentFuel = fuels.get(0); // most recent item is zero item on the list means first item\n Log.d(TAG, \"onChanged: mostRecentFuel.getFuelID() = \" + mostRecentFuel.getFuelID());\n\n lastODOreading = mostRecentFuel.getCurrentKm();\n tin_startingKm.setText(String.valueOf(lastODOreading));\n\n }\n\n\n }\n });\n\n }", "public Nodo espaciosJustos(Nodo nodo){\n System.out.println(\"----------------inicio heuristica espaciosJustos--------------\");\n Operadores operadores = new Operadores();\n //variables de matriz\n int numFilas,numColumnas,numColores;\n \n numColumnas = nodo.getnColumnas();\n numFilas = nodo.getnFilas();\n numColores = nodo.getnColores();\n \n String [][] matriz = new String [numFilas][numColumnas];\n matriz = operadores.clonarMatriz(nodo.getMatriz());\n //-------------------\n \n //variables de filas y columnas\n ArrayList<ArrayListColumna> columnas = new ArrayList<ArrayListColumna>();\n columnas = (ArrayList<ArrayListColumna>)nodo.getColumnas();\n \n ArrayList<ArrayListFila> filas = new ArrayList<ArrayListFila>();\n filas = (ArrayList<ArrayListFila>)nodo.getFilas();\n //---------------------------\n \n ArrayListFila auxListFila = new ArrayListFila();\n ArrayListColumna auxListColumna = new ArrayListColumna();\n \n int cambio=1;\n int changue=0;\n while(cambio!=0){\n cambio=0;\n \n nodo.setCambio(0);\n for(int i=0;i<numFilas;i++){\n auxListFila = (ArrayListFila)filas.get(i);\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListFila.getColor(j);\n\n if(auxColor.getNumero() > 0){\n int contador=0;\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n contador++;\n }\n }\n }\n }\n \n if(auxColor.getNumero() == contador){\n changue=1;\n cambio=1;\n auxColor.setNumero(0);\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n \n auxColor1.setNumero(auxColor1.getNumero()-1);\n\n matriz = operadores.pintarPosicion(matriz, i, c, auxColor.getColor());\n\n nodo.setMatriz(matriz);\n }\n }\n }\n }\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n \n \n }\n }\n }\n }\n \n }\n if(changue==1) nodo.setCambio(1);\n System.out.println(\"----------------fin heuristica espaciosJustos-------------- \");\n return (Nodo)nodo;\n }", "double objetosc() {\n return dlugosc * wysokosc * szerokosc; //zwraca obliczenie poza metode\r\n }", "public void gerarparcelascontrato(int id, int idcliente, int idgrupofinanceiro) {\n\t\tContrato contrato = repo.findById(id).get();\n\t\t// contrato.setCliente(clientes);\n\t\t// contrato.setFinanceiroContrato(financeiroContrato);\n\t\trepo.save(contrato);\n\t\tMovimentoContrato movement = movimentoContratoRepository.findByContratoIdAndStatus(id,\n\t\t\t\tStatusActiv.ABERTO.getDescricao());\n\t\tif (movement == null) {\n\t\t\tmovement = new MovimentoContrato();\n\t\t\tmovement.setDataMovimento(new Date());\n\t\t\tmovement.setStatus(StatusActiv.ABERTO.getDescricao());\n\t\t\tmovement.setTipomovimento(TipoMovimentoEnum.entradaContrato.getDescricao());\n\t\t}\n\t\tmovement.setValor(contrato.getTotal());\n\t\tmovement.setContrato(contrato);\n\t\tmovement.setHistorico(contrato.getFinanceiroContrato());\n\t\tmovement.setParcela(contrato.getPeriodo());\n\n\t\tmovement.setName(\"Contrato Nº \" + String.valueOf(id) + \" Cliente: \" + contrato.getClientename());\n\t\tmovement = movimentoContratoRepository.save(movement);\n\n\t\tfichaLeituraRepository\n\t\t\t\t.deleteAll(fichaLeituraRepository.findByContratoIdAndStatus(id, StatusActiv.ABERTO.getDescricao()));\n\t\texcluirParcelas(movement);\n\t\tmovement.setValor(contrato.getTotal());\n\t\tDateTime dt;\n\t\tDateTime dt12;\n\n\t\t//if (movement.getFaturasQuit().size() > 0) {\n\n\t\t\t//dt = new DateTime(movement.getFaturasQuit().get(0).getDataVencimento());\n\t\t\tdt = new DateTime();\n\t\t\tint ano = dt.getYear();\n\t\t\tint mes = dt.getMonthOfYear();\n\t\t\tdt = new DateTime(ano, mes, contrato.getDiaVencimento(), 8, 0); \n\t\t\tdt12 = new DateTime(ano, mes, contrato.getDiaLeitura(), 8, 0); \n\n\t\t/*} \n\t\telse {\n\t\t\tdt = new DateTime();\n\t\t\tint ano = dt.getYear();\n\t\t\tint mes = dt.getMonthOfYear();\n\t\t\tdt12 = new DateTime(ano, mes, contrato.getDiaLeitura(), 8, 0);\n\t\t}*/\n\t\t/*DateTime dt1 = new DateTime(new Date());\n\t\tfor (Fatura itemmovimento : movement.getFaturasQuit()) {\n\t\t\tdt1 = new DateTime(itemmovimento.getDataVencimento());\n\t\t\tif (dt1.isAfter(dt)) {\n\t\t\t\tdt = dt1;\n\t\t\t}\n\t\t\tif (dt1.isAfter(dt12)) {\n\t\t\t\tdt12 = dt1;\n\t\t\t}\n\n\t\t}\n\t\tdt1 = dt12;*/\n\t\tDateTime plusPeriod = new DateTime();\n\t\tDateTime plusPeriodleitura = new DateTime();\n\t\tFatura itemmovimento;\n\t\tint j = movement.getParcela() - movement.getFaturasQuit().size();\n\t\tList<Integer> indiceparcalas = new LinkedList<Integer>();\n\t\tindiceparcalas = maxparcela(movement, j);\n\t\tdouble valr1 = contrato.getTotal();// getValorAberto() / j;\n\n\t\tList<FichaLeitura> fichas = new ArrayList<>();\n\t\tfor (int i = 0; i < j; i++) {\n\t\t\titemmovimento = new Fatura(movement, (movement.getValor() - movement.getValorAberto()));\n\t\t\tplusPeriod = dt.plus(org.joda.time.Period.months(i));\n\t\t\tplusPeriodleitura = dt12.plus(org.joda.time.Period.months(i));\n\t\t\tint dayOfWeekEndDateNumber = Integer.valueOf(plusPeriod.dayOfWeek().getAsString());\n\t\t\tint DaysToAdd;\n\t\t\t// se final de semana\n\t\t\tif (dayOfWeekEndDateNumber == 6 || dayOfWeekEndDateNumber == 7) {\n\t\t\t\tDaysToAdd = 8 - dayOfWeekEndDateNumber;\n\t\t\t\tplusPeriod = plusPeriod.plusDays(DaysToAdd);\n\t\t\t\tdayOfWeekEndDateNumber = Integer.valueOf(plusPeriod.dayOfWeek().getAsString());\n\t\t\t}\n\n\t\t\tdayOfWeekEndDateNumber = Integer.valueOf(plusPeriodleitura.dayOfWeek().getAsString());\n\n\t\t\t// se final de semana\n\t\t\tif (dayOfWeekEndDateNumber == 6 || dayOfWeekEndDateNumber == 7) {\n\t\t\t\tDaysToAdd = 8 - dayOfWeekEndDateNumber;\n\t\t\t\tplusPeriodleitura = plusPeriodleitura.plusDays(DaysToAdd);\n\t\t\t\tdayOfWeekEndDateNumber = Integer.valueOf(plusPeriod.dayOfWeek().getAsString());\n\t\t\t}\n\n\t\t\titemmovimento.setParcela(indiceparcalas.get(i));\n\t\t\titemmovimento.setValor(contrato.getTotal());\n\t\t\titemmovimento.setDataVencimento(plusPeriod.toDate());\n\t\t\titemmovimento.setDataleitura(plusPeriodleitura.toDate());\n\t\t\titemmovimento.setInstantCreation(new Date());\n\t\t\titemmovimento.setStatus(StatusActiv.ABERTO.getDescricao());\n\t\t\titemmovimento.setMovimentoFinanceiro(movement);\n\t\t\titemmovimento.setContrato(contrato);\n\t\t\titemmovimento.setDataMovimento(movement.getDataMovimento());\n\t\t\titemmovimento.setTipomovimento(TipoMovimentoEnum.entradaContrato.getDescricao());\n\n\t\t\t/*\n\t\t\t * FichaLeitura fichaLeitura = new FichaLeitura(contrato, equipamentoContrato,\n\t\t\t * itemmovimento.getDataleitura(), StatusActiv.ABERTO.getDescricao());\n\t\t\t */\n\n\t\t\tCentroCusto centroCusto = centroCustoRepository.findById(movement.getHistorico().getCentrocusto().getId())\n\t\t\t\t\t.get();\n\t\t\tcentroCusto.setSaldoReceber(centroCusto.getSaldoReceber() + (contrato.getTotal()));\n\n\t\t\tcentroCustoRepository.save(centroCusto);\n\t\t\titemmovimento = faturaRepository.save(itemmovimento);\n\t\t\tfor (EquipamentosContrato equipamentoContrato : contrato.getEquipamentosContratos()) {\n\t\t\t\tfichas.add(new FichaLeitura(contrato, equipamentoContrato, itemmovimento.getDataleitura(),\n\t\t\t\t\t\tStatusActiv.ABERTO.getDescricao(), itemmovimento));\n\t\t\t}\n\n\t\t}\n\t\tfichaLeituraRepository.saveAll(fichas);\n\n\t}", "void gettingBackToInitial(){\n robot.setDrivetrainPosition(-hittingMineralDistance, \"translation\", 1.0);\n }", "public Dipendente() {\r\n\t\tsetnMat();\r\n\t}", "void rozpiszKontraktyPart2NoEV(int index,float wolumenHandlu, float sumaKupna,float sumaSprzedazy )\n\t{\n\t\tArrayList<Prosument> listaProsumentowTrue =listaProsumentowWrap.getListaProsumentow();\n\t\t\n\n\t\tint a=0;\n\t\twhile (a<listaProsumentowTrue.size())\n\t\t{\n\t\t\t\t\t\t\n\t\t\t// ustala bianrke kupuj\n\t\t\t// ustala clakowita sprzedaz (jako consumption)\n\t\t\t//ustala calkowite kupno (jako generacje)\n\t\t\tDayData constrainMarker = new DayData();\n\t\t\t\n\t\t\tArrayList<Point> L1\t=listaFunkcjiUzytecznosci.get(a);\n\t\t\t\n\t\t\t//energia jaka zadeklarowal prosument ze sprzeda/kupi\n\t\t\tfloat energia = L1.get(index).getIloscEnergiiDoKupienia();\n\t\t\t\n\t\t\tif (energia>0)\n\t\t\t{\n\t\t\t\tfloat iloscEnergiiDoKupienia = energia/sumaKupna*wolumenHandlu;\n\t\t\t\t\n\t\t\t\tconstrainMarker.setKupuj(1);\n\t\t\t\tconstrainMarker.setGeneration(iloscEnergiiDoKupienia);\n\t\t\t\t\n\t\t\t\trynekHistory.ustawBetaDlaWynikowHandlu(iloscEnergiiDoKupienia,a);\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfloat iloscEnergiiDoSprzedania = energia/sumaSprzedazy*wolumenHandlu;\n\n\t\t\t\t\n\t\t\t\tconstrainMarker.setKupuj(0);\n\t\t\t\tconstrainMarker.setConsumption(iloscEnergiiDoSprzedania);\n\t\t\t\t\n\t\t\t\trynekHistory.ustawBetaDlaWynikowHandlu(iloscEnergiiDoSprzedania,a);\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tArrayList<Float> priceVector = priceVectorsList.get(priceVectorsList.size()-1);\n\t\t\t\n\t\t\t//poinformuj prosumenta o wyniakch handlu i dostosuj go do wynikow\n\t\t\tlistaProsumentowTrue.get(a).getKontrakt(priceVector,constrainMarker);\n\t\t\t\n\t\t\ta++;\n\t\t}\n\t}", "private void hienThiSuDung(){\n SuDungService suDungService = new SuDungService();\n suDungModels = suDungService.layToanBoSuDung();\n \n modelSuDung.setRowCount(0);\n for (SuDungModel suDungModel : suDungModels) {\n Vector vtRow = new Vector();\n vtRow.add(suDungModel.getMaDV());\n vtRow.add(suDungModel.getMaKH());\n vtRow.add(suDungModel.getNgaySD());\n vtRow.add(suDungModel.getGiaDV());\n modelSuDung.addRow(vtRow);\n }\n }", "public void nourrir() {\n if (!autoriseOperation()) {\n return;\n }\n\n incrFaim(-2);\n incrPoids(1);\n incrHumeur(1);\n incrXp(1);\n\n System.out.println(tamagoStats.getXp());\n setChanged();\n notifyObservers();\n\n }", "public void hentTrekk() {\n\n Parti parti = this.fp_liste_parti.getSelectionModel().getSelectedItem();\n\n if (this.partierLastet && parti != null){\n\n valgtParti = fp_liste_parti.getSelectionModel().getSelectedItem();\n\n for(Trekk t: valgtParti.getTrekkListe()) {\n sp_liste_trekk.getItems().add(t);\n }\n\n tab_pane.getSelectionModel().select(tab_sp);\n\n this.initierAnimasjon();\n\n } else {\n\n Sjakkbrett.visFeil(\"Parti ikke valgt\", \"Du har ikke valgt et parti\", \"Vennligst velg et parti!\");\n\n }\n\n this.sp_knapp_forrige_trekk.setDisable(false);\n this.sp_knapp_spill_av_pause.setDisable(false);\n this.sp_knapp_neste_trekk.setDisable(false);\n this.sp_kombo_hastighet.setDisable(false);\n this.sp_knapp_velg_trekk.setDisable(false);\n\n }", "public void crearGloboAmarillo(int tiempo){ \n GloboAmarillo globoa = new GloboAmarillo();\n globoslista.add(globoa);\n double posicionx = generarPosicionX();\n globoa.fijarPosicion(posicionx);\n gpane.getChildren().addAll(globoa);\n MoverGlobo mv = new MoverGlobo(globoa,tiempo);\n mov= new Thread(mv);\n mov.start(); \n }", "public void run() {\n PopulationFGA<Integer> poblacionActual = new PopulationFGA<>(funcionBorn,\n funcionFitness,\n problema.getDimension(),\n 1);\n poblacionActual.incializa(200);\n while(!condTerminacion.conditionReached(poblacionActual)) {\n System.out.println(\"Generacion Actual: \" + poblacionActual.getGeneracion());\n poblacionActual = iteration(poblacionActual);\n }\n ArrayList<IndividualFGA<Integer>> individuos = poblacionActual.generaIndividuos();\n IndividualFGA<Integer> mejor = individuos.get(0);\n for (IndividualFGA<Integer> e : individuos) {\n if (mejor.getFitness() <= e.getFitness())\n mejor = e;\n }\n System.out.println(\"Mejor solucion \" + '\\n' + mejor.toString());\n //System.out.println(\"Fitness \" + mejor.getFitness());\n int dim = problema.getDimension();\n int costo = 0;\n int obj1;\n int obj2;\n Phenotype<Integer> fenotipo = mejor.getRepActual();\n for (int i = 0; i < (dim - 1); i++) {\n obj1 = fenotipo.getAllele(i).intValue() - 1;\n for (int j = i + 1; j < dim; j++) {\n obj2 =fenotipo.getAllele(j).intValue() - 1; \n costo = costo + problema.getDistanciaEntre(i,j) * problema.getFlujoEntre(obj1,obj2);\n }\n }\n System.out.println(\"Costo de la solucion: \" + costo);\n\n }", "private void aggiornamento()\n {\n\t gestoreTasti.aggiornamento();\n\t \n\t /*Se lo stato di gioco esiste eseguiamo il suo aggiornamento.*/\n if(Stato.getStato() != null)\n {\n \t Stato.getStato().aggiornamento();\n }\n }", "NCModel getModel();", "@Override\n public void cantidad_Ataque(){\n ataque=5+2*nivel+aumentoT;\n }", "@Override\n\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\tmouseMoved(e);\n\t\t\tint moveX= (int) e.getPoint().getX();//abscisse actuelle de ma souris \n\t\t\tint moveY= (int) e.getPoint().getY();//ordonnee actuelle de ma souris \n\t\t\tif (avantX>moveX){//l'abscisse est plus grand qu'avant ca veut dire qu'on est allr vers la droite avec la souris.\n\t\t\t\tmX++;\n\t\t\t}\n\t\t\telse if (avantX<moveX){//l'abscisse est plus petit qu'avant ca veut dire qu'on est alle vers la gauche avec la souris.\n\t\t\t\tmX--;\n\t\t\t}\n\t\t\tif (avantY>moveY){//l'ordonnee est plus petit qu'avant ca veut dire qu'on est alle vers le haut avec la souris.\n\t\t\t\tmY++;\n\t\t\t}\n\t\t\telse if (avantY<moveY ){//l'ordonnee est plus grand qu'avant ca veut dire qu'on est alle vers le bas avec la souris.\n\t\t\t\tmY--;\n\t\t\t}\n\t\t\t//j'enregistre les positions actuelles.\n\t\t\tavantX=moveX;\n\t\t\tavantY=moveY;\n\t\t\tdeplacementMinimap();\n\t\t}", "public GrapheIndicateursProjet (Projet p) {\n seuils = p.getSeuilFixes() ;\n \n // pour l'echelle, on determine les mesures max de toutes les iterations\n \n \n iterations = p.getListeIt() ; \n nbIt = iterations.size() ;\n \n // calcul des maximums\n Iteration tempIt = null ;\n IndicateursIteration tempIndIt = null ;\n for (int i = 0 ; i < nbIt ; i++)\n {\n if (iterations.get(i) instanceof Iteration)\n {\n tempIt = (Iteration)iterations.get(i) ;\n tempIndIt = tempIt.getIndicateursIteration() ;\n // charges\n if (tempIndIt.getTotalCharges() > chargesMax) { chargesMax = tempIndIt.getTotalCharges() ; }\n\t\tif (tempIndIt.getChargeMoyenneParticipants() > moyenneChargesMax) { moyenneChargesMax = tempIndIt.getChargeMoyenneParticipants() ; }\n\t\tif (tempIndIt.getNombreParticipants() > participantsMax) { participantsMax = tempIndIt.getNombreParticipants() ; }\n\t\tif (tempIndIt.getNombreTachesTerminees() > tachesTermineesMax) { tachesTermineesMax = tempIndIt.getNombreTachesTerminees() ; }\n\t\tif (tempIndIt.getNombreMoyenTachesParticipants() > tachesParticipantsMax) { tachesParticipantsMax = tempIndIt.getNombreMoyenTachesParticipants() ; }\n\t\tif (tempIndIt.getDureeMoyenneTaches() > dureeMoyenneTacheMax) { dureeMoyenneTacheMax = tempIndIt.getDureeMoyenneTaches() ; }\n }\n }\n setPreferredSize(new Dimension(ITERATION_WIDTH * nbIt,440));\n\t//setBorder(new TitledBorder(new EtchedBorder(), \"toto\", 5, TitledBorder.ABOVE_TOP)) ;\n }", "private void MembentukListHuruf(){\n for(int i = 0; i < Panjang; i ++){\n Huruf Hrf = new Huruf();\n Hrf.CurrHrf = Kata.charAt(i);\n if(!IsVertikal){\n //horizontal\n Hrf.IdX = StartIdxX;\n Hrf.IdY = StartIdxY+i;\n }else{\n Hrf.IdX = StartIdxX+i;\n Hrf.IdY = StartIdxY;\n }\n // System.out.println(\"iniii \"+Hrf.IdX+\" \"+Hrf.IdY+\" \"+Hrf.CurrHrf+\" \"+NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].AddNoSoal(NoSoal);\n TTS.Kolom[Hrf.IdX][Hrf.IdY].Huruf=Hrf.CurrHrf;\n \n }\n }" ]
[ "0.6000608", "0.58047956", "0.56970406", "0.55994594", "0.5564809", "0.5546096", "0.5536125", "0.5492582", "0.54904824", "0.5488643", "0.5477612", "0.54392636", "0.54141104", "0.5413945", "0.5410896", "0.54092723", "0.540606", "0.5401643", "0.53972626", "0.53712034", "0.53695065", "0.53602767", "0.53349745", "0.533171", "0.5309138", "0.5308188", "0.5304456", "0.52837986", "0.5283478", "0.5283245", "0.5282452", "0.52794874", "0.526972", "0.52697194", "0.526416", "0.52553916", "0.52480286", "0.52453136", "0.5236607", "0.52329755", "0.5232365", "0.52233297", "0.5219799", "0.52012694", "0.5195686", "0.5189983", "0.5187345", "0.5182673", "0.51815873", "0.517927", "0.5174069", "0.51735157", "0.5169884", "0.5168721", "0.5166767", "0.51662", "0.51610315", "0.5160792", "0.5159069", "0.5158929", "0.51585007", "0.5153726", "0.5144609", "0.5144072", "0.51359195", "0.5130607", "0.51283425", "0.51242256", "0.5124151", "0.5123125", "0.5118966", "0.5117828", "0.51153076", "0.5113695", "0.51131284", "0.5112021", "0.510975", "0.51052165", "0.51040196", "0.5100912", "0.51004636", "0.5096166", "0.5096097", "0.50930583", "0.5092234", "0.50920403", "0.5090543", "0.5090271", "0.5088496", "0.50870067", "0.508437", "0.50796187", "0.50751716", "0.507472", "0.50736564", "0.5073479", "0.5060227", "0.50589526", "0.5057894", "0.5056832", "0.50549304" ]
0.0
-1
Instantiates a new User.
public User() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User() {\n log.debug(\"Create a User object\");\n }", "public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = input.nextString();\n return new User(name, surname);\n }", "public User() {\n this.id = 0;\n this.username = \"gfisher\";\n this.password = \"password\";\n this.email = \"[email protected]\";\n this.firstname = \"Gene\";\n this.lastname = \"Fisher\";\n this.type = new UserPermission(true, true, true, true);\n }", "User createUser();", "public User(){}", "public User(){}", "public User(){}", "public User() { }", "private Appuser newUser() {\n //TODO: get logged user from security context\n String createdBy = \"REST\";\n Appuser au = new Appuser();\n Userdetails ud = new Userdetails();\n boolean idOK = false;\n Long id = 0L;\n while (!idOK) {\n id = EntityIdGenerator.random();\n idOK = !userRepository.exists(id);\n }\n //notNull\n ud.setNotes(\"none\");\n au.setPasswdHash(\"*\");\n au.setCreatedBy(createdBy);\n au.setUserId(id);\n ud.setUserId(id);\n au.setUserdetails(ud);\n return au;\n }", "public User() {\r\n \r\n }", "public User() {\n }", "public User() {\r\n\t}", "public User() {\r\n }", "User()\n\t{\n\n\t}", "public User() {\r\n\r\n\t}", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n\t}", "public IUser CreateUser() {\n\t\tIUser iUser = null;\n\t\tswitch (db) {\n\t\tcase \"Mysql\":\n\t\t\tiUser = new MysqlUserImpl();\n\t\t\tbreak;\n\t\tcase \"Access\":\n\t\t\tiUser = new AccessUserImpl();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn iUser;\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\n\t}", "public User() {\n\n }", "public User()\n\t{\n\t}", "public User() {\n super();\n }", "public User() {\n super();\n }", "public User() {\n\t\tsuper(AppEntityCodes.USER);\n\t}", "public User()\n\t{\n\t\tfirstName = \"\";\n\t\tlastName = \"\";\n\t\tusername = \"\";\n\t\tpassword = \"\";\n\t}", "User createUser(UserCreationModel user);", "public void createUser(User user);", "public static User createUser(String id) {\n\n User user = new User();\n user.setId(id);\n\n return user;\n }", "public DbUser() {\r\n\t}", "protected User() {}", "protected User() {}", "public User(){\n }", "public User(String name) {\n this(UUID.randomUUID().toString(), name, String.format(\"User account for %s\", name) );\n }", "@Override\n\tpublic User createNewUser(Account account) {\n\t\treturn new User(account);\n\t\t\n\t}", "public void createUser(User user) {\n\n\t}", "public static createNewUser newInstance() {\n createNewUser fragment = new createNewUser();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "User createUser(User user);", "public User(){\n\n }", "public User(){\n this(null, null);\n }", "public User() {\r\n this(\"\", \"\");\r\n }", "public void newUser(User user);", "private User() {}", "public IdentifiedUser createNewUser() {\n\t\treturn new Gamer();\n\t}", "public User()\r\n\t{\r\n\t\tthis.userId = 0;\r\n\t\tthis.userName = \"\";\r\n\t\tthis.role = \"\";\r\n\t\tthis.firstName = \"\";\r\n\t\tthis.lastName = \"\";\r\n\t\tthis.emailAddress = \"\";\r\n\t\tthis.streetAddress = \"\";\r\n\t\tthis.city = \"\";\r\n\t\tthis.state = \"\";\r\n\t\tthis.zip = 0;\r\n\t\tthis.country = \"\";\r\n\t}", "public User() throws InvalidUserDataException {\n this(DEFAULT_ID, DEFAULT_PASSWORD, DEFAULT_FIRST_NAME, \n DEFAULT_LAST_NAME, DEFAULT_EMAIL_ADDRESS, new Date(), \n new Date(), DEFAULT_TYPE, DEFAULT_ENABLED_STATUS);\n }", "protected User() {\n }", "public User(String username, String password) {\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = password;\n this.isTechAgent = false;\n }", "public User() {\n uid= 0;\n username = \"\";\n password = \"\";\n role = \"user\";\n status = false;\n updatedTime = new Timestamp(0);\n }", "User create(User user);", "private User() {\n }", "public User(String uId, String email, String password) \n\t{\n\t\tthis.userId = uId;\n\t\tthis.accDetails = AccountDetails.create(uId,email,password);\n this.credit = Credit.create(uId);\n }", "public User() {\n username = null;\n password = null;\n email = null;\n firstName = null;\n lastName = null;\n gender = null;\n personID = null;\n }", "public User(String _username, String _password, String _employeeType) {\n // TODO implement here\n username = _username;\n password = _password;\n employeeType = _employeeType;\n// String taskId = UUID.randomUUID().toString();\n }", "private User createWithParameters(Map<String, String> userParameters) {\n User user = new User();\n String passHashed = BCrypt.hashpw(userParameters.get(PASSWORD_PARAMETER_NAME), BCrypt.gensalt());\n user.setUsername(userParameters.get(USERNAME_PARAMETER_NAME));\n user.setPassword(passHashed);\n user.setFirstName(userParameters.get(FIRST_NAME_PARAMETER_NAME));\n user.setLastName(userParameters.get(LAST_NAME_PARAMETER_NAME));\n user.setEmail(userParameters.get(EMAIL_PARAMETER_NAME));\n user.setPhone(userParameters.get(PHONE_PARAMETER_NAME));\n user.setAddress(userParameters.get(ADDRESS_PARAMETER_NAME));\n user.setAccount(BigDecimal.ZERO);\n user.setInitDate(LocalDate.now());\n user.setBlockedUntil(LocalDate.now());\n user.setRole(User.Role.USER);\n return user;\n }", "public User(String firstName, String lastName, Long userid, String email, String password, String userName) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.userid = userid;\n this.email = email;\n this.password = password;\n this.userName = userName;\n\n createContributorPrivilege();\n }", "public static User createUser(Integer userId, String firstName, String lastName,\r\n\t\t\tString email, String userName, String companyName) {\r\n\t\tUser user = new User();\r\n\t\tif (userId != null) {\r\n\t\t\tuser.setUserId(userId);\r\n\t\t}\r\n\t\tuser.setFirstName(firstName);\r\n\t\tuser.setLastName(lastName);\r\n\t\tuser.setEmail(email);\r\n\t\tuser.setUserName(userName);\r\n\t\tuser.setCompanyName(companyName); \r\n\t\treturn user;\r\n\t}", "public JpaUser() {\n }", "UserCreateResponse createUser(UserCreateRequest request);", "public UserProfile() {}", "private User createUser(org.picketlink.idm.model.User picketLinkUser) {\n User user = new User(picketLinkUser.getLoginName());\n user.setFullName(picketLinkUser.getFirstName() + \" \" + picketLinkUser.getLastName());\n user.setShortName(picketLinkUser.getLastName());\n return user;\n }", "public User() {\n\tsuper();\n}", "User(String userID, String password, String firstName, String lastName) {\n this.userID = userID;\n this.password = password;\n this.firstName = firstName;\n this.lastName = lastName;\n }", "public UserBuilder() {\n this.user = new User();\n }", "@Override\n public User createFromParcel(Parcel in) {\n return new User(in);\n }", "CreateUserResult createUser(CreateUserRequest createUserRequest);", "public iUser createUser(int id) {\n iUser user = null;\n String username = getUsername();\n String password = getPassword();\n\n boolean confirmed = confirmed(id, username);\n if (confirmed) {\n user = registerOptions(username, password, id);\n }\n return user;\n }", "public UserAccount() {\n\n\t}", "public User() {\r\n // TODO - implement User.User\r\n throw new UnsupportedOperationException();\r\n }", "public static User newInstance(String account, String password, String name, boolean isFemale) {\n User user = new User();\n user.account = account;\n user.password = password;\n user.name = name;\n user.isFemale = isFemale;\n user.createdDateTime = DateTimeUtil.getCurrentDateTime(); // Automatically generates the date & time.\n return user;\n }", "public UserModel() throws IOException {\n userManager = new UserManager();\n }", "public User createUser(UserDTO userDto) {\n User user = new User();\n user.setLogin(userDto.getLogin());\n user.setFirstName(userDto.getFirstName());\n user.setLastName(userDto.getLastName());\n user.setEmail(userDto.getEmail());\n if (userDto.getLangKey() == null) {\n user.setLangKey(\"en\"); // default language\n } else {\n user.setLangKey(userDto.getLangKey());\n }\n String encryptedPassword = passwordEncoder.encode(RandomUtil.generatePassword());\n user.setPassword(encryptedPassword);\n user.setResetKey(RandomUtil.generateResetKey());\n user.setResetDate(ZonedDateTime.now());\n user.setActivated(false);\n\n user.setRoles(getUserRoles(userDto));\n userRepository.save(user);\n log.debug(\"Created Information for User: {}\", user);\n return user;\n }", "public User(Long id) {\n\t\tsuper(id, AppEntityCodes.USER);\n\t}", "public UserAccount() {\n }", "public User(String firstName, String lastName, String email, String password, String userName) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.email = email;\n this.password = password;\n this.userName = userName;\n\n createContributorPrivilege();\n }", "private void createUser(final String email, final String password) {\n\n }", "public static void createUser(String fname, String lname, String username, String password) {\n\t\tUser newUser = new User(fname, lname, username, password);\t\n\t}", "public User() {\n this.username = \"test\";\n }", "public UserManager() {\n }", "public User() {\n this.firstName = \"Lorenzo\";\n this.lastName = \"Malferrari\";\n this.username = \"[email protected]\";\n this.email = \"[email protected]\";\n this.password = \"123456\";\n this.city = \"Bologna\";\n this.country = \"Italia\";\n this.gender = \"Maschio\";\n this.birthdate = new Date();\n this.age = 21;\n this.imgUser = 1;\n this.last_access = new Date();\n this.registration_date = new Date();\n }", "public User() {\r\n\t\tuName = null;\r\n\t\tpassword = null;\r\n\t\tfullName = null;\r\n\t\tphone = null;\r\n\t\temail = null;\r\n\t}", "public Users() {}", "protected User(){\n this.username = null;\n this.password = null;\n this.accessLevel = null;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n }", "public AppUser() {\r\n\t\tsuper();\r\n\t}" ]
[ "0.7582088", "0.73480594", "0.7273225", "0.7200439", "0.71243304", "0.71243304", "0.71243304", "0.711101", "0.71006274", "0.707437", "0.70445484", "0.70134807", "0.70035017", "0.6995122", "0.6994287", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.6974036", "0.69645983", "0.69595885", "0.69595885", "0.69595885", "0.6958612", "0.69316727", "0.69066805", "0.6905054", "0.6905054", "0.68684435", "0.68493235", "0.68088025", "0.68073004", "0.6801815", "0.6782993", "0.67817426", "0.67817426", "0.67659324", "0.6757833", "0.6753429", "0.6751958", "0.67298645", "0.6716966", "0.6696123", "0.6690816", "0.6689577", "0.66872203", "0.66758394", "0.6652559", "0.66393614", "0.6637278", "0.6622515", "0.6613412", "0.6612878", "0.66108733", "0.66041833", "0.65853554", "0.6569846", "0.6538645", "0.65385073", "0.65357715", "0.6517077", "0.64981276", "0.64933026", "0.6487315", "0.6486772", "0.6478756", "0.6472035", "0.6467129", "0.6462921", "0.64621407", "0.64589614", "0.645698", "0.6455436", "0.6454449", "0.64539886", "0.6452546", "0.6445076", "0.6444465", "0.64360875", "0.643585", "0.64346457", "0.6431079", "0.6423939", "0.6423929", "0.6415369", "0.6414354", "0.64077675", "0.63974744" ]
0.71821743
6
Instantiates a new User no id
public User(String firstName, String lastName, String email, String password, String userName) { this(); this.firstName = firstName; this.lastName = lastName; this.email = email; this.password = password; this.userName = userName; createContributorPrivilege(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Appuser newUser() {\n //TODO: get logged user from security context\n String createdBy = \"REST\";\n Appuser au = new Appuser();\n Userdetails ud = new Userdetails();\n boolean idOK = false;\n Long id = 0L;\n while (!idOK) {\n id = EntityIdGenerator.random();\n idOK = !userRepository.exists(id);\n }\n //notNull\n ud.setNotes(\"none\");\n au.setPasswdHash(\"*\");\n au.setCreatedBy(createdBy);\n au.setUserId(id);\n ud.setUserId(id);\n au.setUserdetails(ud);\n return au;\n }", "User createUser();", "public User() {}", "public User() {}", "public User() {}", "public User() {\n this.id = 0;\n this.username = \"gfisher\";\n this.password = \"password\";\n this.email = \"[email protected]\";\n this.firstname = \"Gene\";\n this.lastname = \"Fisher\";\n this.type = new UserPermission(true, true, true, true);\n }", "static User create(int id){\n return Users.isMyID(id) ? new LoggedUser(id) : new User(id);\n }", "public User() {\n log.debug(\"Create a User object\");\n }", "public User(){}", "public User(){}", "public User(){}", "public static User createUser(String id) {\n\n User user = new User();\n user.setId(id);\n\n return user;\n }", "public User() {\r\n \r\n }", "public User() { }", "public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = input.nextString();\n return new User(name, surname);\n }", "User()\n\t{\n\n\t}", "public User() {\r\n }", "public User(Long id) {\n\t\tsuper(id, AppEntityCodes.USER);\n\t}", "public void newUser(User user);", "public User() {\r\n\r\n\t}", "public User() {\r\n\t}", "public User() {\n }", "public IUser CreateUser() {\n\t\tIUser iUser = null;\n\t\tswitch (db) {\n\t\tcase \"Mysql\":\n\t\t\tiUser = new MysqlUserImpl();\n\t\t\tbreak;\n\t\tcase \"Access\":\n\t\t\tiUser = new AccessUserImpl();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn iUser;\n\t}", "public User() {\n\t}", "public void createUser(User user);", "public User(){\n this(null, null);\n }", "public iUser createUser(int id) {\n iUser user = null;\n String username = getUsername();\n String password = getPassword();\n\n boolean confirmed = confirmed(id, username);\n if (confirmed) {\n user = registerOptions(username, password, id);\n }\n return user;\n }", "public User() {\r\n this(\"\", \"\");\r\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n super();\n }", "public User() {\n super();\n }", "public User() {\n\n }", "public DbUser() {\r\n\t}", "public User() {\n\t\tsuper(AppEntityCodes.USER);\n\t}", "public User()\n\t{\n\t}", "private User() {}", "public User() {\n uid= 0;\n username = \"\";\n password = \"\";\n role = \"user\";\n status = false;\n updatedTime = new Timestamp(0);\n }", "public User()\r\n\t{\r\n\t\tthis.userId = 0;\r\n\t\tthis.userName = \"\";\r\n\t\tthis.role = \"\";\r\n\t\tthis.firstName = \"\";\r\n\t\tthis.lastName = \"\";\r\n\t\tthis.emailAddress = \"\";\r\n\t\tthis.streetAddress = \"\";\r\n\t\tthis.city = \"\";\r\n\t\tthis.state = \"\";\r\n\t\tthis.zip = 0;\r\n\t\tthis.country = \"\";\r\n\t}", "protected User() {}", "protected User() {}", "public void createUser(User user) {\n\n\t}", "User createUser(User user);", "public User(long userId) {\n this.id = userId;\n }", "public static createNewUser newInstance() {\n createNewUser fragment = new createNewUser();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public User(){\r\n this.id = 0;\r\n this.firstName = null;\r\n this.lastName = null;\r\n }", "public IdentifiedUser createNewUser() {\n\t\treturn new Gamer();\n\t}", "private User createDummyUser(String userId) {\n\n return new User(userId, \"Usr_\" + userId, new ArrayList<ShoppingList>());\n }", "public User(){\n }", "public User(long id, String username, String email, String password) {\n this.id = id;\n this.username = username;\n this.email = email;\n this.password = password;\n}", "public User()\n\t{\n\t\tfirstName = \"\";\n\t\tlastName = \"\";\n\t\tusername = \"\";\n\t\tpassword = \"\";\n\t}", "public User(){\n\n }", "@Override\n\tpublic User createNewUser(Account account) {\n\t\treturn new User(account);\n\t\t\n\t}", "public TUser() {\n this(\"t_user\", null);\n }", "public User(int user_id, String full_name, String address, String postal_code, int mobile_no,\n String snow_zone, String garbage_day, String password){\n this.user_id = user_id;\n this.full_name = full_name;\n this.address = address;\n this.postal_code = postal_code;\n this.mobile_no = mobile_no;\n this.snow_zone = snow_zone;\n this.garbage_day = garbage_day;\n this.password = password;\n\n }", "public User() {\n username = null;\n password = null;\n email = null;\n firstName = null;\n lastName = null;\n gender = null;\n personID = null;\n }", "User create(User user);", "@Test\n void createUserReturnsNull() {\n Address address = new Address(\"Earth\", \"Belgium\", \"City\", \"Street\", 0);\n User user = new User(\"Mira\", \"Vogelsang\", \"0412345678\", \"maarten@maarten\", \"pass\", address);\n\n assertNull(controller.createUser(user));\n }", "private User() {\n }", "User createUser(UserCreationModel user);", "public Users() {}", "public User(String username, String password) {\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = password;\n this.isTechAgent = false;\n }", "public User() {\n name = \"\";\n }", "Human_User createHuman_User();", "public User(String _username, String _password, String _employeeType) {\n // TODO implement here\n username = _username;\n password = _password;\n employeeType = _employeeType;\n// String taskId = UUID.randomUUID().toString();\n }", "Utilizator createUser(String username, String password, String nume,\n\t\t\tString prenume, String tip, String aux);", "public User(String name) {\n this(UUID.randomUUID().toString(), name, String.format(\"User account for %s\", name) );\n }", "public User() {\n\tsuper();\n}", "public UserProfile() {}", "int newUser(String username, String password, Time creationTime);", "protected User() {\n }", "public User() {\r\n // TODO - implement User.User\r\n throw new UnsupportedOperationException();\r\n }", "public GameUser() {\n\t}", "public User(int aId, String aFirstName, String aLastName){\r\n this.id = aId;\r\n this.firstName = aFirstName;\r\n this.lastName = aLastName;\r\n }", "public User(String username,\n String firstname,\n String lastname) {\n //create userId\n int newID = numOfObjects + 1;\n String userId = username + \"_\" + newID;\n\n this.userId = userId;\n this.username = username;\n this.firstname = firstname;\n this.lastname = lastname;\n this.calendarsOwned = new ArrayList<Calendar_>();\n this.eventsOwned = new ArrayList<Event>();\n\n //update object counter\n numOfObjects++;\n }", "UserCreateResponse createUser(UserCreateRequest request);", "public UserRecord(Integer idUser, String name, String surname, String title, LocalDateTime dateBirth, LocalDateTime dateCreate, LocalDateTime dateUpdate, LocalDateTime dateDelete, String govId, String username, String password, String email, String gender, String status) {\n super(User.USER);\n\n set(0, idUser);\n set(1, name);\n set(2, surname);\n set(3, title);\n set(4, dateBirth);\n set(5, dateCreate);\n set(6, dateUpdate);\n set(7, dateDelete);\n set(8, govId);\n set(9, username);\n set(10, password);\n set(11, email);\n set(12, gender);\n set(13, status);\n }", "public User(Long id,com.institucion.fm.security.model.User user){\n\t\tthis.id=id;\n\t\tthis.user=user;\n\t}", "public User(String uId, String email, String password) \n\t{\n\t\tthis.userId = uId;\n\t\tthis.accDetails = AccountDetails.create(uId,email,password);\n this.credit = Credit.create(uId);\n }", "CreateUserResult createUser(CreateUserRequest createUserRequest);", "@Test\n\tpublic void newUser() {\n\n\t\tUser user = new User(\"moviewatcher\", \"$2a$10$37jGlxDwJK4mRpYqYvPmyu8mqQJfeQJVSdsyFY5UNAm9ckThf2Zqa\", \"USER\");\n\t\tuserRepository.save(user);\n\n\t\tassertThat(user).isNotNull();\n\t\tassertThat(user).hasFieldOrPropertyWithValue(\"username\", \"moviewatcher\");\n\t}", "public User(String name) {\r\n this.setName(name);\r\n this.id = ++count;\r\n\r\n }", "public User(long id, String fistname, String secondname, String username, String password, String mail){\n this.id = id;\n this.firstname = fistname;\n this.secondname = secondname;\n this.username = username;\n this.password = password;\n this.email = mail;\n }", "public User(String n) { // constructor\r\n name = n;\r\n }", "public UserEntity create(String userId) throws CreateException;", "public JpaUser() {\n }" ]
[ "0.7650244", "0.7557491", "0.7554049", "0.7554049", "0.7554049", "0.7508155", "0.7470328", "0.7452072", "0.74396074", "0.74396074", "0.74396074", "0.73701435", "0.73642164", "0.7355061", "0.7332894", "0.72844154", "0.72647625", "0.72606534", "0.72603697", "0.7258802", "0.72500306", "0.7238191", "0.71929306", "0.7190408", "0.71811604", "0.7179184", "0.71732837", "0.7172842", "0.716939", "0.716939", "0.716939", "0.716939", "0.716939", "0.716939", "0.716939", "0.716939", "0.716939", "0.716939", "0.716939", "0.716939", "0.716939", "0.71637976", "0.71558285", "0.71558285", "0.71558285", "0.71518433", "0.71518433", "0.7134102", "0.71205837", "0.7117164", "0.70925176", "0.7086423", "0.7062017", "0.70560163", "0.70462644", "0.70462644", "0.70455825", "0.7037054", "0.703518", "0.7032824", "0.70097655", "0.6996423", "0.6985299", "0.698012", "0.69291717", "0.6923696", "0.69062054", "0.6902913", "0.6898339", "0.6884558", "0.6884492", "0.6884087", "0.6881277", "0.6880742", "0.68368685", "0.6831186", "0.68297106", "0.6819314", "0.6788053", "0.6778879", "0.67736185", "0.676748", "0.67658454", "0.67623395", "0.6759933", "0.6759932", "0.6756715", "0.67446816", "0.6723572", "0.67093134", "0.67010367", "0.6699405", "0.66951466", "0.6684691", "0.6670788", "0.6666688", "0.6666234", "0.66651267", "0.66519576", "0.66447705", "0.6634434" ]
0.0
-1
Instantiates a new User.
public User(String firstName, String lastName, Long userid, String email, String password, String userName) { this(); this.firstName = firstName; this.lastName = lastName; this.userid = userid; this.email = email; this.password = password; this.userName = userName; createContributorPrivilege(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User() {\n log.debug(\"Create a User object\");\n }", "public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = input.nextString();\n return new User(name, surname);\n }", "public User() {\n this.id = 0;\n this.username = \"gfisher\";\n this.password = \"password\";\n this.email = \"[email protected]\";\n this.firstname = \"Gene\";\n this.lastname = \"Fisher\";\n this.type = new UserPermission(true, true, true, true);\n }", "User createUser();", "public User() {}", "public User() {}", "public User() {}", "public User(){}", "public User(){}", "public User(){}", "public User() { }", "private Appuser newUser() {\n //TODO: get logged user from security context\n String createdBy = \"REST\";\n Appuser au = new Appuser();\n Userdetails ud = new Userdetails();\n boolean idOK = false;\n Long id = 0L;\n while (!idOK) {\n id = EntityIdGenerator.random();\n idOK = !userRepository.exists(id);\n }\n //notNull\n ud.setNotes(\"none\");\n au.setPasswdHash(\"*\");\n au.setCreatedBy(createdBy);\n au.setUserId(id);\n ud.setUserId(id);\n au.setUserdetails(ud);\n return au;\n }", "public User() {\r\n \r\n }", "public User() {\n }", "public User() {\r\n\t}", "public User() {\r\n }", "User()\n\t{\n\n\t}", "public User() {\r\n\r\n\t}", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n }", "public User() {\n\t}", "public IUser CreateUser() {\n\t\tIUser iUser = null;\n\t\tswitch (db) {\n\t\tcase \"Mysql\":\n\t\t\tiUser = new MysqlUserImpl();\n\t\t\tbreak;\n\t\tcase \"Access\":\n\t\t\tiUser = new AccessUserImpl();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn iUser;\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\n\t}", "public User() {\n\n }", "public User()\n\t{\n\t}", "public User() {\n super();\n }", "public User() {\n super();\n }", "public User() {\n\t\tsuper(AppEntityCodes.USER);\n\t}", "public User()\n\t{\n\t\tfirstName = \"\";\n\t\tlastName = \"\";\n\t\tusername = \"\";\n\t\tpassword = \"\";\n\t}", "User createUser(UserCreationModel user);", "public void createUser(User user);", "public static User createUser(String id) {\n\n User user = new User();\n user.setId(id);\n\n return user;\n }", "public DbUser() {\r\n\t}", "protected User() {}", "protected User() {}", "public User(){\n }", "public User(String name) {\n this(UUID.randomUUID().toString(), name, String.format(\"User account for %s\", name) );\n }", "@Override\n\tpublic User createNewUser(Account account) {\n\t\treturn new User(account);\n\t\t\n\t}", "public void createUser(User user) {\n\n\t}", "public static createNewUser newInstance() {\n createNewUser fragment = new createNewUser();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "User createUser(User user);", "public User(){\n\n }", "public User(){\n this(null, null);\n }", "public User() {\r\n this(\"\", \"\");\r\n }", "public void newUser(User user);", "private User() {}", "public IdentifiedUser createNewUser() {\n\t\treturn new Gamer();\n\t}", "public User()\r\n\t{\r\n\t\tthis.userId = 0;\r\n\t\tthis.userName = \"\";\r\n\t\tthis.role = \"\";\r\n\t\tthis.firstName = \"\";\r\n\t\tthis.lastName = \"\";\r\n\t\tthis.emailAddress = \"\";\r\n\t\tthis.streetAddress = \"\";\r\n\t\tthis.city = \"\";\r\n\t\tthis.state = \"\";\r\n\t\tthis.zip = 0;\r\n\t\tthis.country = \"\";\r\n\t}", "public User() throws InvalidUserDataException {\n this(DEFAULT_ID, DEFAULT_PASSWORD, DEFAULT_FIRST_NAME, \n DEFAULT_LAST_NAME, DEFAULT_EMAIL_ADDRESS, new Date(), \n new Date(), DEFAULT_TYPE, DEFAULT_ENABLED_STATUS);\n }", "protected User() {\n }", "public User(String username, String password) {\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = password;\n this.isTechAgent = false;\n }", "public User() {\n uid= 0;\n username = \"\";\n password = \"\";\n role = \"user\";\n status = false;\n updatedTime = new Timestamp(0);\n }", "User create(User user);", "private User() {\n }", "public User(String uId, String email, String password) \n\t{\n\t\tthis.userId = uId;\n\t\tthis.accDetails = AccountDetails.create(uId,email,password);\n this.credit = Credit.create(uId);\n }", "public User() {\n username = null;\n password = null;\n email = null;\n firstName = null;\n lastName = null;\n gender = null;\n personID = null;\n }", "public User(String _username, String _password, String _employeeType) {\n // TODO implement here\n username = _username;\n password = _password;\n employeeType = _employeeType;\n// String taskId = UUID.randomUUID().toString();\n }", "private User createWithParameters(Map<String, String> userParameters) {\n User user = new User();\n String passHashed = BCrypt.hashpw(userParameters.get(PASSWORD_PARAMETER_NAME), BCrypt.gensalt());\n user.setUsername(userParameters.get(USERNAME_PARAMETER_NAME));\n user.setPassword(passHashed);\n user.setFirstName(userParameters.get(FIRST_NAME_PARAMETER_NAME));\n user.setLastName(userParameters.get(LAST_NAME_PARAMETER_NAME));\n user.setEmail(userParameters.get(EMAIL_PARAMETER_NAME));\n user.setPhone(userParameters.get(PHONE_PARAMETER_NAME));\n user.setAddress(userParameters.get(ADDRESS_PARAMETER_NAME));\n user.setAccount(BigDecimal.ZERO);\n user.setInitDate(LocalDate.now());\n user.setBlockedUntil(LocalDate.now());\n user.setRole(User.Role.USER);\n return user;\n }", "public static User createUser(Integer userId, String firstName, String lastName,\r\n\t\t\tString email, String userName, String companyName) {\r\n\t\tUser user = new User();\r\n\t\tif (userId != null) {\r\n\t\t\tuser.setUserId(userId);\r\n\t\t}\r\n\t\tuser.setFirstName(firstName);\r\n\t\tuser.setLastName(lastName);\r\n\t\tuser.setEmail(email);\r\n\t\tuser.setUserName(userName);\r\n\t\tuser.setCompanyName(companyName); \r\n\t\treturn user;\r\n\t}", "public JpaUser() {\n }", "UserCreateResponse createUser(UserCreateRequest request);", "public UserProfile() {}", "private User createUser(org.picketlink.idm.model.User picketLinkUser) {\n User user = new User(picketLinkUser.getLoginName());\n user.setFullName(picketLinkUser.getFirstName() + \" \" + picketLinkUser.getLastName());\n user.setShortName(picketLinkUser.getLastName());\n return user;\n }", "public User() {\n\tsuper();\n}", "User(String userID, String password, String firstName, String lastName) {\n this.userID = userID;\n this.password = password;\n this.firstName = firstName;\n this.lastName = lastName;\n }", "public UserBuilder() {\n this.user = new User();\n }", "@Override\n public User createFromParcel(Parcel in) {\n return new User(in);\n }", "CreateUserResult createUser(CreateUserRequest createUserRequest);", "public iUser createUser(int id) {\n iUser user = null;\n String username = getUsername();\n String password = getPassword();\n\n boolean confirmed = confirmed(id, username);\n if (confirmed) {\n user = registerOptions(username, password, id);\n }\n return user;\n }", "public UserAccount() {\n\n\t}", "public User() {\r\n // TODO - implement User.User\r\n throw new UnsupportedOperationException();\r\n }", "public static User newInstance(String account, String password, String name, boolean isFemale) {\n User user = new User();\n user.account = account;\n user.password = password;\n user.name = name;\n user.isFemale = isFemale;\n user.createdDateTime = DateTimeUtil.getCurrentDateTime(); // Automatically generates the date & time.\n return user;\n }", "public UserModel() throws IOException {\n userManager = new UserManager();\n }", "public User createUser(UserDTO userDto) {\n User user = new User();\n user.setLogin(userDto.getLogin());\n user.setFirstName(userDto.getFirstName());\n user.setLastName(userDto.getLastName());\n user.setEmail(userDto.getEmail());\n if (userDto.getLangKey() == null) {\n user.setLangKey(\"en\"); // default language\n } else {\n user.setLangKey(userDto.getLangKey());\n }\n String encryptedPassword = passwordEncoder.encode(RandomUtil.generatePassword());\n user.setPassword(encryptedPassword);\n user.setResetKey(RandomUtil.generateResetKey());\n user.setResetDate(ZonedDateTime.now());\n user.setActivated(false);\n\n user.setRoles(getUserRoles(userDto));\n userRepository.save(user);\n log.debug(\"Created Information for User: {}\", user);\n return user;\n }", "public User(Long id) {\n\t\tsuper(id, AppEntityCodes.USER);\n\t}", "public UserAccount() {\n }", "public User(String firstName, String lastName, String email, String password, String userName) {\n this();\n this.firstName = firstName;\n this.lastName = lastName;\n this.email = email;\n this.password = password;\n this.userName = userName;\n\n createContributorPrivilege();\n }", "private void createUser(final String email, final String password) {\n\n }", "public static void createUser(String fname, String lname, String username, String password) {\n\t\tUser newUser = new User(fname, lname, username, password);\t\n\t}", "public User() {\n this.username = \"test\";\n }", "public UserManager() {\n }", "public User() {\n this.firstName = \"Lorenzo\";\n this.lastName = \"Malferrari\";\n this.username = \"[email protected]\";\n this.email = \"[email protected]\";\n this.password = \"123456\";\n this.city = \"Bologna\";\n this.country = \"Italia\";\n this.gender = \"Maschio\";\n this.birthdate = new Date();\n this.age = 21;\n this.imgUser = 1;\n this.last_access = new Date();\n this.registration_date = new Date();\n }", "public User() {\r\n\t\tuName = null;\r\n\t\tpassword = null;\r\n\t\tfullName = null;\r\n\t\tphone = null;\r\n\t\temail = null;\r\n\t}", "public Users() {}", "protected User(){\n this.username = null;\n this.password = null;\n this.accessLevel = null;\n this.name = DEFAULT_NAME;\n this.telephone = DEFAULT_TELEPHONE;\n this.email = DEFAULT_EMAIL;\n }", "public AppUser() {\r\n\t\tsuper();\r\n\t}" ]
[ "0.7582088", "0.73480594", "0.7273225", "0.7200439", "0.71821743", "0.71821743", "0.71821743", "0.71243304", "0.71243304", "0.71243304", "0.711101", "0.71006274", "0.707437", "0.70445484", "0.70134807", "0.70035017", "0.6995122", "0.6994287", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.69751424", "0.6974036", "0.69645983", "0.69595885", "0.69595885", "0.69595885", "0.6958612", "0.69316727", "0.69066805", "0.6905054", "0.6905054", "0.68684435", "0.68493235", "0.68088025", "0.68073004", "0.6801815", "0.6782993", "0.67817426", "0.67817426", "0.67659324", "0.6757833", "0.6753429", "0.6751958", "0.67298645", "0.6716966", "0.6696123", "0.6690816", "0.6689577", "0.66872203", "0.66758394", "0.6652559", "0.66393614", "0.6637278", "0.6622515", "0.6613412", "0.6612878", "0.66108733", "0.66041833", "0.65853554", "0.6569846", "0.6538645", "0.65385073", "0.6517077", "0.64981276", "0.64933026", "0.6487315", "0.6486772", "0.6478756", "0.6472035", "0.6467129", "0.6462921", "0.64621407", "0.64589614", "0.645698", "0.6455436", "0.6454449", "0.64539886", "0.6452546", "0.6445076", "0.6444465", "0.64360875", "0.643585", "0.64346457", "0.6431079", "0.6423939", "0.6423929", "0.6415369", "0.6414354", "0.64077675", "0.63974744" ]
0.65357715
72
FirefoxProfile newProfile = new FirefoxProfile(); newProfile.setPreference("browser.cache.disk.enable", false); driver = new FirefoxDriver(newProfile); driver = new FirefoxDriver();
public WebDriver initializeDriver(WebDriver driver) { ChromeOptions options = new ChromeOptions(); options.addArguments("disable-infobars"); Map<String, Object> prefs = new HashMap<>(); prefs.put("credentials_enable_service", false); prefs.put("profile.password_manager_enabled", false); options.setExperimentalOption("prefs", prefs); driver = new ChromeDriver(options); driver.manage().window().maximize(); return driver; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setFirefoxDriver() throws Exception {\n\t\t// Disable cache\n\t\tffProfile.setPreference(\"browser.cache.disk.enable\", false);\n\t\tffProfile.setPreference(\"browser.cache.disk_cache_ssl\", false);\n\t\tffProfile.setPreference(\"browser.cache.memory.enable\", false);\n\t\tffProfile.setPreference(\"browser.cache.offline.enable\", false);\n\t\t// Set to download automatically\n\t\tffProfile.setPreference(\"browser.download.folderList\", 2);\n\t\tffProfile.setPreference(\"browser.download.manager.showWhenStarting\", false);\n\t\tffProfile.setPreference(\"browser.helperApps.neverAsk.saveToDisk\", \"application/zip\");\n\t\tffProfile.setPreference(\"browser.download.dir\", BasePage.myTempDownloadsFolder);// \"\\\\temp_downloads\");\n\t\t// TODO: Using \"C:\" will not work for Linux or OS X support\n\t\tFile dir = new File(BasePage.myTempDownloadsFolder);// \"\\\\temp_downloads\");\n\t\tif (!dir.exists()) {\n\t\t\tdir.mkdir();\n\t\t}\n\t\t// Disable hardware acceleration\n\t\tffProfile.setPreference(\"gfx.direct2d.disabled\", false);\n\t\tffProfile.setPreference(\"layers.acceleration.disabled\", false);\n\t\tFirefoxOptions ffOptions = new FirefoxOptions();\n\n\t\t/*\n\t\t * Set FF to run headless -- Need to make conditional from browser\n\t\t * parameter -- Does NOT work properly with all necessary tests.\n\t\t */\n\t\t// ffOptions.setHeadless(true);\n\n\t\tffOptions.setProfile(ffProfile);\n\t\tcapabilities = DesiredCapabilities.firefox();\n\t\tcapabilities.setCapability(FirefoxDriver.PROFILE, ffProfile);\n\t\tWebDriver myDriver = null;\n\t\tRemoteWebDriver rcDriver;\n\n\t\tswitch (runLocation.toLowerCase()) {\n\t\tcase \"local\":\n\t\t\tSystem.setProperty(\"webdriver.gecko.driver\", firefoxDriverLocation);\n\t\t\tmyDriver = new FirefoxDriver(ffOptions);\n\t\t\tbreak;\n\t\tcase \"grid\":\n\t\t\trcDriver = new RemoteWebDriver(new URL(serverURL), ffOptions);\n\t\t\trcDriver.setFileDetector(new LocalFileDetector());\n\t\t\tmyDriver = new Augmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tcase \"testingbot\":\n\t\t\tif (browserVersion.isEmpty()) {\n\t\t\t\tbrowserVersion = defaultFirefoxVersion;\n\t\t\t}\n\t\t\tif (platformOS.isEmpty()) {\n\t\t\t\tplatformOS = defaultPlatformOS;\n\t\t\t}\n\t\t\tcapabilities.setCapability(\"browserName\", browser);\n\t\t\tcapabilities.setCapability(\"version\", browserVersion);\n\t\t\tcapabilities.setCapability(\"platform\", platformOS);\n\t\t\t// capabilities.setCapability(\"name\", testName); // TODO: set a test\n\t\t\t// name (suite name maybe) or combined with env\n\t\t\trcDriver = new RemoteWebDriver(new URL(serverURL), ffOptions);\n\t\t\tmyDriver = new Augmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tcase \"smartbear\":\n\t\t\tif (browserVersion.isEmpty()) {\n\t\t\t\tbrowserVersion = defaultFirefoxVersion;\n\t\t\t}\n\t\t\tif (platformOS.isEmpty()) {\n\t\t\t\tplatformOS = defaultPlatformOS;\n\t\t\t}\n\t\t\t//capabilities.setCapability(\"name\", testMethod.get());\n\t\t\tcapabilities.setCapability(\"build\", testProperties.getString(TEST_ENV)+\" FF-\"+platformOS);\n\t\t\tcapabilities.setCapability(\"max_duration\", smartBearDefaultTimeout);\n\t\t\tcapabilities.setCapability(\"browserName\", browser);\n\t\t\tcapabilities.setCapability(\"version\", browserVersion);\n\t\t\tcapabilities.setCapability(\"platform\", platformOS);\n\t\t\tcapabilities.setCapability(\"screenResolution\", smartBearScreenRes);\n\t\t\tcapabilities.setCapability(\"record_video\", \"true\"); Reporter.log(\n\t\t\t\t\t \"BROWSER: \" + browser, true); Reporter.log(\"BROWSER Version: \" +\n\t\t\t\t\t\t\t browserVersion, true); Reporter.log(\"PLATFORM: \" + platformOS, true);\n\t\t\tReporter.log(\"URL '\" + serverURL + \"'\", true); rcDriver = new\n\t\t\tRemoteWebDriver(new URL(serverURL), capabilities); myDriver = new\n\t\t\tAugmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tmyDriver = new FirefoxDriver(ffOptions);\n\t\t\tbreak;\n\t\t}\n\t\tdriver.set(myDriver);\n\t}", "public static FirefoxProfile firefoxProfile() {\r\n\r\n\t\tFirefoxProfile firefoxProfile = new FirefoxProfile();\r\n\t\tfirefoxProfile.setPreference(\"browser.download.folderList\", 2);\r\n\t\tfirefoxProfile.setPreference(\"browser.download.dir\", testAdminReportPath);\r\n\t\tfirefoxProfile.setPreference(\"browser.helperApps.neverAsk.saveToDisk\", \"text/csv;application/vnd.ms-excel\");\r\n\t\tfirefoxProfile.setPreference(\"browser.helperApps.alwaysAsk.force\", false);\r\n\t\tfirefoxProfile.setPreference(\"geo.enabled\", false);\r\n\t\treturn firefoxProfile;\r\n\t}", "private static void initialiseBrowser() {\n\t\tif (System.getProperty(\"proxyname\") != null) {\n\t\t\tFirefoxProfile profile = new FirefoxProfile();\n\t\t\tprofile.setPreference(\"network.proxy.type\", 1);\n\t\t\tprofile.setPreference(\"network.proxy.http\", System.getProperty(\"proxyname\"));\n\t\t\tprofile.setPreference(\"network.proxy.http_port\", 3128);\n\n\t\t\tdriver = new FirefoxDriver(profile);\n\t\t\tsetDriver(driver);\n\t\t}\n\t\telse{\n\t\t\tdriver = new FirefoxDriver();\n\t\t\tsetDriver(driver);\n\t\t}\n\t}", "@BeforeTest\n public void setup() {\n\n String browser = Environment.getProperties().browser().toString().toLowerCase();\n\n switch (browser) {\n \n case \"firefox\":\n FirefoxOptions options = new FirefoxOptions(); \n if(Environment.getProperties().headless()){\n options.addArguments(\"--headless\");\n }\n driver = new FirefoxDriver();\n break;\n \n default:\n ChromeOptions optionsChrome = new ChromeOptions();\n if(Environment.getProperties().headless()){\n optionsChrome.addArguments(\"--headless\");\n } \n driver = new ChromeDriver(optionsChrome);\n break;\n } \n\n driver.manage().window().maximize();\n }", "@BeforeClass(alwaysRun = true)\n public void Setup() throws Exception {\n System.setProperty(\"webdriver.gecko.driver\", \"/usr/bin/geckodriver\");\n\n //Initialisation du driver\n driver = new FirefoxDriver();\n //Supression des cookies\n driver.manage().deleteAllCookies();\n }", "private void initDriver(){\r\n String browserToBeUsed = (String) jsonConfig.get(\"browserToBeUsed\");\r\n switch (browserToBeUsed) {\r\n case \"FF\":\r\n System.setProperty(\"webdriver.gecko.driver\", (String) jsonConfig.get(\"fireFoxDriverPath\"));\r\n FirefoxProfile ffProfile = new FirefoxProfile();\r\n // ffProfile.setPreference(\"javascript.enabled\", false);\r\n ffProfile.setPreference(\"intl.accept_languages\", \"en-GB\");\r\n\r\n FirefoxOptions ffOptions = new FirefoxOptions();\r\n ffOptions.setProfile(ffProfile);\r\n driver = new FirefoxDriver(ffOptions);\r\n break;\r\n case \"CH\":\r\n String driverPath = (String) jsonConfig.get(\"chromeDriverPath\");\r\n System.setProperty(\"webdriver.chrome.driver\", driverPath);\r\n\r\n Map<String, Object> prefs = new HashMap<String, Object>();\r\n prefs.put(\"profile.default_content_setting_values.notifications\", 2);\r\n\r\n ChromeOptions options = new ChromeOptions();\r\n options.setExperimentalOption(\"prefs\", prefs);\r\n options.addArguments(\"--lang=en-GB\");\r\n driver = new ChromeDriver(options);\r\n break;\r\n case \"IE\":\r\n System.setProperty(\"webdriver.ie.driver\", (String) jsonConfig.get(\"ieDriverPath\"));\r\n\r\n InternetExplorerOptions ieOptions = new InternetExplorerOptions();\r\n ieOptions.disableNativeEvents();\r\n ieOptions.requireWindowFocus();\r\n ieOptions.introduceFlakinessByIgnoringSecurityDomains();\r\n driver = new InternetExplorerDriver(ieOptions);\r\n }\r\n\r\n driver.manage().window().maximize();\r\n }", "@BeforeTest(description=\"Driver initilization and pre test setup\")\r\n\tpublic void BeforeTest() {\n\t\tString browser = properties.getProperty(\"browser\");\r\n\t\tString browserVersion = properties.getProperty(\"browser-version\");\r\n\t\tlog.debug(\"Setting up \"+browser + \" version : \"+browserVersion);\r\n\t\tWebDriverManager.config().setForceCache(true);\r\n\t\tif(browser.equalsIgnoreCase(\"chrome\")) {\r\n\t\t\tif(browserVersion.equalsIgnoreCase(\"null\")) {\r\n\t\t\t\tWebDriverManager.chromedriver().setup();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tWebDriverManager.chromedriver().version(browserVersion).setup();\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\tlog.error(browser+\" \"+browserVersion+\" not available, defaulting to latest version.\");\r\n\t\t\t\t\tWebDriverManager.chromedriver().setup();\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\tdriver = new ChromeDriver();\r\n\t\t}\r\n\t\telse if(browser.equalsIgnoreCase(\"firefox\")) {\r\n\t\t\tif(browserVersion.equalsIgnoreCase(\"null\")) {\r\n\t\t\t\tWebDriverManager.firefoxdriver().setup();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tWebDriverManager.firefoxdriver().version(browserVersion).setup();\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\tlog.error(browser+\" \"+browserVersion+\" not available, defaulting to latest version.\");\r\n\t\t\t\t\tWebDriverManager.firefoxdriver().setup();\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\tdriver = new FirefoxDriver();\r\n\t\t}\r\n\t\telse if(browser.equalsIgnoreCase(\"phantomjs\")) {\r\n\t\t\tif(browserVersion.equalsIgnoreCase(\"null\")) {\r\n\t\t\t\tWebDriverManager.phantomjs().setup();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tWebDriverManager.phantomjs().version(browserVersion).setup();\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\tlog.error(browser+\" \"+browserVersion+\" not available, defaulting to latest version.\");\r\n\t\t\t\t\tWebDriverManager.phantomjs().setup();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tCapabilities caps = new DesiredCapabilities();\r\n\t\t\t((DesiredCapabilities) caps).setJavascriptEnabled(true);\r\n\t\t\t((DesiredCapabilities) caps).setCapability(\"takesScreenshot\", true);\r\n\t\t\tdriver = new PhantomJSDriver(caps);\r\n\t\t\t\r\n\t\t\tif(properties.getProperty(\"cookies\").equalsIgnoreCase(\"clear\")) {driver.manage().deleteAllCookies();}\r\n\t\t\tdriver.manage().window().maximize();\r\n\t\t}\t\t\r\n\t}", "@BeforeClass\r\n\tpublic void browser() {\r\n\tdriver = new FirefoxDriver();\r\n\t}", "@Test\r\n\tpublic void launch_browser()\r\n\t{ \r\n\t\t\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C://TESTING TOOLS - SOFTWARES/chromedriver.exe\");\r\n\t\tWebDriver driver = new ChromeDriver();\r\n\t\tdriver.get(\"https://www.javatpoint.com/\");\r\n\t\t// remove all cookies\r\n\t\t//driver.manage().deleteAllCookies();\r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\t\r\n\t}", "@Test\n public void test(){\n\n\n FirefoxProfile profile = new FirefoxProfile();\n // profile.EnableNativeEvents = true;\n\n WebDriver driver = new FirefoxDriver(profile);\n driver.get(\"http://www.baidu.com\");\n }", "@Override\n protected RemoteWebDriver createLocalDriver() {\n return new FirefoxDriver();\n }", "@BeforeTest\r\n\tpublic void operBrowser(){\n\t\td1=Driver.getBrowser();\r\n\t\tWebDriverCommonLib wlib=new WebDriverCommonLib();\r\n\t\td1.get(Constant.url);\r\n\t\twlib.maximizeBrowse();\r\n\t\twlib.WaitPageToLoad();\r\n\t}", "@Before\n public void start(){\n DesiredCapabilities caps = new DesiredCapabilities();\n driver = new FirefoxDriver(new FirefoxBinary(new File(\"C:\\\\Program Files (x86)\\\\Nightly\\\\firefox.exe\")), new FirefoxProfile(), caps);\n wait = new WebDriverWait(driver, 10);\n\n //IE\n// DesiredCapabilities caps = new DesiredCapabilities();\n// caps.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true);\n// WebDriver driver = new InternetExplorerDriver(caps);\n\n\n }", "private void setLocalWebdriver() {\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setJavascriptEnabled(true);\n capabilities.setCapability(\"handlesAlerts\", true);\n switch (getBrowserId(browser)) {\n case 0:\n capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,\n Boolean.valueOf(System.getProperty(\"IGNORE_SECURITY_DOMAINS\", \"false\")));\n driver.set(new InternetExplorerDriver(capabilities));\n break;\n case 1:\n driver.set(new FirefoxDriver(capabilities));\n break;\n case 2:\n driver.set(new SafariDriver(capabilities));\n break;\n case 3:\n driver.set(new ChromeDriver(capabilities));\n break;\n default:\n throw new WebDriverException(\"Browser not found: \" + browser);\n }\n }", "public static void setup(String browser) throws Exception{\n if(browser.equalsIgnoreCase(\"firefox\")){\n \tFile pathToBinary = new File(\"C:\\\\Program Files (x86)\\\\Mozilla Firefox 41\\\\firefox.exe\");\n \tFirefoxBinary binary = new FirefoxBinary(pathToBinary);\n \tFirefoxDriver driver = new FirefoxDriver(binary, new FirefoxProfile());\n \t\n \t//System.setProperty(\"webdriver.firefox.driver\",\"C:\\\\Program Files (x86)\\\\Mozilla Firefox\\\\firefox.exe\");\n \t/*DesiredCapabilities capabilies = DesiredCapabilities.firefox();\t\t\t\n capabilies.getBrowserName();\n capabilies.getVersion();*/\n \t\t\t\n \t//create Firefox instance\t \n //driver = new FirefoxDriver(); \n System.out.println(\"Browser Used: \"+browser);\n }\t \n //Check if parameter passed is 'Chrome'\n // https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/chrome/ChromeOptions.html\n // http://www.programcreek.com/java-api-examples/index.php?api=org.openqa.selenium.remote.DesiredCapabilities (Singleton)\n else if(browser.equalsIgnoreCase(\"chrome\")){\t \t \n System.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Selenium\\\\Assets\\\\chromedriver.exe\");\n ChromeOptions opt = new ChromeOptions();\n opt.setBinary(\"C:\\\\Selenium\\\\Assets\\\\chromedriver.exe\");\n opt.setExperimentalOption(\"Browser\", \"Chrome\");\n opt.getExperimentalOption(\"version\");\n \n// DesiredCapabilities capabilies = DesiredCapabilities.chrome();\n// capabilies.setBrowserName(\"chrome\");\n// capabilies.setPlatform(Platform.WINDOWS);\n// capabilies.setVersion(\"38\");\n// DesiredCapabilities capabilities = new DesiredCapabilities();\n \n //Create Chrome instance\n driver = new ChromeDriver(opt);\t \n }\n \n //Check if parameter passed is 'Safari'\t\n else if(browser.equalsIgnoreCase(\"safari\")){\t \t \n \tSystem.setProperty(\"webdriver.safari.driver\",\"C:/safaridriver.exe\");\n \t\n \t//System.setProperty(\"webdriver.safari.noinstall\", \"true\");\n \tdriver = new SafariDriver();\n \t\n /*\tSafariOptions options = new SafariOptions();\n \tSafariDriver driver = new SafariDriver(options);\n \tDesiredCapabilities capabilities = DesiredCapabilities.safari();\n \tcapabilities.setCapability(SafariOptions.CAPABILITY, options);*/\n }\n \n //Check if parameter passed is 'IE'\t \n else if(browser.equalsIgnoreCase(\"ie\")){\n \t//String IE32 = \"C:\\\\Selenium\\\\Assets\\\\IEDriverServer_32.exe\"; //IE 32 bit\n\t\t\tString IE64 = \"C:\\\\Selenium\\\\Assets\\\\IEDriverServer_64.exe\"; //IE 64 bit\n \tSystem.setProperty(\"webdriver.ie.driver\",IE64);\n \t\n /* \tDesiredCapabilities capabilies = DesiredCapabilities.internetExplorer();\n \tcapabilies.setBrowserName(\"ie\");\n capabilies.getBrowserName();\n capabilies.getPlatform();\n capabilies.getVersion();*/\n \n \t//Create IE instance\n \tdriver = new InternetExplorerDriver();\n }\t \n else{\t \n //If no browser passed throw exception\t \n throw new Exception(\"Browser is not correct\");\t \n }\t \n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\n\t}", "@BeforeClass\n\tpublic void openFirefoxBrowser(){\n\t\tdriver = new FirefoxDriver();\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t\t//wait = new WebDriverWait(driver,5);\n\t}", "@Before\n public void setUp() throws Exception {\n\t //driver = WebDriverFactory.getDriver(DesiredCapabilities.firefox());\n\t driver = new FirefoxDriver();\n baseUrl = \"https://my.roboforex.com/\";\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n }", "public static WebDriver getBrowser(BrowserType browserName) {\n\t\tWebDriver driver = null;\n\t\t// System.setProperty(\"webdriver.gecko.driver\",\"G:\\\\eclipse-workspace\\\\zeeui\\\\driver\\\\geckodriver.exe\");\n\t\t// String browserType=Config.getValue(\"BROWSER_TYPE\");\n\t\tif (browserName.equals(BrowserType.FIREFOX)) {\n\t\t\tSystem.setProperty(\"webdriver.gecko.driver\", Constants.firefoxDriver);\n\t\t\tFirefoxProfile profile = new FirefoxProfile();\n\t\t\tprofile.setPreference(\"browser.download.folderList\", 2);\n\t\t\tprofile.setPreference(\"browser.download.manager.showWhenStarting\", false);\n\t\t\tprofile.setPreference(\"browser.download.dir\", Config.getValue(\"EXPORT_FILE_PATH\"));\n\t\t\tprofile.setPreference(\"browser.helperApps.neverAsk.saveToDisk\",\n\t\t\t\t\t\"image/jpg, text/csv,text/xml,application/xml,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/excel,application/pdf,application/octet-stream\");\n\t\t\tdriver = new FirefoxDriver(profile);\n\t\t\tdrivers.put(\"firefox\", driver);\n\t\t} else if (browserName.equals(\"chrome\")) {\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", Constants.chromeDriver);\n\t\t\tMap<String, String> prefs = new Hashtable<String, String>();\n\t\t\tprefs.put(\"download.prompt_for_download\", \"false\");\n\t\t\tprefs.put(\"download.default_directory\", Config.getValue(\"EXPORT_FILE_PATH\"));\n\t\t\tprefs.put(\"download.extensions_to_open\",\n\t\t\t\t\t\"image/jpg, text/csv,text/xml,application/xml,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/excel,application/pdf,application/octet-stream\");\n\n\t\t\tChromeOptions options = new ChromeOptions();\n\t\t\toptions.setExperimentalOption(\"prefs\", prefs);\n\t\t\tdriver = new ChromeDriver(options);\n\t\t\tdrivers.put(\"chrome\", driver);\n\t\t} else if (browserName.equals(\"ie\")) {\n\t\t\tSystem.setProperty(\"webdriver.ie.driver\", Config.getValue(\"IE_DRIVER\"));\n\t\t\tdriver = new InternetExplorerDriver();\n\t\t\tdrivers.put(\"ie\", driver);\n\t\t} else if (browserName.equals(\"edge\")) {\n\t\t\tSystem.setProperty(\"webdriver.edge.driver\", Config.getValue(\"EDGE_DRIVER\"));\n\t\t\tdriver = new EdgeDriver();\n\t\t\tdrivers.put(\"edge\", driver);\n\t\t} else if (browserName.equals(\"safari\")) {\n\t\t\tdriver = new SafariDriver();\n\t\t\tdrivers.put(\"safari\", driver);\n\t\t} else if (browserName.equals(\"htmlUnit\")) {\n\t\t\tdriver = new HtmlUnitDriver();\n\t\t}\n\n\t\treturn driver;\n\n\t}", "public static WebDriver initialise(String browser) {\r\n\t\tFirefoxProfile firefoxProfile = new FirefoxProfile();\r\n\t\tChromeOptions chromeOptions = new ChromeOptions();\r\n\r\n\t\tif (browser.equalsIgnoreCase(\"chrome\")) {\r\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\",\r\n\t\t\t\t\tSystem.getProperty(\"user.dir\") + \"\\\\executables\\\\chromedriver.exe\");\r\n\r\n\t\t\tchromeOptions.addArguments(\"--disable-infobars\");\r\n\t\t\tchromeOptions.addArguments(\"--window-size=1920,1080\");\r\n\t\t\tchromeOptions.addArguments(\"--ignore-certificate-errors\");\r\n\t\t\tchromeOptions.addArguments(\"--disable-default-apps\");\r\n\t\t\tchromeOptions.addArguments(\"--disable-popup-blocking\");\r\n\t\t\tchromeOptions.addArguments(\"--incognito\");\r\n\r\n\t\t\tdriver = new ChromeDriver(chromeOptions);\r\n\r\n\t\t} else if (browser.equalsIgnoreCase(\"firefox\")) {\r\n\t\t\tSystem.setProperty(\"webdriver.gecko.driver\",\r\n\t\t\t\t\tSystem.getProperty(\"user.dir\") + \"\\\\executables\\\\geckodriver.exe\");\r\n\t\t\tfirefoxProfile.setPreference(\"permissions.default.stylesheet\", 2);\r\n\t\t\tfirefoxProfile.setPreference(\"permissions.default.image\", 2);\r\n\t\t\tfirefoxProfile.setPreference(\"dom.ipc.plugins.enabled.libflashplayer.so\", false);\r\n\t\t\tfirefoxProfile.setPreference(\"geo.enabled\", false);\r\n\r\n\t\t\tdriver = new FirefoxDriver(firefoxProfile);\r\n\t\t}\r\n\t\t/* set amount of total time for search for element */\r\n\t\tdriver.manage().timeouts().implicitlyWait(TIMEOUT, TimeUnit.SECONDS);\r\n\t\t/* set amount of time to page load to complete before trow error */\r\n\t\tdriver.manage().timeouts().pageLoadTimeout(PAGE_TIMEOUT, TimeUnit.SECONDS);\r\n\t\t/*\r\n\t\t * set amount of time to wait for a script to finish execution before throwing\r\n\t\t * error\r\n\t\t */\r\n\t\tdriver.manage().timeouts().setScriptTimeout(SCRIPT_TIMEOUT, TimeUnit.SECONDS);\r\n\r\n\t\tdriver.manage().window().maximize();\r\n\r\n\t\treturn driver;\r\n\r\n\t}", "private static WebDriver getFirefoxriver() {\n\t\treturn null;\n\t}", "public static WebDriver firefox()\r\n\t{\r\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",System.getProperty(\"user.dir\")+\"\\\\Gecko\\\\geckodriver.exe\");\r\n\t\tgk = new FirefoxDriver();\r\n\t\treturn gk;\r\n\t}", "private void setChromeDriver() throws Exception {\n\t\t// boolean headless = false;\n\t\tHashMap<String, Object> chromePrefs = new HashMap<String, Object>();\n\t\tchromePrefs.put(\"profile.default_content_settings.popups\", 0);\n\t\tchromePrefs.put(\"download.default_directory\", BasePage.myTempDownloadsFolder);\n\t\tchromeOptions.setExperimentalOption(\"prefs\", chromePrefs);\n\t\t// TODO: Using \"C:\" will not work for Linux or OS X\n\t\tFile dir = new File(BasePage.myTempDownloadsFolder);\n\t\tif (!dir.exists()) {\n\t\t\tdir.mkdir();\n\t\t}\n\n\t\tchromeOptions.addArguments(\"disable-popup-blocking\");\n\t\tchromeOptions.addArguments(\"--disable-extensions\");\n\t\tchromeOptions.addArguments(\"start-maximized\");\n\n\t\t/*\n\t\t * To set headless mode for chrome. Would need to make it conditional\n\t\t * from browser parameter Does not currently work for all tests.\n\t\t */\n\t\t// chromeOptions.setHeadless(true);\n\n\t\tif (runLocation.toLowerCase().equals(\"smartbear\")) {\n\t\t\tReporter.log(\"-- SMARTBEAR: standard capabilities. Not ChromeOptions\", true);\n\t\t\tcapabilities = new DesiredCapabilities();\n\t\t} else {\n\t\t\tcapabilities = DesiredCapabilities.chrome();\n\t\t\tcapabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);\n\t\t}\n\n\t\tWebDriver myDriver = null;\n\t\tRemoteWebDriver rcDriver;\n\n\t\tswitch (runLocation.toLowerCase()) {\n\t\tcase \"local\":\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", chromeDriverLocation);\n\t\t\tmyDriver = new ChromeDriver(chromeOptions);\n\t\t\tbreak;\n\t\tcase \"grid\":\n\t\t\trcDriver = new RemoteWebDriver(new URL(serverURL), capabilities);\n\t\t\trcDriver.setFileDetector(new LocalFileDetector());\n\t\t\tmyDriver = new Augmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tcase \"testingbot\":\n\t\t\tif (browserVersion.isEmpty()) {\n\t\t\t\tbrowserVersion = defaultChromeVersion;\n\t\t\t}\n\t\t\tif (platformOS.isEmpty()) {\n\t\t\t\tplatformOS = defaultPlatformOS;\n\t\t\t}\n\t\t\tcapabilities.setCapability(\"browserName\", browser);\n\t\t\tcapabilities.setCapability(\"version\", browserVersion);\n\t\t\tcapabilities.setCapability(\"platform\", platformOS);\n\t\t\t// capabilities.setCapability(\"name\", testName); // TODO: set a test\n\t\t\t// name (suite name maybe) or combined with env\n\t\t\trcDriver = new RemoteWebDriver(new URL(serverURL), capabilities);\n\t\t\tmyDriver = new Augmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tcase \"smartbear\":\n\t\t\tif (browserVersion.isEmpty()) {\n\t\t\t\tbrowserVersion = defaultChromeVersion;\n\t\t\t}\n\t\t\tif (platformOS.isEmpty()) {\n\t\t\t\tplatformOS = defaultPlatformOS;\n\t\t\t}\n\t\t\t \n\t\t\t//capabilities.setCapability(\"name\", testMethod.get());\n\t\t\tcapabilities.setCapability(\"build\", testProperties.getString(TEST_ENV)+\" Chrome-\"+platformOS);\n\t\t\tcapabilities.setCapability(\"max_duration\", smartBearDefaultTimeout);\n\t\t\tcapabilities.setCapability(\"browserName\", browser);\n\t\t\tcapabilities.setCapability(\"version\", browserVersion);\n\t\t\tcapabilities.setCapability(\"platform\", platformOS);\n\t\t\tcapabilities.setCapability(\"screenResolution\", smartBearScreenRes);\n\t\t\tcapabilities.setCapability(\"record_video\", \"true\"); Reporter.log(\n\t\t\t\t\t \"BROWSER: \" + browser, true); Reporter.log(\"BROWSER Version: \" +\n\t\t\t\t\t\t\t browserVersion, true); Reporter.log(\"PLATFORM: \" + platformOS, true);\n\t\t\tReporter.log(\"URL '\" + serverURL + \"'\", true); rcDriver = new\n\t\t\tRemoteWebDriver(new URL(serverURL), capabilities); myDriver = new\n\t\t\tAugmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", chromeDriverLocation);\n\t\t\tmyDriver = new ChromeDriver(chromeOptions);\n\t\t\tbreak;\n\t\t}\n\t\tdriver.set(myDriver);\n\t}", "@BeforeMethod\n\tpublic void launch()\n\t{\n\t\t\n\t\tdriver=new FirefoxDriver();\n\t\tdriver.manage().window().maximize();\n\t\t\n\t\tdriver.manage().deleteAllCookies();\n\t\tdriver.get(\"https://www.facebook.com/\");\n\t\t\n\t}", "@Before\n public void setup() {\n DesiredCapabilities caps = new DesiredCapabilities();\n caps.setCapability(FirefoxDriver.MARIONETTE, false); // new schema disable\n webdriver = new FirefoxDriver(caps);\n wait = new WebDriverWait(webdriver, 10);\n\n }", "@BeforeTest\n\tpublic void beforeTest() {\n\t\t\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",\".\\\\lib\\\\geckodriver.exe\");\n\t\tdriver = new FirefoxDriver(); \n//\t\tSystem.setProperty(\"webdriver.ie.driver\",\".\\\\lib\\\\IEDriverServer.exe\");\n//\t\tdriver = new InternetExplorerDriver();\n\t\t\n//\t\tSystem.setProperty(\"webdriver.chrome.driver\",\".\\\\lib\\\\chromedriver.exe\");\n//\t\tdriver = new ChromeDriver();\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\t\tdriver.manage().window().maximize();\n\t}", "@Before\n public void setUp() throws Exception {\n driver = new FirefoxDriver();\n driver.get(\"http://stackoverflow.com\");\n driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n }", "@BeforeMethod\r\n\tpublic void setUp() {\n\t\tdriver = new FirefoxDriver();\r\n\t\tbaseUrl = \"https://www.google.com/\";\r\n\r\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\n\t\tdriver.manage().window().maximize();\r\n\r\n\t\tdriver.get(baseUrl);\r\n\t}", "private void createNewDriverInstance() {\n String browser = props.getProperty(\"browser\");\n if (browser.equals(\"firefox\")) {\n FirefoxProfile profile = new FirefoxProfile();\n profile.setPreference(\"intl.accept_languages\", language);\n driver = new FirefoxDriver();\n } else if (browser.equals(\"chrome\")) {\n ChromeOptions options = new ChromeOptions();\n options.setBinary(new File(chromeBinary));\n options.addArguments(\"--lang=\" + language);\n driver = new ChromeDriver(options);\n } else {\n System.out.println(\"can't read browser type\");\n }\n }", "@Test\n public void test1(){\n\n WebDriverManager.chromedriver().setup();\n WebDriver driver2 = new ChromeDriver();\n\n\n\n driver2.get(url);\n bekle(2000);\n driver2.quit();\n\n\n\n }", "public static void initialization() throws InterruptedException, FileNotFoundException {\n\n String browserName = prop.getProperty(\"browser\");\n if (browserName.equalsIgnoreCase(\"chrome\")) {\n WebDriverManager.chromedriver().setup();\n driver = new ChromeDriver();\n } else if (browserName.equalsIgnoreCase(\"firefox\")) {\n WebDriverManager.firefoxdriver().setup();\n driver = new FirefoxDriver();\n }\n driver.manage().window().maximize();\n String url = prop.getProperty(\"url\");\n driver.get(url);\n driver.manage().timeouts().pageLoadTimeout(Util_Constants.IMPLICIT_WAIT, TimeUnit.SECONDS);\n\n\n }", "@Before\r\n\tpublic void OpenChrome() {\n\t\tconfig = new ConfigReader();\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",config.getChromePath());\r\n\t\tdriver = new ChromeDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().deleteAllCookies();\r\n\t\texPages = new ExpediaPages(driver);\r\n\t}", "public static void chromeTest() throws Exception{\n driver = BrowserFactory.getDriver(\"chrome\");\n Thread.sleep(2000);\n\n driver.get(\"http://google.com\");\n Thread.sleep(3000);\n String title = driver.getTitle();\n driver.navigate().to(\"https://etsy.com\");\n Thread.sleep(2000);\n String title2 = driver.getTitle();\n driver.navigate().back();\n title = driver.getTitle();\n Thread.sleep(2000);\n driver.navigate().to(\"https://etsy.com\");\n title2 = driver.getTitle();\n driver.quit();\n }", "@Override\n public WebDriver getWebDriver() {\n return new FirefoxDriver();\n }", "private void initFirefoxDriver(String appUrl) {\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",\"Drivers\\\\geckodriver.exe\");\n\t\tdriver = new FirefoxDriver();\n\t\tdriver.get(appUrl);\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t\t\n\t}", "public static void main(String[] args) {\nString browser=\"ff\";\nif (browser.equals(\"chrome\")) {\n\tWebDriverManager.chromedriver().setup();\n\t// System.setProperty(\"webdriver.chrome.driver\", \"/Users/user/Downloads/chromedriver\");\n\tdriver=new ChromeDriver();\n}\nelse if (browser.equals(\"ff\")) {\n\tWebDriverManager.firefoxdriver().setup();\n\tdriver=new FirefoxDriver();\n}\nelse\n\tif (browser.equals(\"IE\")) {\n\t\tWebDriverManager.iedriver().setup();\n\t\tdriver=new InternetExplorerDriver();\n\t}\n\telse\n\t\tif (browser.equals(\"opera\")) {\n\t\t\tWebDriverManager.operadriver().setup();\n\t\t\tdriver=new OperaDriver();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"no defined driver\");\n\t\t}\n\n\ndriver.get(\"https://google.com\");\n\n\n\n\t\n\n\n\n\n\n\n\n\n\n\n\n\t}", "public void setUpDriver(final String browser) throws MalformedURLException{\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tString gridUrl=System.getProperty(\"gridurl\");\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//check if parameter passed from TestNg is 'firefox'\r\n\t\t\r\n//\t\tif (BrowserLib.FIREFOX.equalsIgnoreCase(browser)){\r\n//\t\t DesiredCapabilities capabilities =DesiredCapabilities.firefox();\r\n//\t\t capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);\r\n//\t\t if(StringUtils.isNotEmpty(gridUrl)){\r\n//\t\t\t driver=new RemoteWebDriver(new URL(gridUrl),capabilities);\r\n//\t\t }\r\n//\t\t else{\r\n//\t\t\t driver =new FirefoxDriver(capabilities);\r\n//\t\t }\r\n\t\t \r\n\t\t\r\n\t\tif(BrowserLib.FIREFOX.equalsIgnoreCase(browser)){\r\n\t\t\t\r\n\t\t\t DesiredCapabilities capabilities =DesiredCapabilities.firefox();\r\n//\t\t\t capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);\r\n\t\t\t \r\n\t\t\t final String firebugpath1=\"src//main//resource//firepath-0.9.7.1-fx.xpi\";\r\n\t\t\t final String firebugpath =\"src//main//resource//firebug-1.12.8.xpi\";\r\n\t\t\t FirefoxProfile profile=new FirefoxProfile();\r\n//\t\t System.setProperty(\"webdriver.firefox.driver\", \"C:\\\\Program Files\\\\MozillaFirefox\\\\firefox.exe\");\r\n\r\n\t\t\t \r\n\t\t\t try{\r\n\t\t\t\t profile.addExtension(new File(firebugpath));\r\n\t\t\t\t profile.addExtension(new File(firebugpath1));\t \r\n\t\t\t }catch (IOException e){\r\n\t\t\t\t logger.error(\"Exception:\",e);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t profile.setPreference(\"extensions.firebug.allpagesActivation\", \"on\");\r\n//\t\t\t capabilities.setCapability(FirefoxDriver.PROFILE,profile);\r\n\t\t\t capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);\r\n\t\t\t System.setProperty(\"webdriver.firefox.driver\", \"C:\\\\Program Files\\\\MozillaFirefox\\\\firefox.exe\");\r\n\t\t\t //if (StringUtils.isNotEmpty(gridUrl)){\r\n\t\t\t if(gridUrl==null){\r\n\t\t\t\t driver =new FirefoxDriver(capabilities); \r\n \t\t\t \r\n\t\t\t }else{\r\n\t\t\t\t driver=new RemoteWebDriver(new URL(gridUrl),capabilities);\r\n\t\t\t }\r\n\t\t}else if(BrowserLib.CHROME.equalsIgnoreCase(browser)){\r\n\t\t\t DesiredCapabilities capabilities =DesiredCapabilities.chrome();\r\n\t\t\t capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);\r\n\t\t\t if(gridUrl==null){\r\n\t\t\t\t driver =new ChromeDriver();\t \r\n\t\t\t }else{\r\n\t\t\t\t driver=new RemoteWebDriver(new URL(gridUrl),capabilities);\r\n\t\t\t }\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t \r\n\t\t}else if(BrowserLib.INTERNET_EXP.equalsIgnoreCase(browser)){\r\n//\t\t\tset path to iedriver.exe you may need to download it from 32 bits\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.setProperty(\"webDriver.ie.driver\", System.getProperty(\"user.dir\")+\"/src/main/resource/\"+ \"IEDriverserver.exe\");\r\n//\t\t\t create ie instance\r\n\t\t\t DesiredCapabilities capabilities =DesiredCapabilities.internetExplorer();\r\n\t\t\t capabilities.setCapability(CapabilityType.ForSeleniumServer.ENSURING_CLEAN_SESSION, true);\r\n//\t\t\t if (StringUtils.isNotEmpty(gridUrl)){\r\n// \t\t\t driver=new RemoteWebDriver(new URL(gridUrl),capabilities);\r\n//\t\t\t }else{\r\n//\t\t\t\t driver =new FirefoxDriver(capabilities); \r\n//\t\t\t }\r\n\t\t\t if(gridUrl.isEmpty()){\r\n\t\t\t\t driver =new InternetExplorerDriver(capabilities); \r\n \t\t\t \r\n\t\t\t }else{\r\n\t\t\t\t driver=new RemoteWebDriver(new URL(gridUrl),capabilities);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t}else{\r\n//\t\t\tif no browser passed throw exception\r\n\t\t\tthrow new UnsupportBrowserException();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tthis.driver.manage().deleteAllCookies();\r\n\t\tthis.browserMaximize();\r\n\t\tthis.driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\n\t\t\r\n\t\t\r\n\t}", "@BeforeClass\n\tpublic static void configureDriver(){\n\t\tif(driver == null) {\n\t\t\tif(Constants.browserName.equalsIgnoreCase(\"chrome\")) {\n\t\t\t\tSystem.setProperty(\"webdriver.chrome.driver\",\n\t\t\t\t\t\t\"C:\\\\Users\\\\rober\\\\Documents\\\\WebDrivers\\\\chromedriver_win32-89\"\n\t\t\t\t\t\t+ \"\\\\chromedriver.exe\");\n\t\t\t\tdriver = new ChromeDriver();\n\t\t\t} else if(Constants.browserName.equalsIgnoreCase(\"firefox\")) {\n\t\t\t\tSystem.setProperty(\"webdriver.gecko.driver\",\n\t\t\t\t\t\t\"C:\\\\Users\\\\rober\\\\Documents\\\\WebDrivers\\\\chromedriver_win32-89\"\n\t\t\t\t\t\t+ \"\\\\geckodriver.exe\");\n\t\t\t\tdriver = new FirefoxDriver();\n\t\t\t} else if(Constants.browserName.equalsIgnoreCase(\"edge\")) {\n\t\t\t\tSystem.setProperty(\"webdriver.edge.driver\",\n\t\t\t\t\t\t\"C:\\\\Users\\\\rober\\\\Documents\\\\WebDrivers\\\\chromedriver_win32-89\"\n\t\t\t\t\t\t+ \"\\\\msedgedriver.exe\");\n\t\t\t\tdriver = new EdgeDriver();\n\t\t\t} else if(Constants.browserName.equalsIgnoreCase(\"ie\")) {\n\t\t\t\tSystem.setProperty(\"webdriver.ie.driver\",\n\t\t\t\t\t\t\"C:\\\\Users\\\\rober\\\\Documents\\\\WebDrivers\\\\chromedriver_win32-89\"\n\t\t\t\t\t\t+ \"\\\\IEDriver.exe\");\n\t\t\t\tdriver = new InternetExplorerDriver();\n\t\t\t}\n\t\t}\n\t\t\n\t\tdriver.manage().deleteAllCookies();\n\t\tdriver.manage().timeouts().implicitlyWait(20,TimeUnit.SECONDS);\n\t\tdriver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);\n\t\tdriver.manage().window().maximize();\n\t\t\n\t\tdriver.get(Constants.url);\n\t\t\n\t}", "@BeforeTest\r\n\tpublic void beforeTest() throws MalformedURLException {\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\PDC2B-Training.pdc2b\\\\Downloads\\\\Selenium Drivers\\\\BrowserDriver\\\\chromedriver_win32\\\\chromedriver.exe\");\r\n\t\tdriver = new ChromeDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().timeouts().implicitlyWait(5000, TimeUnit.SECONDS);\r\n\t}", "@BeforeTest\n\t public void setUp() throws Exception {\n\t\t \n\t\tSystem.setProperty(\"webdriver.gecko.driver\",\n\t\t\t\t\"G:\\\\Selenium\\\\drivers\\\\geckodriver-v0.11.1-win64\\\\geckodriver.exe\");\n\t\tFile pathBinary = new File(\"C:\\\\Uday\\\\Program Files (x86)\\\\Mozilla Firefox\\\\firefox.exe\");\n\t\tFirefoxBinary firefoxBinary = new FirefoxBinary(pathBinary);\n\t\tFirefoxProfile firefoxProfile = new FirefoxProfile();\n\t\tdriver = new FirefoxDriver(firefoxBinary, firefoxProfile);\n\n\t baseUrl = \"http://localhost:8888/\";\n\t driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\t }", "protected FirefoxDriver createFirefoxDriver() {\n FirefoxProfile firefoxProfile = new FirefoxProfile();\n firefoxProfile.setPreference(\"intl.accept_languages\",\n getSystemLanguage());\n FirefoxDriver firefoxDriver = new FirefoxDriver(firefoxProfile);\n firefoxDriver.manage().window().maximize();\n return firefoxDriver;\n }", "@BeforeMethod\r\n public void setUp() {\n WebDriver driver = new FirefoxDriver();\r\n driver.get(\"http://selenium.polteq.com/testshop/index.php\");\r\n }", "public void setChromeDriver(){\n System.setProperty(\"webdriver.chrome.driver\", browserDriverPath);\n seleniumDriver = new ChromeDriver();\n }", "@Before\n public void Setup() { //this is done before every test, chrome driver is saved in a specific location\n\n System.setProperty(\"webdriver.chrome.driver\",\n Constant.CROMEDRIVER);\n\n driver = new ChromeDriver();\n }", "public void WakeFirefox() {\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",\"D://geckodriver.exe\" );\n\t\t\n\t\t// We have to import Webdriver class from library to create object named driver below\n\t\tWebDriver driver = new FirefoxDriver();\n\t\t\n\t\t//Open URL\n\t\tdriver.get(\"https://technoticle.wordpress.com/\");\n\t\t\n\t\t//To get title of Website\n\t\tSystem.out.println(driver.getTitle());\n\t\t\n\t\t//Verification to know whether we are not getting redirected anywhere else. This will print hit URL\n\t\tSystem.out.println(driver.getCurrentUrl());\n\t\t\n\t\t//Close the browser\n\t\tdriver.close();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private void setWebdriver() throws Exception {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\n\t\t\t\tcurrentDir + fileSeparator + \"lib\" + fileSeparator + \"chromedriver.exe\");\n\t\tcapability = DesiredCapabilities.chrome();\n\t\tChromeOptions options = new ChromeOptions();\n\t\toptions.addArguments(\"--disable-extensions\");\n\t\toptions.addArguments(\"disable-infobars\");\n\t\tcapability.setCapability(ChromeOptions.CAPABILITY, options);\n\t\tdriver = new ChromeDriver(capability);\n\t\tdriver.manage().deleteAllCookies();\n\t\t_eventFiringDriver = new EventFiringWebDriver(driver);\n\t\t_eventFiringDriver.get(getUrl());\n\t\t_eventFiringDriver.manage().window().maximize();\n\n\t}", "private void setRemoteWebdriver() {\n\n switch (getBrowserId(browser)) {\n case 0:\n capabilities = DesiredCapabilities.internetExplorer();\n capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,\n Boolean.valueOf(System.getProperty(\"IGNORE_SECURITY_DOMAINS\", \"false\")));\n break;\n case 1:\n\t\tFirefoxProfile profile = new FirefoxProfile();\n \tprofile.setEnableNativeEvents(true);\n capabilities = DesiredCapabilities.firefox();\n\t\tcapabilities.setCapability(FirefoxDriver.PROFILE, profile);\n \tcapabilities.setJavascriptEnabled(true);\n \tcapabilities.setCapability(\"marionette\", false);\n \tcapabilities.setCapability(\"acceptInsecureCerts\", true);\n break;\n case 2:\n capabilities = DesiredCapabilities.safari();\n break;\n case 3:\n capabilities = DesiredCapabilities.chrome();\n break;\n default:\n throw new WebDriverException(\"Browser not found: \" + browser);\n }\n capabilities.setCapability(\"javascriptEnabled\", true);\n capabilities.setCapability(\"platform\", platform);\n capabilities.setCapability(\"version\", version);\n capabilities.merge(extraCapabilities);\n\n try {\n this.driver.set(new RemoteWebDriver(new URL(\"http://\"\n + System.getProperty(\"GRID_HOST\") + \":\"\n + System.getProperty(\"GRID_PORT\") + \"/wd/hub\"),\n capabilities));\n } catch (MalformedURLException e) {\n LOGGER.log(Level.INFO,\n \"MalformedURLException in setRemoteWebdriver() method\", e);\n }\n }", "@Before\n public void setUp() throws Exception {driver = new ChromeDriver();\n// baseUrl = \"https://www.google.com/\";\n// driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n// \n \n\t \n\t baseUrl = \"https://mern-crud.herokuapp.com\";\n\t\t\t\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"/usr/bin/chromedriver\");\n\t\t\t\n\t\t\tdriver = new ChromeDriver();\n\t\t\t\n\t\t\tdriver.manage().deleteAllCookies();\n\t\t\t\n\t\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\t\t\n }", "@Test\r\n\tpublic void f()\r\n\t{\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C://Data_Program//Selenium_Dependencies//chromedriver.exe\");\r\n\t\tWebDriver driver=new ChromeDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.get(\"http://www.google.com\");\r\n\t}", "public void setDriver(String browserName){\r\n\t \r\n\t\t if(browserName==null){\r\n\t\t\t browserName=\"firefox\";\r\n\t\t\t \r\n\t\t }\r\n\t\t if(browserName.equalsIgnoreCase(\"firefox\")){\r\n\t\t\t \r\n\t\t\t System.setProperty(\"webdriver.gecko.driver\", FIREFOX_DRIVER_PATH);\r\n\t\t\t \r\n\t\t\t driver= new FirefoxDriver();\r\n\t\t\t \r\n\t\t }\r\n\t\t \r\n\t\t if(browserName.equalsIgnoreCase(\"chrome\")){\r\n\t\t\t \r\n\t\t\t System.setProperty(\"webdriver.chrome.driver\",CHROME_DRIVER_PATH);\r\n\t\t\t \r\n\t\t\t driver= new ChromeDriver();\r\n\t\t }\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t if(browserName.equalsIgnoreCase(\"ie\")){\r\n\t\t\t \r\n\t\t\t System.setProperty(\"webdriver.ie.driver\",IE_DRIVER_PATH);\r\n\t\t\t \r\n\t\t\t driver= new InternetExplorerDriver();\r\n\t\t\t \r\n\t\t }\r\n\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t}", "@Before\n public synchronized static WebDriver openBrowser() {\n String browser = System.getProperty(\"BROWSER\");\n\n\n if (driver == null) {\n try {\n //Kiem tra BROWSER = null -> gan = chrome\n if (browser == null) {\n browser = System.getenv(\"BROWSER\");\n if (browser == null) {\n browser = \"chrome\";\n }\n }\n switch (browser) {\n case \"chrome\":\n WebDriverManager.chromedriver().setup();\n driver = new ChromeDriver();\n break;\n case \"firefox\":\n WebDriverManager.firefoxdriver().setup();\n driver = new FirefoxDriver();\n break;\n case \"chrome_headless\":\n WebDriverManager.chromedriver().setup();\n ChromeOptions options = new ChromeOptions();\n options.addArguments(\"headless\");\n options.addArguments(\"window-size=1366x768\");\n driver = new ChromeDriver(options);\n break;\n default:\n WebDriverManager.chromedriver().setup();\n driver = new ChromeDriver();\n break;\n }\n } catch (UnreachableBrowserException e) {\n driver = new ChromeDriver();\n } catch (WebDriverException e) {\n driver = new ChromeDriver();\n } finally {\n Runtime.getRuntime().addShutdownHook(new Thread(new BrowserCleanup()));\n }\n driver.get(\"http://demo.guru99.com/v4/\");\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n driver.manage().window().maximize();\n log.info(\"----------- START BRWOSER -----------\");\n\n }\n return driver;\n }", "WebDriver modify(WebDriver webDriver);", "@BeforeMethod(alwaysRun = true)\n public void browserSetup(){\n driver = new ChromeDriver();\n }", "@BeforeMethod\n public void beforeMethod() {\n System.setProperty(\"webdriver.chrome.driver\",\n \"./src/test/resources/drivers/chromedriver\");\n System.setProperty(\"webdriver.gecko.driver\",\n \"./src/test/resources/drivers/geckodriver\");\n System.setProperty(\"webdriver.opera.driver\",\n \"./src/test/resources/drivers/operadriver\");\n\n // Initialize new WebDriver session\n ChromeOptions chromeOptions = new ChromeOptions();\n chromeOptions.setHeadless(false);\n\n driver = new ChromeDriver(chromeOptions);\n\n FirefoxOptions firefoxOptions = new FirefoxOptions();\n firefoxOptions.setHeadless(false);\n\n// driver = new FirefoxDriver(firefoxOptions);\n// driver = new SafariDriver();\n// driver = new OperaDriver();\n\n // Maximize browser window\n driver.manage().window().maximize();\n\n // Take screenshot of the web page and save it to a file\n// File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);\n// FileUtils.copyFile(scrFile, new File(\"./target/screenshot.png\"));\n }", "private static WebDriver launchFirefox()\n\t{\n\t\tif (REMOTE_URL != null && !REMOTE_URL.equals(\"\")) {\n\t\t\tDesiredCapabilities capabilities = DesiredCapabilities.firefox();\n\t\t\ttry {\n\n\t\t\t\treturn new RemoteWebDriver(new URL(System.getProperty(\"RemoteUrl\")), capabilities);\n\t\t\t}\n\n\n\t\t\tcatch (MalformedURLException e) {\n\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tFirefoxProfile profile = new FirefoxProfile();\n\t\t\tprofile.setAcceptUntrustedCertificates(true);\n\n\t\t\treturn new FirefoxDriver(profile);\n\n\t\t}\n\n\n\t}", "public void initDriver() {\n if (getBrowser().equals(\"firefox\")) {\n WebDriverManager.firefoxdriver().setup();\n if (System.getProperty(\"headless\") != null) {\n FirefoxOptions firefoxOptions = new FirefoxOptions();\n firefoxOptions.setHeadless(true);\n driver = new FirefoxDriver(firefoxOptions);\n } else {\n driver = new FirefoxDriver();\n }\n } else {\n WebDriverManager.chromedriver().setup();\n if (System.getProperty(\"headless\") != null) {\n ChromeOptions chromeOptions = new ChromeOptions();\n chromeOptions.setHeadless(true);\n driver = new ChromeDriver(chromeOptions);\n } else {\n driver = new ChromeDriver();\n }\n }\n }", "public static void main(String[] args) {\nWebDriver driver = new FirefoxDriver();\nSystem.out.println(\"hai\");\ndriver.get(\"https://www.google.com\");\nSystem.out.println(driver.getTitle());\ndriver.close();\n\t}", "@Override\r\n public void beforeNavigateRefresh(final WebDriver driver) {\n\r\n }", "public static void initialization() {\n String browserName = properties.getProperty(\"browserName\");\n\n if (browserName.equalsIgnoreCase(\"chrome\")) {\n System.setProperty(\"webdriver.chrome.driver\", \"F:/LearningStuff/WebDrivers/chromedriver.exe\");\n driver = new ChromeDriver();\n\n } else if (browserName.equalsIgnoreCase(\"firefox\")) {\n System.setProperty(\"webdriver.gecko.driver\", \"\");\n driver = new FirefoxDriver();\n }\n\n driver.manage().window().maximize(); //maximize browser\n driver.manage().deleteAllCookies(); //clear cookies\n driver.manage().timeouts().pageLoadTimeout(TestUtil.PAGE_LOAD_TIMEOUT, TimeUnit.SECONDS); //waits for a page load\n driver.manage().timeouts().implicitlyWait(TestUtil.IMPLICIT_WAIT, TimeUnit.SECONDS); //waits for an element\n driver.get(properties.getProperty(\"url\")); //opens the url\n }", "public static void main(String[] args) {\n\n\n WebDriver driver = WebDriverFactory.getDriver(\"CHROME\");\n driver.get(\"http://google.com\");\n driver.navigate().to(\"https://amazon.com\");\n driver.navigate().back();\n\n driver.close();\n\n WebDriver driver2 = WebDriverFactory.getDriver(\"FIREFOX\");\n driver2.get(\"https://www.mozilla.org\");\n\n\n driver2.close();\n }", "public void initialization()\n\t{\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Mrunal\\\\chromedriver.exe\");\n\t\n\t\tif(prop.getProperty(\"browser\").contains(\"chrome\"))\n\t\t driver = new ChromeDriver();\n\t\t \n\t\t driver.manage().deleteAllCookies();\n\t\t driver.manage().timeouts().pageLoadTimeout(2000, TimeUnit.MILLISECONDS);\n\t\t driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n\n\t\t driver.get(prop.getProperty(\"url\"));\n\t\t driver.manage().window().maximize();\n\t\t driver.manage().timeouts().implicitlyWait(8, TimeUnit.SECONDS);\n\t\t \n\t}", "private void setSauceWebdriver() {\n\n switch (getBrowserId(browser)) {\n case 0:\n capabilities = DesiredCapabilities.internetExplorer();\n capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,\n Boolean.valueOf(System.getProperty(\"IGNORE_SECURITY_DOMAINS\", \"false\")));\n break;\n case 1:\n capabilities = DesiredCapabilities.firefox();\n break;\n case 2:\n capabilities = DesiredCapabilities.safari();\n break;\n case 3:\n capabilities = DesiredCapabilities.chrome();\n break;\n case 4:\n capabilities = DesiredCapabilities.iphone();\n capabilities.setCapability(\"deviceName\",\"iPhone Simulator\");\n capabilities.setCapability(\"device-orientation\", \"portrait\");\n break;\n case 5:\n capabilities = DesiredCapabilities.iphone();\n capabilities.setCapability(\"deviceName\",\"iPad Simulator\");\n capabilities.setCapability(\"device-orientation\", \"portrait\");\n break;\n case 6:\n capabilities = DesiredCapabilities.android();\n capabilities.setCapability(\"deviceName\",\"Android Emulator\");\n capabilities.setCapability(\"device-orientation\", \"portrait\");\n break;\n default:\n throw new WebDriverException(\"Browser not found: \" + browser);\n }\n capabilities.merge(extraCapabilities);\n capabilities.setCapability(\"javascriptEnabled\", true);\n capabilities.setCapability(\"platform\", platform);\n capabilities.setCapability(\"version\", version);\n\n try {\n this.driver.set(new RemoteWebDriver(new URL(System\n .getProperty(\"SAUCE_KEY\")), capabilities));\n } catch (MalformedURLException e) {\n LOGGER.log(Level.INFO,\n \"MalformedURLException in setSauceWebdriver() method\", e);\n }\n }", "public WebDriver createWebDriverInstance(String Browser) throws MalformedURLException\n\t{\n\t\tif(d==null && Browser.equals(\"Firefox\"))\n\t\t{\n\n\t\t\td = new FirefoxDriver();\n\t\t\tlogger.info(\"--FireFox Browser has opened \");\n\t\t}\n\n\t\telse if(d==null && Browser.equals(\"Chrome\"))\n\t\t{\n\t\t\tChromeOptions options = new ChromeOptions();\n\t\t\toptions.addArguments(\"start-maximized\");\n\t\t\tDesiredCapabilities capabilities = new DesiredCapabilities(DesiredCapabilities.chrome());\n\t\t\tcapabilities.setCapability (CapabilityType.ACCEPT_SSL_CERTS, true);\n\t\t\tcapabilities.setCapability (ChromeOptions.CAPABILITY,options);\n\t\t\tChromeDriverManager.getInstance().setup();\n\t\t\t\n\t\t\t//Don't Remember Passwords by default\n\t\t\tMap<String, Object> prefs = new HashMap<String, Object>();\n\t\t\tprefs.put(\"credentials_enable_service\", false);\n\t\t\tprefs.put(\"profile.password_manager_enabled\", false);\n\t\t\toptions.setExperimentalOption(\"prefs\", prefs);\n\t\t\t/*\n\t\t\tString path =System.getProperty(\"user.dir\")+File.separator+\"chromedriver.exe\";\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", path);\n\t\t\tChromeOptions options = new ChromeOptions();\n\t\t\tDesiredCapabilities caps = DesiredCapabilities.chrome();*/\n\t\t\td = new ChromeDriver(capabilities);\n\t\t\tlogger.info(\"--Chrome Browser has opened \");\n\t\t}\n\n\t\telse if (d==null && Browser.equals(\"IE\"))\n\t\t{\n\t\t\tString path =\"binary/IEDriverServer.exe\";\n\t\t\tSystem.setProperty(\"webdriver.ie.driver\", path);\n\t\t\tlogger.info(\"--IEDriver has setup\");\n\t\t\tDesiredCapabilities caps = DesiredCapabilities.internetExplorer();\n\t\t\tcaps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);\n\t\t\tcaps.setCapability(\"requireWindowFocus\", true);\n\t\t\tcaps.setCapability(\"enablePersistentHover\", true);\n\t\t\tcaps.setCapability(\"native events\", true);\n\t\t\td = new InternetExplorerDriver(caps);\n\t\t\tlogger.info(\"--IE Browser has opened \");\n\t\t}\n\t\telse if (d==null && Browser.equals(\"IE32bit\"))\n\t\t{\n\t\t\tString path =\"binary/IEDriverServer_32bit.exe\";\n\t\t\tSystem.setProperty(\"webdriver.ie.driver\", path);\n\t\t\tlogger.info(\"--IEDriver has setup\");\n\t\t\tDesiredCapabilities caps = DesiredCapabilities.internetExplorer();\n\t\t\tcaps.setCapability(\n\t\t\t\t\tInternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,\n\t\t\t\t\ttrue);\n\t\t\tcaps.setCapability(\"requireWindowFocus\", true);\n\t\t\tcaps.setCapability(\"enablePersistentHover\", false);\n\t\t\tcaps.setCapability(\"native events\", true);\n\t\t\td = new InternetExplorerDriver(caps);\n\t\t\tlogger.info(\"--IE Browser has opened \");\n\t\t}\n\t\treturn d;\n\n\n\t}", "@BeforeMethod(alwaysRun = true)\n public static void setUp(){\n // ConfigReader.readProperties(Constants.CONFIGURATION_FILEPATH);\n ConfigReader.readProperties(Constants.CONFIGURATION_FILE);\n switch (ConfigReader.getPropertyValue(\"browser\")){\n case \"chrome\":\n //System.setProperty(\"webdriver.chrome.driver\", \"Drivers/chromedriver.exe\");\n WebDriverManager.chromedriver().setup();\n driver=new ChromeDriver();\n break;\n case \"firefox\":\n //System.setProperty(\"webdriver.gecko.driver\", \"Drivers/geckodriver.exe\");\n WebDriverManager.firefoxdriver().setup();\n driver=new FirefoxDriver();\n break;\n default:\n throw new RuntimeException(\"Invalid name of browser\");\n }\n driver.get(ConfigReader.getPropertyValue(\"url\"));\n driver.manage().window().maximize();\n //driver.manage().timeouts().implicitlyWait(Constants.IMPLICIT_WAIT, TimeUnit.SECONDS);\n }", "public static void setChromeDriverDownloadPath(String path)\n\t{\n\t\tApplicationProperties appProperties = p6web.getInstance();\n\t\t\n\ttry{\n\t\t\n\t\tm_driver = ApplicationProperties.getInstance().getDriver();\n\t\tm_driver.get(\"chrome://settings/advanced\");\n JavascriptExecutor js = (JavascriptExecutor) m_driver;\n String prefId = \"download.default_directory\";\n File tempDir=new File(System.getProperty(\"user.dir\")+path);\n if (m_driver.findElements(By.xpath(String.format(\".//input[@pref='%s']\", prefId))).size() == 0) {\n \tm_driver.get(\"chrome://settings-frame\");\n \tm_driver.findElement(By.xpath(\".//button[@id='advanced-settings-expander']\")).click(); }\n String tmpDirEscapedPath = tempDir.getCanonicalPath().replace(\"\\\\\", \"\\\\\\\\\");\n js.executeScript(String.format(\"Preferences.setStringPref('%s', '%s', true)\", prefId,\n tmpDirEscapedPath));\n\t\t}\n\t\n\t\tcatch(IOException e){\n\t\t\t\n\t\t}\n\t\n\t\tm_driver.get(appProperties.getUrl());\n\t\n\t}", "@BeforeClass\n\tpublic void initializebrowser() throws InterruptedException {\n\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", Chrome);\n\t\t// driver = new ChromeDriver(); \n\t\tChromeOptions options = new ChromeOptions();\n\t\toptions.addArguments(\"--disable-extensions\");\n\t\toptions.addArguments(\"test-type\");\n\t\toptions.addArguments(\"--disable-popup-blocking\");\n\t\tdriver = new ChromeDriver(options);\n\t\tdriver.manage().window().maximize();\n\t\tdriver.get(common.URL);\n\t\tThread.sleep(3000);\n\n\t\t\n\t\t/*DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();\n\t\t \n\t\t //Method and Description - void setCapability(java.lang.String capabilityName, boolean value)\n\t\t capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);\n\t\t \n\t\t //Among the facilities provided by the System class are standard input, standard output, and error output streams; access to externally defined \"properties\"; a means of loading files and libraries; and a utility method for quickly copying a portion of an array.\n\t\t System.setProperty(\"webdriver.ie.driver\", common.IE);\n\t\t \n\t\t //InternetExplorerDriver(Capabilities capabilities)\n\t\t WebDriver driver = new InternetExplorerDriver(capabilities);\n\t\t \n\t\t driver.manage().window().maximize();\n\t\t driver.get(common.URL);\n\t\t Thread.sleep(3000);*/\n\t\t\n\t}", "AgentPolicyBuilder setBypassCache(boolean bypassCache);", "@BeforeTest\n\t\t@Parameters(\"browser\")\n\tpublic void beforeTest(String browser) {\n\t\tif (browser.equalsIgnoreCase(\"firefox\")) {\n\t\t\tdriver = new FirefoxDriver();\n\t\t} else if (browser.equalsIgnoreCase(\"chrome\")) {\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"//home//enclaveit//Desktop//chromedriver\");\n\t\t\tdriver = new ChromeDriver();\n\t\t}\n\t\tdriver.get(url);\n\t}", "private static WebDriver getDriver(browsers browser) {\n\t\t\t\tLOG.log(Level.CONFIG, \"Requested driver: \" + browser);\n\t\t// 1. WebDriver instance is not created yet\n\t\tif (driver == null) {\n\t\t\tLOG.log(Level.CONFIG, \"No previous driver found\");\n\t\t\tdriver = newWebDriver( browser);\n\t\t\treturn driver;\n\t\t}\n\t\ttry {\n\t\t\tdriver.getCurrentUrl();//touch with stick\n\t\t} catch (Throwable t) {\n\t\t\tt.printStackTrace();\n\t\t\tnewWebDriver( browser);\n\t\t\treturn driver;\n\t\t}\n\t\treturn driver;\n\t}", "public static void main(String[] args) throws InterruptedException {\n\t\tFirefoxProfile prof = new FirefoxProfile();\r\n\t\tprof.setAcceptUntrustedCertificates(false);\r\n//the above 2 lines will allow you to get past an unsecured site (The connection is untusted. Remember to pass the object in the line below..) Only in FF, IE and Chrome handles it fine \r\n\t\t\r\n\t\tWebDriver driver = new FirefoxDriver(prof);\r\n\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\r\n\t\t//the global 5 second implicit wait above applies for all code below\r\n\t\t\r\n\t\tdriver.get(\"www.ebay.com\");\r\n\t\tdriver.findElement(By.tagName(\"a\")).click();\r\n\t\tThread.sleep(5000L);//explicit wait to wait for 5 seconds to do other tasks\r\n\t\t//But if you need to keep adding sleeps like this it can cause performance issues. So instead let's set a global implicit wait\r\n\t\tdriver.manage().deleteAllCookies();\r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void beforeNavigateRefresh(WebDriver driver) {\n\t\t\r\n\t}", "public void beforeNavigateRefresh(WebDriver driver) {\n\t\t\r\n\t}", "public void beforeNavigateRefresh(WebDriver driver) {\n\t\t\n\t}", "@Test\r\n\t\tpublic static void LaunchUrl()\r\n\t\t{\r\n\t\t\tdriver.manage().deleteAllCookies();\r\n\t\t\tdriver.get(prop.getProperty(\"url\"));\r\n\t\t\tdriver.manage().window().maximize();\t\r\n\t\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\t\r\n\t\t\r\n\t\t}", "public WebDriver openBrowser(String object, String data) {\n\n\t\ttry {\n\n\t\t\tString osName = System.getProperty(\"os.name\");\n\n\t\t\tlogger.debug(osName + \" platform detected\");\n\n\t\t\tosName = osName.toLowerCase();\n\n\t\t\tlogger.debug(osName);\n\n\t\t\tif (osName.indexOf(\"win\") >= 0) {\n\n\t\t\t\tif (driver == null) {\n\n\t\t\t\t\tlogger.debug(\"Opening browser\");\n\n\t\t\t\t\tif (data.equals(\"Mozilla\")) {\n\t\t\t\t\t\t/*Added by nitin gupta on 23/03/2016\n\t\t\t\t\t\t * This code is used to start firefox under proxy for ZAP\n\t\t\t\t\t\t */\n\t\t\t\t\t\t\n\t\t\t\t\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t\t\t\t\tif(CONFIG.getProperty(\"ZAP\").equals(Constants.RUNMODE_YES))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t Proxy proxy = new Proxy();\n\t\t\t\t proxy.setHttpProxy(CONFIG.getProperty(\"server\")+\":\"+CONFIG.getProperty(\"port\"));\n\t\t\t\t proxy.setFtpProxy(CONFIG.getProperty(\"server\")+\":\"+CONFIG.getProperty(\"port\"));\n\t\t\t\t proxy.setSslProxy(CONFIG.getProperty(\"server\")+\":\"+CONFIG.getProperty(\"port\"));\n\t\t\t\t capabilities.setCapability(CapabilityType.PROXY, proxy);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tFirefoxProfile profile = new FirefoxProfile();\n\t\t\t\t\t\tString sep = System.getProperty(\"file.separator\");\n\t\t\t\t\t\tFile dir=new File( System.getProperty(\"user.dir\")+ sep + \"externalFiles\" + sep + \"downloadFiles\");\n\t\t\t\t\t\t if(dir.exists()){\n\t\t\t\t\t\t\tlogger.debug(\"File Exits\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdir.mkdir();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\t\t\t\t\t\tprofile.setPreference(\"browser.download.folderList\",2);\n\t\t\t\t\t profile.setPreference(\"browser.download.manager.showWhenStarting\",false);\n\t\t\t\t\t profile.setPreference(\"browser.download.dir\", System.getProperty(\"user.dir\")+ sep + \"externalFiles\" + sep + \"downloadFiles\");\n\t\t\t\t\t FirefoxBinary binary = new FirefoxBinary(new File(CONFIG.getProperty(\"mozilla_path\")));\n\t\t\t\t\t profile.addExtension(new File(System.getProperty(\"user.dir\")+ sep + \"externalFiles\"+sep+\"uploadFiles\"+sep+\"wave_toolbar-1.1.6-fx.xpi\"));\n\t\t\t\t\t \n\t\t\t\t\t System.setProperty( \"webdriver.gecko.driver\",System.getProperty(\"user.dir\")+ CONFIG.getProperty(\"gecko_path\")); // Added By Kashish\n\t\t\t\t\t \n\t\t\t\t\t /*Added by Nitin on 23 march 2016,capabilities for starting firefox in proxy mode*/\n\t\t\t\t\t driver = new FirefoxDriver(binary, profile, capabilities);\n\n\t\t\t\t\t\tdriver.manage().window().maximize();\n\n\t\t\t\t\t} else if (data.equals(\"IE\")) {\n\n\t\t\t\t\t\tSystem.setProperty(\n\n\t\t\t\t\t\t\"webdriver.ie.driver\",\n\n\t\t\t\t\t\tSystem.getProperty(\"user.dir\")\n\n\t\t\t\t\t\t+ CONFIG.getProperty(\"ie_path\"));\n\n\t\t\t\t\t\tDesiredCapabilities d = new DesiredCapabilities();\n\n\t\t\t\t\t\tdriver = new InternetExplorerDriver(d);\n\n\t\t\t\t\t\tdriver.manage().window().maximize();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\telse if (data.equals(\"Safari\")) {\n\n\t\t\t\t\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\n\t\t\t\t\t\tdriver = new SafariDriver(capabilities);\n\n\t\t\t\t\t\tdriver.manage().window().maximize();\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if (data.equals(\"Chrome\")) \n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*Added by nitin gupta on 23/03/2016\n\t\t\t\t\t\t * This code is used to start chrome under proxy for ZAP\n\t\t\t\t\t\t */\n\t\t\t\t\t\t\n\t\t\t\t\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t\t\t\t\tif(CONFIG.getProperty(\"ZAP\").equals(Constants.RUNMODE_YES))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tProxy proxy = new Proxy();\n\t\t\t\t proxy.setHttpProxy(CONFIG.getProperty(\"server\")+\":\"+CONFIG.getProperty(\"port\"));\n\t\t\t\t proxy.setFtpProxy(CONFIG.getProperty(\"server\")+\":\"+CONFIG.getProperty(\"port\"));\n\t\t\t\t proxy.setSslProxy(CONFIG.getProperty(\"server\")+\":\"+CONFIG.getProperty(\"port\"));\n\t\t\t\t capabilities.setCapability(CapabilityType.PROXY, proxy);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.setProperty(\t\"webdriver.chrome.driver\",System.getProperty(\"user.dir\")+ CONFIG.getProperty(\"chrome_path\"));\n\t\t\t\t\t\tMap<String, Object> prefs = new HashMap<String, Object>(); // Added Code to set Download Path and allowing Multiple downloads on Chrome\n\t\t\t\t\t\tprefs.put(\"profile.content_settings.pattern_pairs.*.multiple-automatic-downloads\", 1);\n\t\t\t\t\t\tprefs.put(\"download.default_directory\", System.getProperty(\"user.dir\")+ File.separator + \"externalFiles\" + File.separator + \"downloadFiles\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tChromeOptions options = new ChromeOptions();\n\t\t\t\t\t\t// options.setExperimentalOption(\"prefs\", prefs);\n\t\t\t\t\t\t options.addArguments(\"--disable-popup-blocking\"); // Added by Sanjay on 07 march 2016 , to disable popup blocking.\n\t\t\t\t\t\t\n\t\t\t\t\t\t /*Added by Nitin on 23 march 2016, capabilities to driver for starting chrome in proxy mode*/\n\t\t\t\t\t\t capabilities.setCapability(ChromeOptions.CAPABILITY, options);\n\t\t\t\t\t\t driver = new ChromeDriver(capabilities);\n\t\t\t\t\t\t driver.manage().window().maximize();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\tlong implicitWaitTime = Long.parseLong(CONFIG.getProperty(\"implicitwait\"));\n\n\t\t\t\t\tdriver.manage().timeouts().implicitlyWait(implicitWaitTime, TimeUnit.SECONDS);\n\t\t\t\t\twait=new WebDriverWait(driver, explicitwaitTime);\n\t\t\t\t\treturn driver;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn driver;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telse if (osName.indexOf(\"mac\") >= 0) {\n\n\t\t\t\tif (driver == null) {\n\n\t\t\t\t\tlogger.debug(\"Opening browser\");\n\n\t\t\t\t\tif (data.equals(\"Mozilla\")) {\n\n\t\t\t\t\t\tFirefoxProfile profile = new FirefoxProfile();\n\n\t\t\t\t\t\tFirefoxBinary binary = new FirefoxBinary(new File(CONFIG.getProperty(\"mozilla_path_mac\")));\n\n\t\t\t\t\t\tdriver = new FirefoxDriver(binary, profile);\n\n\t\t\t\t\t\tdriver.manage().window().maximize();\n\n\t\t\t\t\t} else if (data.equals(\"IE\")) {\n\n\t\t\t\t\t\tSystem.setProperty(\n\n\t\t\t\t\t\t\"webdriver.ie.driver\",\n\n\t\t\t\t\t\tSystem.getProperty(\"user.dir\")\n\n\t\t\t\t\t\t+ CONFIG.getProperty(\"ie_path\"));\n\n\t\t\t\t\t\tDesiredCapabilities d = new DesiredCapabilities();\n\n\t\t\t\t\t\tdriver = new InternetExplorerDriver(d);\n\n\t\t\t\t\t\tdriver.manage().window().maximize();\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if (data.equals(\"Safari\")) {\n\n\t\t\t\t\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t\t\t\t\tcapabilities.setJavascriptEnabled(false);\n\t\t\t\t\t\tdriver = new SafariDriver(capabilities);\n\n\t\t\t\t\t\tdriver.manage().window().maximize();\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if (data.equals(\"Chrome\")) {\n\n\t\t\t\t\t\tSystem.setProperty(\n\n\t\t\t\t\t\t\"webdriver.chrome.driver\",\n\n\t\t\t\t\t\tSystem.getProperty(\"user.dir\")\n\n\t\t\t\t\t\t+ CONFIG.getProperty(\"chrome_path_mac\"));\n\t\t\t\t\t\tChromeOptions options = new ChromeOptions();\n\t\t\t\t\t\toptions.setBinary(CONFIG.getProperty(\"chrome_binary\"));\n\n\t\t\t\t\t\tdriver = new ChromeDriver(options);\n\n\t\t\t\t\t\tdriver.manage().window().maximize();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlong implicitWaitTime = Long.parseLong(CONFIG\n\n\t\t\t\t\t.getProperty(\"implicitwait\"));\n\n\t\t\t\t\tdriver.manage().timeouts()\n\n\t\t\t\t\t.implicitlyWait(implicitWaitTime, TimeUnit.SECONDS);\n\n\t\t\t\t\treturn driver;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn driver;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telse if (osName.indexOf(\"nix\") >= 0 || osName.indexOf(\"nux\") >= 0) {\n\n\t\t\t\tif (driver == null) {\n\n\t\t\t\t\tlogger.debug(\"Opening browser\");\n\n\t\t\t\t\tif (data.equals(\"Mozilla\")) {\n\n\t\t\t\t\t\tFirefoxProfile profile = new FirefoxProfile();\n\n\t\t\t\t\t\tFirefoxBinary binary = new FirefoxBinary(new File(\n\n\t\t\t\t\t\tCONFIG.getProperty(\"mozilla_path_linux\")));\n\n\t\t\t\t\t\tdriver = new FirefoxDriver(binary, profile);\n\n\t\t\t\t\t\tdriver.manage().window().maximize();\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if (data.equals(\"IE\")) {\n\n\t\t\t\t\t\tSystem.setProperty(\"webdriver.ie.driver\",\n\n\t\t\t\t\t\t\"ie_path_linux\");\n\n\t\t\t\t\t\tdriver = new InternetExplorerDriver();\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if (data.equals(\"Chrome\")) {\n\n\t\t\t\t\t\tnew DesiredCapabilities();\n\n\t\t\t\t\t\tURL serverurl = new URL(\"http://localhost:9515\");\n\n\t\t\t\t\t\tDesiredCapabilities capabilities = DesiredCapabilities\n\n\t\t\t\t\t\t.chrome();\n\n\t\t\t\t\t\tdriver = new RemoteWebDriver(serverurl, capabilities);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlong implicitWaitTime = Long.parseLong(CONFIG\n\n\t\t\t\t\t.getProperty(\"implicitwait\"));\n\n\t\t\t\t\tdriver.manage().timeouts()\n\n\t\t\t\t\t.implicitlyWait(implicitWaitTime, TimeUnit.SECONDS);\n\n\t\t\t\t\treturn driver;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn driver;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\treturn driver;\n\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\n\t\t\t// TODO Auto-generated catch block\n\n\t\t\te.printStackTrace();\n\n\t\t\treturn null;\n\n\t\t}\n\n\t}", "@BeforeClass\n public static void setup() {\n String driverPath = \"\";\n System.setProperty(\"webdriver.chrome.driver\", driverPath);\n driver = new ChromeDriver();\n driver.manage().window().maximize();\n }", "@Override\r\n public void afterNavigateRefresh(final WebDriver driver) {\n\r\n }", "public static void initialization(String browserName) throws InterruptedException, IOException\n{\n\n\tif(browserName.equals(prop.getProperty(\"browser\"))) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"D:\\\\Documents\\\\Softwares\\\\chromedriver.exe\");\n\t\tdriver = new ChromeDriver();\n\t\tThread.sleep(2000);\n\t}\n\telse if (browserName.equals(prop.getProperty(\"browser\")))\n\t\t{\n\t\t\tSystem.setProperty(\"webdriver.firefox.driver\",\"D:\\\\Documents\\\\Softwares\\\\geckodriver-v0.20.1-win64\\\\geckodriver.exe\");\n\t\t\tdriver = new FirefoxDriver();\n\t\t}\n\t\t\t\n\telse {\n\t\tSystem.out.println(\"No Browser Value Specified\");\n\t }\n\tdriver.manage().window().maximize();\n\tdriver.manage().deleteAllCookies();\n\tdriver.manage().timeouts().pageLoadTimeout(TestUtilities.PAGE_LOAD_TIMEOUT,TimeUnit.SECONDS);\n\tdriver.manage().timeouts().implicitlyWait(TestUtilities.IMPLICIT_WAIT,TimeUnit.SECONDS);\n\tdriver.get(prop.getProperty(\"url\"));\n\tdriver.manage().window().maximize();\n\tThread.sleep(2000);\n\t\n\t}", "@Before\n public void setUp() throws MalformedURLException {\n DesiredCapabilities cap = new DesiredCapabilities();\n cap.setCapability(\"devicename\",\"MyTestDevice\");\n\n //It works with java-client-4.0.0.jar :)\n drive = new AndroidDriver<WebElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), cap);\n //Reset the cache!\n drive.resetApp();\n\n }", "public void setUpMethod(){\n driver = WebDriverFactory.getDriver(\"Chrome\");\n //maximize the page\n driver.manage().window().maximize();\n //implicit wait\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n }", "public static void main(String[] args) throws InterruptedException {\nWebDriver driver=new FirefoxDriver();\ndriver.get(\"file:/// C:/Users/viprava/Desktop/sample1.html\");\n//driver.findElement(By.id(\"/n\")).click();\n//Thread.sleep(2000);\n//driver.navigate().back();\nThread.sleep(2000);\ndriver.findElement(By.name(\"uname\")).click();\nThread.sleep(2000);\ndriver.navigate().back();\nThread.sleep(2000);\ndriver.findElement(By.className(\"abc\")).click();\nThread.sleep(2000);\ndriver.navigate().back();\nThread.sleep(2000);\ndriver.close();\n\t}", "public WebDriver initDriver (Properties prop) {\r\n\t\tString browserName = prop.getProperty(\"browser\");\r\n\t\tif(browserName.equals(\"chrome\")) {\r\n\t\t\toptionsManager = new OptionsManager(prop);\r\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"./src/test/resources/chrome/chromedriver.exe\");\r\n\t\t\tdriver = new ChromeDriver(optionsManager.getChromeOptions());\r\n\t\t}else if(browserName.equals(\"firefox\")) {\r\n\t\t\toptionsManager = new OptionsManager(prop);\r\n\t\t\tSystem.setProperty(\"webdriver.gecko.driver\",\"./src/test/resources/firefox/geckodriver.exe\");\r\n\t\t\tdriver = new FirefoxDriver(optionsManager.getFirefoxOptions());\r\n\t\t}\r\n\t\t\r\n\t\teventDriver = new EventFiringWebDriver(driver);\r\n\t\teventListener = new WebEventListener();\r\n\t\teventDriver.register(eventListener);\r\n\t\tdriver = eventDriver;\r\n\t\t\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().deleteAllCookies();\r\n\t\tdriver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);\r\n\t\tdriver.get(prop.getProperty(\"url\"));\r\n\t\treturn driver;\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tSystem.setProperty(\"webdriver.gecko.driver\",\"./sotware/geckodriver.exe\");\r\n\t\tFirefoxDriver driver=new FirefoxDriver();\r\n\t}", "@Test\r\n\tpublic void tc1(){\r\n\t\tWebDriverManager.chromedriver().setup();\r\n\t\tdriver=new ChromeDriver();\r\n\t\tdriver.get(\"https://www.seleniumhq.org/download/\");\r\n\t\tString title = driver.getTitle();\r\n\t\tSystem.out.println(title);\r\n\t\tdriver.close();\r\n\t}", "@BeforeClass\n public void BeforeTest(){\n Configuration.browser = \"Chrome\";\n\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\tgetCoverageReport = com.crawljax.plugins.testilizer.Testilizer.getCoverageReport();\n\t if (getCoverageReport)\n\t \tdriver = new FirefoxDriver(getProfile());\n\t else\n\t\t\tdriver = new FirefoxDriver();\n\t\turl = \"http://localhost:8888/claroline-1.11.7/index.php?logout=true\";\n\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\t}", "@BeforeClass\n public static void setUpClass() throws Exception {\n\t driver = new FirefoxDriver();\n\t \n baseUrl = \"http://localhost/\";\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n }", "@BeforeClass\r\n\tpublic void setUp() {\r\n\r\n\t\t// This will launch browser and specific url\r\n\t\tdriver = BrowserFactory.startBrowser(driver, \"Chrome\", \"https://www.flipkart.com/\");\t\r\n\t\r\n\t}", "public WebDriver browserSetup() throws IOException\r\n\t{ \r\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\r\n\t\tSystem.out.println(\"1.Chrome\\n2.Firefox \\nEnter your choice:\");\r\n\t\tString choice=br.readLine();\r\n\t\t\r\n\t\tswitch(choice)\r\n\t\t{\r\n\t\t//To start Chrome Driver\r\n\t\tcase \"1\":\r\n\t\t System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Test Automation\\\\Software\\\\chrome\\\\New Version\\\\chromedriver.exe\");\r\n\t\t ChromeOptions options=new ChromeOptions();\r\n\t\t options.addArguments(\"--disable-notifications\");\r\n\t\t driver=new ChromeDriver(options);\r\n\t\t break;\r\n\t\t\r\n\t\t//To start Firefox Driver\r\n\t\tcase \"2\":\r\n\t\t\tSystem.setProperty(\"webdriver.gecko.driver\", \"C:\\\\***\\\\drivers\\\\geckodriver.exe\");\r\n\t\t\tdriver=new FirefoxDriver();\r\n\t\t\tbreak;\r\n\t\t} \r\n\t\t\r\n\t\tdriver.get(url);\r\n\t\t\r\n\t\t//To maximize the window\r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\tdriver.manage().timeouts().pageLoadTimeout(8, TimeUnit.SECONDS);\r\n\t\t\r\n\t\treturn driver;\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tWebDriver driver;\n\t\t\n\t\t// Used to launch Firefox Driver\n\t\t// WebDriver driver = new FirefoxDriver();\n\t\tFile file = new File(\"driver//geckodriver.exe\");\n\t\tSystem.setProperty(\"webdriver.gecko.driver\", file.getAbsolutePath());\n\t\tDesiredCapabilities capabilities = DesiredCapabilities.firefox();\n\t\tcapabilities.setCapability(\"marionette\",true);\n\t\tdriver = new FirefoxDriver(capabilities);\n\t\t \n\t\t//Launching the URL in to the firefox address bar\n\t\tdriver.get(\"http://www.seleniumhq.org/download/\");\n\t\t\n\t\t//Get the Title of the page\n\t\tString TitleValue = driver.getTitle();\n\t\tSystem.out.println(\"Title of the page is \"+ TitleValue);\n\t\t\n\t\t// Used to maximize the window\n\t\tdriver.manage().window().maximize();\n\t\t\n\t\tdriver.navigate().back();\n\t\tSystem.out.println(\"Navigated back to the page\");\n\t\t\n\t\tdriver.navigate().forward();\n\t\tSystem.out.println(\"Forwared page \");\n\t\t\n\t\tdriver.navigate().refresh();\n\t\tSystem.out.println(\"Refresh the page\");\n\t\t\n\t\t//Close the driver\n\t\tdriver.close();\n\t}", "public void setup(){\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"//Users//bpat12//Downloads//chromedriver\");\n\t\tdriver = new ChromeDriver();\n\t\tSystem.out.println(\"launch browser\");\n\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\tdriver.get(url);\n\t}", "@Test\n\tpublic void ieOptions()\t{\n\t\tSystem.setProperty(InternetExplorerDriverService.IE_DRIVER_LOGLEVEL_PROPERTY,\"INFO\"); \n\t\t//System.setProperty(InternetExplorerDriverService.IE_DRIVER_LOGLEVEL_PROPERTY,\"FATAL\"); \n\t\t//System.setProperty(InternetExplorerDriverService.IE_DRIVER_LOGLEVEL_PROPERTY,\"ERROR\"); \n\t\tSystem.setProperty(InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY, \"D:\\\\IE.log\");\n\t // System.setProperty(InternetExplorerDriverService.IE_DRIVER_SILENT_PROPERTY, \"true\");\n\t\tInternetExplorerOptions options = new InternetExplorerOptions();\n\t\t//options.setPageLoadStrategy(\"\");\n\t\tSystem.setProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY, \"D:\\\\Selenium Drivers\\\\IEDriverServer.exe\");\n\t\tDesiredCapabilities cap = new DesiredCapabilities();\n\t\t// Enable proxy but will enable in system settings\n/*\n\t\tString PROXY = \"83.209.94.89:44557\";\n\t Proxy proxy = new Proxy();\n\t proxy.setAutodetect(false);\n\t proxy.setProxyType(Proxy.ProxyType.MANUAL);\n\t proxy.setSocksProxy(PROXY);\n\t cap.setCapability(CapabilityType.PROXY, proxy);\n\t\t options.merge(cap);\n*/\t\t\n\t\t\n\t\tWebDriver driver = new InternetExplorerDriver(options);\n \tdriver.get(\"https://192.163.254.17/\");\n \t// Get rid of https allow page - standard code\n\t\tdriver.get(\"javascript:document.getElementById('overridelink').click();\");\n\t}", "public void browser() {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"src/test/resources/Driver/chromedriver.exe\");\n\t\tdriver = new ChromeDriver();\n\t\tdriver.manage().window().maximize();// maximize the window\n\t\tdriver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);\n\n\t}", "@BeforeMethod\n public void beforeMethod() {\n \tdriver = new FirefoxDriver();\n \t\n \t// Set a wait time\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n // 2) Open ToolsQA.com\n driver.get(\"http://www.ToolsQA.com\");\n }", "@BeforeTest\r\n\r\n\tpublic void setUp() throws Exception {\r\n\t\t// PropertyConfigurator.configure(\"log4j.properties\");\r\n\t\tdriver = new FirefoxDriver();\r\n\t\tbaseUrl = \"https://pghvm-vr7-www1.omnyx.com/Omnyx.Web/login\";\r\n\r\n\t\t// Maximize the browser's window\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\n\t\tdriver.manage().timeouts().pageLoadTimeout(15, TimeUnit.SECONDS);\r\n\r\n\t}", "@BeforeTest\r\n\tpublic void launch()\r\n\t{\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Yogini\\\\chromedriver\\\\chromedriver.exe\"); //location of browser in local drive\r\n\t\tWebDriver driver = new ChromeDriver(); \r\n\t\tdriver.get(tobj.url);\r\n\t\tSystem.out.println(\"Before test, browser is launched\");\r\n\t}", "@BeforeTest\n\n public void setup() {\n\n \t System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\Lenovo 1\\\\eclipse-workspace\\\\firstTestProject\\\\src\\\\test\\\\resources\\\\chromedriver.exe\");\n driver = new ChromeDriver();\n\n /* System.setProperty(\"webdriver.gecko.driver\", \"C:\\\\Users\\\\Lenovo 1\\\\eclipseprojects\\\\seleniumTestProject\\\\src\\\\test\\\\resources\\\\geckodriver.exe\");\n driver = new FirefoxDriver();*/\n\n\n// System.setProperty(\"webdriver.chrome.driver\", \"/home/ushani/Selenium_ProjectWS/TwoBulls/seleniumTestProject/src/test/resources/chromedriver\");\n// WebDriver driver = new ChromeDriver();\n\n driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\n driver.get(\"http://www.google.com\");\n }", "public void setUp() throws Exception {\n System.setProperty(\"webdriver.chrome.driver\", \"./chromedriver.exe\");\n ChromeOptions options = new ChromeOptions();\n options.addArguments(\"--start-maximized\");\n options.addArguments(\"--disable-notifications\");\n\n _driver = new ChromeDriver(options);\n _driver.get(\"https://staging.snaptravel.com/search?encrypted_user_id=BZ18EE-j_XQAPEzGzj91cQ\");\n _driver.manage().window().maximize();\n _driver.navigate().refresh();\n _driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n new Page(_driver);\n\n }", "@BeforeClass\n public static void setup(){\n WebDriverManager.chromedriver().setup();\n webDriver = new ChromeDriver();\n webDriver.manage().window().maximize();\n webDriver.manage().timeouts().implicitlyWait(3000, TimeUnit.MILLISECONDS);\n }", "@After\n public void tearDown () {\n // driver.quit(); // for chromedriver\n driver.close();\n }", "private static WebDriver driver() {\n\t\treturn null;\r\n\t}", "private void setDriverPathForBrowser(String browserName) {\n \t\n \tif ( !binariesPath.exists() ) throw new IllegalStateException(\"No path at \" + binariesPath.getAbsolutePath() );\n \t\n switch (browserName.toLowerCase()) {\n case \"firefox\":\n {\n if (isMac())\n {\n System.setProperty(\"webdriver.gecko.driver\", new File(binariesPath,\"/MAC/geckodriver-v0.19.0-macos.tar.gz/geckodriver-v0.19.0-macos.tar\").getAbsolutePath());\n }\n else if (isLinux())\n {\n System.setProperty(\"webdriver.gecko.driver\", new File(binariesPath, \"/Ubuntu/geckodriver\").getAbsolutePath());\n }\n else\n {\n System.setProperty(\"webdriver.gecko.driver\", new File(binariesPath, \"/Windows/geckodriver.exe\").getAbsolutePath());\n }\n break;\n }\n case \"chrome\": {\n if (isMac()) {\n System.setProperty(\"webdriver.chrome.driver\", new File(binariesPath, \"/MAC/chromedriver\").getAbsolutePath());\n } else if (isLinux()) {\n System.setProperty(\"webdriver.chrome.driver\",new File(binariesPath, \"/Ubuntu/chromedriver\").getAbsolutePath());\n } else {\n System.setProperty(\"webdriver.chrome.driver\",new File(binariesPath,\"/Windows/chromedriver.exe\").getAbsolutePath());\n }\n break;\n }\n case \"ie\":\n System.setProperty(\"webdriver.ie.driver\", new File(binariesPath,\"/Windows/IEDriverServer.exe\").getAbsolutePath());\n }\n }" ]
[ "0.757007", "0.6764399", "0.666708", "0.64646167", "0.644841", "0.64482886", "0.64480627", "0.64236563", "0.6398326", "0.6393131", "0.6373735", "0.63440704", "0.6335465", "0.632778", "0.63101596", "0.6290352", "0.6285155", "0.6281913", "0.62736654", "0.62579644", "0.62502164", "0.6205416", "0.61608523", "0.6130443", "0.6109655", "0.6101583", "0.60791844", "0.6067377", "0.6043861", "0.6033565", "0.60285234", "0.6023357", "0.60147816", "0.5988951", "0.59819084", "0.59799534", "0.5974605", "0.597198", "0.5962572", "0.5955914", "0.5954557", "0.5945045", "0.5937358", "0.5934456", "0.592283", "0.59183186", "0.5915586", "0.5894784", "0.58858883", "0.58826476", "0.5879972", "0.5865284", "0.5860911", "0.5827224", "0.58170515", "0.5814573", "0.5805229", "0.57858723", "0.5784216", "0.57766455", "0.5772249", "0.57700634", "0.57679194", "0.57633185", "0.5753488", "0.5741733", "0.57287383", "0.5717375", "0.5705061", "0.5704867", "0.5704867", "0.5701375", "0.5700351", "0.5695633", "0.5694858", "0.569441", "0.56914836", "0.5688956", "0.5678699", "0.5666958", "0.56638545", "0.5661398", "0.5660978", "0.5657437", "0.56537706", "0.56526875", "0.56492126", "0.56485975", "0.5647849", "0.56349885", "0.562111", "0.5620241", "0.5618073", "0.5617259", "0.561715", "0.56160754", "0.56156147", "0.5611577", "0.56087637", "0.560835", "0.56023145" ]
0.0
-1
TODO Autogenerated method stub System.out.println(args[0]); System.out.println(args[1]);
public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); ValuesRecords values = new ValuesRecords(args[1]); BTreeStructure btree = new BTreeStructure(args[0]); while(sc.hasNext()) { //get command here! String commline = sc.nextLine(); //split, then check comm[0] if exit; break if true, else commandLine String[] comm = commline.split(" "); if(comm[0].equals("exit")) { break; } //invalid command rejector else if (!comm[0].equals("insert")||!comm[0].equals("select")||!comm[0].equals("update")) { System.out.println("ERROR: invalid command"); } else { commandLine(values, btree, commline); } } sc.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n System.out.println(\"args[0] = \" + args[0]);\n System.out.println(\"args[1] = \" + args[1]);\n System.out.println(\"args[2] = \" + args[2]);\n }", "public static void main(String[] args) {\n\t\tfor (int i =0; i<args.length; i++) {\r\n\t\t\tSystem.out.println(\"args[\"+i+\"]\" + args[i]);\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tfor (int j = 0; j < args.length; j++) {\n\t\t\tSystem.out.println(args[j]);\n\t\t\t\n\t\t}\n\t}", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\r\n\t\tfor (int i=0; i<args.length; i++) {\r\n\t\t\tSystem.out.println(args[i]);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\r\n\t\tfor (int t = 0; t < args.length; t++){\r\n\t\t\tSystem.out.println(\"Argument \" + t + \" is \" + args[t]);\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n\n\t\t\n\t}", "public static void main(String[] args){\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tfor(int i=0;i < args.length;i++){\r\n\t\t\tSystem.out.print(args[i] + \" \");\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public static void main (String args[]) {\n\t\t\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t}", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args){\n\t\t\n\t\t\n \t}", "public static void main(String[] args) {\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\n\n\t}", "public static void main(String[] args){\n\n\t}", "public static void main(String[] args){\n\n\t}", "public static void main(String[] args){\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\nSystem.out.println(\"you passed...\"+args.length);\r\nfor(int i=0;i<args.length;i++)\r\n{\r\n\tSystem.out.println(\"data is\"+args[i]);\r\n}\r\n\t}", "public static void main(String args[]){\n\t\t\n\t\n\t}", "public static void main(String[] args) \n\t{\n\t\t\n\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\t\t\n\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\t\r\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\r\n\t}", "public static void main(String[] args)\r\t{", "public static void main(String[] args) {\n\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n \n\t\t}", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public static void main(String args[]){\n\t\t\r\n\t}", "public static void main(String[] args) {\n System.out.println(\"Start printing out args: \");\n for(int i = 0; i < args.length; i = i + 1) {\n System.out.println(args[i]);\n }\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t}", "public static void main(String args[]){\n\t\t\n\t}", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args){\n \t\n }", "public static void main(String[] args) {\t\n\t\t\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t \t\n\t \t\n\t }", "public static void main(String[] args) {\n \n\t}", "public static void main( String[ ] args ) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t\r\n\t}", "public static void main (String[] args) {\r\n\t\t \r\n\t\t}", "public static void main(String[] args) {\n \n \n \n\t}", "public static void main(String[] args) {\n \r\n\t}", "public static void main(String[] args) {\n\t\t \n\t}", "public static void main(String[] args) \n\t{\n\n\t}", "public static void main(String[] args) \n\t{\n\n\t}", "public static void main(String[] args) \n\t{\n\n\t}", "public static void main(String args[]){\n \t\n \t\n }", "public static void main(String[] args) {\n\t\t\t\t\n\t}", "public static void main(String[] args) {\n\n }", "public static void main(String[] args) {\n\n }", "public static void main(String[] args) {\n\t\r\n\t}", "public static void main(String[] args) {\n\n\n\t}", "public static void main(String[] args) {\n\n\n\t}", "public static void main(String[] args) {\n\n\n\t}", "public static void main(String args[]) {\r\n }", "public static void main(String[] args)\n\t{\n\n\t}", "public static void main(String[] args)\n\t{\n\n\t}", "public static void main(String[] args)\n\t{\n\n\t}", "public static void main(String[] args)\n\t{\n\n\t}", "public static void main(String[] args) {\n\t\t\t}", "public static void main(String[] args) {\r\n\r\n\t}", "public static void main(String[] args) {\r\n\r\n\t}", "public static void main(String[] args) {\r\n\r\n\t}", "public static void main(String[] args) {\n\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\n\t}", "public static void main(String[] args) {\n\n\t}", "public static void main(String[] args) {\n\n\t}", "public static void main(String[] args) {\n\n\t}" ]
[ "0.82079196", "0.8010626", "0.79416114", "0.79365647", "0.7897008", "0.7886174", "0.787778", "0.7863757", "0.7861694", "0.7835075", "0.78246176", "0.78155005", "0.7808297", "0.7808297", "0.7808297", "0.7808297", "0.78004515", "0.7796408", "0.7793028", "0.7793028", "0.7793028", "0.7793028", "0.7793028", "0.7782126", "0.7776755", "0.7776755", "0.7776755", "0.7776755", "0.7776524", "0.7771332", "0.7771332", "0.7771332", "0.7771332", "0.7771332", "0.7771332", "0.7771332", "0.77573514", "0.77573514", "0.77573514", "0.7756636", "0.7756636", "0.77545905", "0.77516675", "0.7751045", "0.774837", "0.77402014", "0.77363104", "0.77342594", "0.77280223", "0.7726545", "0.7722942", "0.7722942", "0.7722942", "0.7722942", "0.7722942", "0.7722942", "0.7722942", "0.7722942", "0.7722942", "0.7719881", "0.7712135", "0.77092016", "0.7708815", "0.7707776", "0.77000844", "0.76978844", "0.76902074", "0.76893264", "0.7683967", "0.76810896", "0.76809347", "0.76788694", "0.7677669", "0.76686513", "0.76679903", "0.765303", "0.76494586", "0.76494586", "0.76494586", "0.7645001", "0.7638617", "0.763129", "0.763129", "0.7626474", "0.7625312", "0.7625312", "0.7625312", "0.7614159", "0.7603933", "0.7603933", "0.7603933", "0.7603933", "0.7599834", "0.75936455", "0.75936455", "0.75936455", "0.7592718", "0.7588036", "0.7588036", "0.7588036", "0.7588036" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Outer o=new Outer(); Outer.inner in=o.new inner(); in.disp_inner(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Constructor for objects of class Triangulo
public Triangulo(double l1, double l2, double l3) { // initialise instance variables lado1=l1; lado2=l2; lado3=l3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Triangulo(int L1, int b, float h) { // el metodo constructor con su parametros que me se servira para inicializar mis atributos\r\n lado = L1;\r\n base = b;\r\n haltura = h;\r\n }", "public Triangle() {}", "public Triangles()\n {\n this.triangles = new ArrayList<>();\n }", "public Trie() {}", "public Trie() {}", "public Trie() {\n\n }", "public Tetraedro(double base, double altura){\n c = new Triangulo(base, altura);\n }", "public TrieNode(){}", "public Rectangulo(){}", "public Trie() {\n \n }", "public Triangle() {\n this(0,0,0,0,0);\n }", "public TripeaksPyramidSolitaire() {\r\n super();\r\n }", "public Triangle (int x, int y, int z){ \r\n \r\n \r\n }", "public Trie() {\n root = new TreeNode();\n }", "public Trie() {\n root = new Node();\n }", "public Triangle() { \n super(\"Triangle: \");\n this.setP1(new Point());\n this.setP2(new Point());\n this.setP3(new Point());\n }", "public Triangle(Triangle tri){\n this(tri.width, tri.height, tri.perpendicular, tri.getX(), tri.getY());\n }", "public Trips() {\n this(\"trips\", null);\n }", "public TrieNode() {\n this.arr = new TrieNode[26];\n }", "public Trie() {\n \troot=new TrieNode();\n }", "public Triangle( Triangle tri ) {\n super(\"Triangle: \");\n this.setP1( new Point( tri.getP1() ) );\n this.setP2( new Point( tri.getP2() ) );\n this.setP3( new Point( tri.getP3() ) );\n }", "public TrieST() {\n }", "public TrieNode() {\n \n }", "public TriangleSolitaireModelImpl() {\r\n super(new TriangleBoard());\r\n }", "public Triangle() {\n\t\tsuper();\n\t\tthis.base = 0;\n\t\tthis.height = 0;\n\t\t\n\t}", "public Triangle() {\n setPointsAs0();\n S = 0;\n }", "public Trie() { // 这里只需要两个field, 不需要存自身值\n root = new TrieNode();\n }", "public Trie() {\n root = new TrieTree(' ');\n }", "public Trie() {\n root = new TrieNode();\n }", "public Trie() {\n root = new TrieNode();\n }", "public Trie() {\n\t\tnodes = new Trie[26];\n\t}", "public Trie() {\n next = new Trie[26];\n }", "public Triangle(){\n\t\tside1=1.0;\n\t\tside2=1.0;\n\t\tside3=1.0;\n\t}", "public Triangle()\n {\n\n this(new Point(-0.5f, (float)-Math.tan(Math.PI / 6), 0f), new Point(\n 0.5f,\n (float)-Math.tan(Math.PI / 6),\n 0f), new Point(0f, (float)Math.sqrt(0.75)\n + (float)-Math.tan(Math.PI / 6), 0f));\n }", "public TrieTree()\n {\n prefixes = 0;\n children = new TreeMap<>();\n childrenAdded = new ArrayList<>();\n }", "public Triangle(IPoint firstPoint, IPoint secondPoint, IPoint thirdPoint)\n {\n this(firstPoint, secondPoint, thirdPoint, null);\n\n }", "TriNode() {\r\n children = new HashMap<>();\r\n isValidWord = false;\r\n }", "public Trie() {\n root = new TrieNode();\n }", "public Trie() {\r\n tree = new ArrayPrefixTree(new CharacterCompressor() {\r\n @Override\r\n public int lowerBound() {\r\n return 'a';\r\n }\r\n\r\n @Override\r\n public int upperBound() {\r\n return 'z';\r\n }\r\n\r\n @Override\r\n public int transform(char c) {\r\n return c;\r\n }\r\n\r\n @Override\r\n public char transfromBack(int c) {\r\n return (char) c;\r\n }\r\n });\r\n }", "public Trie() {\n \troot=new TrieNode();\n }", "Triangle(){\n side1 = 1.0;\n side2 = 1.0;\n side3 = 1.0;\n }", "public TripsFragment() {\n }", "public Articulo(){\r\n\t\t\r\n\t}", "public Trie() {\n root = new TrieNode();\n root.val = ' ';\n }", "public Triangle (int tipX, int tipY, int height, String orientation){\n super.points = new ArrayList();\n x1 = tipX;\n y1 = tipY;\n this.height = height;\n defineVertexes(orientation);\n definePoints();\n }", "public Trie() \n\t {\n\t root = new TrieNode();\n\t }", "public WordDictionary()\n {\n root = new TrieNode1();\n\n }", "public PascalTriangleException()\r\n {\r\n }", "public Triangle() {\n\t\tsuper.addPoint(new java.awt.Point(0,1));\n\t\tsuper.addPoint(new java.awt.Point(1,0));\n\t\tsuper.addPoint(new java.awt.Point(2,1));\n\t}", "public Trie () {\n this.fils = new HashMap<String,Trie>();\n this.fin = false;\n this.num_noeud = 0;\n this.compt = 0;\n }", "public Trie() {\n this.root = new Node('\\0');\n }", "public Trips(String alias) {\n this(alias, TRIPS);\n }", "public TriangleObject (double[][][] t) {\n\tfor (double[][] i: t) {\n Triangle in = new Triangle(i);\n\t\ttriangles.add(in); //You need to instantiate a new triangle to satsify this ^^\n\t}\n }", "TriangleChecker(int x, int y, int z) {\n triangle = new Triangle(x, y, z);\n }", "public Trie_simple(int[] t) {\n\t\tthis(t,0,t.length -1);\n\t}", "public Trie() {\n head = new Node(false);\n }", "public Trie() {\n\t\troot = new TrieNode(' ');\n\t}", "public Triangle(Point p1, Point p2, Point p3) {\n this.p1 = p1;\n this.p2 = p2;\n this.p3 = p3;\n this.path = buildPath();\n }", "public Trie() {\n this.root = new Node(' ');// set root as blank to have multiple tries with different prefixes\n }", "private TrieNode() {\n this.arr = new TrieNode[CAPACITY];\n }", "public Trie() {\n this.root = new Node('0');\n }", "public WordDictionary() {\n \troot=new TrieNode(); \n \n }", "@Override\n\tpublic String toString() {\n\t\treturn \"Triangulo [b_=\" + b_ + \", h_=\" + h_ + \", Area=\" + Area() +\n\t\t\", Diameter=\" + super.Perimeter() + \", Diagonals=\" + super.Diagonals() +\"]\";\n\t}", "public Trie() {\n this.root = new Node(null);\n }", "public Triangle(Point a, Point b, Point c){\n this.a=a;\n this.b=b;\n this.c=c;\n }", "public Triangle( Point p1, Point p2, Point p3 ) {\n super(\"Triangle: \");\n this.setP1(p1);\n this.setP2(p2);\n this.setP3(p3);\n }", "public TTau() {}", "public Triangle(String stringTriangle) {\n setPointsAs0();\n setPoints(stringTriangle);\n setRibs();\n calculateBaseAndHeight();\n calculateS();\n }", "public Tribute()\n {\n vectOfCoef = new Vector<Double>(numOfCoef);\n for(int x =0; x < numOfCoef; x++)\n {\n vectOfCoef.addElement((Math.random() * 2) - 1);\n }\n }", "Triangle(int x, int y, int z) {\n this.x = x;\n this.y = y;\n this.z = z;\n }", "public Triangle (double x1,double y1,double x2, double y2,double x3,double y3)\r\n {\r\n v1 = new Point(x1,y1);\r\n v2 = new Point(x2,y2);\r\n v3 = new Point(x3,y3);\r\n }", "public TrieTree() {\n head = new Node();\n head.pass = 0;\n head.end = 0;\n head.next = new Node[26];\n }", "public TrieNode() {\n children = new HashMap<>();\n isWord = false;\n }", "public WordDictionary() {\n root = new TrieNode();\n }", "public WordDictionary() {\n root = new TrieNode();\n }", "public WordDictionary() {\n root = new TrieNode();\n }", "public RedPuzzle() {\n }", "public WordDictionary() {\n root=new TrieNode();\n }", "public TrieWithWord() {\n root = new TrieNodeWithWord();\n }", "public Trie() {\r\n\t\troot = new Node(null, '\\0', false); // root is set to null with the null\r\n\t\t\t\t\t\t\t\t\t\t\t// character by default\r\n\t}", "public WordDictionary() {\n root = new TrieNode('#');\n }", "public TriangleData()\r\n {\r\n knownCount = 0;\r\n /*--------------------------------------------------------------------*\r\n Input is validated by set. \r\n Must be >= 0.0\r\n Is there a practical maximum?\r\n \r\n Can you throw an exception in a constructor?\r\n *--------------------------------------------------------------------*/\r\n set( DataID.DATA_A, 0.0 );\r\n set( DataID.DATA_B, 0.0 );\r\n set( DataID.DATA_C, 0.0 );\r\n\r\n }", "public TCubico(){}", "FractalTree() {\r\n }", "public ContasCorrentes(){\n this(0,\"\",0.0,0.0,0);\n }", "public Triangle(\n IPoint firstPoint,\n IPoint secondPoint,\n IPoint thirdPoint,\n IPrimitive parent)\n {\n super(parent);\n this.addVertex(firstPoint);\n this.addVertex(secondPoint);\n this.addVertex(thirdPoint);\n\n }", "public QuadGramMap()\n\t{\n\t\tsuper();\n\t}", "public Triangle(int x1, int y1, int x2, int y2, int x3, int y3, String name){\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n this.x3 = x3;\n this.y3 = y3;\n this.name = name;\n \n \n }", "public void triangulo() {\n fill(0);\n stroke(255);\n strokeWeight(5);\n triangle(width/2, 50, height+100, 650, 350, 650);\n //(width/2, height-100, 350, 150, 900, 150);\n }", "public TriangleSolitaireModelImpl(int emptyRow, int emptyCol) throws IllegalArgumentException {\r\n super(new TriangleBoard(emptyRow, emptyCol));\r\n }", "public ImplementTrieI() {\n root = new TrieNode();\n }", "public ShapeTriMesh() {\n\t\tsuper();\n\t\tthis.setName(UUID.randomUUID().toString());\n\t}", "public Triangle(ITriangle triangleToCopy, IPrimitive parent)\n {\n super(triangleToCopy, parent);\n\n }", "public MyTrie() {\n\t\troot = new TreeNode(null, null, null,false); \n\t\tfoundFalse = false;\n\t\tnumNodes=1;\n\t}", "public Triangle (double x1,double y1,double x2, double y2)\r\n {\r\n v1 = new Point(x1,y1);\r\n v2 = new Point(x2,y2);\r\n v3 = new Point(0,0);\r\n }", "public NFA(){}", "public Rectangulo()\n\t{\n\t\tthis.alto = 0;\n\t\tthis.ancho = 0;\n\t\tthis.area = 0;\n\t}", "public TrieNode() {\n map = new HashMap<Character, TrieNode>();\n isLeaf = false;\n }", "public Triangle(double length) {\n super(length); //Creates the square\n super.calculateArea(); //Calculates the area of the whole square\n calculateArea(); //Right Triangle 1/2 area\n }", "public Translation() {\n\n this(0, 0, 0);\n }" ]
[ "0.7647777", "0.73118705", "0.7301778", "0.7180028", "0.7180028", "0.71081626", "0.70190525", "0.690407", "0.6854283", "0.6844558", "0.6801465", "0.67831063", "0.67674", "0.6740422", "0.65786695", "0.6569161", "0.6562382", "0.6550363", "0.6544397", "0.65413076", "0.6529382", "0.65081394", "0.64992875", "0.6491244", "0.64692235", "0.6457423", "0.64552766", "0.6447439", "0.6420121", "0.6420121", "0.6417149", "0.6410356", "0.64027756", "0.6364256", "0.6335769", "0.6331576", "0.6320128", "0.6309038", "0.6307524", "0.63013005", "0.6242913", "0.6237733", "0.6213915", "0.62009585", "0.6200943", "0.6197555", "0.6192804", "0.6187633", "0.61795944", "0.6178835", "0.61670035", "0.6151182", "0.61223876", "0.61046153", "0.60895544", "0.6085398", "0.6057509", "0.605621", "0.60475135", "0.6029908", "0.6019989", "0.60155463", "0.600685", "0.60055566", "0.5982737", "0.5978668", "0.5975688", "0.5971093", "0.5934599", "0.5933149", "0.59252965", "0.592469", "0.5923852", "0.5907692", "0.5907692", "0.5907692", "0.5897783", "0.58898777", "0.58689356", "0.5858852", "0.5858376", "0.5855652", "0.5849741", "0.5848162", "0.583991", "0.58342606", "0.5811967", "0.58082193", "0.5795373", "0.57929736", "0.5792124", "0.5790481", "0.57891434", "0.5772485", "0.5762702", "0.5738996", "0.5716341", "0.57127833", "0.5712526", "0.5711586" ]
0.78182894
0
constructor with folder log path
public Methods(String sLogFolderPath) { try { initialize(); setLogFolderPath(sLogFolderPath); } catch (Exception e) { println("Methods(String sLogFolderPath) : " + e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Log()\n {\n filePath = String.format(\"log-%d.sl\", System.currentTimeMillis());\n\n open();\n }", "LogFile(File file)\n {\n this.file = file;\n }", "public Journal(String folder, String imageFileName, String editLogFileName) throws IOException {\n if (!folder.endsWith(Constants.PATH_SEPARATOR)) {\n folder += Constants.PATH_SEPARATOR;\n }\n mImagePath = folder + imageFileName;\n mEditLogPath = folder + editLogFileName;\n }", "Path getLogFilePath();", "abstract protected String getLogFileName();", "public LogReader(String path) {\n this.path = path;\n }", "public FileAppender()\n {\n //LogManager.getLogManager().reset();\n logger = Logger.getLogger(\"MyLog\");\n\n final Properties loggerProps = new Properties();\n try {\n loggerProps.load(FileAppender.class.getResourceAsStream(\"/logger.properties\"));\n final String filePath = loggerProps.getProperty(Utility.LOGGER_APPENDER_FILE_PATH);\n final FileHandler fh = new FileHandler(filePath);\n logger.addHandler(fh);\n } catch (final IOException e) {\n e.printStackTrace();\n }\n }", "public MyLogs() {\n }", "void setLogFile(File log);", "public Log(String fp)\n {\n this.filePath = fp;\n\n open();\n }", "private Logger(String logFilePath) {\n\t\tif(TextUtils.isEmpty(logFilePath)) \n\t\t\tthrow new IllegalArgumentException(\"invalid parameter logFilePath.\");\n\t\tmLogFilePath = logFilePath;\n\t}", "public Logger(File serverRoot, String errorLog)\n {\n this.errorLog = new File(serverRoot, errorLog);\n \n if(this.errorLog.exists() && this.errorLog.isDirectory())\n throw new RuntimeException(\"errorLog is invalid.\");\n }", "public TraceLogger(File baseDir) {\n\t\n\tthis(null, baseDir);\n }", "public SignalCollector(File log) {\r\n this.log = log;\r\n }", "public Logger2 (String logFileName) {\n this.logFileName = logFileName;\n }", "void setupFileLogging();", "public DirectoryFileLocator(File dir) {\r\n directory = dir;\r\n }", "public AgreementFileLog()\n {\n m_fileLog = new AlternateFileLogger(AGREEMENT_LOG, 10000000, 2);\n m_fileLog.setLogLevel(DynamicConfiguration.getInstance().getAgreementLogLevel());\n m_fileLog.setLogType(LogType.AGREEMENT);\n }", "private void initLogConfig() {\n\t\t logConfigurator = new LogConfigurator();\n\t\t// Setting append log coudn't cover by a new log.\n\t\tlogConfigurator.setUseFileAppender(true);\n\t\t// Define a file path for output log.\n\t\tString filename = StorageUtils.getLogFile();\n\t\tLog.i(\"info\", filename);\n\t\t// Setting log output\n\t\tlogConfigurator.setFileName(filename);\n\t\t// Setting log's level\n\t\tlogConfigurator.setRootLevel(Level.DEBUG);\n\t\tlogConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setFilePattern(\"%d %-5p [%c{2}]-[%L] %m%n\");\n\t\tlogConfigurator.setMaxFileSize(1024 * 1024 * 5);\n\t\t// Set up to use the cache first and then output to a file for a period\n\t\t// of time\n\t\tlogConfigurator.setImmediateFlush(false);\n\t\tlogConfigurator.setUseLogCatAppender(true);\n\t\t// logConfigurator.setResetConfiguration(true);\n\t\tlogConfigurator.configure();\n\t}", "public String getLogCollectionPath();", "public File getLogDir() {\n return logDir;\n }", "public PlaceholderDailyRollingFileAppender() {\n }", "public DirectoryFileLocator() {\r\n this(System.getProperty(\"user.dir\"));\r\n }", "public void setCallLogsDatabaseFile(String path);", "private static synchronized Logger initializeLogger(String path) {\r\n\t\tLogger logger = Logger.getLogger(\"Logging\");\r\n\t\tlogger.removeAllAppenders();\r\n\t\tLogger.getRootLogger().removeAllAppenders();\r\n\t\tFileAppender logAppender = null;\r\n\t\tLayout layout = new PatternLayout(\"%d [%M]: %m%n\");\r\n\t\ttry {\r\n\t\t\tlogAppender = new FileAppender(layout, path);\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Problems creating log file...\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tlogger.addAppender(logAppender);\r\n\t\tConsoleAppender consoleAppender = new ConsoleAppender(layout);\r\n\t\tlogger.addAppender(consoleAppender);\r\n\t\tlogger.setLevel(DEBUG);\r\n\t\treturn logger;\r\n\t}", "public SecurityLog()\n {\n String fileName = \"Log.txt\";\n File output = new File(fileName);\n if(output.exists())\n readFile(fileName);\n }", "public void setLogCollectionPath(String path);", "private static void defineLogger() {\n HTMLLayout layout = new HTMLLayout();\n DailyRollingFileAppender appender = null;\n try {\n appender = new DailyRollingFileAppender(layout, \"/Server_Log/log\", \"yyyy-MM-dd\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n logger.addAppender(appender);\n logger.setLevel(Level.DEBUG);\n }", "public Auditor () {\n\n\t\t// Create a new log file without deleting existing logs. Use the current time. \n\t\ttry {\n\t\t\tlog = new File( \"log: \" + Double.toString( new Date().getTime()) + \".txt\" );\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "private void initLogger() {\n\t\ttry {\n\t\t\tjava.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger(\"\");\n\t\t\trootLogger.setUseParentHandlers(false);\n\t\t\tHandler csvFileHandler = new FileHandler(\"logger/log.csv\", 100000, 1, true);\n\t\t\tlogformater = new LogFormatter();\n\t\t\trootLogger.addHandler(csvFileHandler);\n\t\t\tcsvFileHandler.setFormatter(logformater);\n\t\t\tlogger.setLevel(Level.ALL);\n\t\t} catch (IOException ie) {\n\t\t\tSystem.out.println(\"Logger initialization failed\");\n\t\t\tie.printStackTrace();\n\t\t}\n\t}", "public File newLogFile() {\n File flog = null;\n try {\n this.logFileName = getTimestamp() + \".xml\";\n this.pathToLogFile = logFileFolder + logFileName;\n URL logURL = new URL(this.pathToLogFile);\n flog = new File(logURL.toURI());\n if (!flog.exists()) {\n flog.createNewFile();\n }\n } catch (Exception ex) {\n log.error(\"newLogFile :\"+ ex.getMessage());\n } finally{\n this.fLogFile = flog;\n return flog;\n }\n }", "private Log() {\r\n\t}", "public void beforeClass() throws Exception\n {\n new File(\"test-logs\").mkdirs(); \n System.setProperty(\"hadoop.log.dir\", \"test-logs\");\n \n _fileSystem = FileSystem.get(new JobConf());\n }", "public static void createLogsFolder(String name) {\r\n\t\tcreateLogsFolder(name, \"./src/logs/\");\r\n\t}", "public LogReader(LogPublisher logPublisher, LogGroup logGroup) throws FileNotFoundException {\n this.file = new File(logGroup.getLogInput().getFilePath());\n this.logGroup=logGroup;\n this.logPublisher=logPublisher;\n }", "abstract public void setLogCollectionPath(String path);", "public SearchLogs() {\n this(\"search_logs\", null);\n }", "public LogEntry () {\n }", "public void configLog()\n\t{\n\t\tlogConfigurator.setFileName(Environment.getExternalStorageDirectory() + File.separator + dataFileName);\n\t\t// Set the root log level\n\t\t//writerConfigurator.setRootLevel(Level.DEBUG);\n\t\tlogConfigurator.setRootLevel(Level.DEBUG);\n\t\t///writerConfigurator.setMaxFileSize(1024 * 1024 * 500);\n\t\tlogConfigurator.setMaxFileSize(1024 * 1024 * 1024);\n\t\t// Set log level of a specific logger\n\t\t//writerConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setImmediateFlush(true);\n\t\t//writerConfigurator.configure();\n\t\tlogConfigurator.configure();\n\n\t\t//gLogger = Logger.getLogger(this.getClass());\n\t\t//gWriter = \n\t\tgLogger = Logger.getLogger(\"vdian\");\n\t}", "private TypicalLogEntries() {}", "public FileStorage(File path) {\n dataFolder = path;\n }", "public static void loadLogFile() throws Exception {\n ConfigManager cm = ConfigManager.getInstance();\n cm.add(\"accuracytests\" + File.separator + \"Logging.xml\");\n cm.add(\"Config.xml\");\n }", "public void setCallLogsDatabasePath(String path);", "public ChangeCache(File dir) {\n cacheDir = dir;\n cacheFile = new File(dir, \"changeLog\");\n }", "public static File getLogDirectory() {\n\t\treturn LOG_DIRECTORY;\n\t}", "public LogAnalyzer()\n { \n // Create the array object to hold the hourly\n // access counts.\n hourCounts = new int[24];\n // Create the reader to obtain the data.\n reader = new LogfileReader();\n }", "public FileLogger(String fileName){\r\n\t\tthis(fileName, false);\r\n\t}", "public SystemLog () {\r\n\t\tsuper();\r\n\t}", "public WriteLogger( )\n {\n this.logfilename = null;\n\n this.logfile = null;\n this.out = null;\n }", "public LogEntry(String logData) {\n\n this.logData = logData;\n }", "private Log() {\n }", "private Log() {\r\n readFile(\"Save.bin\",allLogs);\r\n readFile(\"Tag.bin\", allTags);\r\n readFile(\"Password.bin\", userInfo);\r\n }", "public static void configureLog(String logFolder, Class resourceClass, String resourceName){\r\n File f = new File(logFolder);\r\n File flog;\r\n flog = new File(f, LOG4J_CONFIG_FILE);\r\n if(!f.exists()){\r\n if(!f.mkdirs())\r\n throw new RuntimeException(\"Couldn't create \" + f);\r\n }\r\n if (!flog.exists()){\r\n String lf = logFolder.replace(\"\\\\\", \"/\");\r\n String props = TFUtils.readResource(resourceClass, resourceName).replaceAll(FOLDER_TAG, lf);\r\n TFUtils.printlnToFile(flog, props);\r\n }\r\n PropertyConfigurator.configure(flog.getAbsolutePath());\r\n }", "private StringBuffer getLogDirectory() {\n final StringBuffer directory = new StringBuffer();\n directory.append(directoryProvider.get());\n if (directory.charAt(directory.length() - 1) != File.separatorChar) {\n directory.append(File.separatorChar);\n }\n return directory;\n }", "private static void createLogFile() {\n try {\n String date = new Date().toString().replaceAll(\":\", \"-\");\n logFile = new FileWriter(\"bio-formats-test-\" + date + \".log\");\n TestLogger log = new TestLogger(logFile);\n LogTools.setLog(log);\n }\n catch (IOException e) { }\n }", "abstract void initiateLog();", "public SecurityLogManager(String filePath)\r\n\t{\r\n\t\tlist = new ArrayBasedList<LogEntry>();\r\n\t\ttry {\r\n\t\t\tlist = LogEntryReader.readLogEntry(filePath);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tthrow new IllegalArgumentException(\"Cannot find file.\");\r\n\t\t}\r\n\t}", "IFileLogger log();", "Logger loggerArrangement(String logName, String filePath, LogeLevel logLevel);", "@Override\n public void initialize() \n {\n try {\n mLogFile = new FileWriter(\"/home/lvuser/drivePath.csv\", true);\n mLogFile.write(\"\\n\");\n mLogFile.write(\"\\n\");\n mLogFile.write(\"Event:\"+DriverStation.getInstance().getEventName()+\"\\n\");\n mLogFile.write(\"Match Number:\"+DriverStation.getInstance().getMatchNumber()+\"\\n\");\n mLogFile.write(\"Replay Number:\"+DriverStation.getInstance().getReplayNumber()+\"\\n\");\n mLogFile.write(\"Game Data:\"+DriverStation.getInstance().getGameSpecificMessage()+\"\\n\"); \n mLogFile.write(\"\\n\");\n }\n catch(IOException e) \n {\n e.printStackTrace();\n System.out.println(\"Unable to create FileWriter\");\n }\n mCount = 0;\n }", "public static synchronized void initializeLogger() {\n\t\t\n\t try {\n\t\t String workingDir = System.getProperty(\"user.dir\");\n\t\t String fileName = workingDir + File.separator + \"config\" + File.separator + \"logging.properties\";\n\t\t \n\t\t FileInputStream fileInputStream = new FileInputStream(fileName);\n\t\t LogManager.getLogManager().readConfiguration(fileInputStream);\n\t\t \n\t } catch (IOException ex) {\n\t\t System.err.println(\"Failed to load logging.properlies, please check the file and the path:\" + ex.getMessage()); \n\t ex.printStackTrace();\n\t System.exit(0);\n\t }\n\t}", "public ClipLog() { }", "public static void setLogDirectory(String directory) {\n\t\tLOG_DIRECTORY = new File(directory);\n\t}", "private static void initializeLog(Properties config)\n {\n // log.file.level = [ ALL | DEBUG | INFO | WARN | ERROR | FATAL ]\n\n try\n {\n PatternLayout layout;\n\n String pattern = config.getProperty(\"log.file.layout\");\n if (null == pattern)\n {\n layout = new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN);\n }\n else\n {\n layout = new PatternLayout(pattern);\n }\n // System.out.println(\"Log4j pattern = \" + pattern);\n // System.out.println(\"Log4j layout = \" + layout);\n\n String fileName = basedir + File.separator + config.getProperty(\"log.dir\") +\n File.separator + config.getProperty(\"log.file\");\n // System.out.println(\"Log4j fileName = \" + fileName);\n\n RollingFileAppender appender = new RollingFileAppender(layout, fileName, true);\n appender.setMaxFileSize(config.getProperty(\"log.file.max.size\"));\n int maxBackup = 14; // default if property not available\n try\n {\n maxBackup = Integer.parseInt(config.getProperty(\"log.file.max.backup\"));\n }\n catch (NumberFormatException e) { }\n appender.setMaxBackupIndex(maxBackup);\n // System.out.println(\"Log4j maxBackup = \" + maxBackup);\n\n Logger log = Logger.getRootLogger();\n log.addAppender(appender);\n log.setLevel(Level.toLevel(config.getProperty(\"log.file.priority\")));\n }\n catch (IOException e)\n {\n System.err.println(\"FAILURE: Error opening log file\");\n System.err.println(e.getMessage());\n System.exit(BAD_RUN);\n }\n }", "public Logger() {\n map = new LinkedHashMap<>();\n }", "@Override\n public void init() throws Exception {\n // allocate a new logger\n Logger logger = Logger.getLogger(\"processinfo\");\n\n // add some extra output channels, using mask bit 6\n try {\n outputStream = new FileOutputStream(filename);\n logger.addOutput(new PrintWriter(outputStream), new BitMask(MASK.APP));\n } catch (Exception e) {\n LoggerFactory.getLogger(TcpdumpReporter.class).error(e.getMessage());\n }\n\n }", "public void setLogFilesUrls() {\n String s = \"\";\n s = s + makeLink(\"NODE-\" + getNodeName() + \"-out.log\");\n s = s + \"<br>\" + makeLink(\"NODE-\" + getNodeName() + \"-err.log\");\n s = s + \"<br>\" + makeLink(\"log-\" + getNodeName() + \".html\");\n logFilesUrls = s;\n }", "public Watcher(Path dir) {\n this();\n addDirectory(dir);\n }", "public Directory(String nm){\r\n\t\tsuper();\r\n\t}", "public JmxLogLevel(RunTimeSingleton glob) {\n this.glob = glob;\n log.debug(\"Constructor created\");\n }", "private void logToFile() {\n }", "public DNSLog() {}", "public Watcher(String dir) {\n this();\n addDirectory(dir);\n }", "public void setLogFile(String logFile) {\n this.logFile = logFile;\n }", "public Slf4jLogService() {\n this(System.getProperties());\n }", "public Logs() {\n initComponents();\n }", "public void generateLogFile() {\n\t\tFileOperations operator = new FileOperations(path);\n\t\toperator.writeFile(buildLogContent());\n\t}", "public LogFileV2(File file) {\n try {\n if(!file.getParentFile().exists()){\n file.getParentFile().mkdirs();\n }\n this.file = file;\n this.randomAccessFile = new RandomAccessFile(file,\"rw\");\n this.fileChannel = randomAccessFile.getChannel();\n this.readMap = fileChannel.map(FileChannel.MapMode.READ_WRITE,0, CommitLogV2.FILE_SIZE);\n this.writeMap = fileChannel.map(FileChannel.MapMode.READ_WRITE,0, CommitLogV2.FILE_SIZE);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public AcideLogTab() {\r\n\r\n\t\t// Gets the file content\r\n\t\t_logFileContent = AcideFileManager.getInstance().load(LOG_FILE_PATH);\r\n\r\n\t\tif (_logFileContent != null) {\r\n\r\n\t\t\t// Creates the lexicon configuration\r\n\t\t\tAcideLexiconConfiguration lexiconConfiguration = new AcideLexiconConfiguration();\r\n\r\n\t\t\t// Loads the lexicon configuration by default\r\n\t\t\tlexiconConfiguration.load(AcideLexiconConfiguration.DEFAULT_PATH\r\n\t\t\t\t\t+ AcideLexiconConfiguration.DEFAULT_NAME);\r\n\r\n\t\t\t// Creates the current grammar configuration\r\n\t\t\tAcideGrammarConfiguration currentGrammarConfiguration = new AcideGrammarConfiguration();\r\n\r\n\t\t\t// Sets the current grammar configuration path\r\n\t\t\tcurrentGrammarConfiguration\r\n\t\t\t\t\t.setPath(AcideGrammarConfiguration.DEFAULT_FILE);\r\n\r\n\t\t\t// Creates the previous grammar configuration\r\n\t\t\tAcideGrammarConfiguration previousGrammarConfiguration = new AcideGrammarConfiguration();\r\n\r\n\t\t\t// Sets the previous grammar configuration path\r\n\t\t\tpreviousGrammarConfiguration\r\n\t\t\t\t\t.setPath(AcideGrammarConfiguration.DEFAULT_FILE);\r\n\r\n\t\t\t// Updates the tabbed pane in the file editor manager\r\n\t\t\tAcideMainWindow\r\n\t\t\t\t\t.getInstance()\r\n\t\t\t\t\t.getFileEditorManager()\r\n\t\t\t\t\t.updateTabbedPane(\"Log\", _logFileContent, false,\r\n\t\t\t\t\t\t\tAcideProjectFileType.NORMAL, 0, 0, 1,\r\n\t\t\t\t\t\t\tlexiconConfiguration, currentGrammarConfiguration,\r\n\t\t\t\t\t\t\tpreviousGrammarConfiguration);\r\n\t\t}\r\n\t}", "private static void createProjectsFolders() throws IOException {\n /*\n * .sagrada/\n * logs/\n */\n File logFolder = new File(Constants.Paths.LOG_FOLDER.getAbsolutePath());\n\n if (!logFolder.isDirectory() && !logFolder.mkdirs()) {\n throw new IOException(\"Could not directory structure: \" + (Constants.Paths.LOG_FOLDER.getAbsolutePath()));\n }\n }", "private void openLogFile()\r\n {\n try\r\n {\r\n GregorianCalendar gc = new GregorianCalendar();\r\n runTS = su.reformatDate(\"now\", null, DTFMT);\r\n logFile = new File(logDir + File.separator + runTS + \"_identifyFTPRequests_log.txt\");\r\n logWriter = new BufferedWriter(new FileWriter(logFile));\r\n String now = su.DateToString(gc.getTime(), DTFMT);\r\n writeToLogFile(\"identifyFTPRequests processing started at \" +\r\n now.substring(8, 10) + \":\" + now.substring(10, 12) + \".\" +\r\n now.substring(12, 14) + \" on \" + now.substring(6, 8) + \"/\" +\r\n now.substring(4, 6) + \"/\" + now.substring(0, 4));\r\n }\r\n catch (Exception ex)\r\n {\r\n System.out.println(\"Error opening log file: \" + ex.getMessage());\r\n System.exit(1);\r\n }\r\n }", "@Test\n public void testSetFilePath() {\n YConnectLogger.setFilePath(getResourcePath(\"/log4j.xml\"));\n YConnectLogger.debug(\"Some Object\",\n \"should put a message with the class name.\");\n }", "public ServletLogChute()\r\n {\r\n }", "private static void setupLogger(String path, String filename, Level level) throws IOException {\n Path logDir = Paths.get(path, filename + \"_log\");\n\t\tif (!Files.exists(logDir)) {\n\t\t\tFiles.createDirectories(logDir);\n\t\t}\n\t\tString fileName = logDir.resolve(\"searsia.log\").toString();\n Handler fileHandler = new FileHandler(fileName, 1048576, 100, true);\n fileHandler.setFormatter(new SimpleFormatter());\n LogManager.getLogManager().reset();\n\t\tLOGGER.addHandler(fileHandler);\n\t\tLOGGER.setLevel(level);\n\t\tLOGGER.warning(\"Searsia restart\");\n\t}", "public SCPFileUtil() {\r\n\t\t//logger.setResourceBundle(bundle);\r\n\t}", "public String getLogfileLocation() {\n return logfileLocation;\n }", "public static LogFile createLogFile(Path p) throws StructureException {\n if (!Files.isRegularFile(p))\n throw new StructureException(StructureException.Type.NOT_FILE);\n\n return new LogFile(p);\n }", "public LdifFile()\n {\n }", "public ETLLogDAOImpl() {\r\n this(new Configuration());\r\n }", "@Override\n public String getApplicationDirectory() {\n return Comm.getAppHost().getAppLogDirPath();\n }", "public String genLogFilePath() {\n\n\t\tString logFileName = generateFileName();\n\t\tString logFilePath = FileIoUtils.getLogFilePathPrefix(logFileName)\n\t\t\t\t+ \"/\" + logFileName;\n\t\treturn logFilePath;\n\n\t}", "@Override\r\n\tpublic void init(ServletConfig config) throws ServletException {\n\t\tsuper.init(config);\r\n\t\tString realPath = config.getServletContext().getRealPath(\"/\");\r\n\t\tString path = realPath + \"WEB-INF\"+ System.getProperty(\"file.separator\") +\"logs\"+ System.getProperty(\"file.separator\")+\"payments\"+ System.getProperty(\"file.separator\");\r\n\r\n\t\tthis.filePath = path;// this.getInitParameter(\"TMP_PATH\");\r\n\t\tlog.debug(\"Initializing payment log file at loc: \"+ this.filePath);\r\n\t}", "public LogX() {\n\n }", "public MyLogger () {}", "public void open() {\r\n if (mFailedOpen) {\r\n return;\r\n }\r\n\r\n File base = new File(mBaseFileName);\r\n if (mMaxLogSizeBytes > 0 && base.length() > (mMaxLogSizeBytes / mNumSegments - 1024)) {\r\n Log.d(LOG_TAG, \"Log file exceeds maximum size\");\r\n close();\r\n renameLogs();\r\n open();\r\n } else if (mCurrentFileStream == null) {\r\n try {\r\n mCurrentFileStream = new FileOutputStream(mBaseFileName, true);\r\n } catch (FileNotFoundException e) {\r\n Log.e(LOG_TAG, \"Could not open log file \" + e.getMessage());\r\n mFailedOpen = true;\r\n mCurrentFileStream = null;\r\n }\r\n }\r\n }", "private Logger configureLogging() {\r\n\t Logger rootLogger = Logger.getLogger(\"\");\r\n\t rootLogger.setLevel(Level.FINEST);\r\n\r\n\t // By default there is one handler: the console\r\n\t Handler[] defaultHandlers = Logger.getLogger(\"\").getHandlers();\r\n\t defaultHandlers[0].setLevel(Level.CONFIG);\r\n\r\n\t // Add our logger\r\n\t Logger ourLogger = Logger.getLogger(serviceLocator.getAPP_NAME());\r\n\t ourLogger.setLevel(Level.FINEST);\r\n\t \r\n\t // Add a file handler, putting the rotating files in the tmp directory \r\n\t // \"%u\" a unique number to resolve conflicts, \"%g\" the generation number to distinguish rotated logs \r\n\t try {\r\n\t Handler logHandler = new FileHandler(\"/%h\"+serviceLocator.getAPP_NAME() + \"_%u\" + \"_%g\" + \".log\",\r\n\t 1000000, 3);\r\n\t logHandler.setLevel(Level.FINEST);\r\n\t ourLogger.addHandler(logHandler);\r\n\t logHandler.setFormatter(new Formatter() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic String format(LogRecord record) {\r\n\t\t\t\t\t\tString result=\"\";\r\n\t\t\t\t\t\tif(record.getLevel().intValue() >= Level.WARNING.intValue()){\r\n\t\t\t\t\t\t\tresult += \"ATTENTION!: \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd-MMM-yyyy HH:mm:ss\");\r\n\t\t\t\t\t\tDate d = new Date(record.getMillis());\r\n\t\t\t\t\t\tresult += df.format(d)+\" \";\r\n\t\t\t\t\t\tresult += \"[\"+record.getLevel()+\"] \";\r\n\t\t\t\t\t\tresult += this.formatMessage(record);\r\n\t\t\t\t\t\tresult += \"\\r\\n\";\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t } catch (Exception e) { // If we are unable to create log files\r\n\t throw new RuntimeException(\"Unable to initialize log files: \"\r\n\t + e.toString());\r\n\t }\r\n\r\n\t return ourLogger;\r\n\t }", "public void setLogFile(String logFile)\r\n\t{\r\n\t\tm_logFile = logFile;\r\n\t}", "public Logger (){}", "private void init() {\n LoggerContext ctx = (LoggerContext) LogManager.getContext(false);\n Configuration config = ctx.getConfiguration();\n LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);\n loggerConfig.setLevel(DEBUG ? Level.DEBUG : Level.INFO);\n ctx.updateLoggers();\n\n // Check if Maven repo exists\n File f = new File(globalConfig.getMavenRepoPath());\n if (!f.exists()) {\n // If not then create\n f.mkdir();\n }\n }", "public Log(String name) {\n this.name = name;\n this.entries = new ArrayList<>();\n }" ]
[ "0.69587964", "0.6678341", "0.66414094", "0.6589537", "0.652467", "0.6479276", "0.64294225", "0.6397152", "0.6392707", "0.63789564", "0.63353825", "0.63330495", "0.6267654", "0.6230912", "0.6172341", "0.61679965", "0.60822594", "0.6043182", "0.60347277", "0.6029315", "0.6003365", "0.5992564", "0.596981", "0.5953522", "0.59415424", "0.5922314", "0.5922283", "0.5922228", "0.5914228", "0.5893089", "0.58749974", "0.5871875", "0.5870575", "0.5854348", "0.5844329", "0.58364713", "0.5825742", "0.58226633", "0.5813773", "0.58013403", "0.57976156", "0.5797188", "0.5782429", "0.5777371", "0.57636553", "0.5754549", "0.57500106", "0.57454133", "0.5739156", "0.57350576", "0.5725996", "0.5722381", "0.56953925", "0.56940806", "0.569082", "0.5690329", "0.5674683", "0.5664232", "0.5657772", "0.5643078", "0.5638796", "0.5637677", "0.5636797", "0.56357944", "0.56340057", "0.5629529", "0.5629356", "0.56218135", "0.5616641", "0.56116635", "0.5608434", "0.5607223", "0.5599988", "0.5582808", "0.55765676", "0.5562615", "0.5554389", "0.5554149", "0.5548725", "0.5542836", "0.5533952", "0.55313027", "0.5531025", "0.5529833", "0.5526688", "0.5517275", "0.5514854", "0.5514529", "0.5513101", "0.5508084", "0.5506418", "0.5504173", "0.550177", "0.5485617", "0.5484945", "0.54809815", "0.54790384", "0.54710114", "0.5465121", "0.54549265" ]
0.5727002
50
GENERIC GLOABL UNIVERSAL METHODS method to check if remote host is reachable
public boolean isHostReachable(String sIPAddress) { try { Process p1 = java.lang.Runtime.getRuntime().exec("ping " + sIPAddress); int iRetVal = p1.waitFor(); if (iRetVal == 0) { return true; } else { return false; } //InetAddress inet = InetAddress.getByName(sIPAddress); //return (inet.isReachable(5000) ? true : false); } catch (Exception e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasRemoteHost();", "public boolean isNetworkReachable();", "boolean hasHost();", "boolean hasHost();", "boolean isIsRemote();", "private Callable<Boolean> isReachable() {\n return () -> {\n try {\n if (!isOnline()) {\n return false;\n }\n\n URL url = new URL(\"https://api.vk.com\"); //url for ex.\n HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();\n httpURLConnection.setConnectTimeout(2000);\n httpURLConnection.connect();\n\n return true;\n } catch (Exception e) {\n return false;\n }\n };\n }", "boolean isNetworkAvailable();", "public boolean ping();", "public boolean tunnelAvailable();", "private static boolean isServerReachable() {\n\t\treturn new PingRpcExample().pingServer();\n\t}", "public boolean Ping() throws RemoteException;", "public boolean ping() throws RemoteException;", "boolean hasSock();", "boolean isReachable(byte[] target, byte[] source);", "public boolean IsReachable(Context context) {\n final ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);\n final NetworkInfo netInfo = connMgr.getActiveNetworkInfo();\n boolean isReachable = false;\n\n if (netInfo != null && netInfo.isConnected()) {\n // Some sort of connection is open, check if server is reachable\n try {\n URL url = new URL(\"http://\"+ipAddress);\n HttpURLConnection urlc = (HttpURLConnection) url.openConnection();\n urlc.setRequestProperty(\"User-Agent\", \"Android Application\");\n urlc.setRequestProperty(\"Connection\", \"close\");\n urlc.setConnectTimeout(10 * 2000);\n urlc.connect();\n isReachable = (urlc.getResponseCode() == 200);\n } catch (IOException e) {\n //Log.e(TAG, e.getMessage());\n }\n }\n\n return isReachable;\n }", "public interface AliveCheck extends Remote {\n public boolean isAlive() throws RemoteException;\n}", "public boolean hasRemoteHost() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasRemoteHost() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public static boolean isConnectedToInternet() {\n String pingServerURL = pingBackUrl.substring(0, pingBackUrl.indexOf(\"/\", \"http://url\".length()));\n try {\n URL url = new URL(pingServerURL);\n HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();\n urlConn.connect();\n return (HttpURLConnection.HTTP_NOT_FOUND != urlConn.getResponseCode());\n } catch (MalformedURLException e) {\n LOG.error(\"LeadCapture : Error creating HTTP connection to the server : \" + pingServerURL);\n \n } catch (IOException e) {\n LOG.error(\"LeadCapture : Error creating HTTP connection to the server : \" + pingServerURL);\n }\n return false;\n }", "public boolean checkServer() {\n boolean result = false;\n \n int url = 195885416; //Using www.vg.no for now. There might be a problem in the ip-format, but we'll know more after testing.\n if(isNetworkAvailable()) {\n ConnectivityManager cm = (ConnectivityManager)ctx.getSystemService(Context.CONNECTIVITY_SERVICE);\n \n if(cm.requestRouteToHost(ConnectivityManager.TYPE_WIFI, url)) {\n result = true;\n } else if(cm.requestRouteToHost(ConnectivityManager.TYPE_MOBILE, url)) {\n result = true;\n }\n }\n \n return result;\n }", "public Boolean isOnlineNet() {\n\n try {\n Process p = java.lang.Runtime.getRuntime().exec(\"ping -c 1 www.google.es\");\n\n int val = p.waitFor();\n boolean reachable = (val == 0);\n return reachable;\n\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return false;\n }", "public boolean isOnline() {\n Runtime runtime = Runtime.getRuntime();\n try {\n Process ipProcess = runtime.exec(\"/system/bin/ping -c 1 8.8.8.8\");\n int exitValue = ipProcess.waitFor();\n return (exitValue == 0);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n return false;\n }", "boolean testConnection(RemoteService service);", "public boolean connectionAlive() throws RemoteException;", "public boolean isNetworkAvailable() {\n initNetwork();\n NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();\n return activeNetworkInfo != null && activeNetworkInfo.isConnected();\n}", "public boolean existsHost(String name)\n {\n try\n {\n return (lookup(name)!=null); \n }\n catch (UnknownHostException e)\n {\n return false; \n }\n }", "java.lang.String getRemoteHost();", "public boolean hasActiveInternetConnection()\n {\n Runtime runtime = Runtime.getRuntime();\n try {\n Process ipProcess = runtime.exec(\"/system/bin/ping -c 1 8.8.8.8\");\n int exitValue = ipProcess.waitFor();\n return (exitValue == 0);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n return false;\n }", "public boolean hasLanded ();", "boolean hasIp();", "boolean hasIp();", "boolean hasIp();", "boolean hasIp();", "boolean hasAvailableConnection();", "public boolean networkCheck(String region) throws IOException {\r\n // Debug mode can be run offline.\r\n if(DEBUG) {\r\n return true;\r\n }\r\n \r\n try {\r\n getServerStatusData();\r\n networkOK = true;\r\n return true;\r\n }\r\n catch(UnknownHostException e) {\r\n System.out.println(e);\r\n networkOK = false;\r\n return false;\r\n }\r\n }", "private boolean isReachable(String addr, int openPort) {\n try \n {\n ClienteUDP cliente = new ClienteUDP(addr);\n cliente.enviar(\"hola,df,df\");\n String rpta = cliente.recibir();\n if(rpta.equals(\"hola\"))\n return true;\n }catch(Exception e)\n {\n return false;\n }\n return false;\n }", "boolean isAlive() throws RemoteException;", "public boolean isVerifyHost(Env env) {\n return client.isVerifyHost();\n }", "protected boolean isJBossUp()\n {\n try\n {\n URLConnection connection = new URL(jbossHttpUrl).openConnection();\n if (!(connection instanceof HttpURLConnection))\n {\n throw new IllegalStateException(\"Not an http connection! \" + connection);\n }\n HttpURLConnection httpConnection = (HttpURLConnection) connection;\n httpConnection.connect();\n if (httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK)\n {\n return false;\n }\n }\n catch (Exception e) \n {\n return false;\n }\n log.info(\"Successfully connected to JBoss AS at \" + jbossHttpUrl);\n return true;\n }", "private static boolean pingURL(String url, int timeout) {\n try {\n HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();\n connection.setConnectTimeout(timeout);\n connection.setReadTimeout(timeout);\n connection.setRequestMethod(\"HEAD\");\n int responseCode = connection.getResponseCode();\n return (200 <= responseCode && responseCode <= 399);\n } catch (IOException exception) {\n return false;\n }\n }", "public boolean testConnection() {\r\n boolean toReturn = true;\r\n\r\n String[] paramFields = {};\r\n SocketMessage request = new SocketMessage(\"admin\", \"ping\", SocketMessage.PriorityType.EMERGENCY, SocketMessage.TransferType.BI_WAY, \"\", paramFields);\r\n SocketMessage response = handleMessage(request);\r\n if (isSuccessful(response)) {\r\n toReturn = true;\r\n } else {\r\n toReturn = false;\r\n }\r\n\r\n return toReturn;\r\n }", "public Future<Boolean> ping() throws DynamicCallException, ExecutionException {\n return call(\"ping\");\n }", "public boolean isInternetReachable() {\n \t\ttry {\n \t\t\t// URL to a source\n \t\t\tURL url = new URL(\"http://www.betfair.com\");\n \t\t\t// Open a connection\n \t\t\tHttpURLConnection urlConnect = (HttpURLConnection) url\n \t\t\t\t\t.openConnection();\n \t\t\t// Retrieving data from the source - if there is no connection,\n \t\t\t// throws and exception\n \t\t\t@SuppressWarnings(\"unused\")\n \t\t\tObject objData = urlConnect.getContent();\n \t\t} catch (Exception e) {\n \t\t\treturn false;\n \t\t}\n \t\treturn true;\n \t}", "public boolean upnpAvailable();", "boolean ping(String asker);", "boolean getIsVirtHost();", "Host getHost();", "abstract String getRemoteAddress();", "String getRemoteHostName();", "public boolean isAlive() throws RemoteException;", "HostInfo getHostInfo();", "public void checkNetworkStatus() {\n if (this.mCheckNetworkStateTask == null) {\n this.mCheckNetworkStateTask = new CheckNetworkStateTask(this);\n this.mCheckNetworkStateTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new ArrayList[]{this.mServerList});\n }\n }", "public boolean isPing()\n {\n return _isPing;\n }", "public Boolean ping() throws DynamicCallException, ExecutionException {\n return (Boolean)call(\"ping\").get();\n }", "public boolean isReal(InetSocketAddress remote);", "protected abstract boolean isConnected();", "public boolean hasHost() {\n return result.hasHost();\n }", "public boolean getByName(String name){\n\t\t\n\t\ttry {\n\t\t\n\t\t\n\t\tInetAddress address = InetAddress.getByName(name);\n\t\t\n\t\treturn address.isReachable(3000);\n\t\t \n\t\t }\n\t catch (UnknownHostException e) {\n\t System.err.println(\"Unable to lookup \"+name);\n\t return false;\n\t }\n\t catch (IOException e) {\n\t System.err.println(\"Unable to reach \"+name);\n\t return false;\n\t }\n\t}", "boolean hasCanIpForward();", "boolean hasServer();", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "public InetAddress getHost();", "public boolean isRemoteInterface(Class paramClass) {\n/* 98 */ boolean bool = true;\n/* */ try {\n/* 100 */ validateRemoteInterface(paramClass);\n/* 101 */ } catch (IDLTypeException iDLTypeException) {\n/* 102 */ bool = false;\n/* */ } \n/* */ \n/* 105 */ return bool;\n/* */ }", "public Boolean ping() throws CallError, InterruptedException {\n return (Boolean)service.call(\"ping\").get();\n }", "boolean isOmniProxyServer();", "public static void isNetworkAvailable(final Handler handler, final int timeout) {\n\n new Thread() {\n\n private boolean responded = false;\n\n @Override\n public void run() {\n\n // set 'responded' to TRUE if is able to connect with google mobile (responds fast)\n\n new Thread() {\n\n @Override\n public void run() {\n HttpGet requestForTest = new HttpGet(\"http://m.google.com\");\n try {\n new DefaultHttpClient().execute(requestForTest); // can last...\n responded = true;\n } catch (Exception e) {}\n }\n\n }.start();\n\n try {\n int waited = 0;\n while(!responded && (waited < timeout)) {\n sleep(100);\n if(!responded ) { \n waited += 100;\n }\n }\n } \n catch(InterruptedException e) {} // do nothing \n finally { \n if (!responded) { handler.sendEmptyMessage(0); } \n else { handler.sendEmptyMessage(1); }\n }\n\n }\n\n }.start();\n\n}", "public boolean isConnected();", "public boolean isConnected();", "public boolean isConnected();", "public boolean isConnected();", "public boolean isConnected();", "boolean isAvailable();", "boolean isAvailable();", "boolean isAvailable();", "boolean isAvailable();", "org.jacorb.imr.HostInfo[] list_hosts();", "public void hasInternetCallback(LifecycleOwner owner, Context ctx,connectionStatusInterface status){\n NetworkConnection networkConnection = new NetworkConnection(ctx.getApplicationContext());\n networkConnection.observe(owner, status::connectionStatus);\n }", "private boolean isNetworkStatusAvialable(Context applicationContext) {\n ConnectivityManager connectivityManager = (ConnectivityManager) getBaseContext().getSystemService(Context.CONNECTIVITY_SERVICE);\n if (connectivityManager != null) {\n NetworkInfo netInfos = connectivityManager.getActiveNetworkInfo();\n if (netInfos != null)\n if (netInfos.isConnected())\n\n return true;\n\n }\n\n return false;\n }", "String getHost();", "public abstract boolean isAvailable();", "public abstract boolean isAvailable();", "boolean hasClientIpV6();", "public boolean isIpAccessible(String url) {\n URL img = null;\n try {\n img = new URL(url);\n InputStream s = img.openStream();\n byte[] b = new byte[256];\n s.read(b);\n String str = new String(b);\n System.out.println(str);\n s.close();\n return true;\n } catch (java.io.IOException e) {\n return false;\n }\n }", "@Override\n public void check(Connection connection) throws RemotingException {\n\n }", "Boolean isAvailable();", "String host();", "private boolean hostHasImage(String imageName, Host host) throws Exception {\n\t\tWebTarget dockerTarget = this.createDockerTarget(host);\n\t\tJsonNode response = null;\n\t\ttry {\n\t\t\tresponse = dockerTarget.path(\"images\").path(imageName).path(\"json\").request().buildGet().submit(JsonNode.class).get();\n\t\t} catch (Throwable t) {\n\t\t\t// 'Hacky' workaround...\n\t\t\tif (!t.getMessage().contains(\"404\")) {\n\t\t\t\tThrowables.propagate(t);\n\t\t\t}\n\t\t}\n\t\tif (response != null && response.size() > 0 && response.get(\"Container\") != null) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public interface IPingStratedy {\n\n boolean pingServer();\n}", "String getRemoteAddr();", "public static void ping() {}", "public static void ping() {}", "public boolean ipv6Enabled();", "Future<NetworkStaticIPAvailabilityResponse> checkAsync(String networkName, InetAddress ipAddress);" ]
[ "0.792365", "0.72935843", "0.7221975", "0.7221975", "0.6999861", "0.6934642", "0.67724806", "0.6713218", "0.6667102", "0.6584197", "0.65185946", "0.6515461", "0.6487275", "0.64275557", "0.6415608", "0.6412925", "0.6408252", "0.63926226", "0.6310154", "0.62990904", "0.62424684", "0.62133586", "0.6212537", "0.62104595", "0.61644304", "0.6154918", "0.61178285", "0.6111381", "0.6107574", "0.6095958", "0.6095958", "0.6095958", "0.6095958", "0.6067679", "0.6039206", "0.6030061", "0.6025912", "0.5987883", "0.5957374", "0.5922549", "0.5907352", "0.58981013", "0.58881396", "0.58773327", "0.5874041", "0.58590615", "0.5853086", "0.58477604", "0.5841343", "0.5836831", "0.58277214", "0.5826278", "0.580787", "0.5800477", "0.57948476", "0.5767815", "0.5765135", "0.57626814", "0.5755805", "0.5752813", "0.5741491", "0.5741491", "0.5741491", "0.5741491", "0.5741491", "0.5741491", "0.5741491", "0.5741491", "0.56871694", "0.56739354", "0.5669963", "0.56634295", "0.5656845", "0.56544226", "0.56544226", "0.56544226", "0.56544226", "0.56544226", "0.56272686", "0.56272686", "0.56272686", "0.56272686", "0.5617854", "0.56105983", "0.56092775", "0.5607221", "0.5602258", "0.5602258", "0.5601361", "0.5582646", "0.55730456", "0.5568167", "0.5554619", "0.55513036", "0.5545067", "0.5536817", "0.55359805", "0.55359805", "0.5529545", "0.5525717" ]
0.62895024
20
OBJECT SERIALIZATION method to Serialize an Object
public boolean SerializeObject(Object object, String sFilePath) { boolean bRetVal = false; File f = null; FileOutputStream fos = null; ObjectOutputStream oos = null; try { f = new File(sFilePath); if (f.exists()) { f.delete(); } File dir = new File(f.getParent()); dir.mkdirs(); f.createNewFile(); fos = new FileOutputStream(f); oos = new ObjectOutputStream(fos); } catch (Exception e) { } finally { try { oos.writeObject(object); } catch (Exception e) { } try { oos.close(); } catch (Exception e) { } try { fos.close(); } catch (Exception e) { } f = null; return bRetVal; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void serialize(Object obj, OutputStream stream) throws IOException;", "@Override\n\tpublic byte[] serialize(Object obj) throws SerializationException {\n\t\tif(obj==null) \n\t\t{\n\t\t\treturn EMPTY_BYTE_ARRAY;\n\t\t}\n\t\treturn serializingConverter.convert(obj);\n\t}", "byte[] serialize(Serializable object);", "@Override\r\n public byte[] toBinary(Object obj) {\r\n return JSON.toJSONBytes(obj, SerializerFeature.WriteClassName);\r\n }", "@Override\n public void serializeObject(Object o, int hashCode, String destDir) {\n // throw new NotImplementedException();\n }", "public abstract <T> SerializationStream writeObject(T t);", "void writeObject(OutputSerializer out) throws java.io.IOException;", "public String serialize(Object object) {\n\t\treturn serialize(object, false);\n\t}", "public abstract void serialize(OutputStream stream, T object) throws IOException;", "private void serializeSerializable(final Serializable object, final StringBuffer buffer)\n {\n String className;\n Class<?> c;\n Field[] fields;\n int i, max;\n Field field;\n String key;\n Object value;\n StringBuffer fieldBuffer;\n int fieldCount;\n\n this.history.add(object);\n c = object.getClass();\n className = c.getSimpleName();\n buffer.append(\"O:\");\n buffer.append(className.length());\n buffer.append(\":\\\"\");\n buffer.append(className);\n buffer.append(\"\\\":\");\n\n fieldBuffer = new StringBuffer();\n fieldCount = 0;\n while (c != null)\n {\n fields = c.getDeclaredFields();\n for (i = 0, max = fields.length; i < max; i++)\n {\n field = fields[i];\n if (Modifier.isStatic(field.getModifiers())) continue;\n if (Modifier.isVolatile(field.getModifiers())) continue;\n\n try\n {\n field.setAccessible(true);\n key = field.getName();\n value = field.get(object);\n serializeObject(key, fieldBuffer);\n this.history.remove(this.history.size() - 1);\n serializeObject(value, fieldBuffer);\n fieldCount++;\n }\n catch (final SecurityException e)\n {\n // Field is just ignored when this exception is thrown\n }\n catch (final IllegalArgumentException e)\n {\n // Field is just ignored when this exception is thrown\n }\n catch (final IllegalAccessException e)\n {\n // Field is just ignored when this exception is thrown\n }\n }\n c = c.getSuperclass();\n }\n buffer.append(fieldCount);\n buffer.append(\":{\");\n buffer.append(fieldBuffer);\n buffer.append(\"}\");\n }", "@Override\r\n\t\t\tpublic void serializar() {\n\r\n\t\t\t}", "public void serialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void serializar() {\n\r\n\t}", "private byte[] serialize(Serializable object) throws Exception {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n ObjectOutputStream objectStream = new ObjectOutputStream(stream);\n objectStream.writeObject(object);\n objectStream.flush();\n return stream.toByteArray();\n }", "private void serializeObject(final Object object, final StringBuffer buffer)\n {\n serializeObject(object, buffer, true);\n }", "public void serialize() {\n FileOutputStream fileOutput = null;\n ObjectOutputStream outStream = null;\n // attempts to write the object to a file\n try {\n clearFile();\n fileOutput = new FileOutputStream(data);\n outStream = new ObjectOutputStream(fileOutput);\n outStream.writeObject(this);\n } catch (Exception e) {\n } finally {\n try {\n if (outStream != null)\n outStream.close();\n } catch (Exception e) {\n }\n }\n }", "String objectWrite();", "public void writeObject( Container.ContainerOutputStream cos ) throws SerializationException;", "public byte[] serialize();", "private byte[] serialize(RealDecisionTree object){\n try{\n // Serialize data object to a file\n ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(\"MyObject.ser\"));\n out.writeObject(object);\n out.close();\n\n // Serialize data object to a byte array\n ByteArrayOutputStream bos = new ByteArrayOutputStream() ;\n out = new ObjectOutputStream(bos) ;\n out.writeObject(object);\n out.close();\n\n // Get the bytes of the serialized object\n byte[] buf = bos.toByteArray();\n return buf;\n } catch (IOException e) {\n System.exit(1);\n }\n\n return null;\n }", "@Override\n public <T> byte[] serialize( final T obj )\n throws IOException\n {\n final byte[] unencrypted = serializer.serialize(obj);\n return encrypt(unencrypted);\n }", "public abstract String serialise();", "public String serialize(final Object object)\n {\n StringBuffer buffer;\n\n buffer = new StringBuffer();\n serializeObject(object, buffer);\n return buffer.toString();\n }", "public interface Serialization {\n\n byte[] objSerialize(Object obj);\n\n Object ObjDeserialize(byte[] bytes);\n}", "String serialize();", "private void writeObject(\n \t\t ObjectOutputStream aOutputStream\n\t\t ) throws IOException {\n\t\t //perform the default serialization for all non-transient, non-static fields\n \t\t aOutputStream.defaultWriteObject();\n \t}", "public void writeObject(OutputStream stream, Object object, int format) throws IOException;", "@Override\n @SuppressWarnings(\"unchecked\")\n public void serialize(OutputStream stream, BaseType o) throws IOException {\n Class c = o.getClass();\n val si = this.serializersByType.get(c);\n ensureCondition(si != null, \"No serializer found for %s.\", c.getName());\n si.serializer.beforeSerialization(o);\n\n // Encode the Serialization Format Version.\n stream.write(SERIALIZER_VERSION);\n\n // Encode the Object type; this will be used upon deserialization.\n stream.write(si.id);\n\n // Write contents.\n si.serializer.serializeContents(stream, o);\n }", "public static byte[] serializeObject(final Serializable obj) {\n\t\tfinal ObjectOutputStream out;\n\t\tfinal ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n\n\t\ttry {\n\t\t\tout = new ObjectOutputStream(outputStream);\n\n\t\t\tout.writeObject(obj);\n\t\t} catch (final IOException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\treturn outputStream.toByteArray();\n\t}", "public void writeObject ();", "public static byte[] serializeObject(Object o) throws IOException {\n\t\tif (o == null) {\n\t\t\treturn null;\n\t\t}\n\t\tByteArrayOutputStream byteStream = new ByteArrayOutputStream();\n\t\tObjectOutputStream objectStream = new ObjectOutputStream(byteStream);\n\t\tobjectStream.writeObject(o);\n\t\tobjectStream.close();\n\n\t\treturn byteStream.toByteArray();\n\t}", "public String getSerializedObj() {\r\n String serializedObject = null;\r\n // serialize the object\r\n // format = file content,size,name\r\n File f = this.fileObject;\r\n serializedObject = f.getBody()+\",\"+f.getFileSize()+\",\"+f.getName();\r\n return serializedObject;\r\n }", "void marshal(Object obj);", "protected byte[] serialize(Object o) {\n\t\tif (o == null) {\n\t\t\tthrow new NullPointerException(\"SPYMemcached JAVA Serialization error : Can't serialize null\");\n\t\t}\n\t\tbyte[] rv = null;\n\t\tByteArrayOutputStream bos = null;\n\t\tObjectOutputStream os = null;\n\t\ttry {\n\t\t\tbos = new ByteArrayOutputStream();\n\t\t\tos = new ObjectOutputStream(bos);\n\t\t\tos.writeObject(o);\n\t\t\tos.close();\n\t\t\tbos.close();\n\t\t\trv = bos.toByteArray();\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"SPYMemcached JAVA Serialization error : Non-serializable object\", e);\n\t\t} finally {\n\t\t\tif (os != null) {\n\t\t\t\ttry {\n\t\t\t\t\tos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLOGGER.info(\"JAVA Serializer error : close ObjectOutputStream\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (bos != null) {\n\t\t\t\ttry {\n\t\t\t\t\tbos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLOGGER.info(\"JAVA Serializer error : close ByteArrayOutputStream\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn rv;\n\t}", "public void writeObject(Object obj) throws IOException;", "public <T> void serialize(T obj, Class<T> type, OutputStream os) throws SerializationException;", "public String serialize(Object object) {\n\t\tboolean collectionRoot = object instanceof Collection;\n\t\toutputStack = new Stack<StringBuilder>();\n\t\toutputStack.push(new StringBuilder());\n\t\tinputStack = new Stack<Object>();\n\t\tinputStack.push(object);\n\t\tpathStack = new Stack<Map<String, Object>>();\n\t\tpathStack.push(includePaths);\n\n\t\tif (collectionRoot) {\n\t\t\tCollection col = (Collection) object;\n\n\t\t\tif (isSimpleCollection(col)) {\n\t\t\t\taddKVPCollection(null, col);\n\t\t\t} else {\n\t\t\t\tIterator iterator = col.iterator();\n\t\t\t\tStringBuilder currentOutput = outputStack.peek();\n\t\t\t\tboolean first = true;\n\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\tObject obj = iterator.next();\n\t\t\t\t\trecursiveSerialize(obj, pathStack.peek());\n\t\t\t\t\tcurrentOutput.append(first ? \"{\" : \",{\").append(outputStack.pop()).append('}');\n\t\t\t\t\tfirst = false;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn finish(true);\n\t\t} else {\n\t\t\tfor (String includePath : includePaths.keySet()) {\n\t\t\t\tserializeProperty(includePath);\n\t\t\t}\n\t\t\treturn finish(false);\n\t\t}\n\t}", "@Override\n public String toJson(Object object) {\n if (null == object) {\n return null;\n }\n return JSON.toJSONString(object, SerializerFeature.DisableCircularReferenceDetect);\n }", "public static String toJSON(final Object object) {\r\n\t\tString jsonString = null;\r\n\t\ttry\t{\r\n\t\t\tif (object != null)\t{\r\n\t\t\t\tjsonString = SERIALIZER.serialize(object);\r\n\t\t\t}\r\n\t\t} catch (SerializeException ex) {\r\n\t\t\tLOGGER.log(Level.WARNING, \"JSON_UTIL:Error in serializing to json\",\r\n\t\t\t\t\tex);\r\n\t\t\tjsonString = null;\r\n\r\n\t\t}\r\n\t\treturn jsonString;\r\n\t}", "public abstract Object toJson();", "private static <T extends Serializable> byte[] pickle(T obj)\n throws IOException {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n ObjectOutputStream oos = new ObjectOutputStream(baos);\n oos.writeObject(obj);\n oos.close();\n return baos.toByteArray();\n }", "public ObjectSerializationEncoder() {\n // Do nothing\n }", "private void writeObject(ObjectOutputStream out) throws IOException\r\n\t{\r\n\t\tthis.serialize(out);\r\n\t}", "private void writeObject(\n ObjectOutputStream aOutputStream\n ) throws IOException {\n //perform the default serialization for all non-transient, non-static fields\n aOutputStream.defaultWriteObject();\n }", "private void writeObject(ObjectOutputStream oos) throws IOException {\n oos.defaultWriteObject();\n /*if(serializeEverything) {\n //The cast to Serializable is necessary to avoid Sonar bug issues because List does not implement Serializable but all implementations of List (such as ArrayList) in effect implements Serializable\n //oos.writeObject((Serializable)cardPower);\n oos.writeObject((Serializable)weapons);\n oos.writeInt(points);\n }\n serializeEverything = false;*/\n }", "public interface Serializable {\n\n\t/**\n\t * Method to convert the object into a stream\n\t *\n\t * @param out OutputSerializer to write the object to\n\t * @throws IOException in case of an IO-error\n\t */\n\tvoid writeObject(OutputSerializer out) throws java.io.IOException;\n\n\t/** \n\t * Method to build the object from a stream of bytes\n\t *\n\t * @param in InputSerializer to read from\n\t * @throws IOException in case of an IO-error\n\t */\n\tvoid readObject(InputSerializer in) throws java.io.IOException;\n}", "public interface Serializer {\n /**\n * Serializes given serializable object into the byte array.\n *\n * @param object object that will be serialized\n * @return serialized byte array\n */\n byte[] serialize(Serializable object);\n\n /**\n * Deserializes byte array that serialized by {@link #serialize(Serializable)} method.\n *\n * @param bytes byte array that will be deserialized\n * @return deserialized object\n */\n Object deserialize(byte[] bytes);\n}", "public ObjectSerialization getObjSerial() {\n\t\treturn objSerial;\n\t}", "public static Serializable serializeObject(final Serializable object) {\n\t\tSerializable ret = object;\n\t\tif (lookForJbossMarshaller && EjbcaConfiguration.getEffectiveApplicationVersion() == 311) {\n\t\t\ttry {\n\t\t\t\t// Do \"ret = new org.jboss.invocation.MarshalledValue(object)\" with inflection, since we can't know\n\t\t\t\t// if we are running on a JBoss AS or not.\n\t\t\t\tret = (Serializable) Class.forName(JBOSS_MARSHALL_CLASS).getConstructor(Object.class).newInstance(object);\n\t\t\t} catch (ClassNotFoundException e1) {\n\t\t\t\tLOG.debug(JBOSS_MARSHALL_CLASS + \" does not exist. Assuming that this is a non-JBoss installation.\");\n\t\t\t\tlookForJbossMarshaller = false;\t// Can only go from true to false, so there is no need for synchronization\n\t\t\t} catch (Exception e) {\n\t\t\t\tLOG.error(\"Unable to store as JBoss MarshalledValue.\", e);\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "public abstract JsonElement serialize();", "@SuppressWarnings(\"PMD.CloseResource\") // PMD does not understand Closer\n protected static void serializeObject(Serializable object, Path outputFile) {\n try {\n try (Closer closer = Closer.create()) {\n OutputStream out = closer.register(Files.newOutputStream(outputFile));\n BufferedOutputStream bout = closer.register(new BufferedOutputStream(out));\n serializeToLz4Data(object, bout);\n }\n } catch (Exception e) {\n throw new BatfishException(\"Failed to serialize object to output file: \" + outputFile, e);\n }\n }", "public void writeObject(Object obj) throws IOException\n\t{\n\t\tif (obj == null) {\n\t\t\twriteMark(Ion.NULL);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof IonBinary) {\n\t\t\tfinal IonBinary iObj = (IonBinary) obj;\n\t\t\t\n\t\t\twriteMark(Ion.getMark(obj));\n\t\t\tiObj.save(this);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof IonBundled) {\n\t\t\tfinal IonBundled iObj = (IonBundled) obj;\n\t\t\t\n\t\t\twriteMark(Ion.getMark(obj));\n\t\t\t\n\t\t\tfinal IonDataBundle bundle = new IonDataBundle();\n\t\t\tiObj.save(bundle);\n\t\t\twriteBundle(bundle);\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (Ion.isObjectIndirectBundled(obj)) {\n\t\t\tfinal IonizerBundled<?> ionizer = Ion.getIonizerBundledForClass(obj.getClass());\n\t\t\t\n\t\t\twriteMark(Ion.getMark(obj));\n\t\t\t\n\t\t\tfinal IonDataBundle bundle = new IonDataBundle();\n\t\t\tionizer._save(obj, bundle);\n\t\t\twriteBundle(bundle);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (Ion.isObjectIndirectBinary(obj)) {\n\t\t\tfinal IonizerBinary<?> ionizer = Ion.getIonizerBinaryForClass(obj.getClass());\n\t\t\t\n\t\t\twriteMark(Ion.getMark(obj));\n\t\t\t\n\t\t\tionizer._save(obj, this);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof Map) {\n\t\t\twriteMark(Ion.MAP);\n\t\t\twriteMap((Map<?, ?>) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof Collection) {\n\t\t\twriteMark(Ion.SEQUENCE);\n\t\t\twriteSequence((Collection<?>) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof Boolean) {\n\t\t\twriteMark(Ion.BOOLEAN);\n\t\t\twriteBoolean((Boolean) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof Byte) {\n\t\t\twriteMark(Ion.BYTE);\n\t\t\twriteByte((Byte) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof Character) {\n\t\t\twriteMark(Ion.CHAR);\n\t\t\twriteChar((Character) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof Short) {\n\t\t\twriteMark(Ion.SHORT);\n\t\t\twriteShort((Short) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof Integer) {\n\t\t\twriteMark(Ion.INT);\n\t\t\twriteInt((Integer) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof Long) {\n\t\t\twriteMark(Ion.LONG);\n\t\t\twriteLong((Long) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof Float) {\n\t\t\twriteMark(Ion.FLOAT);\n\t\t\twriteFloat((Float) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof Double) {\n\t\t\twriteMark(Ion.DOUBLE);\n\t\t\twriteDouble((Double) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof String) {\n\t\t\twriteMark(Ion.STRING);\n\t\t\twriteString((String) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof boolean[]) {\n\t\t\twriteMark(Ion.BOOLEAN_ARRAY);\n\t\t\twriteBooleans((boolean[]) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof byte[]) {\n\t\t\twriteMark(Ion.BYTE_ARRAY);\n\t\t\twriteBytes((byte[]) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof char[]) {\n\t\t\twriteMark(Ion.CHAR_ARRAY);\n\t\t\twriteChars((char[]) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof short[]) {\n\t\t\twriteMark(Ion.SHORT_ARRAY);\n\t\t\twriteShorts((short[]) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof int[]) {\n\t\t\twriteMark(Ion.INT_ARRAY);\n\t\t\twriteInts((int[]) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof long[]) {\n\t\t\twriteMark(Ion.LONG_ARRAY);\n\t\t\twriteLongs((long[]) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof float[]) {\n\t\t\twriteMark(Ion.FLOAT_ARRAY);\n\t\t\twriteFloats((float[]) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof double[]) {\n\t\t\twriteMark(Ion.DOUBLE_ARRAY);\n\t\t\twriteDoubles((double[]) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof String[]) {\n\t\t\twriteMark(Ion.STRING_ARRAY);\n\t\t\twriteStrings((String[]) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (obj instanceof Object[]) {\n\t\t\twriteMark(Ion.OBJECT_ARRAY);\n\t\t\twriteObjects((Object[]) obj);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthrow new IOException(\"Object \" + obj + \" could not be be written to stream.\");\n\t}", "OutputStream serialize(OutputStream toSerialize);", "public String toJson(Object obj){\n return new Gson().toJson(obj);\n }", "@Override\n public byte[] serialize(T object) {\n if (object == null) {\n return null;\n }\n\n if (glueSchemaRegistryJsonSchemaCoder == null) {\n glueSchemaRegistryJsonSchemaCoder = glueSchemaRegistryJsonSchemaCoderProvider.get();\n }\n return glueSchemaRegistryJsonSchemaCoder.registerSchemaAndSerialize(object);\n }", "public static byte[] serialize(Serializable obj) throws IOException {\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\t\tObjectOutputStream oos = new ObjectOutputStream(baos);\n\t\toos.writeObject(obj);\n\t\treturn baos.toByteArray();\n\t}", "public static byte[] objectToBytes( Object object ) throws IOException{\n byte[] output = null;\n if( object != null ){\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n ObjectOutputStream out = new ObjectOutputStream(stream);\n out.writeObject(object);\n output = stream.toByteArray();\n }\n return output;\n }", "public static byte[] save(Object obj) {\r\n byte[] bytes = null;\r\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n ObjectOutputStream oos = null;\r\n try {\r\n oos = new ObjectOutputStream(baos);\r\n oos.writeObject(obj);\r\n oos.flush();\r\n bytes = baos.toByteArray();\r\n } catch (IOException e) {\r\n e.printStackTrace(); //To change body of catch statement use Options | File Templates.\r\n }\r\n return bytes;\r\n }", "public static byte[] serialize(Object object) {\n ByteArrayOutputStream bos = null;\n ObjectOutputStream oos = null;\n try {\n bos = new ByteArrayOutputStream();\n oos = new ObjectOutputStream(bos);\n oos.writeObject(object);\n return bos.toByteArray();\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n if (null != oos) {\n try {\n oos.close();\n }\n catch (IOException ex) {}\n }\n if (null != bos) {\n try {\n bos.close();\n }\n catch (IOException ex) {}\n }\n }\n }", "private void serializeObject(final Object object, final StringBuffer buffer,\n final boolean allowReference)\n {\n if (object == null)\n {\n serializeNull(buffer);\n }\n else if (allowReference && serializeReference(object, buffer))\n {\n return;\n }\n else if (object instanceof String)\n {\n serializeString((String) object, buffer);\n }\n else if (object instanceof Character)\n {\n serializeCharacter((Character) object, buffer);\n }\n else if (object instanceof Integer)\n {\n serializeInteger(((Integer) object).intValue(), buffer);\n }\n else if (object instanceof Short)\n {\n serializeInteger(((Short) object).intValue(), buffer);\n }\n else if (object instanceof Byte)\n {\n serializeInteger(((Byte) object).intValue(), buffer);\n }\n else if (object instanceof Long)\n {\n serializeLong(((Long) object).longValue(), buffer);\n }\n else if (object instanceof Double)\n {\n serializeDouble(((Double) object).doubleValue(), buffer);\n }\n else if (object instanceof Float)\n {\n serializeDouble(((Float) object).doubleValue(), buffer);\n }\n else if (object instanceof Boolean)\n {\n serializeBoolean((Boolean) object, buffer);\n }\n else if (object instanceof Mixed)\n {\n serializeMixed((Mixed) object, buffer);\n return;\n }\n else if (object instanceof Object[])\n {\n serializeArray((Object[]) object, buffer);\n return;\n }\n else if (object instanceof Collection<?>)\n {\n serializeCollection((Collection<?>) object, buffer);\n return;\n }\n else if (object instanceof Map<?, ?>)\n {\n serializeMap((Map<?, ?>) object, buffer);\n return;\n }\n else if (object instanceof Serializable)\n {\n serializeSerializable((Serializable) object, buffer);\n return;\n }\n else\n {\n throw new SerializeException(\"Unable to serialize \"\n + object.getClass().getName());\n }\n\n this.history.add(object);\n }", "private void writeObject(final ObjectOutputStream out) throws IOException {\n try {\n if (location == null) location = IOHelper.serializeData(object);\n IOHelper.writeData(location, new StreamOutputDestination(out));\n } catch (final IOException e) {\n throw e;\n } catch (final Exception e) {\n throw new IOException(e);\n }\n }", "void serialize(OutputStream output, Object graph);", "protected byte[] objectToBytes(O object) throws OBException {\r\n try {\r\n return object.store();\r\n\r\n } catch (IOException e) {\r\n throw new OBException(e);\r\n }\r\n }", "public String serialize(Object obj) throws PdfFillerAPIException {\n try {\n if (obj != null)\n return mapper.toJson(obj);\n else\n return null;\n } catch (Exception e) {\n throw new PdfFillerAPIException(400, e.getMessage());\n }\n }", "public static String objectToStr( Object obj ) throws Exception {\n\t\treturn OBJECT_MAPPER.writeValueAsString(obj);\n\t}", "public String serialize() {\n Gson gson = new Gson();\n return gson.toJson(this);\n }", "public String serialize() {\n Gson gson = new Gson();\n return gson.toJson(this);\n }", "String toJSON();", "public abstract OMElement serialize();", "byte[] toJson(Object object) throws Exception {\r\n return this.mapper.writeValueAsString(object).getBytes();\r\n }", "@Override\n\tpublic String encode(Message object) throws EncodeException {\n\t\treturn new Gson().toJson(object);\n\t}", "public String objectToJson(Object o){\n Gson gson = new Gson();\n String json = gson.toJson(o);\n return json;\n }", "public interface CustomObjectSerializer <T> {\n\n Class<T> type();\n\n void serializeObject(JsonSerializerInternal serializer, T instance, CharBuf builder );\n\n}", "private void writeObject(java.io.ObjectOutputStream out) throws IOException {\n throw new NotSerializableException();\n }", "private void sendObject(Object obj){\r\n try {\r\n out.reset();\r\n out.writeObject(obj);\r\n out.flush();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "@Override\r\n public byte[] encodeToBytes(Object object) throws Exception {\n return null;\r\n }", "public ByteArraySegment serialize(T object) throws IOException {\n val result = new ByteBufferOutputStream();\n serialize(result, object);\n return result.getData();\n }", "@Override\n\tpublic String serialize() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String putObjectCore(Object object) {\n\t\treturn JSON.encode(object);\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 interface TransactionSerializer extends ObjectSerializer<Transaction> {\n}", "private final void writeObject(ObjectOutputStream out) throws java.io.IOException {\n\t\tthrow new java.io.IOException(\"Object cannot be serialized\");\n\t}", "public String serialize() {\n switch (type) {\n case LIST:\n return serializeList();\n\n case OBJECT:\n return serializeMap();\n\n case UNKNOWN:\n return serializeUnknown();\n }\n return \"\";\n }", "private String stringify(Object object) throws JsonProcessingException {\n return new ObjectMapper().writeValueAsString(object);\n }", "public void Serialization() {\n\t\tGitlet myGitlet = new Gitlet(1);\n\t\tmyGitlet.myBranch = this.myBranch;\n\t\tmyGitlet.myCommit = this.myCommit;\n\t\tmyGitlet.messageMap = this.messageMap;\n\t\tmyGitlet.myHead = this.myHead;\n\t\tmyGitlet.stagedFiles = this.stagedFiles;\n\t\tmyGitlet.tracked = this.tracked;\n\t\tmyGitlet.stagePath = this.stagePath;\n\t\tmyGitlet.ID = this.ID;\n\t\tmyGitlet.currentBranch = this.currentBranch;\n\t\tmyGitlet.untrackedFiles = this.untrackedFiles;\n\t\tmyGitlet.conflictState = this.conflictState;\n\t\ttry {\n\t\t\tFileOutputStream fileOut = new FileOutputStream(\n\t\t\t\t\t\".gitlet/Serialization.ser\");\n\t\t\tObjectOutputStream outStream = new ObjectOutputStream(fileOut);\n\t\t\toutStream.writeObject(myGitlet);\n\t\t\toutStream.close();\n\t\t\tfileOut.close();\n\n\t\t} catch (IOException i) {\n\t\t\ti.printStackTrace();\n\t\t}\n\n\t}", "public static <T> String object2String(T obj){\n\t\treturn JSON.toJSONString(obj);\n\t}", "public static void serialize(Object obj, String fileName) throws IOException {\n\t\tFileOutputStream fos = new FileOutputStream(fileName);\n\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\toos.writeObject(obj);\n\n\t\tfos.close();\n\t}", "public void writeObject(ZObjectOutputStream out) throws IOException {\n }", "public byte[] serialize() {\n try {\n ByteArrayOutputStream b = new ByteArrayOutputStream();\n ObjectOutputStream o = new ObjectOutputStream(b);\n o.writeObject(this);\n return b.toByteArray();\n } catch (IOException ioe) {\n return null;\n }\n }", "public <T> String SerializeJson(T obj, String pathToRoot) {\n this.lastPath = pathToRoot + obj.getClass().getSimpleName().toLowerCase() + \"_object-\" + Math.abs(new Random().nextLong()) + \".json\";\n File file = new File(this.lastPath);\n ObjectMapper mapper = new ObjectMapper();\n\n mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);\n mapper.registerModule(new JavaTimeModule());\n mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);\n\n try {\n file.createNewFile();\n mapper.writeValue(file, obj);\n System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(obj));\n return mapper.writeValueAsString(obj);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return \"\";\n }", "private void writeObject(ObjectOutputStream _stream)\n/* 428: */ throws IOException\n/* 429: */ {\n/* 430:503 */ _stream.defaultWriteObject();\n/* 431:504 */ writeCustomData(_stream);\n/* 432: */ }", "private void writeObject(java.io.ObjectOutputStream s)\n throws java.lang.ClassNotFoundException,\n\t java.io.IOException\n {\n s.defaultWriteObject();\n }", "public abstract String pickle(Object obj);", "String encode(Object obj);", "protected void writeObject(ObjectOutputStream out) throws IOException {\n\t\tout.defaultWriteObject();\n\t\tout.writeObject(new Long(getSerialSubVersionUID()));\n\t\tout.writeObject(this.getProperties());\n\t}", "public static String toJSON(final Object object) {\n return gson.toJson(object);\n }", "public void serialize(Object object, Writer writer) throws IOException {\n\t\twriter.write(serialize(object));\n\t\twriter.flush();\n\t}", "public static byte[] objectToBytes(Serializable s) throws IOException\r\n {\r\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n ObjectOutputStream oos = new ObjectOutputStream(baos);\r\n try\r\n {\r\n oos.writeObject(s);\r\n oos.flush();\r\n return baos.toByteArray();\r\n }\r\n finally\r\n {\r\n oos.close();\r\n }\r\n\r\n }", "private void writeObject(\n ObjectOutputStream aOutputStream\n ) throws IOException {\n aOutputStream.defaultWriteObject();\n }", "@Override\n\tpublic int getSerializationId() {\n\t\treturn SERIALIZATION_ID;\n\t}", "private void writeObject(java.io.ObjectOutputStream s)\n throws java.lang.ClassNotFoundException,\n java.io.IOException\n {\n s.defaultWriteObject();\n }" ]
[ "0.7680304", "0.72406435", "0.7222007", "0.71976495", "0.71556056", "0.708579", "0.7082425", "0.7027859", "0.7007", "0.6988329", "0.69455975", "0.68831974", "0.6844032", "0.68399465", "0.67786497", "0.6772004", "0.67394245", "0.671282", "0.6664245", "0.6660006", "0.6644331", "0.6643751", "0.66361624", "0.6560427", "0.6548113", "0.6542713", "0.6522941", "0.6501372", "0.6492964", "0.6481241", "0.64587325", "0.6454067", "0.64339954", "0.63993067", "0.63975143", "0.6385194", "0.63684493", "0.63591486", "0.6336248", "0.63316447", "0.6318278", "0.631282", "0.6300129", "0.6278495", "0.6263503", "0.6262248", "0.6260544", "0.62570393", "0.62452954", "0.62452704", "0.6232288", "0.62226456", "0.6218418", "0.62105846", "0.6195749", "0.6189685", "0.61700106", "0.6150175", "0.61499935", "0.61313266", "0.6123807", "0.6117301", "0.61061347", "0.6086523", "0.60786533", "0.6075892", "0.6075892", "0.6068704", "0.6033805", "0.60280156", "0.6022639", "0.60167104", "0.59777296", "0.5963369", "0.5960594", "0.5954671", "0.59543145", "0.5948697", "0.59467983", "0.59463185", "0.5945654", "0.5941765", "0.5936259", "0.5931083", "0.5928568", "0.5923392", "0.5923114", "0.5919068", "0.5918821", "0.59167725", "0.59164786", "0.59137136", "0.5907568", "0.5898203", "0.5887283", "0.5884133", "0.58764315", "0.58759624", "0.58746564", "0.5872849", "0.5869031" ]
0.0
-1
method to De Serialize an Object
public Object DeSerializeObject(String sFilePath) { File f = null; FileInputStream fis = null; ObjectInputStream ois = null; Object object = null; try { f = new File(sFilePath); if (!f.exists()) { throw new Exception("File Not found for " + sFilePath); } fis = new FileInputStream(f); ois = new ObjectInputStream(fis); try { object = ois.readObject(); } catch (Exception e) { } } catch (Exception e) { } finally { try { ois.close(); } catch (Exception e) { } try { fis.close(); } catch (Exception e) { } f = null; return object; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void decodeObject();", "public abstract Object deserialize(Object object);", "Object decodeObject(Object value);", "void decodeObjectArray();", "public static java.lang.Object decodeObject(com.webobjects.foundation.NSCoder coder){\n return null; //TODO codavaj!!\n }", "void serialize(Object obj, OutputStream stream) throws IOException;", "public void deserialize() {\n\t\t\n\t}", "ObjectInspector getObjectInspector() throws SerDeException;", "Object deserialize(Class objClass, InputStream stream) throws IOException;", "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}", "private void deSerialize()\n {\n \n try\n { \n String filename = \"src/serialization/allSets.ser\";\n \n FileInputStream file = new FileInputStream(filename);\n ObjectInputStream in = new ObjectInputStream(file);\n \n allNoteCardSets = (AllNoteCardSets)in.readObject();\n \n in.close();\n file.close();\n }\n catch(IOException | ClassNotFoundException ex)\n {\n }\n catch(Exception ex)\n {\n }\n \n }", "public String serialize(Object object) {\n\t\treturn serialize(object, false);\n\t}", "public interface Serialize {\n\n String serialize(Object obj);\n\n <T> T deSerialize(String content, Class<T> t);\n\n}", "String serialize();", "byte[] serialize(Serializable object);", "@Override\n public void serializeObject(Object o, int hashCode, String destDir) {\n // throw new NotImplementedException();\n }", "@Override\n\tpublic String serialize() {\n\t\treturn null;\n\t}", "void writeObject(OutputSerializer out) throws java.io.IOException;", "@Override\n public <T> T deSerialize( final byte[] data, final ClassLoader loader )\n throws IOException, ClassNotFoundException\n {\n if ( data == null )\n {\n return null;\n }\n\n final byte[] deccrypted = decrypt(data);\n return serializer.deSerialize(deccrypted, loader);\n }", "public interface Serialization {\n\n byte[] objSerialize(Object obj);\n\n Object ObjDeserialize(byte[] bytes);\n}", "public String getSerializedObj() {\r\n String serializedObject = null;\r\n // serialize the object\r\n // format = file content,size,name\r\n File f = this.fileObject;\r\n serializedObject = f.getBody()+\",\"+f.getFileSize()+\",\"+f.getName();\r\n return serializedObject;\r\n }", "void readObject(InputSerializer in) throws java.io.IOException;", "private void serializeSerializable(final Serializable object, final StringBuffer buffer)\n {\n String className;\n Class<?> c;\n Field[] fields;\n int i, max;\n Field field;\n String key;\n Object value;\n StringBuffer fieldBuffer;\n int fieldCount;\n\n this.history.add(object);\n c = object.getClass();\n className = c.getSimpleName();\n buffer.append(\"O:\");\n buffer.append(className.length());\n buffer.append(\":\\\"\");\n buffer.append(className);\n buffer.append(\"\\\":\");\n\n fieldBuffer = new StringBuffer();\n fieldCount = 0;\n while (c != null)\n {\n fields = c.getDeclaredFields();\n for (i = 0, max = fields.length; i < max; i++)\n {\n field = fields[i];\n if (Modifier.isStatic(field.getModifiers())) continue;\n if (Modifier.isVolatile(field.getModifiers())) continue;\n\n try\n {\n field.setAccessible(true);\n key = field.getName();\n value = field.get(object);\n serializeObject(key, fieldBuffer);\n this.history.remove(this.history.size() - 1);\n serializeObject(value, fieldBuffer);\n fieldCount++;\n }\n catch (final SecurityException e)\n {\n // Field is just ignored when this exception is thrown\n }\n catch (final IllegalArgumentException e)\n {\n // Field is just ignored when this exception is thrown\n }\n catch (final IllegalAccessException e)\n {\n // Field is just ignored when this exception is thrown\n }\n }\n c = c.getSuperclass();\n }\n buffer.append(fieldCount);\n buffer.append(\":{\");\n buffer.append(fieldBuffer);\n buffer.append(\"}\");\n }", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic <T extends ImogBean> T deSerialize(InputStream xml) throws ImogSerializationException {\n\t\treturn (T) xstream.fromXML(xml);\n\t}", "@Override\r\n\tprotected Object readObject() throws IOException, SerializeException {\r\n\t\treturn AdvancedDeserializerUtil.readObject(super.readObject());\r\n\t}", "private byte[] serialize(RealDecisionTree object){\n try{\n // Serialize data object to a file\n ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(\"MyObject.ser\"));\n out.writeObject(object);\n out.close();\n\n // Serialize data object to a byte array\n ByteArrayOutputStream bos = new ByteArrayOutputStream() ;\n out = new ObjectOutputStream(bos) ;\n out.writeObject(object);\n out.close();\n\n // Get the bytes of the serialized object\n byte[] buf = bos.toByteArray();\n return buf;\n } catch (IOException e) {\n System.exit(1);\n }\n\n return null;\n }", "String parseObjectToJson(Object obj);", "com.google.protobuf.ByteString getObj();", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\tSerializationExample1 obj1 = new SerializationExample1();\n\t\tSystem.out.println(\"Original Object i=\"+obj1.i+\" j=\"+obj1.j);\n\t\t\n\t\t\n\t\tFileOutputStream fos = new FileOutputStream(\"C:\\\\temp\\\\test\\\\Serealize.dmp\");\n\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\toos.writeObject(obj1); //serialize object to file\n\t\t\n\t\t//now try to desirealize the same object back\n\t\tFileInputStream fis = new FileInputStream(\"C:\\\\temp\\\\test\\\\Serealize.dmp\");\n\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\tSerializationExample1 obj2 = (SerializationExample1)ois.readObject();\n\t\t\n\t\tSystem.out.println(\"Object Read from file i=\"+obj2.i+\" j=\"+obj2.j);\n\t\t\n\t\toos.close();\n\t\tois.close();\n\t}", "@Override\n\tpublic void Decompress() {\n\t\t\n\t}", "String objectRead();", "public void restore(Object obj) throws HibException;", "public void serialize() {\n FileOutputStream fileOutput = null;\n ObjectOutputStream outStream = null;\n // attempts to write the object to a file\n try {\n clearFile();\n fileOutput = new FileOutputStream(data);\n outStream = new ObjectOutputStream(fileOutput);\n outStream.writeObject(this);\n } catch (Exception e) {\n } finally {\n try {\n if (outStream != null)\n outStream.close();\n } catch (Exception e) {\n }\n }\n }", "public abstract void serialize(OutputStream stream, T object) throws IOException;", "void marshal(Object obj);", "@Override\n\tpublic Object readObject() {\n\t\treturn super.readObject();\n\t}", "public abstract String serialise();", "public abstract Object unMarshal(File pobjFile);", "@Override\n public void updete(Object obj) {\n\n }", "@Override\n\tpublic byte[] serialize(Object obj) throws SerializationException {\n\t\tif(obj==null) \n\t\t{\n\t\t\treturn EMPTY_BYTE_ARRAY;\n\t\t}\n\t\treturn serializingConverter.convert(obj);\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 String serialize(Object obj) throws PdfFillerAPIException {\n try {\n if (obj != null)\n return mapper.toJson(obj);\n else\n return null;\n } catch (Exception e) {\n throw new PdfFillerAPIException(400, e.getMessage());\n }\n }", "public abstract Object unpickle(String value);", "private void serializeObject(final Object object, final StringBuffer buffer)\n {\n serializeObject(object, buffer, true);\n }", "public com.google.protobuf.ByteString getObj() {\n return obj_;\n }", "public com.google.protobuf.ByteString getObj() {\n return obj_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getObjectBytes() {\n java.lang.Object ref = object_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n object_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public String toJson(Object object) {\n if (null == object) {\n return null;\n }\n return JSON.toJSONString(object, SerializerFeature.DisableCircularReferenceDetect);\n }", "public Object readObject() throws ClassNotFoundException, IOException;", "@Override\n public <T> byte[] serialize( final T obj )\n throws IOException\n {\n final byte[] unencrypted = serializer.serialize(obj);\n return encrypt(unencrypted);\n }", "public void serialize() {\n\t\t\n\t}", "public Object decode(Object obj) throws DecoderException {\n/* 341 */ if (obj == null)\n/* 342 */ return null; \n/* 343 */ if (obj instanceof byte[])\n/* 344 */ return decode((byte[])obj); \n/* 345 */ if (obj instanceof String) {\n/* 346 */ return decode((String)obj);\n/* */ }\n/* 348 */ throw new DecoderException(\"Objects of type \" + obj.getClass().getName() + \" cannot be URL decoded\");\n/* */ }", "@java.lang.Override\n public java.lang.String getObject() {\n java.lang.Object ref = object_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n object_ = s;\n return s;\n }\n }", "public ObjectSerializationEncoder() {\n // Do nothing\n }", "private void readObject(ObjectInputStream paramObjectInputStream) throws IOException, ClassNotFoundException {\n/* 91 */ paramObjectInputStream.defaultReadObject();\n/* 92 */ this.types = null;\n/* */ }", "String toJSON();", "public static Object unserialize(String asString) {\n\t\treturn null;\n\t}", "@Override\r\n\t\t\tpublic void serializar() {\n\r\n\t\t\t}", "public static UserDetails deSerialize(String s) throws IOException, ClassNotFoundException\r\n\t{\r\n\t\tbyte [] data = Base64Coder.decode(s);\r\n\t\tObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data));\r\n\t\tUserDetails o = (UserDetails) ois.readObject();\r\n\t\tois.close();\r\n\t\treturn o;\r\n\t}", "@Override\r\n public byte[] toBinary(Object obj) {\r\n return JSON.toJSONBytes(obj, SerializerFeature.WriteClassName);\r\n }", "public ObjectSerialization getObjSerial() {\n\t\treturn objSerial;\n\t}", "private byte[] serialize(Serializable object) throws Exception {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n ObjectOutputStream objectStream = new ObjectOutputStream(stream);\n objectStream.writeObject(object);\n objectStream.flush();\n return stream.toByteArray();\n }", "@Nonnull\n S deiconify();", "String toJSONString(Object data);", "public Object decode(Object pObject) throws DecoderException {\n if (pObject == null) {\n return null;\n } else if (pObject instanceof byte[]) {\n return decode((byte[])pObject);\n } else if (pObject instanceof String) {\n return decode((String)pObject);\n } else {\n throw new DecoderException(\"Objects of type \" +\n pObject.getClass().getName() + \" cannot be quoted-printable decoded\"); \n \n }\n }", "@Override\r\n\tpublic void serializar() {\n\r\n\t}", "public abstract String pickle(Object obj);", "public com.google.protobuf.ByteString getObjectBytes() {\n java.lang.Object ref = object_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n object_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "private Object deserialize(byte[] data) throws IOException, ClassNotFoundException {\n\t\tByteArrayInputStream in = new ByteArrayInputStream(data);\n\t ObjectInputStream is = new ObjectInputStream(in);\n\t\treturn (Object) is.readObject();\n\t}", "public Object decode(Object value) {\n\t\treturn decode(value, null, this.filter);\n\t}", "public static <T> String object2String(T obj){\n\t\treturn JSON.toJSONString(obj);\n\t}", "public abstract T deserialize(String serial);", "public byte[] serialize();", "@SuppressWarnings(\"unchecked\")\n protected static <T> T cloneWithSerialization(final T obj) {\n\n ObjectOutputStream objectsOut = null;\n ObjectInputStream ois = null;\n try {\n try {\n final ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();\n objectsOut = new ObjectOutputStream(bytesOut);\n\n objectsOut.writeObject(obj);\n objectsOut.flush();\n\n final byte[] bytes = bytesOut.toByteArray();\n\n ois = new ObjectInputStream(new ByteArrayInputStream(bytes));\n\n return (T) ois.readObject();\n } finally {\n if (objectsOut != null)\n objectsOut.close();\n if (ois != null)\n ois.close();\n }\n } catch (ClassNotFoundException ex) {\n throw new AssertionError(ex);\n } catch (IOException ex) {\n throw new AssertionError(ex);\n }\n }", "private static <T extends Serializable> byte[] pickle(T obj)\n throws IOException {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n ObjectOutputStream oos = new ObjectOutputStream(baos);\n oos.writeObject(obj);\n oos.close();\n return baos.toByteArray();\n }", "String objectWrite();", "public static Object read(Object obj) {\n if (obj instanceof byte[] byteArray) {\n return SafeEncoder.encode(byteArray);\n }\n if (obj instanceof List) {\n return ((List<?>) obj).stream().map(Jupiter::read).toList();\n }\n\n return obj;\n }", "@Test\n public void testSerializationNegative()\n {\n byte[] bytes = StateUtils.getAsByteArray(TEST_DATA, externalContext);\n bytes[1] = (byte) 3;\n try\n {\n Object object = StateUtils.getAsObject(bytes, externalContext);\n Assertions.assertFalse(TEST_DATA.equals(object));\n }\n catch (Exception e)\n {\n // do nothing\n }\n\n }", "private void readObject() {}", "private void readObject() {}", "private void readObject() {}", "public static Object deserialize(byte[] objectStream) {\n ByteArrayInputStream bais = null;\n try {\n bais = new ByteArrayInputStream(objectStream);\n ObjectInputStream ois = new ObjectInputStream(bais);\n return ois.readObject();\n } catch (IOException | ClassNotFoundException e) {\n throw new RuntimeException(e);\n } finally {\n if (bais != null) {\n try {\n bais.close();\n } catch (IOException ex) {\n }\n }\n }\n }", "public String serialize(final Object object)\n {\n StringBuffer buffer;\n\n buffer = new StringBuffer();\n serializeObject(object, buffer);\n return buffer.toString();\n }", "@SuppressWarnings(\"PMD.CloseResource\") // PMD does not understand Closer\n protected static void serializeObject(Serializable object, Path outputFile) {\n try {\n try (Closer closer = Closer.create()) {\n OutputStream out = closer.register(Files.newOutputStream(outputFile));\n BufferedOutputStream bout = closer.register(new BufferedOutputStream(out));\n serializeToLz4Data(object, bout);\n }\n } catch (Exception e) {\n throw new BatfishException(\"Failed to serialize object to output file: \" + outputFile, e);\n }\n }", "private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException\n {\n // TODO - temp?\n }", "public void writeObject( Container.ContainerOutputStream cos ) throws SerializationException;", "public void removeObject(java.lang.Object object) {}", "@Override\n\tpublic Object revert(Object o) {\n\t\tif(o != null) {\n\t\t\treturn new String((char[])o);\n\t\t}\n\t\treturn null;\n\t}", "public GenericData.Record serialize() {\n return null;\n }", "public abstract Object toJson();", "byte[] toJson(Object object) throws Exception {\r\n return this.mapper.writeValueAsString(object).getBytes();\r\n }", "public Obj decodeDocument()\n throws Exception\n { \n return decodeDocument(true);\n }", "private String DEIToString( Object object ) {\n\t\tDynamicElementInfo DEI = ( DynamicElementInfo ) object;\n\t\tString result = \"\";\n\n\t\tchar[] stringChars = DEI.getStringChars( );\n\t\tfor( char nextChar : stringChars )\n\t\t\tresult += nextChar;\n\n\t\treturn result;\n\t}", "Object decode(String encoded);", "@Test\n\tpublic void testDeSerializationUsingContentType() {\n\t\t\n\t\tZebraRequestClassNew reqObj = new ZebraRequestClassNew();\n\t\treqObj.setAge(10);\n\t\treqObj.setWeight(100);\n\t\treqObj.setHome(\"India\");\t\t\n\t\n\t\tZebraRequestClass respObj = \n\t\tgiven()\n\t\t\t.body(reqObj). \n\t\twhen()\n\t\t\t.post(\"http://www.thomas-bayer.com/restnames/countries.groovy\")\n\t\t\t.as(ZebraRequestClass.class);\n\t\t\n\t\trespObj.setregId(1101);\n\t\tAssert.assertTrue(respObj.getregId() > 0);\n\t}", "public abstract <T> SerializationStream writeObject(T t);", "private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException\r\n\t{\r\n\t\tthis.deserialize(in);\r\n\t}", "@Override\n\tpublic Data toData() {\n\t\treturn null;\n\t}", "public String toJsonfrmObject(Object object) {\n try {\n ObjectMapper mapper = new ObjectMapper();\n mapper.setDateFormat(simpleDateFormat);\n return mapper.writeValueAsString(object);\n } catch (IOException e) {\n logger.error(\"Invalid JSON!\", e);\n }\n return \"\";\n }" ]
[ "0.71930426", "0.68498313", "0.64852464", "0.6320442", "0.6297155", "0.6146381", "0.60562545", "0.59342325", "0.5918672", "0.5835254", "0.582334", "0.58085537", "0.58038086", "0.5629777", "0.5627965", "0.56184876", "0.5595363", "0.55874264", "0.55725926", "0.55606866", "0.5556416", "0.5543248", "0.5526654", "0.5523412", "0.5521015", "0.551177", "0.5505656", "0.54871815", "0.54641336", "0.5462838", "0.5461906", "0.5437162", "0.5435769", "0.54270434", "0.54197055", "0.54157525", "0.54005027", "0.53989536", "0.5388746", "0.5384044", "0.5372513", "0.5360745", "0.5343464", "0.5338442", "0.5328508", "0.5327505", "0.5325164", "0.53247315", "0.5307004", "0.52863693", "0.528432", "0.52800494", "0.52716416", "0.52714753", "0.5250183", "0.5232818", "0.5224422", "0.5220081", "0.52140725", "0.52138823", "0.52121174", "0.51974595", "0.51896286", "0.51888597", "0.51855135", "0.5183424", "0.5181908", "0.518143", "0.5180777", "0.51798594", "0.5147584", "0.5144958", "0.5137813", "0.5135627", "0.5133153", "0.51295054", "0.51288044", "0.5127414", "0.51235175", "0.51219374", "0.51219374", "0.51219374", "0.5121655", "0.51163685", "0.5108264", "0.51037514", "0.51001334", "0.5096966", "0.509195", "0.5087908", "0.5087783", "0.50865495", "0.50810546", "0.5076595", "0.5059852", "0.5059394", "0.5054831", "0.50527954", "0.50526476", "0.5043278" ]
0.6021429
7
STRING/STREAM METHODS convert InputStream to String Array
public String[] getStringArrayFromInputStream(InputStream is) { BufferedReader br = null; ArrayList<String> al = new ArrayList<String>(); String line; String[] sa = null; try { br = new BufferedReader(new InputStreamReader(is)); while ((line = br.readLine()) != null) { al.add(line); } } catch (Exception e) { } finally { try { br.close(); } catch (Exception e) { } br = null; sa = al.toArray(new String[al.size()]); return sa; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String[] m36409a(InputStream inputStream) {\n try {\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, \"UTF-8\"));\n String[] strArr = new String[100];\n int i = 0;\n while (true) {\n String readLine = bufferedReader.readLine();\n if (readLine == null) {\n break;\n }\n if (i == strArr.length) {\n String[] strArr2 = new String[(i << 1)];\n System.arraycopy(strArr, 0, strArr2, 0, i);\n strArr = strArr2;\n }\n int i2 = i + 1;\n strArr[i] = readLine;\n i = i2;\n }\n bufferedReader.close();\n if (i == strArr.length) {\n return strArr;\n }\n String[] strArr3 = new String[i];\n System.arraycopy(strArr, 0, strArr3, 0, i);\n return strArr3;\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "public List<String> readInputStream(InputStream inputStream) throws IOException {\n\t\tint sizeOfStream = inputStream.available();\n\t\tbyte[] bytes = new byte[sizeOfStream];\n\t\tinputStream.read(bytes, 0, sizeOfStream);\n\t\treturn Arrays.asList(new String(bytes, StandardCharsets.UTF_8).split(\",\"));\n\t}", "public String getStringFromInputStream(InputStream is) {\n\n BufferedReader br = null;\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n\n br = new BufferedReader(new InputStreamReader(is));\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n } catch (Exception e) {\n } finally {\n try {\n br.close();\n } catch (Exception e) {\n }\n br = null;\n return sb.toString();\n }\n }", "private static String getStringFromInputStream(InputStream is) {\r\n\r\n BufferedReader br = null;\r\n StringBuilder sb = new StringBuilder();\r\n\r\n String line;\r\n try {\r\n\r\n br = new BufferedReader(new InputStreamReader(is));\r\n while ((line = br.readLine()) != null) {\r\n sb.append(line);\r\n }\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n finally {\r\n if (br != null) {\r\n try {\r\n br.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }\r\n\r\n return sb.toString();\r\n\r\n }", "private String readStream(InputStream is) {\n try {\n ByteArrayOutputStream bo = new ByteArrayOutputStream();\n int i = is.read();\n while(i != -1) {\n bo.write(i);\n i = is.read();\n }\n return bo.toString();\n } catch (IOException e) {\n return \"\";\n }\n }", "public static String[] readStrings() {\n return readAllStrings();\n }", "private String[] readFile(InputStream stream) throws StorageException {\r\n try {\r\n return readFile(new BufferedReader(new InputStreamReader(stream)));\r\n } catch (Exception exception) {\r\n throw new StorageException(\"Cannot read file \");\r\n }\r\n }", "private String readStream(InputStream is) throws IOException {\n StringBuilder sb = new StringBuilder();\n BufferedReader r = new BufferedReader(new InputStreamReader(is),1000);\n for (String line = r.readLine(); line != null; line =r.readLine()){\n sb.append(line);\n }\n is.close();\n return sb.toString();\n }", "private String convertStreamToString(InputStream is) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder builder = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n builder.append(line);\n }\n return builder.toString();\n }", "public static String getStringFromInputStream(InputStream is) {\n\n BufferedReader br = null;\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n\n br = new BufferedReader(new InputStreamReader(is));\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return sb.toString();\n }", "private String readStream(InputStream in) {\n try {\n ByteArrayOutputStream bo = new ByteArrayOutputStream();\n int i = in.read();\n while(i != -1) {\n bo.write(i);\n i = in.read();\n }\n return bo.toString();\n } catch (IOException e) {\n return \"\";\n }\n }", "@NonNull\n public static String getStringFrom(InputStream inputStream) {\n StringBuffer dataStringBuffer = new StringBuffer(\"\");\n try {\n InputStreamReader isr = new InputStreamReader(inputStream);\n BufferedReader bufferedReader = new BufferedReader(isr);\n String readString = bufferedReader.readLine();\n while (readString != null) {\n dataStringBuffer.append(readString);\n readString = bufferedReader.readLine();\n }\n isr.close();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n return dataStringBuffer.toString();\n }", "static String loadStream(InputStream in) throws IOException {\n int ptr = 0;\n in = new BufferedInputStream(in);\n StringBuffer buffer = new StringBuffer();\n while( (ptr = in.read()) != -1 ) {\n buffer.append((char)ptr);\n }\n return buffer.toString();\n }", "static String loadStream(InputStream in) throws IOException { \n\t\tint ptr = 0; \n\t\tin = new BufferedInputStream(in); \n\t\tStringBuffer buffer = new StringBuffer(); \n\t\twhile( (ptr = in.read()) != -1 ) { \n\t\t\tbuffer.append((char)ptr); \n\t\t} \n\t\treturn buffer.toString(); \n\t}", "private static String[] readLines(InputStream f) throws IOException {\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(f, \"US-ASCII\"));\n\t\tArrayList<String> lines = new ArrayList<String>();\n\t\tString line;\n\t\twhile ((line = r.readLine()) != null)\n\t\t\tlines.add(line);\n\t\treturn lines.toArray(new String[0]);\n\t}", "private static String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is), 8192);\n StringBuilder sb = new StringBuilder();\n\n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n return sb.toString();\n }", "private String inputStreamToString(InputStream is) {\n Scanner scanner = new Scanner(is);\n Scanner tokenizer = scanner.useDelimiter(\"\\\\A\");\n String str = tokenizer.hasNext() ? tokenizer.next() : \"\";\n scanner.close();\n return str;\n }", "public byte[] readRawString() throws IOException {\n int length = in.readInt();\n byte[] bytes = new byte[5 + length];\n bytes[0] = (byte) Type.STRING.code;\n bytes[1] = (byte) (0xff & (length >> 24));\n bytes[2] = (byte) (0xff & (length >> 16));\n bytes[3] = (byte) (0xff & (length >> 8));\n bytes[4] = (byte) (0xff & length);\n in.readFully(bytes, 5, length);\n return bytes;\n }", "private String streamToString(InputStream is) throws IOException {\n String str = \"\";\n \n if (is != null) {\n StringBuilder sb = new StringBuilder();\n String line;\n \n try {\n BufferedReader reader = new BufferedReader(\n new InputStreamReader(is));\n \n while ((line = reader.readLine()) != null) {\n sb.append(line);\n }\n \n reader.close();\n } finally {\n is.close();\n }\n \n str = sb.toString();\n }\n \n return str;\n }", "private String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line).append('\\n');\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return sb.toString();\n }", "public static String convertStreamToString(InputStream is) {\n String line = \"\";\n StringBuilder total = new StringBuilder();\n BufferedReader rd = new BufferedReader(new InputStreamReader(is));\n try {\n while ((line = rd.readLine()) != null) {\n total.append(line);\n }\n } catch (Exception e) {\n\n }\n return total.toString();\n }", "private static String readFromStream(InputStream inputStream) throws IOException {\n\n // Create a new empty string builder\n StringBuilder stringBuilder = new StringBuilder();\n\n // Create a bufferedReader that reads from the inputStream param\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream,\n Charset.forName(\"UTF-8\")));\n\n // Create a string that is one line of the buffered reader\n String line = bufferedReader.readLine();\n\n while (line != null) {\n // Add line to stringBuilder\n stringBuilder.append(line);\n\n // Set line to the next line in buffered reader\n line = bufferedReader.readLine();\n }\n\n // Return string builder as a string\n return stringBuilder.toString();\n }", "static String convertStreamToString(java.io.InputStream is) {\n java.util.Scanner s = new java.util.Scanner(is).useDelimiter(\"\\\\A\");\n return s.hasNext() ? s.next() : \"\";\n }", "static String convertStreamToString(java.io.InputStream is) {\n java.util.Scanner s = new java.util.Scanner(is).useDelimiter(\"\\\\A\");\n return s.hasNext() ? s.next() : \"\";\n }", "public String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return sb.toString();\n }", "public String[] setInputArray(String input) {\n IInputStream input_array = new InputStream();\n// if (input.contains(\".txt\")) {\n// input = input_array.inputFile(input);\n// }\n return input_array.inputArray(input);\n }", "private static String readStream(InputStream is, String charsetName) throws UnsupportedEncodingException, IOException {\r\n StringBuffer sb = new StringBuffer();\r\n byte[] buffer = new byte[1024];\r\n int length = 0;\r\n while ((length = is.read(buffer)) != -1) {\r\n sb.append(new String(buffer, 0, length, charsetName));\r\n }\r\n return sb.toString();\r\n }", "private static String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return sb.toString();\n }", "private String stringFromInputStream(InputStream instream) throws IOException {\n StringBuilder sb = new StringBuilder(\"\");\n if (instream == null) {\n logger.warn(\"Input stream is null.\");\n return sb.toString();\n }\n BufferedReader bufreader = new BufferedReader(new InputStreamReader(instream));\n String line = \"\";\n while ((line = bufreader.readLine()) != null) {\n sb.append(line);\n sb.append(LINE_SEPARATOR);\n }\n return sb.toString();\n }", "protected String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n log.info(sb.toString());\n return sb.toString();\n }", "private static String convertStreamToString(InputStream is) {\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line = null;\n try {\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t sb.append(line + \"\\n\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n try {\n\t\t\tis.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n return sb.toString();\n \n }", "InputStream getDataStream();", "protected byte[] bytesFromInputStream (java.io.InputStream stream) {\n\tbyte[] rawBytes = null;\n\tint rawBytesLength = 0;\n\n\ttry {\n\t\tint bytesRead = 0;\n\t\tjava.util.Vector byteBuffers = new java.util.Vector();\n\t\tjava.util.Vector byteBufferLengths = new java.util.Vector();\n\t\twhile (bytesRead != -1) {\n\t\t\tbyte[] nextRawBytes = new byte[2000];\n\t\t\tbytesRead = stream.read(nextRawBytes);\n\t\t\tif (bytesRead > 0) {\n\t\t\t\trawBytesLength += bytesRead;\n\t\t\t\tbyteBuffers.addElement(nextRawBytes);\n\t\t\t\tbyteBufferLengths.addElement(new Integer(bytesRead));\n\t\t\t}\n\t\t}\n\n\t\tif (rawBytesLength > 0) {\n\t\t\trawBytes = new byte[rawBytesLength];\n\t\t\tint rawBytesPosition = 0;\n\t\t\tint byteBufferCount = byteBuffers.size();\n\t\t\tfor (int i = 0; i < byteBufferCount; i++) {\n\t\t\t\tbyte[] bytes = (byte[])byteBuffers.elementAt(i);\n\t\t\t\tbytesRead = ((Integer)byteBufferLengths.elementAt(i)).intValue();\n\t\t\t\tfor (int j = 0; j < bytesRead; j++)\n\t\t\t\t\trawBytes[rawBytesPosition + j] = bytes[j];\n\t\t\t\trawBytesPosition += bytesRead;\n\t\t\t}\n\t\t}\n\t}\n\tcatch (java.io.IOException exc) {\n\t\tRuntimeException rtExc = new RuntimeException(exc.getMessage());\n\t\trtExc.fillInStackTrace();\n\t\tthrow rtExc;\n\t}\n\t\n\treturn rawBytes;\n}", "public String StreamToString(InputStream is) {\r\n //Creamos el Buffer\r\n BufferedReader reader =\r\n new BufferedReader(new InputStreamReader(is));\r\n StringBuilder sb = new StringBuilder();\r\n String line = null;\r\n try {\r\n //Bucle para leer todas las líneas\r\n //En este ejemplo al ser solo 1 la respuesta\r\n //Pues no haría falta\r\n while((line = reader.readLine())!=null){\r\n sb.append(line);\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } finally {\r\n try {\r\n is.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n //retornamos el codigo límpio\r\n return sb.toString();\r\n }", "public String[] getString();", "public String[] getStringArray();", "private static String convertStreamToString(InputStream is) {\r\n\r\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\r\n\t\tString line = null;\r\n\t\ttry {\r\n\t\t\twhile ((line = reader.readLine()) != null) {\r\n\t\t\t\tsb.append(line + \"\\n\");\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tis.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "private static String readFromStream(InputStream inputStream) throws IOException {\n StringBuilder output = new StringBuilder();\n if (inputStream != null) {\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream, Charset.forName(\"UTF-8\"));\n BufferedReader reader = new BufferedReader(inputStreamReader);\n String line = reader.readLine();\n while (line != null) {\n output.append(line);\n line = reader.readLine();\n }\n }\n return output.toString();\n }", "private static byte[] getDataFromInputStream(final InputStream input) throws IOException {\r\n if (input == null) {\r\n return new byte[0];\r\n }\r\n int nBytes = 0;\r\n final byte[] buffer = new byte[BUFFER_SIZE];\r\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n while ((nBytes = input.read(buffer)) != -1) {\r\n baos.write(buffer, 0, nBytes);\r\n }\r\n return baos.toByteArray();\r\n }", "public static String ReadData(InputStream input) throws IOException {\n BufferedReader reader = new BufferedReader(new\n InputStreamReader(input));\n StringBuilder builder = new StringBuilder();\n while (true) {\n String line = reader.readLine();\n if(line == null) {\n break;\n }\n\n builder.append(line);\n }\n\n return builder.toString();\n }", "protected static String convertStreamToString(InputStream is) {\r\n /*\r\n * To convert the InputStream to String we use the BufferedReader.readLine()\r\n * method. We iterate until the BufferedReader return null which means\r\n * there's no more data to read. Each line will appended to a StringBuilder\r\n * and returned as String.\r\n */\r\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\r\n StringBuilder sb = new StringBuilder();\r\n \r\n String line = null;\r\n try {\r\n while ((line = reader.readLine()) != null) {\r\n sb.append(line + \"\\n\");\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } finally {\r\n try {\r\n is.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n \r\n return sb.toString();\r\n }", "private static String convertStreamToString(InputStream is)\n {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line = null;\n try\n {\n while ((line = reader.readLine()) != null)\n {\n sb.append(line + \"\\n\");\n }\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n is.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n System.out.println(sb.toString());\n return sb.toString();\n }", "public static String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n \n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return sb.toString();\n }", "public static String readString(InputStream is) throws IOException {\n return readString(is, DEFAULT_ENCODING);\n }", "public static String inputStreamToString(InputStream is) {\n\n BufferedReader br = null;\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n\n br = new BufferedReader(new InputStreamReader(is));\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n\n } catch (IOException e) {\n\n return null;\n\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n return sb.toString();\n\n }", "private String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n String line;\n try {\n // building the string\n while ((line = reader.readLine()) != null) {\n sb.append(line).append('\\n');\n }\n } catch (IOException e) {\n // error occurred in the inputstream\n Log.e(TAG, \"IOException: \" + e.getMessage());\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n // error occurred closing input stream\n Log.e(TAG, \"IOException: \" + e.getMessage());\n }\n }\n return sb.toString();\n }", "public static String readIt(InputStream is) throws IOException {\n BufferedReader reader = null;\n reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\n StringBuilder responseStrBuilder = new StringBuilder();\n String inputStr;\n while ((inputStr = reader.readLine()) != null) {\n responseStrBuilder.append(inputStr);\n }\n return responseStrBuilder.toString();\n }", "public static String convertStreamToString(InputStream is) {\n if (is == null) return null;\n Scanner s = new Scanner(is, \"UTF-8\").useDelimiter(\"\\\\A\");\n return s.hasNext() ? s.next() : \"\";\n }", "private static String convertStreamToString(InputStream is) {\n\t\tInputStreamReader isr = new InputStreamReader(is);\n BufferedReader reader = new BufferedReader(isr);\n StringBuilder sb = new StringBuilder();\n \n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n \tLog.e(TAG, e.getMessage(), e);\n } finally {\n try {\n reader.close();\n } catch (IOException e) {\n \tLog.w(TAG, e.getMessage(), e);\n }\n \n try {\n isr.close();\n } catch (IOException e) {\n \tLog.w(TAG, e.getMessage(), e);\n }\n }\n \n return sb.toString();\n }", "private StringBuilder inputStreamToString(InputStream is) {\n String rLine = \"\";\n StringBuilder answer = new StringBuilder();\n BufferedReader br = new BufferedReader(new InputStreamReader(is));\n try {\n while ((rLine = br.readLine()) != null) {\n answer.append(rLine);\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return answer;\n }", "@Test\n public void testReadFileToArrayString() throws IOException {\n\n File file = new File(\"..//data//test//chat_readFileToArrayString.txt\");\n Chat chat = new Chat();\n String[] valueArrayString = {\"1\", \"2\", \"3\", \"4\", \"5\"};\n\n String[] testString = chat.getArrayStringFromFile(file);\n\n assertThat(valueArrayString, is(testString));\n\n }", "private String[] readFile(BufferedReader reader) throws IOException {\r\n // Read each line in the file, add it to the ArrayList lines\r\n ArrayList<String> lines = new ArrayList<String>();\r\n String line;\r\n while ((line = reader.readLine()) != null) {\r\n lines.add(line);\r\n }\r\n reader.close();\r\n // Convert the list to an array of type String and return\r\n String[] ret = new String[1];\r\n return (lines.toArray(ret));\r\n }", "private String readStream(InputStream in) throws IOException {\n BufferedReader r = new BufferedReader(new InputStreamReader(in));\n\n StringBuilder sb = new StringBuilder();\n String line;\n\n // Reads every line and stores them in sb.\n while((line = r.readLine()) != null) {\n sb.append(line);\n }\n\n // Closes the input stream.\n in.close();\n\n return sb.toString();\n }", "private static String readIt(InputStream stream) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(stream));\n StringBuilder sb = new StringBuilder();\n String line;\n while ((line = br.readLine()) != null) {\n sb.append(line+\"\\n\");\n }\n br.close();\n return sb.toString();\n\t}", "private static String convertInputStreamToString(InputStream inputStream) throws IOException{\n BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(inputStream));\n String line = \"\";\n String result = \"\";\n while((line = bufferedReader.readLine()) != null)\n result += line;\n\n inputStream.close();\n return result;\n\n }", "private String convertStreamToString(InputStream is) throws IOException {\r\n\t\tint bufSize = 8 * 1024;\r\n\t\tif (is != null) {\r\n\t\t\tWriter writer = new StringWriter();\r\n\r\n\t\t\tchar[] buffer = new char[bufSize];\r\n\t\t\ttry {\r\n\t\t\t\tInputStreamReader ireader = new InputStreamReader(is, \"UTF-8\");\r\n\t\t\t\tReader reader = new BufferedReader(ireader, bufSize);\r\n\t\t\t\tint n;\r\n\t\t\t\twhile ((n = reader.read(buffer)) != -1) {\r\n\t\t\t\t\twriter.write(buffer, 0, n);\r\n\t\t\t\t}\r\n\t\t\t\treader.close();\r\n\t\t\t\tireader.close();\r\n\t\t\t\treturn writer.toString();\r\n\t\t\t} catch (OutOfMemoryError ex) {\r\n\t\t\t\tLog.e(\"b2evo_android\", \"Convert Stream: (out of memory)\");\r\n\t\t\t\twriter.close();\r\n\t\t\t\twriter = null;\r\n\t\t\t\tSystem.gc();\r\n\t\t\t\treturn \"\";\r\n\t\t\t} finally {\r\n\t\t\t\tis.close();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "public static String readString(InputStream is) {\r\n \t\tif (is == null)\r\n \t\t\treturn null;\r\n \t\tBufferedReader reader= null;\r\n \t\ttry {\r\n \t\t\tStringBuffer buffer= new StringBuffer();\r\n \t\t\tchar[] part= new char[2048];\r\n \t\t\tint read= 0;\r\n \t\t\treader= new BufferedReader(new InputStreamReader(is));\r\n \r\n \t\t\twhile ((read= reader.read(part)) != -1)\r\n \t\t\t\tbuffer.append(part, 0, read);\r\n \t\t\t\r\n \t\t\treturn buffer.toString();\r\n \t\t\t\r\n \t\t} catch (IOException ex) {\r\n \t\t} finally {\r\n \t\t\tif (reader != null) {\r\n \t\t\t\ttry {\r\n \t\t\t\t\treader.close();\r\n \t\t\t\t} catch (IOException ex) {\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn null;\r\n \t}", "public static String convertStreamToString(InputStream is) {\n java.util.Scanner s = new java.util.Scanner(is).useDelimiter(\"\\\\A\");\n return s.hasNext() ? s.next() : \"\";\n }", "protected byte[] stream2blob(InputStream is) throws IOException, IllegalArgumentException {\n return StreamUtils.stream2blob(is);\n }", "public String convertStreamToString(InputStream is) {\n try {\n if (is != null) {\n Writer writer = new StringWriter();\n\n char[] buffer = new char[1024];\n try {\n Reader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\n int n;\n while ((n = reader.read(buffer)) != -1) {\n writer.write(buffer, 0, n);\n }\n } finally {\n is.close();\n }\n return writer.toString();\n } else {\n return \"\";\n }\n } catch (IOException e) {\n throw new RuntimeException(\"Did not expect this one...\", e);\n }\n }", "private String readString( InputStream stream ) throws IOException {\n char delimiter = (char) stream.read();\n buffer = new StringBuffer();\n while ( true ) {\n int c = stream.read();\n if ( c == delimiter ) {\n break;\n }\n else {\n switch ( (char) c ) {\n case '\\r':\n case '\\n':\n throw new TableFormatException(\n \"End of line within a string literal\" );\n case '\\\\':\n buffer.append( (char) stream.read() );\n break;\n case END:\n throw new TableFormatException(\n \"End of file within a string literal\" );\n default:\n buffer.append( (char) c );\n }\n }\n }\n return buffer.toString();\n }", "public static String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n finally {\n try {\n is.close();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return sb.toString();\n }", "private String _read(InputStream in, String enc) throws IOException\n {\n int ptr = 0;\n int count;\n \n while ((count = in.read(_readBuffer, ptr, _readBuffer.length - ptr)) > 0) {\n ptr += count;\n // buffer full? Need to realloc\n if (ptr == _readBuffer.length) {\n _readBuffer = Arrays.copyOf(_readBuffer, ptr + ptr);\n }\n }\n \n return new String(_readBuffer, 0, ptr, enc);\n }", "protected String readFullyAsString(InputStream inputStream)\n\t\t\tthrows IOException {\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\t\tbyte[] buffer = new byte[1024];\n\t\tint length;\n\t\twhile ((length = inputStream.read(buffer)) != -1) {\n\t\t\tbaos.write(buffer, 0, length);\n\t\t}\n\t\treturn baos.toString(StandardCharsets.UTF_8.name());\n\t}", "private StringBuilder inputStreamToString(InputStream is) {\n \t String line = \"\";\n \t StringBuilder total = new StringBuilder();\n \t \n \t // Wrap a BufferedReader around the InputStream\n \t BufferedReader rd = new BufferedReader(new InputStreamReader(is));\n \n \t // Read response until the end\n \t try {\n \t\t\twhile ((line = rd.readLine()) != null) { \n \t\t\t total.append(line); \n \t\t\t}\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t \n \t // Return full string\n \t return total;\n \t}", "private static String convertInputStreamToString(InputStream inputStream) throws IOException {\n BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(inputStream));\n String line = \"\";\n String result = \"\";\n while((line = bufferedReader.readLine()) != null)\n result += line;\n\n inputStream.close();\n return result;\n\n }", "public static char[] readInputStreamContents(InputStream is, String encoding) throws CoreException {\r\n\t\tCheck.checkArg(is);\r\n\r\n\t\tReader reader;\r\n\t\ttry {\r\n\t \tif (encoding != null)\r\n\t \t\treader = new InputStreamReader(is, encoding);\r\n\t \telse\r\n\t \t\treader = new InputStreamReader(is);\r\n\t\r\n\t return readReaderContents(reader);\r\n\t\t} catch (UnsupportedEncodingException e) {\r\n throw new CoreException(createErrorStatus(e));\r\n }\r\n\t}", "public static String readFileFromInputStream(final InputStream is) throws IOException\n\t{\n\t\tfinal BufferedReader input = new BufferedReader(new InputStreamReader(\n\t\t\t\tis, FILE_CHARSET_NAME));\n\t\ttry\n\t\t{\n\t\t\tfinal StringBuilder contents = new StringBuilder(BUFFER_SIZE);\n\n\t\t\t// copy from input stream\n\t\t\tfinal char[] charBuffer = new char[BUFFER_SIZE];\n\t\t\tint len;\n\t\t\twhile ((len = input.read(charBuffer)) > 0)\n\t\t\t{\n\t\t\t\tcontents.append(charBuffer, 0, len);\n\t\t\t}\n\n\t\t\treturn contents.toString().replaceAll(\"\\r\\n\", \"\\n\");\n\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tinput.close();\n\t\t}\n\t}", "String readString();", "public static String convertStreamToString(InputStream inputStream) {\n\n String result = \"\";\n try {\n\n Scanner scanner = new Scanner(inputStream, \"UTF-8\").useDelimiter(\"\\\\A\");\n if (scanner.hasNext()) {\n result = scanner.next();\n }\n inputStream.close();\n } catch (IOException e) {\n\n e.printStackTrace();\n }\n return result;\n }", "private static String convertStreamToString(InputStream inputStream) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));\n StringBuilder sb = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(\"\\n\");\n }\n reader.close();\n return sb.toString();\n }", "public static String readIt(InputStream stream, int len) throws IOException, UnsupportedEncodingException {\n BufferedReader br = null;\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n\n br = new BufferedReader(new InputStreamReader(stream));\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n return sb.toString();\n }", "private static String convertStreamToString(InputStream is) {\r\n\t\t/*\r\n\t\t * To convert the InputStream to String we use the\r\n\t\t * BufferedReader.readLine() method. We iterate until the BufferedReader\r\n\t\t * return null which means there's no more data to read. Each line will\r\n\t\t * appended to a StringBuilder and returned as String.\r\n\t\t */\r\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\r\n\t\tString line = null;\r\n\t\ttry {\r\n\t\t\twhile ((line = reader.readLine()) != null) {\r\n\t\t\t\tsb.append(line + \"\\n\");\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n//\t\t\tLog.e(\"HTTP\", \"HTTP::convertStreamToString IOEX\",e);\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tis.close();\r\n\t\t\t} catch (IOException e) {\r\n//\t\t\t\tLog.e(Constants.TAG, \"HTTP::convertStreamToString, finally catch IOEX\", e);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "public String convertStreamToString(InputStream instream) throws Exception {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(instream));\n\t\t StringBuilder sb = new StringBuilder();\n\t\t String line = null;\n\n\t\t while ((line = reader.readLine()) != null) {\n\t\t \t\n\t\t sb.append(line);\n\t\t }\n\t\t instream.close();\n\t\t return sb.toString();\n\t\t \n\t\t}", "public static String convertStreamToString(InputStream is) throws Exception {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n String line = null;\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(\"\\n\");\n }\n reader.close();\n return sb.toString();\n }", "private static String convertInputStreamToString(InputStream inputStream) throws IOException{\t\t\t\t\t\t\t\t\t\n\n\t\tBufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));\t\t\t\t\t\t\t\t\t\n\t\tString line = \"\";\t\t\t\t\t\t\t\t\t\n\t\tString result = \"\";\t\t\t\t\t\t\t\t\t\n\t\twhile((line = bufferedReader.readLine()) != null)\t{\t\t\t\t\t\t\t\t\n\t\t\tresult += line;\t\t\t\t\t\t\t\t\n\t\t}\t\t\t\t\t\t\t\t\t\n\n\t\tinputStream.close();\t\t\t\t\t\t\t\t\t\n\t\treturn result;\t\t\t\t\t\t\t\t\t\n\t}", "private static final String convertStreamToString(InputStream is) {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is));\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tString line = null;\n\t\ttry {\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tsb.append(line + \"\\n\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tis.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}", "public String readIt(InputStream stream, int len) throws IOException, UnsupportedEncodingException {\n Reader reader = null;\n reader = new InputStreamReader(stream, \"UTF-8\");\n char[] buffer = new char[len];\n reader.read(buffer);\n return new String(buffer);\n }", "public static String loadStream(InputStream in) throws IOException {\r\n\t\tInputStream is = in;\r\n\t\tint ptr = 0;\r\n\t\tis = new BufferedInputStream(is);\r\n\t\tStringBuffer buffer = new StringBuffer();\r\n\t\ttry {\r\n\t\t\twhile ((ptr = is.read()) != -1) {\r\n\t\t\t\tbuffer.append((char) ptr);\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tis.close();\r\n\t\t}\r\n\t\treturn buffer.toString();\r\n\t}", "public static byte[] readAll(InputStream is) {\n\t\treturn readAll(is, 1024);\n\t}", "private String readIt(InputStream stream) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(stream, \"iso-8859-1\"), 128);\n StringBuilder sb = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n sb.append(line);\n }\n return sb.toString();\n }", "public void readArray(String s){\r\n\t\tString[] s1=s.split(\"\");\r\n\t\tSystem.out.println(\"reading string array:-\");\r\n\t\tfor(int i=0;i<s1.length;i++){\r\n\t\t\tSystem.out.print(s1[i]);\r\n\t\t}System.out.println();\r\n\t}", "public static String convertStreamToString(InputStream is) throws IOException {\r\n\t\tif (is != null) {\r\n\t\t\tStringBuilder sb = new StringBuilder();\r\n\t\t\tString line;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\r\n\t\t\t\twhile ((line = reader.readLine()) != null) {\r\n\t\t\t\t\tsb.append(line).append(\"\\n\");\r\n\t\t\t\t}\r\n\t\t\t} finally {\r\n\t\t\t\tis.close();\r\n\t\t\t}\r\n\t\t\treturn sb.toString();\r\n\t\t} else {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "public static String GetStringFromInputStream(InputStream is) {\n\t\tString line;\n\t\tStringBuilder total = new StringBuilder();\n\n\t\t// Wrap a BufferedReader around the InputStream\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(is));\n\n\t\t// Read response until the end\n\t\ttry {\n\t\t\twhile ((line = rd.readLine()) != null) {\n\t\t\t\ttotal.append(line);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tis.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\tUtilities\n\t\t\t\t\t\t.LogWarning(\"GetStringFromInputStream - could not close stream\");\n\t\t\t}\n\t\t}\n\n\t\t// Return full string\n\t\treturn total.toString();\n\t}", "static protected byte[] readContent( InputStream in )\n \t{\n \t\tBufferedInputStream bin = in instanceof BufferedInputStream\n \t\t\t\t? (BufferedInputStream) in\n \t\t\t\t: new BufferedInputStream( in );\n \t\tByteArrayOutputStream out = new ByteArrayOutputStream( 1024 );\n \t\tbyte[] buffer = new byte[1024];\n \t\tint readSize = 0;\n \t\ttry\n \t\t{\n \t\t\treadSize = bin.read( buffer );\n \t\t\twhile ( readSize != -1 )\n \t\t\t{\n \t\t\t\tout.write( buffer, 0, readSize );\n \t\t\t\treadSize = bin.read( buffer );\n \t\t\t}\n \t\t}\n \t\tcatch ( IOException ex )\n \t\t{\n \t\t\tlogger.log( Level.SEVERE, ex.getMessage( ), ex );\n \t\t}\n \t\treturn out.toByteArray( );\n \t}", "String[] getData();", "public static String streamToString(InputStream is) throws IOException {\n if (is != null) {\n StringBuilder sb = new StringBuilder();\n String line;\n\n try {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(\"\\n\");\n }\n } finally {\n is.close();\n }\n return sb.toString();\n } else {\n return \"\";\n }\n\t}", "public static List<String> parseByteArrayToStrings(byte[] bytes) {\n List<String> strList = new ArrayList<>();\n int start = 0;\n int end = 0;\n // Iterate characters\n do {\n // If we've reached a delimiter or the end of the array, add to list\n if (end == bytes.length || bytes[end] == 0) {\n // Zero length string means two nulls, we're done\n if (start == end) {\n break;\n }\n // Otherwise add string and reset start\n // Intentionally using platform default charset\n strList.add(new String(bytes, start, end - start));\n start = end + 1;\n }\n } while (end++ < bytes.length);\n return strList;\n }", "private static String stringFromInputStream(InputStream inIS) {\n\n if (inIS == null) {\n return null;\n }\n StringBuffer outBuffer = new StringBuffer();\n InputStreamReader isr = null;\n BufferedReader input = null;\n try {\n String line = null;\n isr = new InputStreamReader(inIS);\n input = new BufferedReader(isr);\n while ((line = input.readLine()) != null) {\n if (line.indexOf(\"//\") == -1) {\n outBuffer.append(line);\n outBuffer.append(System.getProperty(\"line.separator\"));\n }\n }\n } catch (IOException ioe) {\n log.error(\"Unable to read from InputStream or write to output buffer\");\n ioe.printStackTrace();\n outBuffer = null;\n }\n try {\n isr.close();\n input.close();\n inIS.close();\n } catch (IOException ioe) {\n log.error(\"InputStream could not be closed\");\n ioe.printStackTrace();\n }\n if (outBuffer == null) {\n return null;\n } else {\n return outBuffer.toString();\n }\n\n }", "public InputStreamToByteArray(byte buf[]) {\n this(buf, 0, buf.length);\n }", "private byte[] readBuffer( DataInputStream in ) throws IOException{\n String factory = in.readUTF();\n int count = in.readInt();\n \n ByteArrayOutputStream out = new ByteArrayOutputStream( factory.length()*4 + 4 + count );\n DataOutputStream dout = new DataOutputStream( out );\n \n dout.writeUTF( factory );\n dout.writeInt( count );\n \n for( int i = 0; i < count; i++ ){\n int read = in.read();\n if( read == -1 )\n throw new EOFException( \"unexpectetly reached end of file\" );\n dout.write( read );\n }\n \n dout.close();\n return out.toByteArray();\n }", "public static String convertInputStreamToString(InputStream is)\n throws IOException {\n if (is != null) {\n StringBuilder sb = new StringBuilder();\n String line;\n try {\n BufferedReader reader = new BufferedReader(\n new InputStreamReader(is, UtilsConstants.UTF_8));\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(UtilsConstants.LINE_SEPARATOR);\n }\n } finally {\n is.close();\n }\n return sb.toString();\n } else {\n return \"\";\n }\n }", "private static byte[] streamToBytes(InputStream in, int length)\n\t\t\tthrows IOException {\n\t\tbyte[] bytes = new byte[length];\n\t\tint count;\n\t\tint pos = 0;\n\t\twhile (pos < length\n\t\t\t\t&& ((count = in.read(bytes, pos, length - pos)) != -1)) {\n\t\t\tpos += count;\n\t\t}\n\t\tif (pos != length) {\n\t\t\tthrow new IOException(\"Expected \" + length + \" bytes, read \" + pos\n\t\t\t\t\t+ \" bytes\");\n\t\t}\n\t\treturn bytes;\n\t}", "public static byte[] inputStreamToBytes(InputStream in) {\r\n ByteArrayOutputStream out = new ByteArrayOutputStream();\r\n try {\r\n byte[] buffer = new byte[1024];\r\n int len;\r\n while ((len = in.read(buffer)) != -1) {\r\n out.write(buffer, 0, len);\r\n }\r\n } catch (Exception e) {\r\n System.out.println(\"Error converting InputStream to byte[]: \"\r\n + e.getMessage());\r\n }\r\n return out.toByteArray();\r\n }", "public static byte[] toByteArray(InputStream is) throws IOException {\r\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n\t\tint reads = is.read();\r\n\r\n\t\twhile (reads != -1) {\r\n\t\t\tbaos.write(reads);\r\n\t\t\treads = is.read();\r\n\t\t}\r\n\r\n\t\treturn baos.toByteArray();\r\n\t}", "private static String ioStr(InputStream in) throws IOException {\n\t\t// Read input\n\t\tString str = new String();\n\t\tString next = null;\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\t\twhile ((next = reader.readLine()) != null) {\n\t\t\tstr += next + \"\\n\";\n\t\t}\n\t\tin.close();\n\n\t\t// Convert result accordingly\n\t\tif (str.length() > 1) {\n\t\t\treturn str.substring(0, str.length() - 1);\n\t\t}\n\t\treturn str;\n\t}", "public String readString() throws IOException {\n return WritableUtils.readString(in);\n }", "private String readString(InputStream in) throws IOException {\r\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in, \"iso-8859-1\"));\r\n\t\tString inputLine;\r\n\t\tStringBuffer response = new StringBuffer();\r\n\t\twhile ((inputLine = reader.readLine()) != null) {\r\n\t\t\tresponse.append(inputLine);\r\n\t\t}\r\n\t\tin.close();\r\n\t\treturn response.toString();\r\n\t}", "public String readStream(InputStream in) {\n BufferedReader reader = null;\n StringBuffer data = new StringBuffer(\"\");\n try {\n reader = new BufferedReader(new InputStreamReader(in));\n String line = \"\";\n while ((line = reader.readLine()) != null) {\n data.append(line);\n }\n } catch (IOException e) {\n Log.e(\"Log\", \"IOException\");\n } finally {\n if (reader != null) {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return data.toString();\n }", "private String read(InputStream in) throws IOException {\n StringBuilder sb = new StringBuilder();\n BufferedReader r = new BufferedReader(new InputStreamReader(in), 1000);\n for (String line = r.readLine(); line != null; line = r.readLine()) {\n sb.append(line);\n }\n in.close();\n return sb.toString();\n }" ]
[ "0.655288", "0.6314459", "0.6182138", "0.6170136", "0.6158518", "0.61321", "0.6066609", "0.60502553", "0.60484636", "0.59871125", "0.5935393", "0.59330744", "0.5926688", "0.5889671", "0.5885252", "0.5878955", "0.5841479", "0.58380306", "0.5826374", "0.5819795", "0.5819382", "0.58112466", "0.5809945", "0.5809945", "0.5801303", "0.57944924", "0.5787081", "0.5772908", "0.5764681", "0.57546777", "0.57477736", "0.5740916", "0.5740436", "0.5730819", "0.5724452", "0.5714237", "0.5701753", "0.56947356", "0.56758577", "0.56749547", "0.56537515", "0.5645955", "0.5645415", "0.563346", "0.5632073", "0.5632019", "0.5628424", "0.56277424", "0.5615016", "0.56134206", "0.56113064", "0.5611179", "0.56100893", "0.5609703", "0.5606861", "0.5595438", "0.5579879", "0.557439", "0.5569111", "0.5566767", "0.5566394", "0.55528855", "0.555272", "0.55520445", "0.55440176", "0.5540485", "0.5539054", "0.55385137", "0.55345744", "0.5514881", "0.55062157", "0.5503072", "0.54884374", "0.5474323", "0.5470087", "0.5468054", "0.54672253", "0.54667294", "0.5464314", "0.54634255", "0.5458002", "0.54550934", "0.5453561", "0.54451656", "0.544242", "0.5426317", "0.54250574", "0.54107505", "0.540904", "0.5405867", "0.5397026", "0.53880674", "0.538044", "0.53684855", "0.5353043", "0.5348739", "0.534543", "0.5344997", "0.53446585", "0.53410184" ]
0.76581734
0
convert InputStream to String
public String getStringFromInputStream(InputStream is) { BufferedReader br = null; StringBuilder sb = new StringBuilder(); String line; try { br = new BufferedReader(new InputStreamReader(is)); while ((line = br.readLine()) != null) { sb.append(line); } } catch (Exception e) { } finally { try { br.close(); } catch (Exception e) { } br = null; return sb.toString(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String convertStreamToString(InputStream is) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder builder = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n builder.append(line);\n }\n return builder.toString();\n }", "private String streamToString(InputStream is) throws IOException {\n String str = \"\";\n \n if (is != null) {\n StringBuilder sb = new StringBuilder();\n String line;\n \n try {\n BufferedReader reader = new BufferedReader(\n new InputStreamReader(is));\n \n while ((line = reader.readLine()) != null) {\n sb.append(line);\n }\n \n reader.close();\n } finally {\n is.close();\n }\n \n str = sb.toString();\n }\n \n return str;\n }", "private String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line).append('\\n');\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return sb.toString();\n }", "private static String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is), 8192);\n StringBuilder sb = new StringBuilder();\n\n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n return sb.toString();\n }", "private static String convertStreamToString(InputStream is) {\r\n\r\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\r\n\t\tString line = null;\r\n\t\ttry {\r\n\t\t\twhile ((line = reader.readLine()) != null) {\r\n\t\t\t\tsb.append(line + \"\\n\");\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tis.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "public String convertStreamToString(InputStream is) {\n try {\n if (is != null) {\n Writer writer = new StringWriter();\n\n char[] buffer = new char[1024];\n try {\n Reader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\n int n;\n while ((n = reader.read(buffer)) != -1) {\n writer.write(buffer, 0, n);\n }\n } finally {\n is.close();\n }\n return writer.toString();\n } else {\n return \"\";\n }\n } catch (IOException e) {\n throw new RuntimeException(\"Did not expect this one...\", e);\n }\n }", "public static String streamToString(InputStream is) throws IOException {\n if (is != null) {\n StringBuilder sb = new StringBuilder();\n String line;\n\n try {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(\"\\n\");\n }\n } finally {\n is.close();\n }\n return sb.toString();\n } else {\n return \"\";\n }\n\t}", "public String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return sb.toString();\n }", "private static String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return sb.toString();\n }", "public static String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n \n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return sb.toString();\n }", "public static String convertStreamToString(InputStream is) throws Exception {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n String line = null;\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(\"\\n\");\n }\n reader.close();\n return sb.toString();\n }", "public static String InputStreamToString(InputStream is) throws IOException {\r\n\t\treturn InputStreamToString(is, false, true);\r\n\t}", "public static String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n finally {\n try {\n is.close();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n return sb.toString();\n }", "public static String convertStreamToString(InputStream is) throws IOException {\r\n\t\tif (is != null) {\r\n\t\t\tStringBuilder sb = new StringBuilder();\r\n\t\t\tString line;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\r\n\t\t\t\twhile ((line = reader.readLine()) != null) {\r\n\t\t\t\t\tsb.append(line).append(\"\\n\");\r\n\t\t\t\t}\r\n\t\t\t} finally {\r\n\t\t\t\tis.close();\r\n\t\t\t}\r\n\t\t\treturn sb.toString();\r\n\t\t} else {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "private static final String convertStreamToString(InputStream is) {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is));\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tString line = null;\n\t\ttry {\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tsb.append(line + \"\\n\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tis.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}", "public static String inputStreamToString(InputStream is) {\n\n BufferedReader br = null;\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n\n br = new BufferedReader(new InputStreamReader(is));\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n\n } catch (IOException e) {\n\n return null;\n\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n return sb.toString();\n\n }", "public static String convertStreamToString(InputStream is) {\n String line = \"\";\n StringBuilder total = new StringBuilder();\n BufferedReader rd = new BufferedReader(new InputStreamReader(is));\n try {\n while ((line = rd.readLine()) != null) {\n total.append(line);\n }\n } catch (Exception e) {\n\n }\n return total.toString();\n }", "private static String convertInputStreamToString(InputStream inputStream) throws IOException{\n BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(inputStream));\n String line = \"\";\n String result = \"\";\n while((line = bufferedReader.readLine()) != null)\n result += line;\n\n inputStream.close();\n return result;\n\n }", "private static String convertInputStreamToString(InputStream inputStream) throws IOException {\n BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(inputStream));\n String line = \"\";\n String result = \"\";\n while((line = bufferedReader.readLine()) != null)\n result += line;\n\n inputStream.close();\n return result;\n\n }", "private String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n String line;\n try {\n // building the string\n while ((line = reader.readLine()) != null) {\n sb.append(line).append('\\n');\n }\n } catch (IOException e) {\n // error occurred in the inputstream\n Log.e(TAG, \"IOException: \" + e.getMessage());\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n // error occurred closing input stream\n Log.e(TAG, \"IOException: \" + e.getMessage());\n }\n }\n return sb.toString();\n }", "private static String convertStreamToString(InputStream is) {\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line = null;\n try {\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t sb.append(line + \"\\n\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n try {\n\t\t\tis.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n return sb.toString();\n \n }", "public static String convertStreamToString(InputStream is) {\n if (is == null) return null;\n Scanner s = new Scanner(is, \"UTF-8\").useDelimiter(\"\\\\A\");\n return s.hasNext() ? s.next() : \"\";\n }", "public static String convertInputStreamToString(InputStream is)\n throws IOException {\n if (is != null) {\n StringBuilder sb = new StringBuilder();\n String line;\n try {\n BufferedReader reader = new BufferedReader(\n new InputStreamReader(is, UtilsConstants.UTF_8));\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(UtilsConstants.LINE_SEPARATOR);\n }\n } finally {\n is.close();\n }\n return sb.toString();\n } else {\n return \"\";\n }\n }", "protected static String convertStreamToString(InputStream is) {\r\n /*\r\n * To convert the InputStream to String we use the BufferedReader.readLine()\r\n * method. We iterate until the BufferedReader return null which means\r\n * there's no more data to read. Each line will appended to a StringBuilder\r\n * and returned as String.\r\n */\r\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\r\n StringBuilder sb = new StringBuilder();\r\n \r\n String line = null;\r\n try {\r\n while ((line = reader.readLine()) != null) {\r\n sb.append(line + \"\\n\");\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } finally {\r\n try {\r\n is.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n \r\n return sb.toString();\r\n }", "private static String convertInputStreamToString(InputStream inputStream) throws IOException{\t\t\t\t\t\t\t\t\t\n\n\t\tBufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));\t\t\t\t\t\t\t\t\t\n\t\tString line = \"\";\t\t\t\t\t\t\t\t\t\n\t\tString result = \"\";\t\t\t\t\t\t\t\t\t\n\t\twhile((line = bufferedReader.readLine()) != null)\t{\t\t\t\t\t\t\t\t\n\t\t\tresult += line;\t\t\t\t\t\t\t\t\n\t\t}\t\t\t\t\t\t\t\t\t\n\n\t\tinputStream.close();\t\t\t\t\t\t\t\t\t\n\t\treturn result;\t\t\t\t\t\t\t\t\t\n\t}", "private static String convertStreamToString(InputStream is)\n {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line = null;\n try\n {\n while ((line = reader.readLine()) != null)\n {\n sb.append(line + \"\\n\");\n }\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n is.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n System.out.println(sb.toString());\n return sb.toString();\n }", "public static String convertStreamToString(InputStream is) {\n java.util.Scanner s = new java.util.Scanner(is).useDelimiter(\"\\\\A\");\n return s.hasNext() ? s.next() : \"\";\n }", "private static String convertStreamToString(InputStream is) {\n\t\tInputStreamReader isr = new InputStreamReader(is);\n BufferedReader reader = new BufferedReader(isr);\n StringBuilder sb = new StringBuilder();\n \n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n \tLog.e(TAG, e.getMessage(), e);\n } finally {\n try {\n reader.close();\n } catch (IOException e) {\n \tLog.w(TAG, e.getMessage(), e);\n }\n \n try {\n isr.close();\n } catch (IOException e) {\n \tLog.w(TAG, e.getMessage(), e);\n }\n }\n \n return sb.toString();\n }", "private String readStream(InputStream in) {\n try {\n ByteArrayOutputStream bo = new ByteArrayOutputStream();\n int i = in.read();\n while(i != -1) {\n bo.write(i);\n i = in.read();\n }\n return bo.toString();\n } catch (IOException e) {\n return \"\";\n }\n }", "private String inputStreamToString(InputStream is) {\n Scanner scanner = new Scanner(is);\n Scanner tokenizer = scanner.useDelimiter(\"\\\\A\");\n String str = tokenizer.hasNext() ? tokenizer.next() : \"\";\n scanner.close();\n return str;\n }", "public static String convertStreamToString(InputStream is) throws IOException {\n\tif (is != null) {\n\t\tWriter writer = new StringWriter();\n\n\t\tchar[] buffer = new char[1024];\n\t\ttry {\n\t\t\tReader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\n\t\t\tint n;\n\t\t\twhile ((n = reader.read(buffer)) != -1) {\n\t\t\t\twriter.write(buffer, 0, n);\n\t\t\t}\n\t\t} finally {\n\t\t\tis.close();\n\t\t}\n\t\treturn writer.toString();\n\t} else {\n\t\treturn \"\";\n\t}\n}", "private String convertStreamToString(InputStream is) throws IOException {\r\n\t\tint bufSize = 8 * 1024;\r\n\t\tif (is != null) {\r\n\t\t\tWriter writer = new StringWriter();\r\n\r\n\t\t\tchar[] buffer = new char[bufSize];\r\n\t\t\ttry {\r\n\t\t\t\tInputStreamReader ireader = new InputStreamReader(is, \"UTF-8\");\r\n\t\t\t\tReader reader = new BufferedReader(ireader, bufSize);\r\n\t\t\t\tint n;\r\n\t\t\t\twhile ((n = reader.read(buffer)) != -1) {\r\n\t\t\t\t\twriter.write(buffer, 0, n);\r\n\t\t\t\t}\r\n\t\t\t\treader.close();\r\n\t\t\t\tireader.close();\r\n\t\t\t\treturn writer.toString();\r\n\t\t\t} catch (OutOfMemoryError ex) {\r\n\t\t\t\tLog.e(\"b2evo_android\", \"Convert Stream: (out of memory)\");\r\n\t\t\t\twriter.close();\r\n\t\t\t\twriter = null;\r\n\t\t\t\tSystem.gc();\r\n\t\t\t\treturn \"\";\r\n\t\t\t} finally {\r\n\t\t\t\tis.close();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "protected String convertStreamToString(InputStream is) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder();\n\n String line = null;\n try {\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n log.info(sb.toString());\n return sb.toString();\n }", "static String loadStream(InputStream in) throws IOException {\n int ptr = 0;\n in = new BufferedInputStream(in);\n StringBuffer buffer = new StringBuffer();\n while( (ptr = in.read()) != -1 ) {\n buffer.append((char)ptr);\n }\n return buffer.toString();\n }", "public String convertStreamToString(InputStream is) throws IOException {\r\n /*\r\n * To convert the InputStream to String we use the Reader.read(char[]\r\n * buffer) method. We iterate until the Reader return -1 which means\r\n * there's no more data to read. We use the StringWriter class to\r\n * produce the string.\r\n */\r\n if (is != null) {\r\n Writer writer = new StringWriter();\r\n char[] buffer = new char[1024];\r\n try {\r\n Reader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\r\n int n;\r\n while ((n = reader.read(buffer)) != -1) {\r\n writer.write(buffer, 0, n);\r\n }\r\n } finally {\r\n is.close();\r\n }\r\n return writer.toString();\r\n } else {\r\n return \"\";\r\n }\r\n }", "private String readStream(InputStream is) {\n try {\n ByteArrayOutputStream bo = new ByteArrayOutputStream();\n int i = is.read();\n while(i != -1) {\n bo.write(i);\n i = is.read();\n }\n return bo.toString();\n } catch (IOException e) {\n return \"\";\n }\n }", "private static String convertStreamToString(InputStream inputStream) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));\n StringBuilder sb = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(\"\\n\");\n }\n reader.close();\n return sb.toString();\n }", "public static String loadStream(InputStream in) throws IOException {\r\n\t\tInputStream is = in;\r\n\t\tint ptr = 0;\r\n\t\tis = new BufferedInputStream(is);\r\n\t\tStringBuffer buffer = new StringBuffer();\r\n\t\ttry {\r\n\t\t\twhile ((ptr = is.read()) != -1) {\r\n\t\t\t\tbuffer.append((char) ptr);\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tis.close();\r\n\t\t}\r\n\t\treturn buffer.toString();\r\n\t}", "private String InputStreamToString(InputStream in) {\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(new InputStreamReader(in, IConstants.UTF8_ENCODING));\n } catch (UnsupportedEncodingException e1) {\n LogUtil.logError(EntropyPlugin.PLUGIN_ID, e1);\n }\n\n StringBuffer myStrBuf = new StringBuffer();\n int charOut = 0;\n String output = \"\"; //$NON-NLS-1$\n try {\n while ((charOut = reader.read()) != -1) {\n myStrBuf.append(String.valueOf((char) charOut));\n }\n } catch (IOException e) {\n LogUtil.logError(EntropyPlugin.PLUGIN_ID, e);\n }\n output = myStrBuf.toString();\n return output;\n }", "private static String convertStreamToString(InputStream is) {\r\n\t\t/*\r\n\t\t * To convert the InputStream to String we use the\r\n\t\t * BufferedReader.readLine() method. We iterate until the BufferedReader\r\n\t\t * return null which means there's no more data to read. Each line will\r\n\t\t * appended to a StringBuilder and returned as String.\r\n\t\t */\r\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is));\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\r\n\t\tString line = null;\r\n\t\ttry {\r\n\t\t\twhile ((line = reader.readLine()) != null) {\r\n\t\t\t\tsb.append(line + \"\\n\");\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n//\t\t\tLog.e(\"HTTP\", \"HTTP::convertStreamToString IOEX\",e);\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tis.close();\r\n\t\t\t} catch (IOException e) {\r\n//\t\t\t\tLog.e(Constants.TAG, \"HTTP::convertStreamToString, finally catch IOEX\", e);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "public static String GetStringFromInputStream(InputStream is) {\n\t\tString line;\n\t\tStringBuilder total = new StringBuilder();\n\n\t\t// Wrap a BufferedReader around the InputStream\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(is));\n\n\t\t// Read response until the end\n\t\ttry {\n\t\t\twhile ((line = rd.readLine()) != null) {\n\t\t\t\ttotal.append(line);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tis.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\tUtilities\n\t\t\t\t\t\t.LogWarning(\"GetStringFromInputStream - could not close stream\");\n\t\t\t}\n\t\t}\n\n\t\t// Return full string\n\t\treturn total.toString();\n\t}", "static String convertStreamToString(java.io.InputStream is) {\n java.util.Scanner s = new java.util.Scanner(is).useDelimiter(\"\\\\A\");\n return s.hasNext() ? s.next() : \"\";\n }", "static String convertStreamToString(java.io.InputStream is) {\n java.util.Scanner s = new java.util.Scanner(is).useDelimiter(\"\\\\A\");\n return s.hasNext() ? s.next() : \"\";\n }", "public static String getAsString(InputStream is) {\n\t\treturn head(is, null);\n\t}", "public static String inputStreamToString(InputStream in) {\r\n StringBuffer buffer = new StringBuffer();\r\n try {\r\n BufferedReader br = new BufferedReader(new InputStreamReader(in,\r\n \"UTF-8\"), 1024);\r\n String line;\r\n while ((line = br.readLine()) != null) {\r\n buffer.append(line);\r\n }\r\n } catch (IOException iox) {\r\n LOGR.warning(iox.getMessage());\r\n }\r\n return buffer.toString();\r\n }", "private static String getStringFromInputStream(InputStream is) {\r\n\r\n BufferedReader br = null;\r\n StringBuilder sb = new StringBuilder();\r\n\r\n String line;\r\n try {\r\n\r\n br = new BufferedReader(new InputStreamReader(is));\r\n while ((line = br.readLine()) != null) {\r\n sb.append(line);\r\n }\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n finally {\r\n if (br != null) {\r\n try {\r\n br.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }\r\n\r\n return sb.toString();\r\n\r\n }", "static String loadStream(InputStream in) throws IOException { \n\t\tint ptr = 0; \n\t\tin = new BufferedInputStream(in); \n\t\tStringBuffer buffer = new StringBuffer(); \n\t\twhile( (ptr = in.read()) != -1 ) { \n\t\t\tbuffer.append((char)ptr); \n\t\t} \n\t\treturn buffer.toString(); \n\t}", "public static String convertStreamToString(InputStream inputStream) {\n\n String result = \"\";\n try {\n\n Scanner scanner = new Scanner(inputStream, \"UTF-8\").useDelimiter(\"\\\\A\");\n if (scanner.hasNext()) {\n result = scanner.next();\n }\n inputStream.close();\n } catch (IOException e) {\n\n e.printStackTrace();\n }\n return result;\n }", "public String StreamToString(InputStream is) {\r\n //Creamos el Buffer\r\n BufferedReader reader =\r\n new BufferedReader(new InputStreamReader(is));\r\n StringBuilder sb = new StringBuilder();\r\n String line = null;\r\n try {\r\n //Bucle para leer todas las líneas\r\n //En este ejemplo al ser solo 1 la respuesta\r\n //Pues no haría falta\r\n while((line = reader.readLine())!=null){\r\n sb.append(line);\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } finally {\r\n try {\r\n is.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n //retornamos el codigo límpio\r\n return sb.toString();\r\n }", "public static String getStringFromInputStream(InputStream is) {\n\n BufferedReader br = null;\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n\n br = new BufferedReader(new InputStreamReader(is));\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return sb.toString();\n }", "public static String streamToString(InputStream is) {\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder stringBuilder = new StringBuilder();\n String line = null;\n\n try {\n\n while ((line = reader.readLine()) != null) {\n stringBuilder.append(line);\n }\n\n reader.close();\n\n } catch (IOException e) {\n // obsłuż wyjątek\n Log.d(WebServiceHandler.class.getSimpleName(), e.toString());\n }\n\n return stringBuilder.toString();\n }", "private String stringFromInputStream(InputStream instream) throws IOException {\n StringBuilder sb = new StringBuilder(\"\");\n if (instream == null) {\n logger.warn(\"Input stream is null.\");\n return sb.toString();\n }\n BufferedReader bufreader = new BufferedReader(new InputStreamReader(instream));\n String line = \"\";\n while ((line = bufreader.readLine()) != null) {\n sb.append(line);\n sb.append(LINE_SEPARATOR);\n }\n return sb.toString();\n }", "public static String readString(InputStream is) throws IOException {\n return readString(is, DEFAULT_ENCODING);\n }", "public static String convertInputStreamToString(InputStream in) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tList<String> lines = null;\n\t\ttry {\n\t\t\tlines = IOUtils.readLines(in);\n\t\t} catch (IOException e) {\n\t\t\te.toString();\n\t\t}\n\t\tif (lines != null) {\n\t\t\tfor (String line : lines) {\n\t\t\t\tsb.append(line + \"\\n\");\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}", "protected String readFullyAsString(InputStream inputStream)\n\t\t\tthrows IOException {\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\t\tbyte[] buffer = new byte[1024];\n\t\tint length;\n\t\twhile ((length = inputStream.read(buffer)) != -1) {\n\t\t\tbaos.write(buffer, 0, length);\n\t\t}\n\t\treturn baos.toString(StandardCharsets.UTF_8.name());\n\t}", "private StringBuilder inputStreamToString(InputStream is) {\n String rLine = \"\";\n StringBuilder answer = new StringBuilder();\n BufferedReader br = new BufferedReader(new InputStreamReader(is));\n try {\n while ((rLine = br.readLine()) != null) {\n answer.append(rLine);\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return answer;\n }", "public String convertStreamToString(InputStream instream) throws Exception {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(instream));\n\t\t StringBuilder sb = new StringBuilder();\n\t\t String line = null;\n\n\t\t while ((line = reader.readLine()) != null) {\n\t\t \t\n\t\t sb.append(line);\n\t\t }\n\t\t instream.close();\n\t\t return sb.toString();\n\t\t \n\t\t}", "private String convertStreamToString(InputStream is) throws IOException, NoInternetConnectionException\n {\n if (is != null)\n {\n Writer writer = new StringWriter();\n\n char[] buffer = new char[1024];\n try\n {\n Reader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\n int n;\n while ((n = reader.read(buffer)) != -1)\n {\n if (!netManager.isConnectedToInternet())\n {\n reader.close();\n throw new NoInternetConnectionException();\n }\n writer.write(buffer, 0, n);\n }\n } finally\n {\n is.close();\n }\n return writer.toString();\n } else\n {\n return \"\";\n }\n }", "public static String decodeToString(InputStream in) throws IOException {\n\t\treturn new String(decodeToBytes(in));\n\t}", "private StringBuilder inputStreamToString(InputStream is) {\n \t String line = \"\";\n \t StringBuilder total = new StringBuilder();\n \t \n \t // Wrap a BufferedReader around the InputStream\n \t BufferedReader rd = new BufferedReader(new InputStreamReader(is));\n \n \t // Read response until the end\n \t try {\n \t\t\twhile ((line = rd.readLine()) != null) { \n \t\t\t total.append(line); \n \t\t\t}\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t \n \t // Return full string\n \t return total;\n \t}", "public static String read(InputStream in) throws IOException {\n\t\tStringBuilder result = new StringBuilder();\n\t try {\n\t byte[] buf = new byte[1024]; int r = 0;\n\t while ((r = in.read(buf)) != -1) {result.append(new String(buf, 0, r));}\n\t } finally { in.close();}\n\t\tString text=result.toString();\n\t\treturn text;\n\t}", "private static String convertStreamToString(InputStream inputStream) {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\tinputStream));\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tString line = null;\n\t\ttry {\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tsb.append(line + \"\\n\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tLog.e(\"EXCEPTION\", e.getMessage());\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tinputStream.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tLog.i(\"##sb#\", sb.toString());\n\t\treturn sb.toString();\n\t}", "public static String convertStreamToString(InputStream is) throws IOException {\n\n String encoding = \"UTF-8\"; //default\n\n\n // cerca se il documento specifica un altro encoding\n if (is != null) {\n StringBuilder sb = new StringBuilder();\n String line;\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));//\"UTF-8\"));\n while ((line = reader.readLine()) != null) { //CRASHA\n sb.append(line).append(\"\\n\");\n if ((sb.toString().contains(\"<?\") && sb.toString().contains(\"?>\")) && sb.toString().contains(\"encoding=\")) {\n\n Pattern p = Pattern.compile(\".*<\\\\?.*encoding=.(.*).\\\\?>.*\", Pattern.DOTALL);\n\n Matcher matcher = p.matcher(sb.toString());\n\n if (matcher.matches()) {\n encoding = matcher.group(1);\n }\n\n break;\n }\n }\n\n\n\n }\n\n // converte\n if (is != null) {\n StringBuilder sb = new StringBuilder();\n String line;\n\n try {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is, encoding));//\"UTF-8\"));\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(\"\\n\");\n System.out.println(line);\n }\n } finally {\n is.close();\n }\n return sb.toString();\n } else {\n return \"error\";\n }\n }", "@NonNull\n public static String getStringFrom(InputStream inputStream) {\n StringBuffer dataStringBuffer = new StringBuffer(\"\");\n try {\n InputStreamReader isr = new InputStreamReader(inputStream);\n BufferedReader bufferedReader = new BufferedReader(isr);\n String readString = bufferedReader.readLine();\n while (readString != null) {\n dataStringBuffer.append(readString);\n readString = bufferedReader.readLine();\n }\n isr.close();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n return dataStringBuffer.toString();\n }", "protected String convertStreamToString(InputStream is, String charset) {\n\t\tScanner s = new Scanner(is, charset);\n\t\ttry {\n\t\t\ts.useDelimiter(\"\\\\A\");\n\t\t\treturn s.hasNext() ? s.next() : \"\";\n\t\t} finally {\n\t\t\ts.close();\n\t\t}\n\t}", "public static String readString(InputStream is) {\r\n \t\tif (is == null)\r\n \t\t\treturn null;\r\n \t\tBufferedReader reader= null;\r\n \t\ttry {\r\n \t\t\tStringBuffer buffer= new StringBuffer();\r\n \t\t\tchar[] part= new char[2048];\r\n \t\t\tint read= 0;\r\n \t\t\treader= new BufferedReader(new InputStreamReader(is));\r\n \r\n \t\t\twhile ((read= reader.read(part)) != -1)\r\n \t\t\t\tbuffer.append(part, 0, read);\r\n \t\t\t\r\n \t\t\treturn buffer.toString();\r\n \t\t\t\r\n \t\t} catch (IOException ex) {\r\n \t\t} finally {\r\n \t\t\tif (reader != null) {\r\n \t\t\t\ttry {\r\n \t\t\t\t\treader.close();\r\n \t\t\t\t} catch (IOException ex) {\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn null;\r\n \t}", "private String readStream(InputStream in) throws IOException {\n BufferedReader r = new BufferedReader(new InputStreamReader(in));\n\n StringBuilder sb = new StringBuilder();\n String line;\n\n // Reads every line and stores them in sb.\n while((line = r.readLine()) != null) {\n sb.append(line);\n }\n\n // Closes the input stream.\n in.close();\n\n return sb.toString();\n }", "private static String ioStr(InputStream in) throws IOException {\n\t\t// Read input\n\t\tString str = new String();\n\t\tString next = null;\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\t\twhile ((next = reader.readLine()) != null) {\n\t\t\tstr += next + \"\\n\";\n\t\t}\n\t\tin.close();\n\n\t\t// Convert result accordingly\n\t\tif (str.length() > 1) {\n\t\t\treturn str.substring(0, str.length() - 1);\n\t\t}\n\t\treturn str;\n\t}", "private static String readIt(InputStream stream) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(stream));\n StringBuilder sb = new StringBuilder();\n String line;\n while ((line = br.readLine()) != null) {\n sb.append(line+\"\\n\");\n }\n br.close();\n return sb.toString();\n\t}", "private static String readFromStream(InputStream inputStream) throws IOException {\n StringBuilder output = new StringBuilder();\n if (inputStream != null) {\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream, Charset.forName(\"UTF-8\"));\n BufferedReader reader = new BufferedReader(inputStreamReader);\n String line = reader.readLine();\n while (line != null) {\n output.append(line);\n line = reader.readLine();\n }\n }\n return output.toString();\n }", "private static String read(InputStream in) throws IOException {\n StringBuilder builder = new StringBuilder();\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n String line = null;\n while ((line = reader.readLine()) != null)\n builder.append(line);\n\n return builder.toString();\n }", "public static String readFileFromInputStream(final InputStream is) throws IOException\n\t{\n\t\tfinal BufferedReader input = new BufferedReader(new InputStreamReader(\n\t\t\t\tis, FILE_CHARSET_NAME));\n\t\ttry\n\t\t{\n\t\t\tfinal StringBuilder contents = new StringBuilder(BUFFER_SIZE);\n\n\t\t\t// copy from input stream\n\t\t\tfinal char[] charBuffer = new char[BUFFER_SIZE];\n\t\t\tint len;\n\t\t\twhile ((len = input.read(charBuffer)) > 0)\n\t\t\t{\n\t\t\t\tcontents.append(charBuffer, 0, len);\n\t\t\t}\n\n\t\t\treturn contents.toString().replaceAll(\"\\r\\n\", \"\\n\");\n\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tinput.close();\n\t\t}\n\t}", "private String readStream(InputStream is) throws IOException {\n StringBuilder sb = new StringBuilder();\n BufferedReader r = new BufferedReader(new InputStreamReader(is),1000);\n for (String line = r.readLine(); line != null; line =r.readLine()){\n sb.append(line);\n }\n is.close();\n return sb.toString();\n }", "private static String readStream(InputStream is, String charsetName) throws UnsupportedEncodingException, IOException {\r\n StringBuffer sb = new StringBuffer();\r\n byte[] buffer = new byte[1024];\r\n int length = 0;\r\n while ((length = is.read(buffer)) != -1) {\r\n sb.append(new String(buffer, 0, length, charsetName));\r\n }\r\n return sb.toString();\r\n }", "public static String readFromInputStream(InputStream inputStream) throws IOException {\n StringBuilder streamOutput = new StringBuilder();\n if (inputStream != null) {\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream, Charset\n .forName(\"UTF-8\"));\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n String line = bufferedReader.readLine();\n while (line != null) {\n streamOutput.append(line);\n line = bufferedReader.readLine();\n }\n }\n return streamOutput.toString();\n }", "public static String readString(InputStream is, String encoding) throws IOException {\n StringWriter sw = new StringWriter();\n try {\n copy(is, sw, encoding);\n return sw.toString();\n } finally {\n close(is);\n close(sw);\n }\n }", "public String responsetoString(InputStream in) throws IOException{\n\t\tBufferedReader br = new BufferedReader( new InputStreamReader(in));\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString line = null;\n\t\twhile((line = br.readLine())!= null){\n\t\t\tsb.append(line);\t\t\t\n\t\t}\n\t\tin.close();\n\t\treturn sb.toString();\n\t}", "private static String stringFromInputStream(InputStream inIS) {\n\n if (inIS == null) {\n return null;\n }\n StringBuffer outBuffer = new StringBuffer();\n InputStreamReader isr = null;\n BufferedReader input = null;\n try {\n String line = null;\n isr = new InputStreamReader(inIS);\n input = new BufferedReader(isr);\n while ((line = input.readLine()) != null) {\n if (line.indexOf(\"//\") == -1) {\n outBuffer.append(line);\n outBuffer.append(System.getProperty(\"line.separator\"));\n }\n }\n } catch (IOException ioe) {\n log.error(\"Unable to read from InputStream or write to output buffer\");\n ioe.printStackTrace();\n outBuffer = null;\n }\n try {\n isr.close();\n input.close();\n inIS.close();\n } catch (IOException ioe) {\n log.error(\"InputStream could not be closed\");\n ioe.printStackTrace();\n }\n if (outBuffer == null) {\n return null;\n } else {\n return outBuffer.toString();\n }\n\n }", "private String readIt(InputStream stream) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(stream, \"iso-8859-1\"), 128);\n StringBuilder sb = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n sb.append(line);\n }\n return sb.toString();\n }", "private static String readFromStream(InputStream inputStream) throws IOException {\n\n // Create a new empty string builder\n StringBuilder stringBuilder = new StringBuilder();\n\n // Create a bufferedReader that reads from the inputStream param\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream,\n Charset.forName(\"UTF-8\")));\n\n // Create a string that is one line of the buffered reader\n String line = bufferedReader.readLine();\n\n while (line != null) {\n // Add line to stringBuilder\n stringBuilder.append(line);\n\n // Set line to the next line in buffered reader\n line = bufferedReader.readLine();\n }\n\n // Return string builder as a string\n return stringBuilder.toString();\n }", "static String slurp(InputStream stream) throws IOException {\n StringBuilder sb = new StringBuilder();\n BufferedReader br = new BufferedReader(new InputStreamReader(stream));\n String line;\n while ((line = br.readLine()) != null) {\n sb.append(line).append(System.lineSeparator());\n }\n br.close();\n return sb.toString();\n }", "public static String readIt(InputStream is) throws IOException {\n BufferedReader reader = null;\n reader = new BufferedReader(new InputStreamReader(is, \"UTF-8\"));\n StringBuilder responseStrBuilder = new StringBuilder();\n String inputStr;\n while ((inputStr = reader.readLine()) != null) {\n responseStrBuilder.append(inputStr);\n }\n return responseStrBuilder.toString();\n }", "public String inputStreamToString(InputStream inputStreamFromServer) throws IOException{\r\n //create bufferedReader from inputStream\r\n BufferedReader bufferedReader = new BufferedReader(\r\n new InputStreamReader(inputStreamFromServer));\r\n\r\n //hold variables\r\n String inputLine;\r\n StringBuffer responseAsString = new StringBuffer();\r\n\r\n //reading with buffer\r\n while((inputLine = bufferedReader.readLine()) != null){\r\n responseAsString.append(inputLine);\r\n }\r\n\r\n return responseAsString.toString();\r\n\r\n }", "public String readStream(InputStream in) {\n BufferedReader reader = null;\n StringBuffer data = new StringBuffer(\"\");\n try {\n reader = new BufferedReader(new InputStreamReader(in));\n String line = \"\";\n while ((line = reader.readLine()) != null) {\n data.append(line);\n }\n } catch (IOException e) {\n Log.e(\"Log\", \"IOException\");\n } finally {\n if (reader != null) {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return data.toString();\n }", "public static String read(InputStream input) throws Exception {\r\n\t\treader.setInput(input);\r\n\t\treader.setCharset(\"UTF-8\");\r\n\t\treturn reader.read();\r\n\t}", "public String readIt(InputStream stream, int len) throws IOException, UnsupportedEncodingException {\n Reader reader = null;\n reader = new InputStreamReader(stream, \"UTF-8\");\n char[] buffer = new char[len];\n reader.read(buffer);\n return new String(buffer);\n }", "private String readString(InputStream in) throws IOException {\r\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in, \"iso-8859-1\"));\r\n\t\tString inputLine;\r\n\t\tStringBuffer response = new StringBuffer();\r\n\t\twhile ((inputLine = reader.readLine()) != null) {\r\n\t\t\tresponse.append(inputLine);\r\n\t\t}\r\n\t\tin.close();\r\n\t\treturn response.toString();\r\n\t}", "public static String readIt(InputStream stream, int len) throws IOException, UnsupportedEncodingException {\n BufferedReader br = null;\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n\n br = new BufferedReader(new InputStreamReader(stream));\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n\n return sb.toString();\n }", "public static String copyToString(InputStream in, Charset charset) throws IOException {\n if (in == null) throw new IllegalArgumentException(\"No InputStream specified\");\n if (charset == null) throw new IllegalArgumentException(\"No Charset specified\");\n StringBuilder out = new StringBuilder();\n InputStreamReader reader = new InputStreamReader(in, charset);\n char[] buffer = new char[BUFFER_SIZE];\n int bytesRead;\n while ((bytesRead = reader.read(buffer)) != -1) {\n out.append(buffer, 0, bytesRead);\n }\n return out.toString();\n }", "protected String readUnicodeInputStream(InputStream in) throws IOException {\n\t\tUnicodeReader reader = new UnicodeReader(in, null);\n\t\tString data = FileCopyUtils.copyToString(reader);\n\t\treader.close();\n\t\treturn data;\n\t}", "public static String streamToText(InputStream stream) {\n\t\ttry {\n\t\t\treturn readerToText(new InputStreamReader(stream, AppConventions.CHAR_ENCODING));\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\tlogger.error(\"Error while reading from reader. {}\", e.getMessage());\n\t\t\treturn \"\";\n\t\t}\n\t}", "private static String readFromStream(InputStream inputStream) {\n StringBuilder outputString = new StringBuilder();\n if (inputStream != null) {\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream, Charset.forName(\"UTF-8\"));\n BufferedReader reader = new BufferedReader(inputStreamReader);\n try {\n String line = reader.readLine();\n while (line != null) {\n outputString.append(line);\n line = reader.readLine();\n }\n } catch (IOException e) {\n Log.e(LOG_TAG, \"Error reading line from reader, readFromStream() block\", e);\n }\n }\n return outputString.toString();\n }", "private String read(InputStream in) throws IOException {\n StringBuilder sb = new StringBuilder();\n BufferedReader r = new BufferedReader(new InputStreamReader(in), 1000);\n for (String line = r.readLine(); line != null; line = r.readLine()) {\n sb.append(line);\n }\n in.close();\n return sb.toString();\n }", "public static String readFile(InputStream in) throws IOException {\n final StringBuffer sBuffer = new StringBuffer();\n final BufferedReader br = new BufferedReader(new InputStreamReader(in));\n final char[] buffer = new char[1024];\n\n int cnt;\n while ((cnt = br.read(buffer, 0, buffer.length)) > -1) {\n sBuffer.append(buffer, 0, cnt);\n }\n br.close();\n in.close();\n return sBuffer.toString();\n }", "public static String toString(final InputStream input, final Charset encoding) throws IOException {\n final StringWriter sw = new StringWriter();\n copy(input, sw, encoding);\n return sw.toString();\n }", "private String read() {\n\n String s = \"\";\n\n try {\n // Check if there are bytes available\n if (inStream.available() > 0) {\n\n // Read bytes into a buffer\n byte[] inBuffer = new byte[1024];\n int bytesRead = inStream.read(inBuffer);\n\n // Convert read bytes into a string\n s = new String(inBuffer, \"ASCII\");\n s = s.substring(0, bytesRead);\n }\n\n } catch (Exception e) {\n Log.e(TAG, \"Read failed!\", e);\n }\n\n return s;\n }", "public String readString() throws IOException {\n return WritableUtils.readString(in);\n }", "public static String readString(InputStream is, String encoding) {\n \t\tif (is == null)\n \t\t\treturn null;\n \t\tBufferedReader reader= null;\n \t\ttry {\n \t\t\tStringBuffer buffer= new StringBuffer();\n \t\t\tchar[] part= new char[2048];\n \t\t\tint read= 0;\n \t\t\treader= new BufferedReader(new InputStreamReader(is, encoding));\n \n \t\t\twhile ((read= reader.read(part)) != -1)\n \t\t\t\tbuffer.append(part, 0, read);\n \t\t\t\n \t\t\treturn buffer.toString();\n \t\t\t\n \t\t} catch (IOException ex) {\n \t\t\tCompareUIPlugin.log(ex);\n \t\t} finally {\n \t\t\tif (reader != null) {\n \t\t\t\ttry {\n \t\t\t\t\treader.close();\n \t\t\t\t} catch (IOException ex) {\n \t\t\t\t\t// silently ignored\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\treturn null;\n \t}", "public static String toString(final InputStream input, final String encoding)\n throws IOException {\n return toString(input, Charset.forName(encoding));\n }", "private String getTextLineFromStream( InputStream is ) throws IOException {\n StringBuffer buffer = new StringBuffer();\n int b;\n\n \twhile( (b = is.read()) != -1 && b != (int) '\\n' ) {\n \t\tbuffer.append( (char) b );\n \t}\n \treturn buffer.toString().trim();\n }" ]
[ "0.8287886", "0.8158139", "0.81556314", "0.8113989", "0.8075132", "0.8070196", "0.8050584", "0.8034654", "0.8028828", "0.8010856", "0.8005428", "0.8005033", "0.7989694", "0.7987228", "0.7977151", "0.79752237", "0.7971573", "0.7952899", "0.79171985", "0.7911311", "0.7907695", "0.7905855", "0.7896584", "0.7862572", "0.78609896", "0.7844819", "0.7829153", "0.78071356", "0.7798317", "0.77914715", "0.7791183", "0.77906835", "0.7772813", "0.7770208", "0.7761766", "0.77466494", "0.77396023", "0.7717213", "0.7707763", "0.77016497", "0.7667107", "0.7663982", "0.7663982", "0.7660148", "0.7656821", "0.7631565", "0.762776", "0.7618581", "0.7596147", "0.7584088", "0.74576056", "0.74553746", "0.7422153", "0.73832583", "0.73822004", "0.73772705", "0.73723483", "0.7347844", "0.73027825", "0.7273518", "0.7263076", "0.724458", "0.72331417", "0.7215604", "0.72106344", "0.71975994", "0.7195573", "0.71882266", "0.71405", "0.7120166", "0.71071774", "0.7095513", "0.7020606", "0.7014243", "0.7005524", "0.699062", "0.6947766", "0.6942668", "0.693426", "0.690589", "0.690011", "0.68889993", "0.68711126", "0.6855721", "0.67395246", "0.6732502", "0.67193365", "0.6716701", "0.6704799", "0.6702999", "0.6638196", "0.6633138", "0.6613935", "0.6557367", "0.6555237", "0.6534123", "0.6519537", "0.64733243", "0.64569175", "0.6441232" ]
0.7693746
40
method replace all 'n' space & 'tab' characters into single space.
public String getSingleSpaceString(String sInputString) { String sOutputString = ""; try { //loop replace all TAB by single space while (sInputString.contains(" ")) { sInputString = sInputString.replaceAll(" ", " ").trim(); } //loop to replace all double space by single space while (sInputString.contains(" ")) { sInputString = sInputString.replaceAll(" ", " ").trim(); } } catch (Exception e) { } finally { sOutputString = sInputString; sInputString = null; return sOutputString; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected final String space(int n) {\n StringBuffer buf = new StringBuffer(0);\n for (int i = 0; i < n; i++) {\n buf.append(\" \");\n }\n return buf.toString();\n }", "private static void processTab() {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tif (charCount == MAX_W) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tline[charCount] = ' ';\n\t\t\tcharCount++;\n\t\t}\n\t\tcurrentWord = charCount;\n\t}", "public String tab(String str) {\n if (str == null || str.trim().isEmpty()) {\n return str;\n }\n str = str.replaceAll(\"\\n\\t\", \"\\n\\t\\t\");\n str = str.replaceAll(\"\\n<\", \"\\n\\t<\");\n return \"\\t\" + str;\n }", "public static String spaces(int n) {\n StringBuffer b = new StringBuffer();\n for (int i = 0; i < n; i++) {\n b.append(' ');\n }\n return b.toString();\n }", "@Test\n\tpublic void removeWhiteSpaceFromTabs() {\n\t\tString input = \"two tousand \" + \"\\t\" + \"\\t\" + \" sixteen\" \n\t\t\t\t+ \"new \" + \"\\t\" + \" lines!\" + \"\\n\" + \" \" + \"\\n\";\n\t\tSystem.out.println(input);\n\t\tStringUtility stringUtility = new StringUtility();\n\t\tString actualCastedString = stringUtility.castWordNumberToNumber(input);\n\t\tactualCastedString = stringUtility.removeWhiteSpace(actualCastedString);\n\n\t\tString correctlyCastedString = \"2tousandsixteennewlines!\";\n\n\t\tAssert.assertEquals(actualCastedString, correctlyCastedString);\n\t}", "public static String spaces(int n)\n\t{\n\t\tString str = \"\";\n\t\tfor(int i = 0; i < n; i++)\n\t\t{\n\t\t\tstr += \" \";\n\t\t}\n\t\treturn str;\n\t}", "public static String trimer (String text){\n\t\treturn text.replaceAll(\"\\\\s+\", \" \");\n\t}", "private static String clearSpaces(final String old) {\n return old.replace(\" \", \"\").replace(\"\\n\", \"\");\n }", "public String reorderSpaces(String text) {\n\t\tchar[] newStr = new char[text.length()];\n\t\tString[] splitStr = text.split(\" \");\n\t\tint wordCount = 0;\n\t\tint spaceCount = 0;\n\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tif (text.charAt(i) == ' ') {\n\t\t\t\tspaceCount++;\n\t\t\t}\n\t\t}\n\n\t\tfor (String word : splitStr) {\n\t\t\tif (!word.trim().isEmpty()) {\n\t\t\t\twordCount++;\n\t\t\t}\n\t\t}\n\n\t\tint space = wordCount <= 1 ? spaceCount : spaceCount / (wordCount - 1);\n\t\tint extraSpace = wordCount <= 1 ? 0 : spaceCount % (wordCount - 1);\n\t\tint k = 0;\n\n\t\tfor (String word : splitStr) {\n\t\t\tif (!word.trim().isEmpty()) {\n\t\t\t\tfor (int i = 0; i < word.trim().length(); i++) {\n\t\t\t\t\tnewStr[k++] = word.trim().charAt(i);\n\t\t\t\t}\n\n\t\t\t\tfor (int i = 0; k < text.length() && i < space; i++) {\n\t\t\t\t\tnewStr[k++] = ' ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; k < text.length() && i < extraSpace; i++) {\n\t\t\tnewStr[k++] = ' ';\n\t\t}\n\n\t\treturn new String(newStr);\n\t}", "public static String removeWhitespace(String s) {\n s = s.replace(\" \",\"\");\n s = s.replace(\"\\n\",\"\");\n s = s.replace(\"\\t\",\"\");\n return s;\n }", "private static String manualTab(String entry)\r\n\t{\r\n\t\tString tab = \"\";\r\n\t\tfor(int count=0; count < 15 - entry.length(); count++)\r\n\t\t\ttab += \" \";\r\n\t\treturn tab;\r\n\t}", "private String spacing(String line) {\n \n \t\t/* Remove redundant spaces (keep only one space between two words) */\n \t\tint limit = 0;\n \t\tMatcher matcher = patternSpaces.matcher(line);\n \n \t\tString oldLine = line;\n \n \t\tremSpaces: while (matcher.find()) {\n \n \t\t\tint offset = matcher.start();\n \n \t\t\t// do not remove spaces at the beginning of a line\n \t\t\tif (line.substring(0, offset).trim().equals(\"\"))\n \t\t\t\tcontinue;\n \n \t\t\t/*\n \t\t\t * if the spaces (or tabs) are at the beginning of a line or before a comment, then we keep them\n \t\t\t */\n \t\t\t/*\n \t\t\t * Matcher matcherSpacesBeforeComment = patternSpacesBeforeComment.matcher(line); if\n \t\t\t * (matcherSpacesBeforeComment.find()) { if (offset < matcherSpacesBeforeComment.end()) continue\n \t\t\t * remSpaces; }\n \t\t\t */\n \n \t\t\t// if the spaces are before a comment, then we keep them\n \t\t\tString afterSpaces = line.substring(matcher.end());\n \t\t\tif (afterSpaces.startsWith(\"(*\"))\n \t\t\t\tcontinue remSpaces;\n \n \t\t\t// If we are inside a string, then we skip this replacing\n \t\t\tMatcher matcherString = patternString.matcher(line);\n \t\t\twhile (matcherString.find()) {\n \t\t\t\tif (matcherString.start() <= offset && offset < matcherString.end())\n \t\t\t\t\tcontinue remSpaces;\n \t\t\t}\n \n \t\t\t// If we are inside a comment, then we skip this replacing\n \t\t\tMatcher matcherComment = patternComment.matcher(line);\n \t\t\twhile (matcherComment.find()) {\n \t\t\t\tif (matcherComment.start() <= offset && offset < matcherComment.end())\n \t\t\t\t\tcontinue remSpaces;\n \t\t\t}\n \n \t\t\tline = line.substring(0, offset) + \" \" + line.substring(matcher.end());\n \n \t\t\t// we have to reset the matcher, because we modified the line\n \t\t\tmatcher = patternSpaces.matcher(line);\n \n \t\t\t// we put a limit, just in case we would get into an infinite loop\n \t\t\tif (limit++ > 10000) {\n \t\t\t\tOcamlPlugin.logError(\"Infinite loop detected in formatter during spacing (1): <<\" + oldLine\n \t\t\t\t\t\t+ \">>\");\n \t\t\t\tbreak;\n \t\t\t}\n \n \t\t}\n \n \t\t// remove spaces before commas\n \t\t//line = line.replaceAll(\" ,\", \",\");\n \t\t// remove spaces before semicolons\n \t\t//line = line.replaceAll(\" ;\", \";\");\n \n \t\tfor (int nPattern = 0; nPattern <= 1; nPattern++) {\n \t\t\tPattern patternSpacing;\n \t\t\tif (nPattern == 0)\n \t\t\t\tpatternSpacing = patternSpacingRight;\n \t\t\telse\n \t\t\t\tpatternSpacing = patternSpacingLeft;\n \n \t\t\t/*\n \t\t\t * We put a limit to the number of replacements, just in case we would get into an infinite loop\n \t\t\t */\n \t\t\tlimit = 0;\n \t\t\t// add spaces before some characters\n \t\t\tmatcher = patternSpacing.matcher(line);\n \n \t\t\toldLine = line;\n \n \t\t\taddSpaces: while (matcher.find()) {\n \n \t\t\t\tint offset = matcher.start() + 1;\n \t\t\t\tif (offset > line.length() - 1 || offset < 0) {\n \t\t\t\t\tocaml.OcamlPlugin.logError(\"OcamlIndenter:format : invalid position\");\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \n \t\t\t\t// if we are inside a string, then we skip this replacement\n \t\t\t\tMatcher matcherString = patternString.matcher(line);\n \t\t\t\twhile (matcherString.find()) {\n \t\t\t\t\tif (matcherString.start() <= offset && offset < matcherString.end())\n \t\t\t\t\t\tcontinue addSpaces;\n \t\t\t\t}\n \n \t\t\t\t// Skip replacement if in comment\n \t\t\t\tMatcher matcherComment = patternComment.matcher(line);\n \t\t\t\twhile (matcherComment.find()) {\n \t\t\t\t\tif (matcherComment.start() <= offset && offset < matcherComment.end())\n \t\t\t\t\t\tcontinue addSpaces;\n \t\t\t\t}\n \n \t\t\t\tline = line.substring(0, offset) + \" \" + line.substring(offset);\n \n \t\t\t\t// we have to reset the matcher, because we modified the line\n \t\t\t\tmatcher = patternSpacing.matcher(line);\n \t\t\t\tif (limit++ > 10000) {\n \t\t\t\t\tOcamlPlugin.logError(\"Infinite loop detected in formatter during spacing (2): <<\"\n \t\t\t\t\t\t\t+ oldLine + \">>\");\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\treturn line;\n \n \t}", "public void setInsertSpaces(boolean substitute);", "static String fixInputLine(String input){\n\t\tString fixed = input;\n\n\t\tfor(int i = 0; i < 10; i++){ //run 10 passes, getting rid of redundant tabs.\n\t\t\tfixed = fixed.replaceAll(\"\\\\\\t\\\\\\t\", \"\\t\");\n\t\t}\n\n\t\t//turn any remaining tabs into % characters. \n\n\t\tfixed = fixed.replaceAll(\"\\\\\\t\", \"%\");\n\n\t\t//System.out.println(fixed);\n\t\treturn fixed;\n\t}", "private String replaceSpaces(String value) {\r\n\t\treturn value.replace(\" \", \"_\");\r\n\t}", "private void space() {\n if (wereTokens && !spaceSuppressed) {\n out.print(' ');\n }\n }", "public String padSpace(int n) {\n\t\tif (n < 0) { n = 0; }\n\t\tString s = \"\";\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\ts = s + \" \";\n\t\t}\n\t\treturn s;\n\t}", "public static String markSpaces(String inText)\n {\n return inText.replaceAll(\"\\n\", \"\\\\\\\\n\").replaceAll(\"\\r\", \"\\\\\\\\r\")\n .replaceAll(\"\\t\", \"\\\\\\\\t\").replaceAll(\"\\f\", \"\\\\\\\\f\").replaceAll(\" \", \"_\");\n }", "private String normalize(String text) {\n final String nbsp = new String(new char[] {(char) 160});\n return text.replaceAll(\"\\\\s+(\" + nbsp + \")+\\\\s+\", \"$1\")\n .replace((char) 160, ' ')\n .replaceAll(\n \"\\n+\", \"\\n\")\n .replaceAll(\"\\r|\\t\", \"\")\n .trim();\n }", "private String normalizeSpace(final String arg) {\n return arg.replaceAll(Constants.SPACE_PATTERN, Constants.SPACE);\n }", "public static String removeLeftSpaceOrTabs(String current) {\n char ch;\n int whiteSpacesLen = 0;\n for (int i = 0; i < current.length(); i++) {\n ch = current.charAt(i);\n if (CR == ch || LF == ch || CharacterConstants.SPACE == ch || CharacterConstants.TAB == ch) {\n whiteSpacesLen++;\n } else {\n break;\n }\n }\n return current.substring(whiteSpacesLen);\n }", "public static String removeRightSpaceOrTabs(String current) {\n char ch;\n int whiteSpacesLen = 0;\n for (int i = current.length() - 1; i >= 0; i--) {\n ch = current.charAt(i);\n if (CR == ch || LF == ch || CharacterConstants.SPACE == ch || CharacterConstants.TAB == ch) {\n whiteSpacesLen++;\n } else {\n break;\n }\n }\n return current.substring(0, current.length() - whiteSpacesLen);\n }", "public static void spaces() {\r\n // prints 13 spaces\r\n for (int space = 0; space < 15; space++) {\r\n System.out.println(\"\");\r\n }\r\n\r\n }", "void addSpaces() {\n\t\tSystem.out.print(\" \");\n\t\tfor (int j = 0; j < 3; j++)\n\t\t\tSystem.out.print(\"| \");\n\t\tSystem.out.println(\"|\");\n\t}", "public static String formatSpaces(String s) {\n \tString temp = s;\n \tif(s.contains(\"underscores\")) temp = s.replace(\" \", \"_\");\n return temp;\n }", "public static String whitespace(int count, String spaces) {\r\n\t\tfor (int i = 0; i < count; i++) {spaces += \" \";}\r\n\t\treturn spaces;\r\n\t}", "static void printSpaces()\n{ int i;\n for (i=0;i<sangria;i++)\n\t System.out.print(\" \");\n}", "public String quitaespacios (String str) {\n\n str = repNull(str);\n str = str.trim();\n str = rep(str, \"[ ]{2,}\", \" \");\n\n return str;\n }", "private static String escapeWhitespace( final String input )\n {\n return input.replaceAll( \"\\\\ \", \"\\\\\\\\ \" );\n }", "public String getTab() {\r\n if(date.length() < 10)\r\n return \"\\t\\t\";\r\n else\r\n return \"\\t\";\r\n }", "private void initWhitespace(Set<String> s) {\n\t\ts.add(\" \");\n\t\ts.add(\"\\n\");\n\t\ts.add(\"\\t\");\n }", "@Override\n\tpublic String abbreviatedCellText(){\n\t\tString realText = text;\n\t\tif(text.charAt(0) == '\\\"'){\n\t\t\trealText = text.substring(1, text.length() - 1);\n\t\t}\n\t\tif(realText.length() > 10){\t\t//if it contains more than 10 characters\n\t\t\trealText = text.substring(1, 11);\t//using substring to take the first 10\n\t\t\treturn realText;\n\t\t}else{\n\t\t\t//fills in the spaces\n\t\t\twhile(realText.length()<10){\t//if it contains less than 10 characters\t\n\t\t\t\trealText += \" \";\t\t//pad to ten\n\n\t\t\t}\n\t\t\treturn realText;\n\t\t}\n\t}", "private String indent(int spaces) {\n\t\tString result = \"\";\n\t\tfor (int i = 0; i < spaces; i++) {\n\t\t\tresult = result + \" \";// it creates as much spaces as it is told to\n\t\t}\n\t\treturn result;\n\t}", "public static void space(int space) {\r\n\t\tfor(int i=0; i<space; i++) {\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t}", "void replaceSpaces(String strmain, int trueLen) {\n char[] str = strmain.toCharArray();\n int spaceCount = 0, index, i = 0;\n for (i = 0; i < trueLen; i++) {\n if(str[i]==' ')\n spaceCount++;\n }\n index = trueLen + spaceCount * 2; //length of the final string\n if (trueLen < str.length)\n str[trueLen] = '\\0';\n for (i = trueLen - 1; i >= 0; i--) {\n if (str[i] == ' ') {\n str[index - 1] = '0';\n str[index - 2] = '2';\n str[index - 3] = '%';\n index = index - 3;\n } else {\n str[index - 1] = str[i];\n index--;\n }\n }\n System.out.println(str);\n }", "private static String trimWhiteSpace(String sentence) {\n\t\tsentence = sentence.replaceAll(\"[^a-zA-Z]\", \" \");\n//\t\tsentence = sentence.replaceAll(\"\\n\", \" \");\n//\t\tsentence = sentence.replaceAll(\"\\t\", \" \");\n// sentence = sentence.replaceAll(\"\\\\.\", \" \");\n// sentence = sentence.replaceAll(\",\", \" \");\n \n//\t\tint length;\n//\t\tdo {\n//\t\t\tlength = sentence.length();\n//\t\t\tsentence = sentence.replaceAll(\" \", \" \");\n//\n//\t\t} while (sentence.length() < length);\n\t\treturn sentence;\n\t}", "private boolean getReplaceNonBreakingSpace() {\n return false;\n }", "public static String formatSpaces(String s) {\n\t\tif(s.contains(\"underscores\"))\n\t\treturn s.replaceAll(\" \", \"_\");\n\t\t\n\t\treturn s;\n\t}", "public static String restoreSpaces(String input) {\n\t\tchar[] chars = input.toCharArray();\n\t\tint current = 0;\n\t\tString result = \"\";\n\n\t\twhile (current < chars.length) {\n\t\t\tRetrievalTreeNode root = retrievalTree;\n\t\t\twhile (root.leaves.contains(chars[current])) {\n\t\t\t\troot = root.leaves.get(chars[current]);\n\t\t\t}\n\t\t\twhile (!root.isWord) {\n\t\t\t\troot = root.parent;\n\t\t\t}\n\t\t\tresult += input.substring(current, root.depth) + \" \";\n\t\t\tcurrent = root.depth;\n\t\t}\n\t\treturn result;\n\t}", "public static void main(String[] args) {\n\t String str = \"Fred F. Flintstone\";\n\t str.replace(\" \", \"%20\");\n\t System.out.println(str.replace(\" \", \"%20\"));\n\t System.out.println(replaceSpace(str.toCharArray()));\n\t }", "private void tabPrinter() {\n IntStream.range(0, tabs).forEach(i -> writer.print(\" \"));\n }", "public static char[] replaceSpace(char[] str){\n\t\t // TODO\n\t\t return str;\n\t }", "private boolean space() {\r\n return CHAR(' ');\r\n }", "@Test\n\tpublic void removeWhiteSpaceFromNewLine() {\n\t\tString input = \"two tousand sixteen \"\n\t\t\t\t+ \"new \" + \"lines!\" + \"\\n\" + \" \" + \"\\n\";\n\n\t\tStringUtility stringUtility = new StringUtility();\n\t\tString actualCastedString = stringUtility.castWordNumberToNumber(input);\n\t\tactualCastedString = stringUtility.removeWhiteSpace(actualCastedString);\n\n\t\tString correctlyCastedString = \"2tousandsixteennewlines!\";\n\n\t\tAssert.assertEquals(actualCastedString, correctlyCastedString);\n\t}", "public static void tab(String tab) {\n Formatting.indent = tab;\n }", "private String editString(String s) {\n s = s.replace(\"[31m\", \"\");\n s = s.replace(\"[0m\", \"\");\n s = s.replace(\"[33m\", \"\");\n s = s.replace(\"[36m\", \"\");\n s = s.replace(\"[34m\", \"\");\n s = s.replace(\"*\", \"\");\n s = s.replace(\"|\", \"\");\n //s = s.replace(\"]\", \"]\\n\");\n s = s.replace(\"\\t\", \"\\n\");\n\n\n return s;\n }", "public static String removeSpaces(String s) {\r\n StringTokenizer stt = new StringTokenizer(s);\r\n String res = \"\";\r\n\r\n while (stt.hasMoreTokens()) {\r\n String tok = stt.nextToken().trim();\r\n res += tok;\r\n }\r\n return res;\r\n }", "public String removeSpaces(String str) {\n str = str.replace(\" \", \"-\");\n return str;\n }", "private String limpiar_texto(String texto){\n \n texto = texto.replaceAll(\"\\n\",\"\");\n texto=texto.toUpperCase();\n for(int i=0;i<texto.length();i++){\n //Se crea un for que llenara el nuevo char\n int posicion = tabla.indexOf(texto.charAt(i)); //charat regresa el valor del arreglo\n if(posicion == -1){ \n texto=texto.replace(texto.charAt(i),' ');\n //En caso que no aparezca en la tabla de caracteres\n //Tiene que ser eliminado\n }\n }\n return texto;\n }", "static void trimWhitespace() {\n for (int i = a.size() - 1; i >= 0; i-- ) {\n Object o = a.get(i);\n StringBuilder sb = new StringBuilder();\n if (o instanceof Token)\n sb.append( ((Token)o).image );\n else\n sb.append((String)o);\n while(sb.length() > 0 && (sb.charAt(sb.length() - 1) == '\\u005cr'\n || sb.charAt(sb.length() - 1) == '\\u005cn'\n || sb.charAt(sb.length() - 1) == '\\u005ct'\n || sb.charAt(sb.length() - 1) == ' ')) {\n sb.deleteCharAt(sb.length() - 1);\n }\n if (sb.length() == 0) {\n a.remove(i);\n }\n else {\n a.set(i, sb.toString());\n break;\n }\n }\n if (a.size() == 0) {\n while(outputBuffer.length() > 0 && (outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005cr'\n || outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005cn'\n || outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005ct'\n || outputBuffer.charAt(outputBuffer.length() - 1) == ' ')) {\n outputBuffer.deleteCharAt(outputBuffer.length() - 1);\n }\n }\n }", "String getSpace();", "public static String saveWhitespaces(String s) {\n\t\treturn StringUtil.replace(s, \" \", \"\\u00A0\");\n\t}", "public void spaces() {\n System.out.println(\"\");\n System.out.println(\"\");\n }", "public static String formatSpaces(String s) {\n\t\t\n\t\tif(s.contains(\"underscores\")==true) {\n\t\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\t\tif(s.charAt(i)==' ') {\n\t\t\t\t\tString t1=s.substring(0, i);\n\t\t\t\t\tString t2=s.substring(i+1, s.length());\n\t\t\ts=t1+\"_\"+t2;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\treturn s;\n\t}", "public static String formatText(String t) {\r\n if (t.length() > 0) {\r\n char chars[] = t.toCharArray();\r\n for (int index = 0; index < chars.length; index++)\r\n if (chars[index] == '_') {\r\n chars[index] = ' ';\r\n if (index + 1 < chars.length && chars[index + 1] >= 'a' && chars[index + 1] <= 'z')\r\n chars[index + 1] = (char) ((chars[index + 1] + 65) - 97);\r\n }\r\n\r\n if (chars[0] >= 'a' && chars[0] <= 'z')\r\n chars[0] = (char) ((chars[0] + 65) - 97);\r\n return new String(chars);\r\n } else {\r\n return t;\r\n }\r\n }", "@Override\n\tpublic void space() {\n\t\t\n\t}", "public String removespaces(String inputString) {\r\n char[] charArray = inputString.toCharArray();\r\n \r\n String stringWithoutSpaces = \"\";\r\n \r\n for (int i = 0; i < charArray.length; i++) \r\n {\r\n if ( (charArray[i] != ' ') && (charArray[i] != '\\t') )\r\n {\r\n stringWithoutSpaces = stringWithoutSpaces + charArray[i];\r\n }\r\n }\r\n return stringWithoutSpaces;\r\n\t}", "@Override\n\tpublic String spaceRemover(String input) {\n\t\treturn input.replaceAll(\"\\\\s+\",\"\");\n\n\t}", "public static String replacement(String inp, String rep) {\n return inp.trim().replace(\" \", rep);\n }", "public static String setLen(String s, int nofSpaces) {\n\t\tStringBuilder sb = new StringBuilder(s);\n\t\tfor (int i = 0; i < nofSpaces; i++)\n\t\tsb.insert(0, \" \");\n\t\t2\n\t\treturn sb.toString();\n\t}", "char skipSpaces () {\n char c = getChar ();\n while (c == ' ' || c == '\\t' || c == '\\n' || c == '\\r') {\n if (c == '\\n') { m_nbLines++; }\n c = getNextChar ();\n }\n return c;\n }", "public static String tab() {\n return indent;\n }", "public XMLString fixWhiteSpace(boolean trimHead, boolean trimTail, boolean doublePunctuationSpaces) {\n/* 92 */ return new XMLStringDefault(this.m_str.trim());\n/* */ }", "private void skipSpaces() {\r\n\t\twhile (currentIndex < expression.length && (expression[currentIndex] == ' ' || expression[currentIndex] == '\\t'\r\n\t\t\t\t|| expression[currentIndex] == '\\n' || expression[currentIndex] == '\\r')) {\r\n\t\t\tcurrentIndex++;\r\n\t\t}\r\n\t}", "protected static String reduceString(String input) {\n String newString = input.toLowerCase();\n int len = newString.length();\n String retval = \"\";\n for (int i = 0; i < len; i++) {\n if (newString.charAt(i) == ' ' || newString.charAt(i) == '\\t') continue; else retval += newString.charAt(i);\n }\n return retval;\n }", "private void addSpaces(String text) {\n if (!text.equals(myPreviousText)) {\n // Remove spaces\n text = text.replace(\" \", \"\");\n\n // Add space between each character\n StringBuilder newText = new StringBuilder();\n for (int i = 0; i < text.length(); i++) {\n if (i == text.length() - 1) {\n // Do not add a space after the last character -> Allow user to delete last character\n newText.append(Character.toUpperCase(text.charAt(text.length() - 1)));\n }\n else {\n newText.append(Character.toUpperCase(text.charAt(i)) + LETTER_SPACING);\n }\n }\n\n myPreviousText = newText.toString();\n // Update the text with spaces and place the cursor at the end\n myEditText.setText(newText);\n myEditText.setSelection(newText.length());\n }\n }", "public static void main(String[] args) {\n\t\tString str = \"Harmohan Is Mad Person\";\n\t\tString newString = str.replaceAll(\" \", \"\");\n\t\tSystem.out.println(newString);\n\t\t\n\n\t}", "public String addSpaces(String string) {\n string = string.replaceAll(\"_\", \" \");\n return string;\n }", "@Override\n public void run() {\n int count = text.length() - text.replace(\" \", \"\").length();\n System.out.printf(\"Spaces: %d;\\n\", count);\n }", "public static String cutSpaces(String s){\n\t\tString res = s;\n\t\t\n\t\twhile ((res.startsWith(\" \")||(res.startsWith(\"\\n\")))&& res.length()>0) {\n\t\t\tres=res.substring(1);\n\t\t}\n\t\treturn res;\n\t}", "public String abbreviatedCellText() {\r\n\t\treturn \" \";//returns 10 spaces because the cell has to be empty\r\n\t}", "@Test\n public void testReplacingEmptyString()\n {\n String expectedValue=null,actualValue;\n actualValue=replaceingchar.replaceChar(\" \");\n assertEquals(expectedValue,actualValue);\n }", "public static void replaceSpaces(char str[], int length) {\n\t\tint spaceCount = 0;\n\t\tint newLength = 0;\n\t\tfor (int i = 0; i < length; i++) {\n\t\t\tif (str[i] == ' ') {\n\t\t\t\tspaceCount++;\n\t\t\t}\n\t\t}\n\t\tnewLength = length + 2 * spaceCount;\n\t\t// take a new array\n\t\tchar[] newStr = new char[newLength];\n\t\t// insert from the end\n\t\tfor (int i = length - 1; i >= 0; i--) {\n\t\t\tif (str[i] == ' ') {\n\t\t\t\tnewStr[newLength - 1] = '0';\n\t\t\t\tnewStr[newLength - 2] = '2';\n\t\t\t\tnewStr[newLength - 3] = '%';\n\t\t\t\tnewLength = newLength - 3;\n\t\t\t} else {\n\t\t\t\tnewStr[newLength - 1] = str[i];\n\t\t\t\tnewLength--;\n\t\t\t}\n\t\t}\n\t\tSystem.err.println(String.valueOf(newStr));\n\t}", "public static String fromNullToSpace(String a) {\r\n\t\tif (a == null || \"\".equals(a)) {\r\n\t\t\treturn \" \";\r\n\t\t} else {\r\n\t\t\treturn a;\r\n\t\t}\r\n\t}", "public static String tab(String string, int number){\n String concl = \"\";\n for (String line : string.split(\"\\n\")){\n for (int i = 0; i < number; i++){\n concl += \" \";\n }\n concl += line + \"\\n\";\n }\n return concl;\n }", "@Override\n\tprotected void handleTab() {\n\t\thandleSpace();\n\t}", "static void staircase(int n) {\r\n \tString row = \"\";\r\n \tfor (int i = n - 1; i >= 0; i--) {\r\n \t\trow = \"\";\r\n\t\t\tfor (int j = 0; j < n; j++) {\r\n\t\t\t\tif (i <= j ) {\r\n\t\t\t\t\trow += \"#\";\r\n\t\t\t\t}else {\r\n\t\t\t\t\trow += \" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(row);\r\n\t\t}\r\n }", "public String alternateWordSwap() {\n\t\tString output=\"\";\r\n\t\tString arr[]=this.str.split(\" \");\r\n\t\tfor(int i=0,j=1;i<arr.length;i+=2,j+=2){\r\n\t\t\tString temp=arr[i];\r\n\t\t\tarr[i]=arr[j];\r\n\t\t\tarr[j]=temp;\r\n\t\t}\r\n\t\t\r\n\t\tfor(String s:arr){\r\n\t\t\toutput+=s+\" \";\r\n\t\t}\r\n\t\treturn output.trim();\r\n\t}", "private boolean checkSpacingTabs(){\r\n\t\tString tmp = \"\";\r\n\t\ttry{ tmp = doc.getText(getCaretPosition()-2,1); }\r\n\t\tcatch(BadLocationException a){};\r\n\t\tSystem.out.println((int)tmp.charAt(0));\r\n\t\tif(tmp.charAt(0) == 9) return true;\r\n\t\telse return false;\r\n\t}", "private static String justifyLine(String text, int totalSpacesToInsert) {\n String[] wordArray = text.split(\"\\\\s\");\n String toAppend = \" \";\n\n while ((totalSpacesToInsert) >= (wordArray.length - 1)) {\n toAppend = toAppend + \" \";\n totalSpacesToInsert = totalSpacesToInsert - (wordArray.length - 1);\n }\n int i = 0;\n String justifiedText = \"\";\n for (String word : wordArray) {\n if (i < totalSpacesToInsert)\n justifiedText = justifiedText + word + \" \" + toAppend;\n\n else\n justifiedText = justifiedText + word + toAppend;\n\n i++;\n }\n\n return justifiedText;\n }", "private static final String formatTextAsHtml(String text) {\n StringBuffer html = new StringBuffer();\n html.append(\"<tt>\");\n for (int idx = 0; idx < text.length(); idx++) {\n if (text.charAt(idx) == ' ') {\n html.append(\"&nbsp;\");\n } else if (text.charAt(idx) == '\\t') {\n html.append(\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\");\n } else if (text.charAt(idx) == '\\n') {\n html.append(\"<br>\");\n } else {\n html.append(text.charAt(idx));\n }\n }\n html.append(\"</tt>\");\n return html.toString();\n }", "public static String squeezeWhitespace (String input){\r\n return Whitespace.matcher(input).replaceAll(\" \").trim();\r\n }", "private String addSpaces(String expr) {\n\t\tString output = \"\";\n\t\tString prev = \" \";\n\n\t\tfor(Character c : expr.trim().toCharArray()) {\n\t\t\tif(!areSameType(prev, c.toString()) || isOperator(prev) || \n\t\t\t\t\t(isMatrix(c.toString()) && isMatrix(prev))) \n\t\t\t\toutput += \" \";\n\t\t\toutput += c;\n\t\t\tprev = c.toString();\n\t\t}\n\n\t\treturn output;\n\t}", "static void staircase(int n) {\n\n \t/* Imlementacion para java11 (aqui se creo el repeat)\n \tfor( int i = 1; i <= n; i++ ) {\n \t\tSystem.out.println(\" \".repeat(n - i) + \"#\".repeat(i));\n \t}\n \t */\n\n \tString salida = \"\";\n \tfor( int i = 1; i <= n; i++ ) {\n \t\tfor( int j = 0; j < n - i; j++ ) {\n \t\t\tsalida += \" \"; \n \t\t}\n \t\tfor( int j = 0; j < i; j++ ) {\n \t\t\tsalida += \"#\";\n \t\t}\n \t\tSystem.out.println(salida);\n \t\tsalida = \"\";\n \t}\n }", "private void skipBlankSpaces() {\n\t\twhile(currentIndex < data.length) {\n\t\t\tchar c = data[currentIndex];\n\t\t\tif(c == ' ' || c == '\\t' || c =='\\n' || c == '\\r') {\n\t\t\t\tcurrentIndex++;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t String kkNo=\"12345 4532 7686 3550\";\n\t\t\t\tString isim=\"sanim sah29\";\n\t\t\t\tSystem.out.println(kkNo.replace(\" \", \"\"));\n\t\t\t\tSystem.out.println(kkNo); // 12345 4532 7686 3550 yoksa 12345453276863550\n\t\t\t\t\n\t\t\t\t// replaceAll ile\n\t\t\t\t\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\s\", \"\")); // s sadece space\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\S\", \"*\")); // S space olmayan hersey\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\w\", \"&\")); // harf veya rakamlarin hepsi\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\W\", \"-\")); // harf veya rakamlarin disindaki hersey\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\d\", \"0\")); // rakamlarin hepsi\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\D\", \"a\")); // rakamlarin disindaki hersey\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\s\", \"\")); // s sadece space\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\S\", \"*\")); // S space olmayan hersey\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\w\", \"&\")); // harf veya rakamlarin hepsi\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\W\", \"-\")); // harf veya rakamlarin disindaki hersey\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\d\", \"0\")); // rakamlarin hepsi\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\D\", \"a\")); // rakamlarin disindaki hersey\n\t\t\t\t\n\t\t\t\t//syso icinde yapilan Manipulationlar asil Stringi degistirmez\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\n\n\t}", "static void trimNL() {\n if(outputBuffer.length() > 0 && outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005cn')\n outputBuffer.deleteCharAt(outputBuffer.length() - 1);\n if(outputBuffer.length() > 0 && outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005cr')\n outputBuffer.deleteCharAt(outputBuffer.length() - 1);\n }", "private String _removeSpaces(String matrixElement) {\n char[] es = matrixElement.toCharArray();\n char[] _temp = new char[es.length];\n int count = 0;\n for (int i = 0; i < es.length; i++) {\n if (Character.isDigit(es[i]) || es[i] == '.' || es[i] == '-') {\n _temp[count++] = es[i];\n }\n }\n return new String(_temp, 0, count);\n }", "public static String padRightSpaces(final String s, final int n) {\n\t\treturn String.format(\"%1$-\" + n + \"s\", s);\n\t}", "static String m8561a(String str) {\n return str.replaceAll(\"\\r\\n\", \"\\n\").replaceAll(\" *\\n *\", \"\\n\").replaceAll(\"\\n\", \" \").replaceAll(\"[ \\t\\\\x0B\\f\\r]+\", \" \");\n }", "private void Spacing() {\n\n try {\n while (true) {\n try {\n Space();\n } catch (SyntaxError e) {\n Comment();\n }\n }\n } catch (SyntaxError e) {\n }\n }", "private String whiteSpace(String sum, String num)\n {\n\tString space = \"\";\n\tfor(int i = 0; i < sum.length() - num.length(); i++)\n\t space += \" \";\n\treturn space;\n }", "private static char[] replaceSpaceInString(char[] array, int length) {\n\tint spaceCount = 0;\n\tfor(int i =0;i<length;i++)\n\t\tif(array[i]==' ')\n\t\t\tspaceCount++;\n\tchar newArr[] = new char[length + 2*spaceCount+1];\n\tint newLength = 0;\n\tnewArr[length + 2*spaceCount] = '\\0';\n\tfor(int i =0;i<length;i++){\n\t\tif(array[i]==' '){\n\t\t\tnewArr[newLength] = '%';\n\t\t\tnewArr[newLength+1] = '2';\n\t\t\tnewArr[newLength+2] = '0';\n\t\t\tnewLength+=3;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnewArr[newLength] = array[i];\n\t\t\tnewLength++;\n\t\t}\n\t}\n\t\n\treturn newArr;\n}", "@Test\n\t public void test3()\n\t{\n\t\t\tString s = new String();\n\t s = s.replaceAll(\"\\\\s+\", \" \");\n\t assertEquals(\"\", LRS.lrs(s)); \n\t}", "public void changeSpaces(int extraSpaces) {\n int newSpaces = spaces + extraSpaces;\n //to accept the input:\n this.setSpaces(newSpaces);\n }", "public static char[] replaceSpace(char[] array, int trueLength) {\n\t\tSystem.out.println(array.length);\n\t\tint newIndex = trueLength-1 + charCount(array, trueLength, ' ')*2;\n\t\tSystem.out.println(newIndex);\n\t\tfor(int i=trueLength-1; i>=0; i--) {\n\t\t\tif(array[i]==' ') {\n\t\t\t\tarray[newIndex--] = '0';\n\t\t\t\tarray[newIndex--] ='2';\n\t\t\t\tarray[newIndex--] = '%';\n\t\t\t} else {\n\t\t\t\tarray[newIndex--] = array[i];\n\t\t\t}\n\t\t}\n\t\treturn array;\n\t}", "public String formatSpaceBetweenWords(String line) {\r\n line = line.replaceAll(\"\\\\s+\", \" \"); \r\n line = line.toLowerCase();\r\n line = oneSpaceSpecial(line, \".\");\r\n line = oneSpaceSpecial(line, \",\");\r\n line = oneSpaceSpecial(line, \":\");\r\n line = oneSpaceSpecial(line, \"\\\"\");\r\n return line.trim();\r\n }", "private static String trim(String s) {\n return s.replace(\" \", \"\");\n }", "@org.junit.Test\n public void markingSpaces()\n {\n assertEquals(\"empty\", \"\", markSpaces(\"\"));\n assertEquals(\"simple\", \"just_a_test\", markSpaces(\"just a test\"));\n assertEquals(\"all\", \"just\\\\ta\\\\ntest\\\\f\\\\r_with___all_\\\\n\\\\nthings\",\n markSpaces(\"just\\ta\\ntest\\f\\r with all \\n\\nthings\"));\n }", "public static String addSpace(int y) {\n\t\tString str = new String();\n\t\tif (y < 10)\n\t\t\tstr = \" \" + y;\n\t\telse if (y < 100)\n\t\t\tstr = \" \" + y;\n\t\telse\n\t\t\tstr = \"\" + y;\n\t\treturn str;\n\t}" ]
[ "0.6953138", "0.6846682", "0.66882914", "0.66065246", "0.657741", "0.6423301", "0.62439823", "0.61423886", "0.612835", "0.61000615", "0.6035646", "0.6034102", "0.6022887", "0.5988832", "0.5984698", "0.59247684", "0.5914094", "0.58662343", "0.5861261", "0.5789072", "0.573677", "0.5696507", "0.5680945", "0.56561387", "0.56250703", "0.559642", "0.5591396", "0.55642766", "0.55529827", "0.554414", "0.5474808", "0.54586506", "0.5448098", "0.5447783", "0.54434544", "0.544044", "0.5435868", "0.54216164", "0.54192424", "0.54141784", "0.5402007", "0.5395197", "0.537554", "0.5369069", "0.53524095", "0.53478014", "0.53477955", "0.53404003", "0.5338477", "0.53346705", "0.533264", "0.53210896", "0.5311763", "0.5310443", "0.5307304", "0.53050405", "0.5301651", "0.529552", "0.52922535", "0.52732915", "0.52614504", "0.5245044", "0.5242995", "0.5233624", "0.52331126", "0.52219373", "0.52180463", "0.51957077", "0.5195567", "0.5193538", "0.5189452", "0.5173874", "0.5172478", "0.5148677", "0.51373607", "0.51272565", "0.51207316", "0.5119368", "0.5117801", "0.5107856", "0.51043105", "0.5095046", "0.508973", "0.5070652", "0.50689065", "0.5065001", "0.5057077", "0.50405157", "0.50308794", "0.50248086", "0.50201905", "0.50131243", "0.50035805", "0.49994427", "0.4993481", "0.4983948", "0.49790657", "0.49755538", "0.49567538", "0.49425313" ]
0.58138543
19
method remove/vannish all 'n' space & 'tab' characters
public String getSpaceFreeString(String sInputString) { String sOutputString = ""; try { //loop to remove all 'tab's while (sInputString.contains(" ")) { sInputString = sInputString.replaceAll(" ", "").trim(); } //loop to remove all space space while (sInputString.contains(" ")) { sInputString = sInputString.replaceAll(" ", "").trim(); } } catch (Exception e) { } finally { sOutputString = sInputString; sInputString = null; return sOutputString; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void removeWhiteSpaceFromTabs() {\n\t\tString input = \"two tousand \" + \"\\t\" + \"\\t\" + \" sixteen\" \n\t\t\t\t+ \"new \" + \"\\t\" + \" lines!\" + \"\\n\" + \" \" + \"\\n\";\n\t\tSystem.out.println(input);\n\t\tStringUtility stringUtility = new StringUtility();\n\t\tString actualCastedString = stringUtility.castWordNumberToNumber(input);\n\t\tactualCastedString = stringUtility.removeWhiteSpace(actualCastedString);\n\n\t\tString correctlyCastedString = \"2tousandsixteennewlines!\";\n\n\t\tAssert.assertEquals(actualCastedString, correctlyCastedString);\n\t}", "private static void processTab() {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tif (charCount == MAX_W) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tline[charCount] = ' ';\n\t\t\tcharCount++;\n\t\t}\n\t\tcurrentWord = charCount;\n\t}", "public String tab(String str) {\n if (str == null || str.trim().isEmpty()) {\n return str;\n }\n str = str.replaceAll(\"\\n\\t\", \"\\n\\t\\t\");\n str = str.replaceAll(\"\\n<\", \"\\n\\t<\");\n return \"\\t\" + str;\n }", "public static String removeLeftSpaceOrTabs(String current) {\n char ch;\n int whiteSpacesLen = 0;\n for (int i = 0; i < current.length(); i++) {\n ch = current.charAt(i);\n if (CR == ch || LF == ch || CharacterConstants.SPACE == ch || CharacterConstants.TAB == ch) {\n whiteSpacesLen++;\n } else {\n break;\n }\n }\n return current.substring(whiteSpacesLen);\n }", "public static String removeWhitespace(String s) {\n s = s.replace(\" \",\"\");\n s = s.replace(\"\\n\",\"\");\n s = s.replace(\"\\t\",\"\");\n return s;\n }", "private static String clearSpaces(final String old) {\n return old.replace(\" \", \"\").replace(\"\\n\", \"\");\n }", "private boolean checkSpacingTabs(){\r\n\t\tString tmp = \"\";\r\n\t\ttry{ tmp = doc.getText(getCaretPosition()-2,1); }\r\n\t\tcatch(BadLocationException a){};\r\n\t\tSystem.out.println((int)tmp.charAt(0));\r\n\t\tif(tmp.charAt(0) == 9) return true;\r\n\t\telse return false;\r\n\t}", "static String fixInputLine(String input){\n\t\tString fixed = input;\n\n\t\tfor(int i = 0; i < 10; i++){ //run 10 passes, getting rid of redundant tabs.\n\t\t\tfixed = fixed.replaceAll(\"\\\\\\t\\\\\\t\", \"\\t\");\n\t\t}\n\n\t\t//turn any remaining tabs into % characters. \n\n\t\tfixed = fixed.replaceAll(\"\\\\\\t\", \"%\");\n\n\t\t//System.out.println(fixed);\n\t\treturn fixed;\n\t}", "static void trimNL() {\n if(outputBuffer.length() > 0 && outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005cn')\n outputBuffer.deleteCharAt(outputBuffer.length() - 1);\n if(outputBuffer.length() > 0 && outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005cr')\n outputBuffer.deleteCharAt(outputBuffer.length() - 1);\n }", "private static String trimWhiteSpace(String sentence) {\n\t\tsentence = sentence.replaceAll(\"[^a-zA-Z]\", \" \");\n//\t\tsentence = sentence.replaceAll(\"\\n\", \" \");\n//\t\tsentence = sentence.replaceAll(\"\\t\", \" \");\n// sentence = sentence.replaceAll(\"\\\\.\", \" \");\n// sentence = sentence.replaceAll(\",\", \" \");\n \n//\t\tint length;\n//\t\tdo {\n//\t\t\tlength = sentence.length();\n//\t\t\tsentence = sentence.replaceAll(\" \", \" \");\n//\n//\t\t} while (sentence.length() < length);\n\t\treturn sentence;\n\t}", "public static String removeRightSpaceOrTabs(String current) {\n char ch;\n int whiteSpacesLen = 0;\n for (int i = current.length() - 1; i >= 0; i--) {\n ch = current.charAt(i);\n if (CR == ch || LF == ch || CharacterConstants.SPACE == ch || CharacterConstants.TAB == ch) {\n whiteSpacesLen++;\n } else {\n break;\n }\n }\n return current.substring(0, current.length() - whiteSpacesLen);\n }", "private boolean getReplaceNonBreakingSpace() {\n return false;\n }", "public String quitaespacios (String str) {\n\n str = repNull(str);\n str = str.trim();\n str = rep(str, \"[ ]{2,}\", \" \");\n\n return str;\n }", "public static String trimer (String text){\n\t\treturn text.replaceAll(\"\\\\s+\", \" \");\n\t}", "@Override\n\tpublic String spaceRemover(String input) {\n\t\treturn input.replaceAll(\"\\\\s+\",\"\");\n\n\t}", "private String normalize(String text) {\n final String nbsp = new String(new char[] {(char) 160});\n return text.replaceAll(\"\\\\s+(\" + nbsp + \")+\\\\s+\", \"$1\")\n .replace((char) 160, ' ')\n .replaceAll(\n \"\\n+\", \"\\n\")\n .replaceAll(\"\\r|\\t\", \"\")\n .trim();\n }", "private static String manualTab(String entry)\r\n\t{\r\n\t\tString tab = \"\";\r\n\t\tfor(int count=0; count < 15 - entry.length(); count++)\r\n\t\t\ttab += \" \";\r\n\t\treturn tab;\r\n\t}", "private void skipBlankSpaces() {\n\t\twhile(currentIndex < data.length) {\n\t\t\tchar c = data[currentIndex];\n\t\t\tif(c == ' ' || c == '\\t' || c =='\\n' || c == '\\r') {\n\t\t\t\tcurrentIndex++;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public String removespaces(String inputString) {\r\n char[] charArray = inputString.toCharArray();\r\n \r\n String stringWithoutSpaces = \"\";\r\n \r\n for (int i = 0; i < charArray.length; i++) \r\n {\r\n if ( (charArray[i] != ' ') && (charArray[i] != '\\t') )\r\n {\r\n stringWithoutSpaces = stringWithoutSpaces + charArray[i];\r\n }\r\n }\r\n return stringWithoutSpaces;\r\n\t}", "static void trimNL(String s) {\n StringBuilder sb = new StringBuilder(s);\n while(sb.length() > 0 && (sb.charAt(sb.length() - 1) == '\\u005cr' || sb.charAt(sb.length() - 1) == '\\u005cn'))\n sb.deleteCharAt(sb.length() - 1);\n }", "@Override\n\tprotected void filterUserInputText(AttributedString text) {\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tchar ch = text.charAt(i);\n\t\t\tif (ch == '\\t' || ch == '\\n' || ch == '\\r') {\n\t\t\t\ttext.delete(Range.make(i, 1));\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tsuper.filterUserInputText(text);\n\t}", "private String spacing(String line) {\n \n \t\t/* Remove redundant spaces (keep only one space between two words) */\n \t\tint limit = 0;\n \t\tMatcher matcher = patternSpaces.matcher(line);\n \n \t\tString oldLine = line;\n \n \t\tremSpaces: while (matcher.find()) {\n \n \t\t\tint offset = matcher.start();\n \n \t\t\t// do not remove spaces at the beginning of a line\n \t\t\tif (line.substring(0, offset).trim().equals(\"\"))\n \t\t\t\tcontinue;\n \n \t\t\t/*\n \t\t\t * if the spaces (or tabs) are at the beginning of a line or before a comment, then we keep them\n \t\t\t */\n \t\t\t/*\n \t\t\t * Matcher matcherSpacesBeforeComment = patternSpacesBeforeComment.matcher(line); if\n \t\t\t * (matcherSpacesBeforeComment.find()) { if (offset < matcherSpacesBeforeComment.end()) continue\n \t\t\t * remSpaces; }\n \t\t\t */\n \n \t\t\t// if the spaces are before a comment, then we keep them\n \t\t\tString afterSpaces = line.substring(matcher.end());\n \t\t\tif (afterSpaces.startsWith(\"(*\"))\n \t\t\t\tcontinue remSpaces;\n \n \t\t\t// If we are inside a string, then we skip this replacing\n \t\t\tMatcher matcherString = patternString.matcher(line);\n \t\t\twhile (matcherString.find()) {\n \t\t\t\tif (matcherString.start() <= offset && offset < matcherString.end())\n \t\t\t\t\tcontinue remSpaces;\n \t\t\t}\n \n \t\t\t// If we are inside a comment, then we skip this replacing\n \t\t\tMatcher matcherComment = patternComment.matcher(line);\n \t\t\twhile (matcherComment.find()) {\n \t\t\t\tif (matcherComment.start() <= offset && offset < matcherComment.end())\n \t\t\t\t\tcontinue remSpaces;\n \t\t\t}\n \n \t\t\tline = line.substring(0, offset) + \" \" + line.substring(matcher.end());\n \n \t\t\t// we have to reset the matcher, because we modified the line\n \t\t\tmatcher = patternSpaces.matcher(line);\n \n \t\t\t// we put a limit, just in case we would get into an infinite loop\n \t\t\tif (limit++ > 10000) {\n \t\t\t\tOcamlPlugin.logError(\"Infinite loop detected in formatter during spacing (1): <<\" + oldLine\n \t\t\t\t\t\t+ \">>\");\n \t\t\t\tbreak;\n \t\t\t}\n \n \t\t}\n \n \t\t// remove spaces before commas\n \t\t//line = line.replaceAll(\" ,\", \",\");\n \t\t// remove spaces before semicolons\n \t\t//line = line.replaceAll(\" ;\", \";\");\n \n \t\tfor (int nPattern = 0; nPattern <= 1; nPattern++) {\n \t\t\tPattern patternSpacing;\n \t\t\tif (nPattern == 0)\n \t\t\t\tpatternSpacing = patternSpacingRight;\n \t\t\telse\n \t\t\t\tpatternSpacing = patternSpacingLeft;\n \n \t\t\t/*\n \t\t\t * We put a limit to the number of replacements, just in case we would get into an infinite loop\n \t\t\t */\n \t\t\tlimit = 0;\n \t\t\t// add spaces before some characters\n \t\t\tmatcher = patternSpacing.matcher(line);\n \n \t\t\toldLine = line;\n \n \t\t\taddSpaces: while (matcher.find()) {\n \n \t\t\t\tint offset = matcher.start() + 1;\n \t\t\t\tif (offset > line.length() - 1 || offset < 0) {\n \t\t\t\t\tocaml.OcamlPlugin.logError(\"OcamlIndenter:format : invalid position\");\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \n \t\t\t\t// if we are inside a string, then we skip this replacement\n \t\t\t\tMatcher matcherString = patternString.matcher(line);\n \t\t\t\twhile (matcherString.find()) {\n \t\t\t\t\tif (matcherString.start() <= offset && offset < matcherString.end())\n \t\t\t\t\t\tcontinue addSpaces;\n \t\t\t\t}\n \n \t\t\t\t// Skip replacement if in comment\n \t\t\t\tMatcher matcherComment = patternComment.matcher(line);\n \t\t\t\twhile (matcherComment.find()) {\n \t\t\t\t\tif (matcherComment.start() <= offset && offset < matcherComment.end())\n \t\t\t\t\t\tcontinue addSpaces;\n \t\t\t\t}\n \n \t\t\t\tline = line.substring(0, offset) + \" \" + line.substring(offset);\n \n \t\t\t\t// we have to reset the matcher, because we modified the line\n \t\t\t\tmatcher = patternSpacing.matcher(line);\n \t\t\t\tif (limit++ > 10000) {\n \t\t\t\t\tOcamlPlugin.logError(\"Infinite loop detected in formatter during spacing (2): <<\"\n \t\t\t\t\t\t\t+ oldLine + \">>\");\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\treturn line;\n \n \t}", "char skipSpaces () {\n char c = getChar ();\n while (c == ' ' || c == '\\t' || c == '\\n' || c == '\\r') {\n if (c == '\\n') { m_nbLines++; }\n c = getNextChar ();\n }\n return c;\n }", "@Test\n\tpublic void removeWhiteSpaceFromNewLine() {\n\t\tString input = \"two tousand sixteen \"\n\t\t\t\t+ \"new \" + \"lines!\" + \"\\n\" + \" \" + \"\\n\";\n\n\t\tStringUtility stringUtility = new StringUtility();\n\t\tString actualCastedString = stringUtility.castWordNumberToNumber(input);\n\t\tactualCastedString = stringUtility.removeWhiteSpace(actualCastedString);\n\n\t\tString correctlyCastedString = \"2tousandsixteennewlines!\";\n\n\t\tAssert.assertEquals(actualCastedString, correctlyCastedString);\n\t}", "private void skipSpaces() {\r\n\t\twhile (currentIndex < expression.length && (expression[currentIndex] == ' ' || expression[currentIndex] == '\\t'\r\n\t\t\t\t|| expression[currentIndex] == '\\n' || expression[currentIndex] == '\\r')) {\r\n\t\t\tcurrentIndex++;\r\n\t\t}\r\n\t}", "public void testRegEx(){\n\t\tString emptyLineRegEx = \"\\\\s*\";\r\n\t\t\r\n\t\tassertTrue(\"\".matches(emptyLineRegEx));\r\n\t\tassertTrue(\" \".matches(emptyLineRegEx));\r\n\t\tassertTrue(\"\\n\".matches(emptyLineRegEx));\r\n\t\tassertTrue(\"\\t\".matches(emptyLineRegEx));\r\n\t\tassertTrue(\"\\r\".matches(emptyLineRegEx));\r\n\t\tassertTrue(\"\\n \\t \".matches(emptyLineRegEx));\r\n\t\tassertTrue(\" \\n \\t \\n\\n\\n \".matches(emptyLineRegEx));\r\n\t\tassertFalse(\" . \\n \".matches(emptyLineRegEx));\r\n\t\t\r\n\t\t// space or tab any number of times\r\n\t\tString spaceTabRegEx = \"[ \\t]*\";\r\n\t\t\r\n\t\tassertTrue(\"\".matches(spaceTabRegEx));\r\n\t\tassertTrue(\" \".matches(spaceTabRegEx));\r\n\t\tassertTrue(\"\\t\".matches(spaceTabRegEx));\r\n\t\tassertTrue(\" \".matches(spaceTabRegEx));\r\n\t\tassertTrue(\"\\t\\t\".matches(spaceTabRegEx));\r\n\t\tassertTrue(\" \\t \\t \\t \".matches(spaceTabRegEx));\r\n\t\tassertFalse(\"\\n\".matches(spaceTabRegEx));\r\n\t\tassertFalse(\" l \".matches(spaceTabRegEx));\r\n\t\tassertFalse(\"\\t\\n\".matches(spaceTabRegEx));\r\n\t\t\r\n\t\t\r\n\t\t//Nucleotide sequence\r\n\t\tString ntRegEx = \"[ACGTacgt]+\";\r\n\t\t\r\n\t\tassertTrue(\"CAGTATGCATACC\".matches(ntRegEx));\r\n\t\tassertTrue(\"CTTATTTCAGGAAAATTTTTTCAAAACTGTAAAACAAAAACCATTTTTCACAGAATCTAAGGGTATCTGAAAGCTTAAAATAACTTCAGAAAGATATCAATTCCAGCTGTTTAGTACCTGAACTGTCTGTAAACGTTTCTTCTCGAATTATAGAAAATTTTCCACTTTTTCAAGTTCAGGTTTTCAAGAAACCCCACGATTTCCACTCATCGTTTCCAATGTCCAATTTCCCATCCAATTTGCCGCACTCTGACCCAATGACTTGTTCCTTTGCCAATCAATGCTACCTAATAAATTTAAAAGTTTAACACGCATCCAATTGACACACAGGTAACCGCCCTTTCTTCTTTTACATAATTCGGAAACTTCAAAGAGCCGAAGGTGTCGGTTGTAGCAGCAGCGGAGGAACGGATGCCAATTGCGCAACTCTCGGCTCAACTCTTTTAGTGCTCCGAGAGCAGGAAGAAGAATACTGTTGGGTTGTAATAAAGACGGATGTTTTTGTTCAGAGTAGATTAGCTCGTGTTTGATTGGATTTGACCGGATCAAGAGGGGAATGTCCTGGTGGAATTAAATTTTATTAGAATAAATTGTATTTGGTGTTTAAATTCGAATCAATAATATTTATGAGCTTTAATGAATAAGTGTTAGATTATATAATTCTATAATTTTTGAACAAGCAATTCAAAAAGAAAACAAATTTTAGTAACCTCCGAAATCAAGCTGGGTGGCCTCTAGAAGTTTTGAAAAAACTTTTTTTATATTCTGTTGGAGTTTTTTTAAGTTTTATAATTATAGGTTAATCTTTCTAATTTGTAAGCTTTTTCTTAACCAATTTTTTTTGTTAACATTTTTTTGGAATTATGCTATATGACCTATACCTAAAACAGTTTAAAAGTTTAAAAAAATTTTCTATATTTTTCACTTCGTATTGAACCTCCTGGGTACATATATTGACAGCACATATCTTGTTTGTCTCAGATTTTATCAAATAAGTTTAACAAGTAAACCATGCACCAAATATTTTTCTAGGTCTCTGTAGTTAGGAAATATTTAATAAAAATAAAAATAACCGAGATATGAGCCATCAAAGTAGATCAATTAAGGCACAGGAAAAAAGATCTGAATAAAATCGAAGTTCTTAAAAATATAAATCAAACAAAATTTTTTCCAGAATTTCAGCCGAGAATTTCCAGCCGATTTGTTTATATTTTCCACATCACTCCCCACACTTCTCTCACACAAACACGATAAAATCTTGAGAAGCAATTAGCGCCAATCAACTCAACACAAAAACGAAAAGCCAACGAAAAGCTAAAGCTATCATCGTTGTCGCGTCTATGAGCAACTCAATCGTTCATCATCCTCATCTTCAGAGTGCTCAAACCTACCGTAACCCGAATTGGGCGGAGCCAAAGGGTCCGAAACAGTGCACCAGGGCGGGGAGGGACCCTGAGAAACGAGAGGGAAGTGAGCAATTGTTGAAGTGTCAGTTGTGCTCATCGAGGTCCGATGAAGAGACGCGCCTGCTCACCTACACAACTGACTTCCCCCATATACCTTTTTCTAGAATTTCCTTTTTTAGATTTATACGGTCAGGTAAAAAGGTAGAGTTTTACAGTGTAGAAATTAGGAAATTGCTCAAAAAGCCGAGCAGAATGCATATAAGAAGTACCATAGCCCCAAAGATTCGATTTTCCAGGGTTCAATCAATTTTTGTACTTTGACAGCGTATATCTCAGTTTTCTTTGATTTTATCAAAAACTAGTCAACTGACAAAATACTTGAAAAGTATTCCTTTATATTTTGGTAGCTGACCATTGTTTGTTAAAATATAAGGGAATCGAAATGTCGGTTATCAAAGTAGAACCTAACCTAAATCGCTATATATGCTATTTTTCAAAAAAAAAAACACGTTTTACTTTGTCTCAACTTATTAATATTCTTTAATATTTTTTCTATTTCTACCATTTTCCAAATTTTCCAATAATTTTCCAGAA\".matches(ntRegEx));\r\n\t\tassertTrue(\"cagtagta\".matches(ntRegEx));\r\n\t\tassertTrue(\"aCgtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"a CgtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"aCXtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"a.CgtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"a1CgtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"aNCgtTG\".matches(ntRegEx));\r\n\t\tassertFalse(\"AGTATAATGACAACTTACAAAzTTGGGAAATCTGGAAAACCGAGC\".matches(ntRegEx));\r\n\t\t\r\n\t\t//PWM line \r\n\t\t// unicode for | is \\u007C\r\n\t\t// space: \\u0020\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"\\u007C\");\r\n\r\n\t\tString pwmRexEx = \"[ACGT][\\\\t ]+\\\\|([\\\\t ]+[0-9]+)+\";\r\n\t\t\r\n\t\tassertTrue(\"G\t|\t12 \t2\t 2343\".matches(pwmRexEx));\r\n\t\tassertTrue(\"A | 1 2 3\".matches(pwmRexEx));\r\n\t\tassertTrue(\"C | 11 2234 3\".matches(pwmRexEx));\r\n\t\tassertTrue(\"T |\t1\t12\t3123\".matches(pwmRexEx));\r\n\t\tassertTrue(\"A\t|\t49\t0\t288\t26\t77\t67\t45\t50\".matches(pwmRexEx));\r\n\t\tassertTrue(\"A\\t|\\t49\\t0\\t288\\t26\\t77\\t67\\t45\\t50\".matches(pwmRexEx));\r\n\t\tassertFalse(\"a | 1 2 3\".matches(pwmRexEx));\r\n\t\tassertFalse(\"A |\\n 1 2 3\".matches(pwmRexEx));\r\n\t\tassertFalse(\"A 1 2 3\".matches(pwmRexEx));\r\n\t\tassertFalse(\"A |\t1 C 3\".matches(pwmRexEx));\r\n\t\tassertFalse(\"C |1 2 3\".matches(pwmRexEx));\r\n\t\t\r\n\t\t\r\n\t\t// fasta sequence name\r\n\t\t\r\n\t\tString fastaNameSeqRegEx = \">[ \\t]*\\\\w+.*\"; \r\n\t\t\r\n\t\tassertTrue(\"> name \".matches(fastaNameSeqRegEx));\r\n\t\tassertTrue(\">name\".matches(fastaNameSeqRegEx));\r\n\t\tassertTrue(\">\\t name\\t\".matches(fastaNameSeqRegEx));\r\n\t\tassertTrue(\"> name123 stuf\\t12342 \\t\".matches(fastaNameSeqRegEx));\r\n\t\tassertTrue(\">check sda\".matches(fastaNameSeqRegEx));\r\n\t\tassertTrue(\"> negExSeq_0_B0304.1\".matches(fastaNameSeqRegEx));\r\n\t\t\r\n\t\tassertFalse(\"\".matches(fastaNameSeqRegEx));\r\n\t\tassertFalse(\" > name \".matches(fastaNameSeqRegEx));\r\n\t\tassertFalse(\">\\tname\\t\\n\".matches(fastaNameSeqRegEx));\r\n\t\tassertFalse(\">\\t\".matches(fastaNameSeqRegEx));\r\n\t\t\r\n\t\t\r\n\t\t//fasta file sequence\r\n\t\t\r\n\t\tString oneFastaSection = \"\\\\s*\" + fastaNameSeqRegEx + \"\\\\s*\\n+\" + \"[ACGTacgt]+\" ;\r\n\t\tString fastaSeqRegEx = \"(\" + oneFastaSection + \"[ \\t\\r]*\\n\" + \")*\" + oneFastaSection + \"\\\\s*\" ;\r\n\t\t\r\n\t\tassertTrue(\"> Y105E8B.1c\\nacgtacgtacggttacCTTACAAAATTGGGAAATCTGGAAAACCGAGC\".matches(fastaSeqRegEx));\r\n\t\tassertTrue(\"> negExSeq_0_B0304.1\\nCCACGCTTGATATATGGA\\n\".matches(fastaSeqRegEx));\r\n\t\tassertTrue(\"> negExSeq_0_B0304.1\\nCCACGCTTGATATATGGAAGCGTACAACAGGCATTATTCCATC\\n>C02B8.4\\nCTTATTTCAGGAAAATTTTTTCAAA\".matches(fastaSeqRegEx));\r\n\t\tassertTrue(\"\\t\\t\\t\\t\\t\\n> negExSeq_0_B0304.1\\nCCACGCTTGATATATGGAAGCGTACAACAGGCATTATTCCATC\\n\\t\\t\\t\\t\\n> C02B8.4\\nCTTATTTCAGGAAAATTTTTTCAAAA\\n\\t\\t \\n \\t\".matches(fastaSeqRegEx));\r\n\t\tassertTrue(\"\\t\\t\\t\\t\\r\\n> negExSeq_0_B0304.1\\r\\nCCACGCTTGATATATGGAAGCGTACAACAGGCATTATTCCATC\\n\\t\\t\\t\\t\\n> C02B8.4\\nCTTATTTCAGGAAAATTTTTTCAAAA\\n\\t\\t \\n \\t\".matches(fastaSeqRegEx));\r\n\t\tString realOutput = \"\\t\\t\\t\\t\\t\\r\\n> B0304.1\\r\\nCTTATTTCAGGGAA\\r\\n\\r\\n> F29F11.5\\r\\nGCCACATGG\\r\\n\\r\\n\\t\\t\\t\";\r\n\t\tassertTrue(realOutput.matches(fastaSeqRegEx));\r\n\t\r\n\t\t\r\n\t\t\r\n\t\tassertFalse(\"\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"> Y105E8B.1c\\n\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"> Y105E8B.1c\\nAGTATAATGACAACTTACAAAzTTGGGAAATCTGGAAAACCGAGC\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"> Y105E8B.1c acgtacgtacggttacCTTACAAAATTGGGAAATCTGGAAAACCGAGC\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"> negExSeq_0_B0304.1\\nCCACGCTTGATATATGGAAGCGTACAACAGGCATTATTCCATC >C02B8.4\\nCTTATTTCAGGAAAATTTTTTCAAA\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"> negExSeq_0_B0304.1\\nCCACGCTTGATATATGGAAGCGTACAACAGGCATTATTCCATC\\n\\nCTTATTTCAGGAAAATTTTTTCAAA\".matches(fastaSeqRegEx));\r\n\t\tassertFalse(\"\".matches(fastaSeqRegEx));\r\n\t\t\r\n\t\t\r\n\t\t// pwm line: \r\n\r\n\t\tString pwmLineRegEx1 = \"[ACGTacgt][ \\t]*\\\\|([ \\t]*\\\\d+)+[ \\t]*\";\r\n\t\t\r\n\t\tassertTrue(\"A | 2 26 7\".matches(pwmLineRegEx1));\r\n\t\tassertTrue(\"A |2 26 7\".matches(pwmLineRegEx1));\r\n\t\tassertTrue(\"A| 2 26 7\".matches(pwmLineRegEx1));\r\n\t\tassertTrue(\"A\\t| \\t2 \\t\\t\\t26 7\\t\\t \".matches(pwmLineRegEx1));\r\n\r\n\t\tassertFalse(\"\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\" \\t \\t \".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"abra-cadabra\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"> test A | 1 2 3\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"A 2 26 7\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"A | 2 A 7\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"A 2 26 7\".matches(pwmLineRegEx1));\r\n\t\tassertFalse(\"A [ 2 26 7]\".matches(pwmLineRegEx1));\r\n\t\t\r\n\t\t\r\n\t\tString pwmLineRegEx2 = \"[ACGTacgt][ \\t]*\\\\[([ \\t]*\\\\d+)+[ \\t]*\\\\][ \\t]*\";\r\n\r\n\t\tassertTrue(\"A [ 2 26 7]\".matches(pwmLineRegEx2));\r\n\t\tassertTrue(\"A\\t[\\t2\\t26\\t7\\t]\".matches(pwmLineRegEx2));\r\n\t\tassertTrue(\"A[ 2 26 7]\".matches(pwmLineRegEx2));\r\n\t\t\r\n\t\tassertFalse(\"\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\" \\t \\t \".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"abra-cadabra\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"> test A | 1 2 3\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A 2 26 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"2 26 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A | 2 A 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A 2 26 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A 2 26 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A [ 2 26 7\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A [ ]\".matches(pwmLineRegEx2));\r\n\t\tassertFalse(\"A | 2 26 7\".matches(pwmLineRegEx2));\r\n\t\t\r\n\t\tString pwmRegEx1 = \"[Aa][ \\t]*\\\\|([ \\t]*\\\\d+)+[ \\t]*\\\\s*\\n\" +\r\n\t\t\t\t\"[Cc][ \\t]*\\\\|([ \\t]*\\\\d+)+[ \\t]*\\\\s*\\n\" +\r\n\t\t\t\t\"[Gg][ \\t]*\\\\|([ \\t]*\\\\d+)+[ \\t]*\\\\s*\\n\" +\r\n\t\t\t\t\"[Tt][ \\t]*\\\\|([ \\t]*\\\\d+)+[ \\t]*\\\\s*\";\r\n\t\t\r\n\t\tassertTrue(\"A | 2 26 7\\nC | 2 26 7\\nG | 2 26 7\\nT | 2 26 7\".matches(pwmRegEx1));\r\n\t\tassertTrue(\"A | 2 26 7\\nC | 2 26 7\t\\nG | 2 26 7\\nT |\t2\t\t26 7\\r\\n\".matches(pwmRegEx1));\r\n\r\n\t\tassertFalse(\"\".matches(pwmRegEx1));\r\n\t\tassertFalse(\"A | 2 26 7\\nC | 2 26 7\\nG | 2 26 7\".matches(pwmRegEx1));\r\n\t\tassertFalse(\"A 2 26 7\\nC | 2 26 7\t\\nG | 2 26 7\\nT |\t2\t\t26 7\\r\\n\".matches(pwmRegEx1));\r\n\r\n\t\r\n\t\tString pwmRegEx2 = \"[Aa][ \\t]*\\\\[([ \\t]*\\\\d+)+[ \\t]*\\\\][ \\t]*\\\\s*\\n\" +\r\n\t\t\"[Cc][ \\t]*\\\\[([ \\t]*\\\\d+)+[ \\t]*\\\\][ \\t]*\\\\s*\\n\" +\r\n\t\t\"[Gg][ \\t]*\\\\[([ \\t]*\\\\d+)+[ \\t]*\\\\][ \\t]*\\\\s*\\n\" +\r\n\t\t\"[Tt][ \\t]*\\\\[([ \\t]*\\\\d+)+[ \\t]*\\\\][ \\t]*\\\\s*\";\r\n\r\n\t\tassertTrue(\"A [ 2 26 7]\\r\\nC [ 2 26 7]\\r\\nG [ 2 26 7]\\nT [ 2 26 7]\".matches(pwmRegEx2));\r\n\t\tassertTrue(\"A [\\t2 26 7]\\r\\nC [ 2 26 7]\\r\\nG [ 2 26 7]\\nT [ 2 26 7]\\n\".matches(pwmRegEx2));\r\n\r\n\t\tassertFalse(\"\".matches(pwmRegEx2));\r\n\t\tassertFalse(\"A [ 2 26 7]\\r\\nC [ 2 26 7]\\r\\nG [ 2 26 7]\\nT [ 2 26 7\".matches(pwmRegEx2));\r\n\t\tassertFalse(\"A [ 2 26 7]\\r\\nC [ 2 26 7]G [ 2 26 7]\\nT [ 2 26 7]\".matches(pwmRegEx2));\r\n\t\tassertFalse(\"A [ 2 26 7]\\r\\nC [ 2 26 7]\\r\\nG [ 2 26 7]\\nA [ 2 26 7]\".matches(pwmRegEx2));\r\n\t\tassertFalse(\"\\tA [ 2 26 7]\\r\\nC [ 2 26 7]\\r\\nG [ 2 26 7]\\nT [ 2 26 7]\".matches(pwmRegEx2));\r\n\t\t\r\n\t}", "private static String trim(String s) {\n return s.replace(\" \", \"\");\n }", "static void trimWhitespace() {\n for (int i = a.size() - 1; i >= 0; i-- ) {\n Object o = a.get(i);\n StringBuilder sb = new StringBuilder();\n if (o instanceof Token)\n sb.append( ((Token)o).image );\n else\n sb.append((String)o);\n while(sb.length() > 0 && (sb.charAt(sb.length() - 1) == '\\u005cr'\n || sb.charAt(sb.length() - 1) == '\\u005cn'\n || sb.charAt(sb.length() - 1) == '\\u005ct'\n || sb.charAt(sb.length() - 1) == ' ')) {\n sb.deleteCharAt(sb.length() - 1);\n }\n if (sb.length() == 0) {\n a.remove(i);\n }\n else {\n a.set(i, sb.toString());\n break;\n }\n }\n if (a.size() == 0) {\n while(outputBuffer.length() > 0 && (outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005cr'\n || outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005cn'\n || outputBuffer.charAt(outputBuffer.length() - 1) == '\\u005ct'\n || outputBuffer.charAt(outputBuffer.length() - 1) == ' ')) {\n outputBuffer.deleteCharAt(outputBuffer.length() - 1);\n }\n }\n }", "protected final String space(int n) {\n StringBuffer buf = new StringBuffer(0);\n for (int i = 0; i < n; i++) {\n buf.append(\" \");\n }\n return buf.toString();\n }", "private String limpiar_texto(String texto){\n \n texto = texto.replaceAll(\"\\n\",\"\");\n texto=texto.toUpperCase();\n for(int i=0;i<texto.length();i++){\n //Se crea un for que llenara el nuevo char\n int posicion = tabla.indexOf(texto.charAt(i)); //charat regresa el valor del arreglo\n if(posicion == -1){ \n texto=texto.replace(texto.charAt(i),' ');\n //En caso que no aparezca en la tabla de caracteres\n //Tiene que ser eliminado\n }\n }\n return texto;\n }", "public static String cleanText(String text)\r\n\t{\r\n\t\ttext = text.replace(\"\\n\", \"\\\\n\");\r\n\t\ttext = text.replace(\"\\t\", \"\\\\t\");\r\n\r\n\t\treturn text;\r\n\t}", "public static String removeQuebraLinha (String s) {\n\n\t\tif (StringUtils.isNotBlank(s)) {\n\n\t\t\ts = s.replaceAll(\"\\r\", \"\"); \n\t\t\ts = s.replaceAll(\"\\t\", \"\");\n\t\t\ts = s.replaceAll(\"\\n\", \"\");\n\t\t}\n\n\t\treturn s;\n\t}", "private String editString(String s) {\n s = s.replace(\"[31m\", \"\");\n s = s.replace(\"[0m\", \"\");\n s = s.replace(\"[33m\", \"\");\n s = s.replace(\"[36m\", \"\");\n s = s.replace(\"[34m\", \"\");\n s = s.replace(\"*\", \"\");\n s = s.replace(\"|\", \"\");\n //s = s.replace(\"]\", \"]\\n\");\n s = s.replace(\"\\t\", \"\\n\");\n\n\n return s;\n }", "private String normalizeSpace(final String arg) {\n return arg.replaceAll(Constants.SPACE_PATTERN, Constants.SPACE);\n }", "public static String removeSpaces(String s) {\r\n StringTokenizer stt = new StringTokenizer(s);\r\n String res = \"\";\r\n\r\n while (stt.hasMoreTokens()) {\r\n String tok = stt.nextToken().trim();\r\n res += tok;\r\n }\r\n return res;\r\n }", "@Override\n\tprotected void filterUserInputText(AttributedString text) {\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tchar ch = text.charAt(i);\n\t\t\tif (ch == '\\t' || (!multiline && (ch == '\\n' || ch == '\\r'))) {\n\t\t\t\ttext.delete(Range.make(i, 1));\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tsuper.filterUserInputText(text);\n\t}", "public static String cutSpaces(String s){\n\t\tString res = s;\n\t\t\n\t\twhile ((res.startsWith(\" \")||(res.startsWith(\"\\n\")))&& res.length()>0) {\n\t\t\tres=res.substring(1);\n\t\t}\n\t\treturn res;\n\t}", "public void setInsertSpaces(boolean substitute);", "private String replaceSpaces(String value) {\r\n\t\treturn value.replace(\" \", \"_\");\r\n\t}", "@Test\n\tpublic void testRemoveWhiteSpacesAndPunctuation() {\n\t\tString input = \"2$2?5 5!63\";\n\t\tString actual = GeneralUtility.removeWhiteSpacesAndPunctuation(input);\n\t\tString expected = \"225563\";\n\t\tAssert.assertEquals(expected, actual);\n\t}", "protected static String reduceString(String input) {\n String newString = input.toLowerCase();\n int len = newString.length();\n String retval = \"\";\n for (int i = 0; i < len; i++) {\n if (newString.charAt(i) == ' ' || newString.charAt(i) == '\\t') continue; else retval += newString.charAt(i);\n }\n return retval;\n }", "private String _removeSpaces(String matrixElement) {\n char[] es = matrixElement.toCharArray();\n char[] _temp = new char[es.length];\n int count = 0;\n for (int i = 0; i < es.length; i++) {\n if (Character.isDigit(es[i]) || es[i] == '.' || es[i] == '-') {\n _temp[count++] = es[i];\n }\n }\n return new String(_temp, 0, count);\n }", "private void space() {\n if (wereTokens && !spaceSuppressed) {\n out.print(' ');\n }\n }", "public boolean getTrimSpaces();", "public static String ungroupify(String text){\r\n return text.replaceAll(\"[\\\\sx]\", \"\");\r\n}", "@Override\n\tpublic String clean(String input) {\n\t\tinput = input.replaceAll(removeCommonWords.toString(), \" \");\n\t\t//input = input.replaceAll(removeSingleCharacterOrOnlyDigits.toString(), \" \");\n\t\t//input = input.replaceAll(removeTime.toString(), \" \");\n\t\t//input = input.replaceAll(\"(\\\\s+>+\\\\s+)+\", \" \");\n\t\treturn input;\n\t}", "private static String removeWhitespace(String str)\n {\n // A string buffer to build the result in.\n StringBuffer res;\n\n // Create the result string buffer.\n res = new StringBuffer(str.length());\n\n // Iterate through the input string, appending chars to the\n // result if they are not white space.\n for (int iChar = 0; iChar < str.length(); iChar++) {\n if (!Character.isWhitespace(str.charAt(iChar))) {\n res.append(str.charAt(iChar));\n }\n }\n\n return res.toString();\n }", "public static String removeNonAlphabeticCharactersFrom(String text) {\n\n // replacing \\r\\n\\t for a single space\n text = text.replaceAll(\"[\\\\p{Cntrl}]\", \" \");\n\n // strips off all non-alphabetic character:[\\p{Lower}\\p{Upper}] apart from a blank\n text = text.replaceAll(\"[^\\\\p{Alpha}\\\\p{Blank}]\", \" \");\n\n // remove extra spaces\n text = text.replaceAll(\"\\\\s+\", \" \");\n\n return text.trim();\n }", "public static String restoreSpaces(String input) {\n\t\tchar[] chars = input.toCharArray();\n\t\tint current = 0;\n\t\tString result = \"\";\n\n\t\twhile (current < chars.length) {\n\t\t\tRetrievalTreeNode root = retrievalTree;\n\t\t\twhile (root.leaves.contains(chars[current])) {\n\t\t\t\troot = root.leaves.get(chars[current]);\n\t\t\t}\n\t\t\twhile (!root.isWord) {\n\t\t\t\troot = root.parent;\n\t\t\t}\n\t\t\tresult += input.substring(current, root.depth) + \" \";\n\t\t\tcurrent = root.depth;\n\t\t}\n\t\treturn result;\n\t}", "public static String markSpaces(String inText)\n {\n return inText.replaceAll(\"\\n\", \"\\\\\\\\n\").replaceAll(\"\\r\", \"\\\\\\\\r\")\n .replaceAll(\"\\t\", \"\\\\\\\\t\").replaceAll(\"\\f\", \"\\\\\\\\f\").replaceAll(\" \", \"_\");\n }", "public void ignorableWhitespace(char[] ch, int start, int length) { }", "public XMLString fixWhiteSpace(boolean trimHead, boolean trimTail, boolean doublePunctuationSpaces) {\n/* 92 */ return new XMLStringDefault(this.m_str.trim());\n/* */ }", "public static String stripWhiteSpace(String str) {\n if (str != null) {\n StringBuffer stringBuffer = new StringBuffer(str.length());\n for (int i = 0, strLen = str.length(); i < strLen; i++) {\n final char ch = str.charAt(i);\n if (ch != ' ' && ch != '\\r' && ch != '\\n' && ch != '\\t') {\n stringBuffer.append(ch);\n }\n }\n return stringBuffer.toString();\n }\n return str;\n }", "public static String trimHorizontalSpace(String str) {\n String horizontalSpace = \"\\\\h\";\n str = str.replaceAll(\"(^\" + horizontalSpace + \"*)|(\" + horizontalSpace + \"*$)\", \"\");\n return str;\n }", "public static void spaces() {\r\n // prints 13 spaces\r\n for (int space = 0; space < 15; space++) {\r\n System.out.println(\"\");\r\n }\r\n\r\n }", "@Test\n\tpublic void testTrimmingWhiteSpaces() {\n\t\t// Setup\n\t\tString file = \" file.name \";\n\n\t\t// Exercise\n\t\tLine line = new Line(\"5\", \"5\", file);\n\n\t\t// Verify\n\t\tassertEquals(\"file.name\", line.toString());\n\t}", "public static String clearLongWhitespaces(String str) {\r\n\r\n if (str == null) {\r\n str = \"\";\r\n }\r\n String result = \"\";\r\n StringTokenizer st = new StringTokenizer(str);\r\n while (st.hasMoreTokens()) {\r\n String s = st.nextToken();\r\n if (s != null) {\r\n result += s.trim();\r\n }\r\n }\r\n return result.trim();\r\n }", "public static String cleanString(String s) {\n\t\ts = s.trim();\n\t\tString newStr = \"\";\n\t\tboolean lastWasSpace = false;\n\t\tfor(int i = 0; i < s.length(); i++) {\n\t\t\tchar c = s.charAt(i);\n\t\t\tif(c == ' ' && lastWasSpace) {\n\t\t\t\t//Ignore\n\t\t\t} else if (c == ' ' && !lastWasSpace) {\n\t\t\t\tnewStr+=c;\n\t\t\t\tlastWasSpace = true;\n\t\t\t} else {\n\t\t\t\tnewStr+=c;\n\t\t\t\tlastWasSpace = false;\n\t\t\t}\n\t\t}\n\t\ts = newStr;\n\t\treturn s;\n\t}", "private int skipWhitespace() {\n int prev = '\\n';\n while (position < length) {\n int c = data.charAt(position);\n switch (c) {\n case '\\t': case ' ':\n prev = c;\n position++;\n break;\n case '\\n':\n // handle \\r\\n\n if (prev != '\\r') {\n lineNumber++;\n }\n prev = c;\n position++;\n break;\n case '\\r':\n prev = c;\n position++;\n lineNumber++;\n break;\n default:\n return prev;\n }\n }\n return prev;\n }", "protected static int removeWhiteSpace(char[] data) {\n if (data == null)\n return 0;\n \n // count characters that's not whitespace\n int newSize = 0;\n int len = data.length;\n for (int i = 0; i < len; i++) {\n if (!isWhiteSpace(data[i]))\n data[newSize++] = data[i];\n }\n return newSize;\n }", "private static String cleanTextContent(String text) {\n text = text.replaceAll(\"[^\\\\x00-\\\\x7F]\", \"\");\n\n // erases all the ASCII control characters\n text = text.replaceAll(\"[\\\\p{Cntrl}&&[^\\r\\n\\t]]\", \"\");\n\n // removes non-printable characters from Unicode\n text = text.replaceAll(\"\\\\p{C}\", \"\");\n \n text = text.replaceAll(\"[\\\\r\\\\n]+\", \" \");\n\n return text.trim();\n }", "public String removeSpaces(String str) {\n str = str.replace(\" \", \"-\");\n return str;\n }", "public static void main(String[] args) {\n\t\tString str = \"Harmohan Is Mad Person\";\n\t\tString newString = str.replaceAll(\" \", \"\");\n\t\tSystem.out.println(newString);\n\t\t\n\n\t}", "@Test\n\tpublic void removeWhiteSpace() {\n\t\tString input = \"two tousand sixteen\";\n\n\t\tStringUtility stringUtility = new StringUtility();\n\t\tString actualCastedString = stringUtility.castWordNumberToNumber(input);\n\t\tactualCastedString = stringUtility.removeWhiteSpace(actualCastedString);\n\n\t\tString correctlyCastedString = \"2tousandsixteen\";\n\n\t\tAssert.assertEquals(actualCastedString, correctlyCastedString);\n\t}", "@Test\n public void testSafeTrim() {\n assertEquals(\"\", Strings.safeTrim(null));\n assertEquals(\"\", Strings.safeTrim(\" \\t\\n\"));\n assertEquals(\"hello there!\", Strings.safeTrim(\" hello there! \\n\"));\n }", "public static String spaces(int n) {\n StringBuffer b = new StringBuffer();\n for (int i = 0; i < n; i++) {\n b.append(' ');\n }\n return b.toString();\n }", "public static void main(String[] args) {\n\t\t\n\t\t String kkNo=\"12345 4532 7686 3550\";\n\t\t\t\tString isim=\"sanim sah29\";\n\t\t\t\tSystem.out.println(kkNo.replace(\" \", \"\"));\n\t\t\t\tSystem.out.println(kkNo); // 12345 4532 7686 3550 yoksa 12345453276863550\n\t\t\t\t\n\t\t\t\t// replaceAll ile\n\t\t\t\t\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\s\", \"\")); // s sadece space\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\S\", \"*\")); // S space olmayan hersey\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\w\", \"&\")); // harf veya rakamlarin hepsi\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\W\", \"-\")); // harf veya rakamlarin disindaki hersey\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\d\", \"0\")); // rakamlarin hepsi\n\t\t\t\tSystem.out.println(kkNo.replaceAll(\"\\\\D\", \"a\")); // rakamlarin disindaki hersey\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\s\", \"\")); // s sadece space\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\S\", \"*\")); // S space olmayan hersey\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\w\", \"&\")); // harf veya rakamlarin hepsi\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\W\", \"-\")); // harf veya rakamlarin disindaki hersey\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\d\", \"0\")); // rakamlarin hepsi\n\t\t\t\tSystem.out.println(isim.replaceAll(\"\\\\D\", \"a\")); // rakamlarin disindaki hersey\n\t\t\t\t\n\t\t\t\t//syso icinde yapilan Manipulationlar asil Stringi degistirmez\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\n\n\t}", "@Test\n\tpublic void testEmptyString() {\n\t\tString s = \" \\t \";\n\t\tassertTrue(\"Empty string with tab\", StringUtil.isEmpty(s));\n\t}", "static String m8561a(String str) {\n return str.replaceAll(\"\\r\\n\", \"\\n\").replaceAll(\" *\\n *\", \"\\n\").replaceAll(\"\\n\", \" \").replaceAll(\"[ \\t\\\\x0B\\f\\r]+\", \" \");\n }", "private boolean space() {\r\n return CHAR(' ');\r\n }", "public static void main(String[] args) {\nString given=\"hello im jaiprashanth hw are you\";\nchar ch[]=given.toCharArray();\n\nfor(int i=0;i<ch.length;i++) {\n\tif(ch[i]==' ') {\n\tch[i+1]=(char)(ch[i+1]-32);\n\t}\nSystem.out.println(ch);\n}\n}", "public String reorderSpaces(String text) {\n\t\tchar[] newStr = new char[text.length()];\n\t\tString[] splitStr = text.split(\" \");\n\t\tint wordCount = 0;\n\t\tint spaceCount = 0;\n\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tif (text.charAt(i) == ' ') {\n\t\t\t\tspaceCount++;\n\t\t\t}\n\t\t}\n\n\t\tfor (String word : splitStr) {\n\t\t\tif (!word.trim().isEmpty()) {\n\t\t\t\twordCount++;\n\t\t\t}\n\t\t}\n\n\t\tint space = wordCount <= 1 ? spaceCount : spaceCount / (wordCount - 1);\n\t\tint extraSpace = wordCount <= 1 ? 0 : spaceCount % (wordCount - 1);\n\t\tint k = 0;\n\n\t\tfor (String word : splitStr) {\n\t\t\tif (!word.trim().isEmpty()) {\n\t\t\t\tfor (int i = 0; i < word.trim().length(); i++) {\n\t\t\t\t\tnewStr[k++] = word.trim().charAt(i);\n\t\t\t\t}\n\n\t\t\t\tfor (int i = 0; k < text.length() && i < space; i++) {\n\t\t\t\t\tnewStr[k++] = ' ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; k < text.length() && i < extraSpace; i++) {\n\t\t\tnewStr[k++] = ' ';\n\t\t}\n\n\t\treturn new String(newStr);\n\t}", "private static String escapeWhitespace( final String input )\n {\n return input.replaceAll( \"\\\\ \", \"\\\\\\\\ \" );\n }", "public static String saveWhitespaces(String s) {\n\t\treturn StringUtil.replace(s, \" \", \"\\u00A0\");\n\t}", "private void removeSpaces(String[] lines) {\r\n for (int i = 0; i<lines.length; i++) {\r\n lines[i] = lines[i].strip();\r\n lines[i] = lines[i].replaceAll(\"\\\"\", \"\");\r\n }\r\n }", "@Override\n\tprotected void handleTab() {\n\t\thandleSpace();\n\t}", "protected final void removeChar()\n\t{\n\t\tif (showCaret && displayingCaret)\n\t\t{\n\t\t\tif (text.getText().length() > 1) text.setText(text.getText().substring(0, text.getText().length() - 2) + \"|\");\n\t\t}\n\t\telse if (text.getText().length() > 1) text.setText(text.getText().substring(0, text.getText().length() - 2) + \" \");\n\t}", "private void removeWhitespace() {\n /*\n * Get rid of comments.\n * Regex breakdown:\n * //.* : Some string that starts with \"//\"\n */\n instruction = instruction.replaceAll(\"//.*\", \"\");\n\n /*\n * Now replace all whitespace with a single space\n * Regex breakdown:\n * \\s+ : Find all whitespace that appear in a chunk\n */\n instruction = instruction.replaceAll(\"\\\\s+\", \" \");\n\n // Get rid of leading/trailing whitespace (if there is any whitespace at\n // the start/end of a line, it will be converted into one space character\n // as a result of the previous line)\n /*\n * Regex breakdown:\n * ^ : At the start of the line...\n * \\s+ : Match whitespace that occurs in a glob\n */\n instruction = instruction.replaceAll(\"^\\\\s+\", \"\");\n /*\n * Regex breakdown:\n * \\s+ : Match whitespace that occurs in a glob\n * $ : At the end of the line\n */\n instruction = instruction.replaceAll(\"\\\\s+$\", \"\");\n }", "public String getTab() {\r\n if(date.length() < 10)\r\n return \"\\t\\t\";\r\n else\r\n return \"\\t\";\r\n }", "public static String removeWhiteSpace(String value) {\n return value.replaceAll(\"\\\\s\", \"\");\n }", "private String removeLeadingWhitespace(String input) {\n for (int index = 0; index < input.length(); index++) {\n if (!Character.isWhitespace(input.charAt(index))) {\n return input.substring(index);\n }\n }\n return input;\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n String s = scan.nextLine();\n // System.out.println(s);\n s = s.replace(\"!\", \" \");\n s = s.replace(\".\", \" \");\n s = s.replace(\"'\", \" \");\n s = s.replace(\"_\", \" \");\n s = s.replace(\"@\", \" \");\n s = s.replace(\"?\", \" \");\n s = s.replace(\",\", \" \");\n s = s.replace(\" \", \" \");\n s = s.replace(\" \", \" \");\n while(s.contains(\" \")) {\n \ts = s.replace(\" \", \" \");\n }\n \n \n while(s.charAt(0)==' '&&s.length()>1) {\n \tif(s.charAt(0)!=' ') {\n \t//\tSystem.out.println(s.length() +\"s \"+s);\n \t\tbreak;\n \t}else {\n \t\t//System.out.println(s.length() +\"s (\"+s+\")\");\n \t\ts = s.trim();\n \t}\n }\n \n if(!s.equals(\" \")) {\n s = s.trim();\n String [] allToken = s.split(\" \");\n System.out.println(allToken.length);\n for(int y=0;y<allToken.length;y++) {\n System.out.println(allToken[y]);\t\n }\n // System.out.println(allToken.length);\n }else {\n \t System.out.println(0);\n }\n scan.close();\n }", "static void printSpaces()\n{ int i;\n for (i=0;i<sangria;i++)\n\t System.out.print(\" \");\n}", "public static void main(String[] args) {\n\n\t\tRemoveWhitespace rws = new RemoveWhitespace();\n\t\tString res = rws.removeWhtSpace(\"hi how are you?\");\n\t\tString res2 = rws.removeWhtSpaceV2(\"hi how are you?\");\n\t\tSystem.out.println(res);\n\t\tSystem.out.println(res2);\n\t\t\n\t\tSystem.out.println(rws.removeTrailingWhtSpace(\" Hey what is up? \"));\n\t}", "private void skipBlankSpaces() {\n while (currentIndex < this.data.length) {\n if (!Character.isWhitespace(data[currentIndex])) {\n break;\n }\n currentIndex++;\n }\n }", "private static int removeWhiteSpace(char[] data) {\n if (CommonUtil.isNull(data)) {\n return 0;\n }\n\n // count characters that's not whitespace\n int newSize = 0;\n int len = data.length;\n for (int i = 0; i < len; i++) {\n if (!isWhiteSpace(data[i])) {\n data[newSize++] = data[i];\n }\n }\n return newSize;\n }", "@Override\n\tpublic String abbreviatedCellText(){\n\t\tString realText = text;\n\t\tif(text.charAt(0) == '\\\"'){\n\t\t\trealText = text.substring(1, text.length() - 1);\n\t\t}\n\t\tif(realText.length() > 10){\t\t//if it contains more than 10 characters\n\t\t\trealText = text.substring(1, 11);\t//using substring to take the first 10\n\t\t\treturn realText;\n\t\t}else{\n\t\t\t//fills in the spaces\n\t\t\twhile(realText.length()<10){\t//if it contains less than 10 characters\t\n\t\t\t\trealText += \" \";\t\t//pad to ten\n\n\t\t\t}\n\t\t\treturn realText;\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tchar[] just = {'a','b','c','d',' ',' ',' ','e'};\n\t\t\n\t\tSystem.out.println(Arrays.toString(just));\n\t\t\n\t\tremoveWhiteSpace(just);\n\t\t\n\t\tSystem.out.println(Arrays.toString(just));\n\t}", "public String getSingleSpaceString(String sInputString) {\n String sOutputString = \"\";\n try {\n\n //loop replace all TAB by single space\n while (sInputString.contains(\"\t\")) {\n sInputString = sInputString.replaceAll(\"\t\", \" \").trim();\n }\n\n //loop to replace all double space by single space\n while (sInputString.contains(\" \")) {\n sInputString = sInputString.replaceAll(\" \", \" \").trim();\n }\n\n } catch (Exception e) {\n\n } finally {\n sOutputString = sInputString;\n sInputString = null;\n return sOutputString;\n }\n }", "public void spaces() {\n System.out.println(\"\");\n System.out.println(\"\");\n }", "private static String removeSoftHyphens(String in) {\n String result = in.replaceAll(\"\\u00AD\", \"\");\n return result.length() == 0 ? \"-\" : result;\n }", "public static String removeSpace(String a){\n String b = \" \"; //STRING TO MAKE PALINDROME TEST\n for(int i =0; i<a.length();i++){ //WORK FOR MORE CASES\n if((int)a.charAt(i)==(int)b.charAt(0))\n a=a.substring(0,i)+a.substring(i+1);\n }\n return a;\n }", "protected static String trimWhitespace(String s) {\n int len = s.length();\n StringBuffer buf = new StringBuffer(len);\n for (int ii = 0; ii < len; ii++) {\n char c = s.charAt(ii);\n if (!Character.isWhitespace(c)) {\n buf.append(c);\n }\n }\n return buf.toString();\n }", "public String removeComplexWhiteSpaces(@NotNull String rawText) {\n return rawText.replaceAll(\"(\\\\s)?\\n\\n(\\\\s)?\", \"\\n\").trim();\n }", "private void trimWhitespaces() {\n \n while(currentIndex < dataLength && Character.isWhitespace( data[currentIndex] )) {\n ++currentIndex;\n }\n }", "@Override\n public void run() {\n int count = text.length() - text.replace(\" \", \"\").length();\n System.out.printf(\"Spaces: %d;\\n\", count);\n }", "public static void main(String[] args) {\n\t String str = \"Fred F. Flintstone\";\n\t str.replace(\" \", \"%20\");\n\t System.out.println(str.replace(\" \", \"%20\"));\n\t System.out.println(replaceSpace(str.toCharArray()));\n\t }", "private void skipWhitespace() {\n while (currentPos < endPos && filterString.charAt(currentPos) == ' ') {\n currentPos++;\n }\n }", "private String cleanText(String str) {\r\n\t\tString clean = str.replace(\" \", \"\");\r\n\t\tclean = clean.replace(\":\", \"\");\r\n\t\tclean = clean.replace(\"$\", \"\");\r\n\t\tclean = clean.replace(\".\", \"\");\r\n\t\tclean = clean.replace(\"\\\"\", \"\");\r\n\t\tclean = clean.replace(\"'\", \"\");\r\n\t\tclean = clean.replace(\"&\", \"\");\r\n\t\treturn clean;\r\n\t}", "@Test\n public void testReplacingEmptyString()\n {\n String expectedValue=null,actualValue;\n actualValue=replaceingchar.replaceChar(\" \");\n assertEquals(expectedValue,actualValue);\n }", "Rule WhiteSpace() {\n return ZeroOrMore(AnyOf(\" \\n\\r\\t\\f\"));\n }" ]
[ "0.7071539", "0.6893322", "0.6438535", "0.6418886", "0.63886833", "0.63422364", "0.6310011", "0.62551296", "0.62527716", "0.62075394", "0.6206543", "0.613743", "0.6118753", "0.6089791", "0.605813", "0.60147", "0.60039467", "0.5998672", "0.5991294", "0.59734017", "0.5936911", "0.5918056", "0.58650136", "0.5800034", "0.57905626", "0.57811236", "0.5779464", "0.57781446", "0.57421625", "0.573611", "0.5729375", "0.5717194", "0.5704357", "0.57026476", "0.56786454", "0.5672489", "0.56442416", "0.5614213", "0.5611616", "0.55845386", "0.5562989", "0.5555115", "0.5551978", "0.5549546", "0.5546606", "0.5524094", "0.55235684", "0.55224717", "0.5519411", "0.5518133", "0.551617", "0.5509781", "0.54994726", "0.5493409", "0.54860735", "0.54719543", "0.5469943", "0.546703", "0.54352146", "0.54190636", "0.54187137", "0.5417942", "0.54165673", "0.5415829", "0.54007655", "0.5392436", "0.53921646", "0.53808707", "0.53761905", "0.53754044", "0.5365194", "0.53645194", "0.5361144", "0.536103", "0.535967", "0.53460383", "0.53338724", "0.5329012", "0.5327532", "0.5325847", "0.53223103", "0.5315432", "0.5295589", "0.529324", "0.52929693", "0.5289362", "0.5289119", "0.52853507", "0.5275037", "0.5271897", "0.52629364", "0.52569306", "0.52559674", "0.52549213", "0.5253164", "0.52511895", "0.52500564", "0.5244226", "0.52356404", "0.52254796", "0.52045834" ]
0.0
-1
GENERIC UTILITY METHODS method to get absolute class/jar path for class object passed as parameter
public String getClassPath(Object ClassObject) { try { String temp = null; temp = new File(ClassObject.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()).getParent(); temp = URLDecoder.decode(temp, "UTF-8"); return temp; } catch (Exception e) { return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ClassPath getClassPath();", "public String getClassPath();", "public static String getJarPath() {\n String classPath = \"/\" + JavaUtils.class.getName();\n classPath = classPath.replace(\".\", \"/\") + \".class\";\n try {\n URL url = JavaUtils.class.getResource(classPath);\n String path = URLDecoder.decode(url.getPath(), \"UTF-8\");\n path = URLDecoder.decode(new URL(path).getPath(), \"UTF-8\");\n int bang = path.indexOf(\"!\");\n if (bang >= 0) {\n path = path.substring(0, bang);\n }\n return path;\n } catch (Exception e) {\n ReportingUtils.logError(e, \"Unable to get path of jar\");\n return \"\";\n }\n }", "String resolveClassPath(String classPath);", "private String jarName(){\n // determine the name of this class\n String className=\"/\"+this.getClass().getName().replace('.','/')+\".class\";\n // find out where the class is on the filesystem\n String classFile=this.getClass().getResource(className).toString();\n\n if( (classFile==null) || !(classFile.startsWith(\"jar:\")) ) return null;\n \n // trim out parts and set this to be forwardslash\n classFile=classFile.substring(5,classFile.indexOf(className));\n classFile=FilenameUtil.setForwardSlash(classFile);\n\n // chop off a little bit more\n classFile=classFile.substring(4,classFile.length()-1);\n \n return FilenameUtil.URLSpacetoSpace(classFile);\n }", "public String getPath (Class<?> cn) {\n return PATH + cn.getSimpleName().toLowerCase() + FILE_EXTENSION;\n }", "public String getClassName(String path);", "private Path getClasspath() {\n return getRef().classpath;\n }", "public static String sBasePath() \r\n\t{\r\n\t\tif(fromJar) \r\n\t\t{\r\n\t\t\tFile file = new File(System.getProperty(\"java.class.path\"));\r\n\t\t\tif (file.getParent() != null)\r\n\t\t\t{\r\n\t\t\t\treturn file.getParent().toString();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\treturn new java.io.File(\"\").getCanonicalPath();\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "private static IPath getClassPath(IProject iproject) {\n\t\tIJavaProject project = JavaCore.create(iproject);\n\n\t\t// IClasspathEntry[] classPath = null;\n\t\t// IPath[] path = null;\n\t\tIPath out = null;\n\t\ttry {\n\t\t\tout = project.getOutputLocation();\n\t\t} catch (JavaModelException e) {\n\t\t\tLogger.err.println(e);\n\t\t}\n\n\t\treturn out;\n\t}", "public static PathAnchor classpath(Class<?> clz) {\n String name = clz.getName();\n String path = name.replace(\".\", \"/\");\n return new Classpath(Paths.get(path).getParent(), clz.getClassLoader());\n }", "public static String getClassURI(\n\t\t\t@SuppressWarnings(\"rawtypes\") final Class clazz)\n\t\t\tthrows RuntimeException {\n\t\tURI classURI = null;\n\t\ttry {\n\t\t\tclassURI = clazz.getProtectionDomain().getCodeSource()\n\t\t\t\t\t.getLocation().toURI();\n\t\t} catch (final URISyntaxException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\tfinal String selfString = classURI.toString();\n\t\treturn selfString;\n\t}", "public String getJarLocation();", "public String getPathToJarFolder(){\n Class cls = ReadWriteFiles.class;\r\n ProtectionDomain domain = cls.getProtectionDomain();\r\n CodeSource source = domain.getCodeSource();\r\n URL url = source.getLocation();\r\n try {\r\n URI uri = url.toURI();\r\n path = uri.getPath();\r\n \r\n // get path without the jar\r\n String[] pathSplitArray = path.split(\"/\");\r\n path = \"\";\r\n for(int i = 0; i < pathSplitArray.length-1;i++){\r\n path += pathSplitArray[i] + \"/\";\r\n }\r\n \r\n return path;\r\n \r\n } catch (URISyntaxException ex) {\r\n LoggingAspect.afterThrown(ex);\r\n return null;\r\n }\r\n }", "java.lang.String getClasspath(int index);", "java.lang.String getClasspath(int index);", "@Override\n public Class getJavaClass() throws IOException, ClassNotFoundException {\n open();\n URL url;\n int p = path.lastIndexOf('/');\n int p2 = path.substring(0,p-1).lastIndexOf('/');\n\n File f = new File(path.substring(0,p2));\n url = f.toURI().toURL();\n URL[] urls = new URL[1];\n urls[0] = url;\n ClassLoader loader = new URLClassLoader(urls);\n\n String cls = path.substring(p2 + 1, path.lastIndexOf('.')).replace('/', '.');\n\n if (cfile.getParentFile().getParentFile().getName().equals(\"production\")) {\n cls = cls.substring(cls.lastIndexOf('.') + 1);\n }\n\n\n\n return loader.loadClass(cls);\n }", "java.lang.String getClass_();", "java.lang.String getClass_();", "private static String getJarFilePath() throws URISyntaxException, UnsupportedEncodingException {\n\n\t\tFile jarFile;\n\n\t\t// if (codeSource.getLocation() != null) {\n\t\t// jarFile = new File(codeSource.getLocation().toURI());\n\t\t// } else {\n\t\tString path = ConfigurationLocator.class.getResource(ConfigurationLocator.class.getSimpleName() + \".class\")\n\t\t\t\t.getPath();\n\t\tString jarFilePath = path.substring(path.indexOf(\":\") + 1, path.indexOf(\"!\"));\n\t\tjarFilePath = URLDecoder.decode(jarFilePath, \"UTF-8\");\n\t\tjarFile = new File(jarFilePath);\n\t\t// }\n\t\treturn jarFile.getParentFile().getAbsolutePath();\n\t}", "public String getJarName() {\r\n\t\tURL clsUrl = getClass().getResource(getClass().getSimpleName() + \".class\");\r\n\t\tif (clsUrl != null) {\r\n\t\t\ttry {\r\n\t\t\t\tjava.net.URLConnection conn = clsUrl.openConnection();\r\n\t\t\t\tif (conn instanceof java.net.JarURLConnection) {\r\n\t\t\t\t\tjava.net.JarURLConnection connection = (java.net.JarURLConnection) conn;\r\n\t\t\t\t\tString path = connection.getJarFileURL().getPath();\r\n\t\t\t\t\t// System.out.println (\"Path = \"+path);\r\n\t\t\t\t\tint index = path.lastIndexOf('/');\r\n\t\t\t\t\tif (index >= 0)\r\n\t\t\t\t\t\tpath = path.substring(index + 1);\r\n\t\t\t\t\treturn path;\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static String getLocationOnDisk(Class<?> aClass) {\n ProtectionDomain protectionDomain = aClass.getProtectionDomain();\n if (protectionDomain == null) {\n //Android\n return null;\n }\n CodeSource codeSource = protectionDomain.getCodeSource();\n if (codeSource == null) {\n //Custom classloader with for example classes defined using URLClassLoader#defineClass(String name, byte[] b, int off, int len)\n return null;\n }\n return UrlUtils.decodeURL(codeSource.getLocation().getPath());\n }", "public static String extractClassURI(Class klass) {\n\n\t\tString javaName = klass.getCanonicalName();\n\t\t// System.out.println(\"JAVA \" + javaName);\n\n\t\tIterator<String> keys = nsMap.keySet().iterator();\n\t\tString uri = Describer.defaultBase;\n\n\t\twhile (keys.hasNext()) {\n\t\t\tString key = keys.next();\n\t\t\tif (javaName.startsWith(key)) {\n\t\t\t\tjavaName = javaName.substring(key.length());\n\t\t\t\turi = nsMap.get(key);\n\t\t\t}\n\t\t}\n\n\t\tString[] split = javaName.split(\"\\\\.\");\n\t\t// System.out.println(split.length);\n\n\t\t// uri += split[1] + \".\" + split[0];\n\t\t// uri += \"/projects/\" + split[2] + \"/code\";\n\t\tfor (int i = 1; i < split.length; i++) {\n\t\t\turi += \"/\" + split[i];\n\t\t}\n\t\treturn uri;\n\t}", "@Override\n \tprotected File deriveLocalFileCodeBase(Class<?> baseClass)\n \t{\n \t\t// setup codeBase\n \t\tif (baseClass == null)\n \t\t\tbaseClass = this.getClass();\n \n \t\tPackage basePackage = baseClass.getPackage();\n \t\tString packageName = basePackage.getName();\n \t\tString packageNameAsPath = packageName.replace('.', Files.sep);\n \n \t\tString pathName = System.getProperty(\"user.dir\") + Files.sep;\n \t\tFile path = new File(pathName);\n \t\tString pathString = path.getAbsolutePath();\n \n \t\t// println(\"looking for \" + packageNameAsPath +\" in \" + pathString);\n \n \t\tint packageIndex = pathString.lastIndexOf(packageNameAsPath);\n \t\tif (packageIndex != -1)\n \t\t{\n \t\t\tpathString = pathString.substring(0, packageIndex);\n \t\t\tpath = new File(pathString + Files.sep);\n \t\t}\n \n \t\tcodeBase = new ParsedURL(path);\n \t\tprintln(\"codeBase=\" + codeBase);\n \t\treturn path;\n \t}", "public static File findClassDir(Class<?> clazz) {\n\t\ttry {\n\t\t\tString path = clazz.getProtectionDomain().getCodeSource().getLocation().getFile();\n\t\t\treturn new File(URLDecoder.decode(path, \"UTF-8\"));\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\tthrow new AssertionError(e);\n\t\t}\n\t}", "public String getSystemClassPath();", "private byte[] getClassBytes(String slashedName) {\n URL url = Thread.currentThread().getContextClassLoader().getResource(\n slashedName + \".class\");\n if (url == null) {\n logger.log(TreeLogger.DEBUG, \"Unable to find \" + slashedName\n + \" on the classPath\");\n return null;\n }\n String urlStr = url.toExternalForm();\n if (slashedName.equals(mainClass)) {\n // initialize the mainUrlBase for later use.\n mainUrlBase = urlStr.substring(0, urlStr.lastIndexOf('/'));\n } else {\n assert mainUrlBase != null;\n if (!mainUrlBase.equals(urlStr.substring(0, urlStr.lastIndexOf('/')))) {\n logger.log(TreeLogger.DEBUG, \"Found \" + slashedName + \" at \" + urlStr\n + \" The base location is different from that of \" + mainUrlBase\n + \" Not loading\");\n return null;\n }\n }\n \n // url != null, we found it on the class path.\n try {\n URLConnection conn = url.openConnection();\n return Util.readURLConnectionAsBytes(conn);\n } catch (IOException ignored) {\n logger.log(TreeLogger.DEBUG, \"Unable to load \" + urlStr\n + \", in trying to load \" + slashedName);\n // Fall through.\n }\n return null;\n }", "private static String computeClassPath(Map<String, String> propMap,\n File domainDir, File bootstrapJar) {\n final String METHOD = \"computeClassPath\";\n String result = null;\n List<File> prefixCP = Utils.classPathToFileList(\n propMap.get(\"classpath-prefix\"), domainDir);\n List<File> suffixCP = Utils.classPathToFileList(\n propMap.get(\"classpath-suffix\"), domainDir);\n boolean useEnvCP = \"false\".equals(\n propMap.get(\"env-classpath-ignored\"));\n List<File> envCP = Utils.classPathToFileList(\n useEnvCP ? System.getenv(\"CLASSPATH\") : null, domainDir);\n List<File> systemCP = Utils.classPathToFileList(\n propMap.get(\"system-classpath\"), domainDir);\n\n if (prefixCP.size() > 0 || suffixCP.size() > 0 || envCP.size() > 0\n || systemCP.size() > 0) {\n List<File> mainCP = Utils.classPathToFileList(\n bootstrapJar.getAbsolutePath(), null);\n\n if (mainCP.size() > 0) {\n List<File> completeCP = new ArrayList<>(32);\n completeCP.addAll(prefixCP);\n completeCP.addAll(mainCP);\n completeCP.addAll(systemCP);\n completeCP.addAll(envCP);\n completeCP.addAll(suffixCP);\n\n // Build classpath in proper order - prefix / main / system \n // / environment / suffix\n // Note that completeCP should always have at least 2 elements\n // at this point (1 from mainCP and 1 from some other CP\n // modifier)\n StringBuilder classPath = new StringBuilder(1024);\n Iterator<File> iter = completeCP.iterator();\n classPath.append(Utils.quote(iter.next().getPath()));\n while (iter.hasNext()) {\n classPath.append(File.pathSeparatorChar);\n classPath.append(Utils.quote(iter.next().getPath()));\n }\n result = classPath.toString();\n } else {\n LOGGER.log(Level.WARNING, METHOD, \"cpError\");\n }\n }\n return result;\n }", "public interface IClassPath {\n /**\n * Add a codebase. The object will be interrogated to determine whether it\n * is an application codebase or an auxiliary codebase. Application\n * codebases must be scannable.\n *\n * @param codeBase\n * the codebase to add\n */\n public void addCodeBase(ICodeBase codeBase);\n\n /**\n * Return an iterator over the application codebases.\n *\n * @return iterator over the application codebases\n */\n public Iterator<? extends ICodeBase> appCodeBaseIterator();\n\n /**\n * Return an iterator over the auxiliary codebases.\n *\n * @return iterator over the auxiliary codebases\n */\n public Iterator<? extends ICodeBase> auxCodeBaseIterator();\n\n /**\n * Lookup a resource by name.\n *\n * @param resourceName\n * name of the resource to look up\n * @return ICodeBaseEntry representing the resource\n * @throws ResourceNotFoundException\n * if the resource is not found\n */\n public ICodeBaseEntry lookupResource(String resourceName) throws ResourceNotFoundException;\n\n /**\n * Add a resource name to codebase entry mapping. Once this is done, future\n * lookups of this resource will automatically resolve to the given codebase\n * entry.\n *\n * @param resourceName\n * the resource name to map\n * @param codeBaseEntry\n * the codebase entry to use for this resource\n */\n public void mapResourceNameToCodeBaseEntry(String resourceName, ICodeBaseEntry codeBaseEntry);\n\n /**\n * Close all of the code bases that are part of this class path. This should\n * be done once the client is finished with the classpath.\n */\n public void close();\n\n /**\n * Returns all of the application code base entries that are part of this class path.\n *\n * @return map where the key is slashed (VM) class name with \".class\" suffix\n */\n public Map<String, ICodeBaseEntry> getApplicationCodebaseEntries();\n\n}", "public java.lang.String getClassPath() {\n return this.classPath;\n }", "private static String getFQClassName(final String root, final String path) {\r\n\t\t//Remove root from front of path and \".class\" from end of path\r\n\t\tString trimmed = path.substring(path.indexOf(root) + root.length(), path.indexOf(\".class\"));\r\n\t\t\r\n\t\t//Replace backslashes with periods\r\n\t\treturn trimmed.replaceAll(Matcher.quoteReplacement(\"\\\\\"), \".\");\r\n\t}", "public String getClassPath() {\n return classPath;\n }", "@SuppressWarnings(\"deprecation\")\r\n\tpublic static URL findResourceInClassPath(String resourceName) {\r\n\r\n\t\tURL url;\r\n\r\n\t\t// Tries to locate the resource with the class loader\r\n\t\turl = ClassLoader.getSystemResource(resourceName);\r\n\t\tif (url != null)\r\n\t\t\treturn url;\r\n\r\n\t\t// Tries to locate the resource in the main directory\r\n\t\turl = FileLoader.class.getResource(resourceName);\r\n\t\tif (url != null)\r\n\t\t\treturn url;\r\n\r\n\t\t// Tries to locate the resource in the class list\r\n\t\tString path = FileLoader.class.getResource(FileLoader.class.getSimpleName() + \".class\").getPath();\r\n\t\tif( path != null ) {\r\n\t\t\tString pathParts[] = path.split(\"!\");\r\n\t\t\tpath = pathParts[0];\r\n\t\t\tpathParts = path.split(\"file:\");\r\n\t\t\tif( pathParts.length > 1 ) {\r\n\t\t\t\tpath = pathParts[1];\r\n\t\t\t} else {\r\n\t\t\t\tpath = pathParts[0];\r\n\t\t\t}\r\n\t\t\tif( path.contains(\"/lib/\")) {\r\n\t\t\t\tFile f = new File(path);\r\n\t\t\t\tf = f.getParentFile().getParentFile();\r\n\t\t\t\tf = new File(f.getPath() + File.separator + \"classes\" + File.separator + resourceName);\r\n\t\t\t\tif( f.exists()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\treturn f.toURL();\r\n\t\t\t\t\t} catch( Exception e) {}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tFile f = new File(path);\r\n\t\t\t\ttry {\r\n\t\t\t\t\tf = f.getParentFile().getParentFile().getParentFile();\r\n\t\t\t\t\tf = new File(f.getPath() + File.separator + resourceName);\r\n\t\t\t\t\tif( f.exists()) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\treturn f.toURL();\r\n\t\t\t\t\t\t} catch(Exception e) {}\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch(NullPointerException npe) {}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "String getInstanceOfClass();", "private static URL classToUrl(Class c) {\n final String fullName = c.getName();\n final String pkg = c.getPackage().getName();\n final String className = fullName.substring(pkg.length() + 1, fullName.length()).replace('$', '.');\n return c.getResource(className + \".sql.stg\");\n }", "Object getClass_();", "Object getClass_();", "private static File calculateBluejLibDir()\n {\n File bluejDir = null;\n String bootFullName = Boot.class.getResource(\"Boot.class\").toString();\n\n try {\n if (! bootFullName.startsWith(\"jar:\")) {\n // Boot.class is not in a jar-file. Find a lib directory somewhere\n // above us to use\n File startingDir = (new File(new URI(bootFullName)).getParentFile());\n while((startingDir != null) &&\n !(new File(startingDir.getParentFile(), \"lib\").isDirectory())) {\n startingDir = startingDir.getParentFile();\n }\n \n if (startingDir == null) {\n bluejDir = null;\n }\n else {\n bluejDir = new File(startingDir.getParentFile(), \"lib\");\n }\n }\n else {\n // The class is in a jar file, '!' separates the jar file name\n // from the class name. Cut off the class name and the \"jar:\" prefix.\n int classIndex = bootFullName.indexOf(\"!\");\n String bootName = bootFullName.substring(4, classIndex);\n \n File finalFile = new File(new URI(bootName));\n bluejDir = finalFile.getParentFile();\n } \n } \n catch (URISyntaxException use) { }\n \n return bluejDir;\n }", "public Path createClasspath() {\r\n return getCommandLine().createClasspath(getProject()).createPath();\r\n }", "private static URL getDeployableXmlUrl(Class<?> clazz)\n {\n // Initialize\n StringBuffer urlString = new StringBuffer();\n\n // Assemble filename in form \"fullyQualifiedClassName\"\n urlString.append(clazz.getName());\n\n // Make a String\n String flatten = urlString.toString();\n\n // Adjust for filename structure instead of package structure\n flatten = flatten.replace('.', '/');\n\n // Append Suffix\n flatten = flatten + DEFAULT_SUFFIX_DEPLOYABLE_XML;\n\n // Get URL\n URL url = Thread.currentThread().getContextClassLoader().getResource(flatten);\n assert url != null : \"URL was not found for \" + flatten;\n \n // Return\n return url;\n }", "static URL[] getClassPath() throws MalformedURLException {\n List<URL> classPaths = new ArrayList<>();\n\n classPaths.add(new File(\"target/test-classes\").toURI().toURL());\n\n // Add this test jar which has some frontend resources used in tests\n URL jar = getTestResource(\"jar-with-frontend-resources.jar\");\n classPaths.add(jar);\n\n // Add other paths already present in the system classpath\n ClassLoader classLoader = ClassLoader.getSystemClassLoader();\n URL[] urls = URLClassLoader.newInstance(new URL[] {}, classLoader)\n .getURLs();\n for (URL url : urls) {\n classPaths.add(url);\n }\n return classPaths.toArray(new URL[0]);\n }", "public static PathAnchor classpath() {\n return classpath(Config.class.getClassLoader());\n }", "String getMainClass();", "private void createClassPath() {\n classPath = classFactory.createClassPath();\n }", "public String getClasspath()\n\t{\n\t\treturn classpath;\n\t}", "public static String getRunningJarName(\n\t\t\t@SuppressWarnings(\"rawtypes\") final Class clazz) {\n\t\tfinal String classURI = RuntimeLogbasenamePropertyDefiner\n\t\t\t\t.getClassURI(clazz);\n\n\t\tString jarName = null;\n\t\tif (RuntimeLogbasenamePropertyDefiner.isRunningAsJar(classURI)) {\n\t\t\tfinal String vals[] = classURI.split(\"/\");\n\t\t\tfor (final String val : vals) {\n\t\t\t\t// skip all path fragments until the one with the '!'\n\t\t\t\tif (val.contains(\"!\")) {\n\t\t\t\t\tjarName = val.substring(0, val.length() - 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn jarName;\n\t}", "public static String getClassPath(String schemaName) throws SQLException\n\t{\n\t\tResultSet rs = null;\n\t\tPreparedStatement stmt = null;\n\t\ttry\n\t\t{\n\t\t\tif(schemaName == null || schemaName.length() == 0)\n\t\t\t\tschemaName = \"public\";\n\t\t\telse\n\t\t\t\tschemaName = schemaName.toLowerCase();\n\n\t\t\tstmt = SQLUtils\n\t\t\t\t.getDefaultConnection()\n\t\t\t\t.prepareStatement(\n\t\t\t\t\t\"SELECT r.jarName\"\n\t\t\t\t\t\t+ \" FROM sqlj.jar_repository r INNER JOIN sqlj.classpath_entry c ON r.jarId = c.jarId\"\n\t\t\t\t\t\t+ \" WHERE c.schemaName = ? ORDER BY c.ordinal\");\n\n\t\t\tstmt.setString(1, schemaName);\n\t\t\trs = stmt.executeQuery();\n\t\t\tStringBuffer buf = null;\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tif(buf == null)\n\t\t\t\t\tbuf = new StringBuffer();\n\t\t\t\telse\n\t\t\t\t\tbuf.append(':');\n\t\t\t\tbuf.append(rs.getString(1));\n\t\t\t}\n\t\t\treturn (buf == null) ? null : buf.toString();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tSQLUtils.close(rs);\n\t\t\tSQLUtils.close(stmt);\n\t\t}\n\t}", "public static URL getResourceFromClassPath(Class clazz,String path) {\n\t\treturn clazz.getClassLoader().getResource(path);\n\t}", "public String constructFullClasspath() {\n\t\t\t\tString cp = super.constructFullClasspath();\n\t\t\t\tcp += File.pathSeparator + soot.options.Options.v().soot_classpath();\n\t\t\t\treturn cp;\n\t\t\t}", "private static List<Class<?>>\n getClassNameFromJar(JarFile jarFile, String packageName, boolean isRecursion, String postfix) throws ClassNotFoundException {\n LOG.info(\"get Class List from jar \" + jarFile.getName());\n\n List<Class<?>> lc = new ArrayList<>();\n\n lc = jarFile.stream()\n .filter(f -> !f.isDirectory())\n .map(f -> f.getName().replace(\"/\", \".\"))\n .filter(f -> f.startsWith(packageName) && f.endsWith(postfix) && !f.contains(\"$\"))\n .map(f -> f.replace(postfix, \"\"))\n .map(f -> {\n try {\n return Class.forName(f);\n } catch (ClassNotFoundException e) {\n LOG.error(\"cast classstr \" + f + \" to class failed\");\n throw new RuntimeException(e);\n }\n })\n .collect(Collectors.toList());\n\n return lc;\n }", "private static URI toResourceURI( Class<?> baseClass, String baseDir) {\n try {\n return\n baseClass != null\n ? baseClass.getResource( baseDir==null? \".\" : baseDir).toURI()\n : new URI( \"file://\" + (baseDir==null? \"\" : baseDir));\n }\n catch( Exception e) {\n throw new IllegalArgumentException( \"Can't create URI\", e);\n }\n }", "public ClasspathDirectory() {\r\n this(System.getProperty(\"java.class.path\"));\r\n }", "public com.google.protobuf.ByteString\n getClasspathBytes(int index) {\n return classpath_.getByteString(index);\n }", "public com.google.protobuf.ByteString\n getClasspathBytes(int index) {\n return classpath_.getByteString(index);\n }", "private String getClassname() {\r\n\t\tString classname = this.getClass().getName();\r\n\t\tint index = classname.lastIndexOf('.');\r\n\t\tif (index >= 0)\r\n\t\t\tclassname = classname.substring(index + 1);\r\n\t\treturn classname;\r\n\t}", "public java.lang.String getClasspath(int index) {\n return classpath_.get(index);\n }", "protected Class<?> findClass(String paramString) throws ClassNotFoundException {\n/* 343 */ if (!paramString.startsWith(\"sun.reflect.misc.\")) {\n/* 344 */ throw new ClassNotFoundException(paramString);\n/* */ }\n/* 346 */ String str = paramString.replace('.', '/').concat(\".class\");\n/* 347 */ URL uRL = getResource(str);\n/* 348 */ if (uRL != null) {\n/* */ try {\n/* 350 */ return defineClass(paramString, uRL);\n/* 351 */ } catch (IOException iOException) {\n/* 352 */ throw new ClassNotFoundException(paramString, iOException);\n/* */ } \n/* */ }\n/* 355 */ throw new ClassNotFoundException(paramString);\n/* */ }", "public String getClasspath() {\n return classpath;\n }", "java.lang.String getClassName();", "public interface ClasspathComponent {\r\n\r\n /**\r\n * Find a class by name within thsi classpath component.\r\n * @param className the name of the class\r\n * @return the <tt>FindResult</tt> object. <tt>null</tt> if no class could be found.\r\n */\r\n public FindResult findClass(String className);\r\n\r\n /**\r\n * Merge all classes in this classpath component into the supplied tree.\r\n * @param model the tree model.\r\n * @param reset whether this is an incremental operation or part of a reset.\r\n * For a reset, no change events will be fired on the tree model.\r\n */\r\n public void mergeClassesIntoTree(DefaultTreeModel model, boolean reset);\r\n\r\n /**\r\n * Add a <tt>ClasspathChangeListener</tt>.\r\n * @param listener the listener\r\n */\r\n public void addClasspathChangeListener(ClasspathChangeListener listener);\r\n\r\n /**\r\n * Remove a <tt>ClasspathChangeListener</tt>.\r\n * @param listener the listener\r\n */\r\n public void removeClasspathChangeListener(ClasspathChangeListener listener);\r\n}", "String getClassName();", "String getClassName();", "String getClassName();", "protected String retrieveRbFile() {\r\n\t\tString className = this.getClass().getName();\r\n\t\tString packageName = this.getClass().getPackage().getName() + \".\";\r\n\t\treturn className.replaceFirst(packageName, \"\");\r\n\t}", "public String getRuntimeClass();", "public java.lang.String getClasspath(int index) {\n return classpath_.get(index);\n }", "java.lang.String getBootclasspath(int index);", "java.lang.String getBootclasspath(int index);", "public StringBuilder getClassPathDescription() {\n\n // load the jars from the classpath\n StringBuilder classPathLog = new StringBuilder();\n String[] classpathArray = getClassPathArray();\n\n if (classpathArray.length == 0) {\n return classPathLog;\n }\n\n // Make a map containing folders as keys and jar names as values\n Map<String, List<String>> classPathMap = new HashMap<String, List<String>>();\n for (int i = 0; i < classpathArray.length; i++) {\n String jarFullPath = classpathArray[i].replace(\"\\\\\", \"/\");\n String absPath = jarFullPath.substring(0, jarFullPath.lastIndexOf('/') + 1);\n String simpleJarName = jarFullPath.substring(jarFullPath.lastIndexOf('/') + 1,\n jarFullPath.length());\n if (classPathMap.containsKey(absPath)) {\n classPathMap.get(absPath).add(simpleJarName);\n } else {\n classPathMap.put(absPath, new ArrayList<String>(Arrays.asList(simpleJarName)));\n }\n }\n\n // append instances of same jar one after another\n for (String path : new TreeSet<String>(classPathMap.keySet())) {\n classPathLog.append(\"\\n\");\n classPathLog.append(path);\n List<String> jarList = classPathMap.get(path);\n Collections.sort(jarList);\n for (String lib : jarList) {\n classPathLog.append(\"\\n\\t\");\n classPathLog.append(lib);\n }\n }\n return classPathLog;\n }", "public String resolvePath();", "private Class loadClass(ClassInfo classInfo) {\n Class type = null;\n try {\n URLClassLoader classLoader = new URLClassLoader(new URL[]{\n new File(classInfo.getPath()).toURI().toURL()\n });\n type = classLoader.loadClass(classInfo.getName());\n } catch (MalformedURLException ex) {\n Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, \"Class url stimmt nicht. Ggf. hat der ClassIndexer einen falschen Pfad!\", ex);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, \"Klasse konnte nicht gefunden werden!\", ex);\n }\n return type;\n }", "private Resource getOntClass(Object bean) {\r\n\t\treturn ontClass(bean).addProperty(javaclass, bean.getClass().getName());\r\n\t}", "public IJavaClassFile getMainClass();", "public interface GetPath {\n //path是svn中的地址,realpath是class的路径\n public void copyFileAndFloder(String[] paths, String realPath);\n}", "CtPath getPath();", "java.util.List<java.lang.String>\n getClasspathList();", "public static File getJarPath() throws URISyntaxException {\n\t\tFile jarPath = new File(Parser.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());\n\t\treturn jarPath.getParentFile();\n\t}", "public static ClassPath forJar(Optional<ClassPath> parent, Path jarPath) throws IOException {\n URI uri = URI.create(\"jar:\" + jarPath.toUri());\n FileSystem fs = FileSystems.newFileSystem(uri, new HashMap<>());\n return new DirectoryClassPath(parent, Iterables.getOnlyElement(fs.getRootDirectories())) {\n @Override\n public void close() throws Exception {\n fs.close();\n super.close();\n }\n };\n }", "private Class<?> getClassFromHistoryEntry(final String clazz) {\n try {\n return Class.forName(clazz);\n } catch (ClassNotFoundException cnfe) {\n // I know this can't happen\n }\n \n return null;\n }", "public ClassPath(String dir) {\n classPath = buildClassPath(dir, new JarZipNameFilter());\n }", "com.google.protobuf.ByteString\n getClasspathBytes(int index);", "public static JARArchive createDefaultJar(Class<?> aClass) {\n JARArchive archive = ShrinkWrap.create(JARArchive.class);\n ClassLoader cl = aClass.getClassLoader();\n\n Set<CodeSource> codeSources = new HashSet<>();\n\n URLPackageScanner.Callback callback = (className, asset) -> {\n ArchivePath classNamePath = AssetUtil.getFullPathForClassResource(className);\n ArchivePath location = new BasicPath(\"\", classNamePath);\n archive.add(asset, location);\n\n try {\n Class<?> cls = cl.loadClass(className);\n codeSources.add(cls.getProtectionDomain().getCodeSource());\n } catch (ClassNotFoundException | NoClassDefFoundError e) {\n e.printStackTrace();\n }\n };\n\n URLPackageScanner scanner = URLPackageScanner.newInstance(\n true,\n cl,\n callback,\n aClass.getPackage().getName());\n\n scanner.scanPackage();\n\n Set<String> prefixes = codeSources.stream().map(e -> e.getLocation().toExternalForm()).collect(Collectors.toSet());\n\n try {\n List<URL> resources = Collections.list(cl.getResources(\"\"));\n\n resources.stream()\n .filter(e -> {\n for (String prefix : prefixes) {\n if (e.toExternalForm().startsWith(prefix)) {\n return true;\n }\n }\n return false;\n })\n .filter(e -> e.getProtocol().equals(\"file\"))\n .map(e -> getPlatformPath(e.getPath()))\n .map(e -> Paths.get(e))\n .filter(e -> Files.isDirectory(e))\n .forEach(e -> {\n try {\n Files.walkFileTree(e, new SimpleFileVisitor<Path>() {\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n if (!file.toString().endsWith(\".class\")) {\n Path location = e.relativize(file);\n archive.add(new FileAsset(file.toFile()), javaSlashize(location));\n }\n return super.visitFile(file, attrs);\n }\n });\n } catch (IOException e1) {\n }\n });\n\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n return archive;\n }", "public String getClassName();", "@Classpath\n @InputFiles\n public FileCollection getClasspath() {\n return _classpath;\n }", "java.util.List<java.lang.String>\n getClasspathList();", "public abstract String getResourcePath(Method method);", "private String relativizeLibraryClasspath(final String property, final File projectDir) {\n final String value = PropertyUtils.getGlobalProperties().getProperty(property);\n if (value == null)\n return null;\n final String[] paths = PropertyUtils.tokenizePath(value);\n final StringBuffer sb = new StringBuffer();\n for (int i=0; i<paths.length; i++) {\n final File f = antProjectHelper.resolveFile(paths[i]);\n if (CollocationQuery.areCollocated(f, projectDir)) {\n sb.append(PropertyUtils.relativizeFile(projectDir, f));\n } else {\n return null;\n }\n if (i+1<paths.length) {\n sb.append(File.pathSeparatorChar);\n }\n }\n if (sb.length() == 0) {\n return null;\n } \n return sb.toString();\n }", "public static PathAnchor classpath(String prefix, ClassLoader loader) {\n return new Classpath(Paths.get(prefix), loader);\n }", "public String getOperationClassFullPath() {\n\t\treturn operationClassFullPath;\n\t}", "public static PathAnchor classpath(ClassLoader loader) {\n return classpath(\"\", loader);\n }", "public static String getClassName(Class<?> objectClass) {\n RemoteClass annotation = objectClass.getAnnotation(RemoteClass.class);\n if (annotation != null) {\n return annotation.alias();\n }\n String className = objectClass.getName();\n if (className.startsWith(\"org.red5.compatibility.\")) {\n // Strip compatibility prefix from classname\n className = className.substring(23);\n if (\"flex.messaging.messages.AsyncMessageExt\".equals(className)) {\n className = \"DSA\";\n } else if (\"flex.messaging.messages.CommandMessageExt\".equals(className)) {\n className = \"DSC\";\n } else if (\"flex.messaging.messages.AcknowledgeMessageExt\".equals(className)) {\n className = \"DSK\";\n }\n }\n log.debug(\"Classname: {}\", className);\n return className;\n }", "public interface ClasspathFileInterface \r\n{\r\n \r\n public boolean exists ();\r\n public String getName ();\r\n public String getAbsolutePath ();\r\n public InputStream openInputStream () throws IOException;\r\n \r\n}", "public interface JavaExecutableLocator {\n public String javaExecutable();\n}", "private ClassLoader getClassLoader() {\r\n return this.getClass().getClassLoader();\r\n }", "public String findPackageForTest(String testClassName);", "public Path getFromClasspath(String classpathRelativePath) throws URISyntaxException {\n return Paths.get( PathUtil.class.getClassLoader().getResource(classpathRelativePath).toURI());\n }", "private static URL[] findJARs() {\n\tFilenameFilter filter = new FilenameFilter() {\n\t\tpublic boolean accept(File dir, String name) {\n\t\t\tString lcname = name.toLowerCase();\n//System.out.println(lcname+\" => \"+(lcname.endsWith(\".jar\") && !lcname.startsWith(\"multivalent\")));\n\t\t\treturn lcname.endsWith(\".jar\") && !lcname.startsWith(\"multivalent\")/*no snapshots*/ && new File(dir, name).canRead();\n\t\t}\n\t};\n\n\t// look for JARs in same directory (or, during development, in c:/temp)\n//\tFile dir;\n\tString jar = URIs.decode/*in case space in path*/(Multivalent.class.getResource(\"Multivalent.class\").toString());\n//System.out.println(\"Bootstrap res = \"+jar);\n\tString top;\n\tif (jar.startsWith(\"jar:\")) { // deployment: e.g., \"jar:file:/C:/temp/Multivalent20011127.jar!/multivalent/Multivalent.class\"\n\t\tjar = jar.substring(\"jar:file:\".length(), jar.indexOf('!'));\n\t\ttop = jar.substring(0, jar.lastIndexOf('/')+1);\n\t//} else if (new File(\"/c:/temp\").exists()) { // my development => CLASSPATH\n\t//\ttop = \"/c:/temp\";\n\t\t// CLASSPATH is selfsame JAR -- ignore as ClassLoader gets anyhow\n\n\t} else { // others' development: e.g., \"file:/D:/prj/Multivalent/www/jar/multivalent/Multivalent.class\"\n\t\tint inx = jar.lastIndexOf('/'); // chop \"Multivalent.class\"\n\t\tinx = jar.lastIndexOf('/', inx-1); // chop \"multivalent\"\n\n\t\tjar = jar.substring(\"file:\".length(), inx+1);\n//System.out.println(\"jar = \"+jar);\n\t\ttop = jar;\n\t}\n\n\n\tList urls = new ArrayList(20);\n\n\tif (standalone_) System.out.println(\"Searching for JARs in \"+top);\n\ttry {\n\t\tFile[] f = new File(top).listFiles(filter);\n\t\tfor (int i=0,imax=f.length; i<imax; i++) {\n\t\t\turls.add(f[i].toURI().toURL());\n\t\t\tif (standalone_) System.out.println(\"\\t\"+f[i]);\n\t\t}\n\t} catch (MalformedURLException canthappen) { System.err.println(canthappen/*f[i]*/); System.err.println(\"Move to different directory\"); }\n\n\treturn (URL[])urls.toArray(new URL[0]);\n }", "public ClassFile getClassFile(String name) throws IOException {\n if (name.indexOf('.') > 0) {\n int i = name.lastIndexOf('.');\n String pathname = name.replace('.', File.separatorChar) + \".class\";\n if (baseFileName.equals(pathname) ||\n baseFileName.equals(pathname.substring(0, i) + \"$\" +\n pathname.substring(i+1, pathname.length()))) {\n return readClassFile(path);\n }\n } else {\n if (baseFileName.equals(name.replace('/', File.separatorChar) + \".class\")) {\n return readClassFile(path);\n }\n }\n return null;\n }", "protected String getFullyQualifiedClassName(String classname)\n {\n return classname.contains(\".\") ? classname : \"org.apache.cassandra.hadoop.\" + classname;\n }", "abstract String getClassName();" ]
[ "0.718757", "0.70566946", "0.67305624", "0.65908533", "0.6432008", "0.64013916", "0.6397098", "0.6358527", "0.63558984", "0.6259728", "0.621858", "0.62168884", "0.61998767", "0.6159947", "0.6135468", "0.6135468", "0.60413635", "0.60259295", "0.60259295", "0.5994583", "0.59911096", "0.59533733", "0.5950296", "0.594244", "0.59373313", "0.58841354", "0.58044446", "0.5743126", "0.5713607", "0.5709786", "0.5702645", "0.56871444", "0.5684932", "0.5630833", "0.56171954", "0.5599605", "0.5599605", "0.5592623", "0.5575704", "0.55684465", "0.5556644", "0.55501825", "0.553706", "0.5475024", "0.5457193", "0.5424032", "0.5421801", "0.5416834", "0.54168016", "0.5371657", "0.5336979", "0.53325236", "0.5310019", "0.530957", "0.5308101", "0.5289636", "0.5282103", "0.52809364", "0.52705616", "0.52657473", "0.525056", "0.525056", "0.525056", "0.52492887", "0.524718", "0.5237643", "0.522867", "0.522867", "0.522769", "0.5225743", "0.5222434", "0.5221893", "0.5205126", "0.5198882", "0.5197493", "0.5196019", "0.51913184", "0.51874745", "0.5181485", "0.51795924", "0.517595", "0.5168564", "0.5156467", "0.5147259", "0.5143032", "0.51428163", "0.5130655", "0.5129281", "0.51258904", "0.51198804", "0.5111823", "0.5110237", "0.51078004", "0.5092097", "0.5084219", "0.5082804", "0.50801116", "0.5075572", "0.5072454", "0.50718266" ]
0.7061388
1
method to sort hashmap by values
public HashMap sortByValues(HashMap map) { List list = new LinkedList(map.entrySet()); // Defined Custom Comparator here Collections.sort(list, new Comparator() { public int compare(Object o1, Object o2) { return ((Comparable) ((Map.Entry) (o1)).getValue()) .compareTo(((Map.Entry) (o2)).getValue()); } }); List array = new LinkedList(); if (list.size() >= 3) // Make sure you really have 3 elements { array.add(list.get(list.size() - 1)); // The last array.add(list.get(list.size() - 2)); // The one before the last array.add(list.get(list.size() - 3)); // The one before the one before the last } else { array = list; } // Here I am copying the sorted list in HashMap // using LinkedHashMap to preserve the insertion order HashMap sortedHashMap = new LinkedHashMap(); for (Iterator it = array.iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); sortedHashMap.put(entry.getKey(), entry.getValue()); } return sortedHashMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private HashMap<String, Double> sortByValues(HashMap<String, Double> map) {\n List<Map.Entry<String, Double>> list =\n new LinkedList<>(map.entrySet());\n\n Collections.sort(list, new Comparator<Map.Entry<String, Double>>() {\n @Override\n public int compare(Map.Entry<String, Double> o1, Map.Entry<String, Double> o2) {\n return (o1.getValue()).compareTo(o2.getValue());\n }\n });\n\n HashMap<String, Double> sortedHashMap = new LinkedHashMap<>();\n for (Map.Entry<String, Double> item : list) {\n sortedHashMap.put(item.getKey(), item.getValue());\n }\n return sortedHashMap;\n }", "public static HashMap sortByValues(HashMap map){\r\n List list = new LinkedList(map.entrySet());\r\n Collections.sort(list, new Comparator() {\r\n @Override\r\n public int compare(Object o1, Object o2) {\r\n return ((Comparable) ((Map.Entry) (o1)).getValue())\r\n .compareTo(((Map.Entry) (o2)).getValue());\r\n }\r\n });\r\n HashMap sortedHashMap= new LinkedHashMap();\r\n for(Iterator it=list.iterator();it.hasNext();){\r\n Map.Entry entry= (Map.Entry) it.next();\r\n sortedHashMap.put(entry.getKey(), entry.getValue());\r\n }\r\n return sortedHashMap;\r\n }", "private static HashMap sortValues(Map<Integer, String> map) {\n\t\tList list = new LinkedList(map.entrySet());\n\t\t// Custom Comparator\n\t\tCollections.sort(list, new Comparator() {\n\t\t\tpublic int compare(Object o1, Object o2) {\n\t\t\t\treturn ((Comparable) ((Map.Entry) (o1)).getValue()).compareTo(((Map.Entry) (o2)).getValue());\n\t\t\t}\n\t\t});\n\t\t// copying the sorted list in HashMap to preserve the iteration order\n\t\tHashMap sortedHashMap = new LinkedHashMap();\n\t\tfor (Iterator it = list.iterator(); it.hasNext();) {\n\t\t\tMap.Entry entry = (Map.Entry) it.next();\n\t\t\tsortedHashMap.put(entry.getKey(), entry.getValue());\n\t\t}\n\t\treturn sortedHashMap;\n\t}", "private static void sortMap(HashMap<Integer, Integer> map) {\n\t\t\n\t}", "public static <K, V extends Comparable<V>> Map<K, V> sortByValues(Map<K, V> map) {\n \tComparator<K> valueComparator = new Comparator<K>() {\n\t\t\tpublic int compare(K key, K key2) {\n\t\t\t\tint compareKeys = map.get(key2).compareTo(map.get(key));\n\t\t\t\tif (compareKeys == 0) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn compareKeys;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tMap<K, V> sortedByValues = new TreeMap<K, V>(valueComparator);\n\t\tsortedByValues.putAll(map);\n\t\treturn sortedByValues;\n }", "public static <K, V extends Comparable<V>> Map<K, V> sortByValues(final Map<K, V> map) {\r\n \tComparator<K> valueComparator = new Comparator<K>() {\r\n \t public int compare(K k1, K k2) {\r\n \t int compare = map.get(k2).compareTo(map.get(k1));\r\n \t if (compare == 0) return 1;\r\n \t else return compare;\r\n \t }\r\n \t};\r\n \tMap<K, V> sortedByValues = new TreeMap<K, V>(valueComparator);\r\n \tsortedByValues.putAll(map);\r\n \t\r\n \treturn sortedByValues;\r\n }", "Map<String, Double> sortByValues(Map<String, Double> map_to_sort){\n\tList<Map.Entry<String,Double>> ranklist = new LinkedList<Map.Entry<String,Double>>(map_to_sort.entrySet());\n\tCollections.sort(ranklist, new Comparator<Map.Entry<String, Double>>(){\n\t\tpublic int compare(Map.Entry<String,Double> o1, Map.Entry<String,Double> o2){\n\t\t\treturn o2.getValue().compareTo((double)o1.getValue() );\n\t\t}\n\t});\n\t\n\tMap<String, Double> sortedRank = new LinkedHashMap<String,Double>();\n\tfor(Map.Entry<String, Double> rank : ranklist){\n\t\tsortedRank.put(rank.getKey(), rank.getValue());\t\t\t\n\t}\n\t\n\treturn sortedRank;\n\t}", "public static void sortbyValue()\n {\n //1. Create a list from elements of HashMap\n List<Map.Entry<Integer,String>> list = new LinkedList<>(map.entrySet());\n\n //2. Sort the list -- >Sory via Value\n //Collections.sort(list, (Map.Entry<Integer,String> o1,Map.Entry<Integer,String> o2) -> (o1.getKey().compareTo(o2.getKey())));\n\n //2. Sort the list -- >Sory via Key\n Collections.sort(list, (Map.Entry<Integer,String> o1,Map.Entry<Integer,String> o2) -> (o1.getValue().compareTo(o2.getValue())));\n\n \n //3. Put data from sorted list to map\n Map<Integer,String> temp = new LinkedHashMap<Integer,String>();\n\n for(Map.Entry<Integer,String> entry : list)\n {\n temp.put(entry.getKey(), entry.getValue());\n }\n\n //4. Printing the data from map\n for(Map.Entry<Integer,String> entry : temp.entrySet())\n {\n System.out.println(entry.getKey()+\" \"+entry.getValue());\n }\n }", "private static HashMap<String, Integer> sortByValue(HashMap<String, Integer> unsortMap) {\n\t\tList<HashMap.Entry<String, Integer>> list = new LinkedList<HashMap.Entry<String, Integer>>(\n\t\t\t\tunsortMap.entrySet());\n\n\t\t// 2. Sort list with Collections.sort(), provide a custom Comparator\n\t\t// Try switch the o1 o2 position for a different order\n\t\tCollections.sort(list, new Comparator<HashMap.Entry<String, Integer>>() {\n\t\t\tpublic int compare(HashMap.Entry<String, Integer> o1, HashMap.Entry<String, Integer> o2) {\n\t\t\t\treturn (o2.getValue()).compareTo(o1.getValue());\n\t\t\t}\n\t\t});\n\n\t\t// 3. Loop the sorted list and put it into a new insertion order Map\n\t\t// LinkedHashMap\n\t\tHashMap<String, Integer> sortedMap = new LinkedHashMap<String, Integer>();\n\t\tfor (HashMap.Entry<String, Integer> entry : list) {\n\t\t\tsortedMap.put(entry.getKey(), entry.getValue());\n\t\t}\n\n\t\t/*\n\t\t * //classic iterator example for (Iterator<Map.Entry<String, Integer>>\n\t\t * it = list.iterator(); it.hasNext(); ) { Map.Entry<String, Integer>\n\t\t * entry = it.next(); sortedMap.put(entry.getKey(), entry.getValue()); }\n\t\t */\n\n\t\treturn sortedMap;\n\t}", "public static < K, V extends Comparable<V>>\n Map< K, V>\n sortByValues(final Map< K, V> map) {\n Comparator< K> valueComparator\n = new Comparator< K>() {\n public int compare(K k1, K k2) {\n int compare\n = map.get(k1).compareTo(map.get(k2));\n if (compare == 0) {\n return 1;\n } else {\n return compare;\n }\n }\n };\n Map< K, V> sortedByValues\n = new TreeMap<K, V>(valueComparator);\n\n sortedByValues.putAll(map);\n return sortedByValues;\n }", "public static <K, V extends Comparable<V>> Map<K, V> sortByValues(final Map<K, V> map) {\r\n\r\n\t\tComparator<K> valueComparator = new Comparator<K>() {\r\n\t\t\tpublic int compare(K k1, K k2) {\r\n\t\t\t\tint compare = map.get(k1).compareTo(map.get(k2));\r\n\t\t\t\tif (compare == 0) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn compare;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tMap<K, V> sortedByValues = new TreeMap<K, V>(valueComparator);\r\n\t\tsortedByValues.putAll(map);\r\n\t\treturn sortedByValues;\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tSortByValue sbv = new SortByValue();\r\n\t\tsbv.setValueOnMap(12, \"Aarti\");\r\n\t\tsbv.setValueOnMap(15, \"Sonam\");\r\n\t\tsbv.setValueOnMap(17, \"Anita\");\r\n\t\tsbv.setValueOnMap(13, \"Premlata\");\r\n\t\tsbv.setValueOnMap(14, \"Komal\");\r\n\t\tsbv.setValueOnMap(20, \"Namita\");\r\n\t\tsbv.setValueOnMap(25, \"Babita\");\r\n\t\t\r\n\t\tMap<Integer, String> _map = sbv.getValueFromMap();\r\n\t\t/*Iterator<Map.Entry<Integer, String>> _it = _map.entrySet().iterator();\r\n\t\twhile(_it.hasNext()){\r\n\t\t\tMap.Entry<Integer, String> _map_value = _it.next();\r\n\t\t\tSystem.out.println(_map_value.getKey()+\"|\"+_map_value.getValue());\r\n\t\t}*/\r\n\t\t\r\n\t\tSet<Entry<Integer, String>> set = _map.entrySet();\r\n\t\tList<Entry<Integer, String>> list = new ArrayList<Entry<Integer, String>>(set);\r\n\t\tSystem.out.println(\"HashMap values Before sort:\");\r\n\t\tfor(Map.Entry<Integer, String> listBeforeSort : list){\r\n\t\t\tSystem.out.println(listBeforeSort.getKey()+\" | \"+listBeforeSort.getValue());\r\n\t\t}\r\n\t\t\r\n\t\tCollections.sort(list, new Comparator<Map.Entry<Integer, String>>(){\r\n\t\t\tpublic int compare(Map.Entry<Integer, String> value1, Map.Entry<Integer, String> value2){\r\n\t\t\t\treturn value1.getValue().compareTo(value2.getValue());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tSystem.out.println(\"HashMap values After sort:\");\r\n\t\tfor(Map.Entry<Integer, String> listBeforeSort : list){\r\n\t\t\tSystem.out.println(listBeforeSort.getKey()+\" | \"+listBeforeSort.getValue());\r\n\t\t}\r\n\t}", "private HashMap<String, Integer> sort(HashMap<String, Integer> hashMap) {\n List<HashMap.Entry<String, Integer>> list =\n new LinkedList<>(hashMap.entrySet());\n\n Comparator<HashMap.Entry<String, Integer>> compareByValue = Comparator.comparing(HashMap.Entry::getValue);\n Comparator<HashMap.Entry<String, Integer>> compareByKey = Comparator.comparing(HashMap.Entry::getKey);\n Comparator<HashMap.Entry<String, Integer>> compareByValueThenKey = compareByValue.thenComparing(compareByKey);\n Collections.sort(list, compareByValueThenKey);\n\n HashMap<String, Integer> tmp = new LinkedHashMap<>();\n for (HashMap.Entry<String, Integer> entry : list) {\n tmp.put(entry.getKey(), entry.getValue());\n }\n return tmp;\n }", "public static HashMap<String, Long> sortByValue(HashMap<String, Long> hm) \r\n { \r\n // Create a list from elements of HashMap \r\n List<Map.Entry<String, Long> > list = new LinkedList<Map.Entry<String, Long> >(hm.entrySet()); \r\n \r\n // Sort the list \r\n Collections.sort(list, new Comparator<Map.Entry<String, Long> >() { \r\n public int compare(Map.Entry<String, Long> o1, \r\n Map.Entry<String, Long> o2) \r\n { \r\n return (o1.getValue()).compareTo(o2.getValue()); \r\n } \r\n }); \r\n \r\n // put data from sorted list to hashmap \r\n HashMap<String, Long> temp = new LinkedHashMap<String, Long>(); \r\n for (Map.Entry<String, Long> aa : list) { \r\n temp.put(aa.getKey(), aa.getValue()); \r\n } \r\n return temp; \r\n }", "public HashMap<String, Integer> sortByValue(HashMap<String, Integer> hm){\n\t\tList<Map.Entry<String, Integer>> list = new LinkedList<Map.Entry<String, Integer>>(hm.entrySet());\n\t\t\n\t\t//sort the list\n\t\tCollections.sort(list, new Comparator<Map.Entry<String, Integer>>(){\n\t\t\tpublic int compare(Map.Entry<String, Integer> o1, \n\t\t\t\t\t\t\t\tMap.Entry<String, Integer> o2) {\n\t\t\t\treturn (o1.getValue().compareTo(o2.getValue()));\n\t\t\t}\n\t\t});\n\t\t\n\t\t//put data from sorted list to new hashmap\n\t\tHashMap<String, Integer> temp = new LinkedHashMap<String, Integer>();\n\t\tfor(Map.Entry<String, Integer> aa : list) {\n\t\t\ttemp.put(aa.getKey(), aa.getValue());\n\t\t}\n\t\treturn temp;\n\t}", "private static Map<String, Integer> sortByComparator(Map<String, Integer> unsortMap) {\n\t\tList<Map.Entry<String, Integer>> list = \n\t\t\tnew LinkedList<Map.Entry<String, Integer>>(unsortMap.entrySet());\n \n\t\t// Sort list with comparator, to compare the Map values\n\t\tComparator<Map.Entry<String, Integer>> comparator;\n\t\tcomparator=Collections.reverseOrder(new Comparator<Map.Entry<String, Integer>>() {\n\t\t\tpublic int compare(Map.Entry<String, Integer> o1,\n Map.Entry<String, Integer> o2) {\n\t\t\t\treturn (o1.getValue()).compareTo(o2.getValue());\n\t\t\t}\n\t\t});\n\t\tCollections.sort(list, comparator);\n \n\t\t// Convert sorted map back to a Map\n\t\tMap<String, Integer> sortedMap = new LinkedHashMap<String, Integer>();\n\t\tfor (Iterator<Map.Entry<String, Integer>> it = list.iterator(); it.hasNext();) {\n\t\t\tMap.Entry<String, Integer> entry = it.next();\n\t\t\tsortedMap.put(entry.getKey(), entry.getValue());\n\t\t}\n\t\treturn sortedMap;\n\t}", "public static HashMap<Integer, Integer> sortByValue(HashMap<Integer, Integer> hm) \n { \n // Create a list from elements of HashMap \n List<Map.Entry<Integer, Integer> > list = \n new LinkedList<Map.Entry<Integer, Integer> >(hm.entrySet()); \n \n // Sort the list \n Collections.sort(list, new Comparator<Map.Entry<Integer, Integer> >() { \n public int compare(Map.Entry<Integer, Integer> o1, \n Map.Entry<Integer, Integer> o2) \n { \n return (o1.getValue()).compareTo(o2.getValue()); \n } \n }); \n \n // put data from sorted list to hashmap \n HashMap<Integer, Integer> temp = new LinkedHashMap<Integer, Integer>(); \n for (Map.Entry<Integer, Integer> aa : list) { \n temp.put(aa.getKey(), aa.getValue()); \n } \n return temp; \n }", "public static HashMap<Integer, Integer> sortByValue(HashMap<Integer, Integer> hm) \n { \n // Create a list from elements of HashMap \n List<Map.Entry<Integer, Integer> > list = \n new LinkedList<Map.Entry<Integer, Integer> >(hm.entrySet()); \n \n // Sort the list \n Collections.sort(list, new Comparator<Map.Entry<Integer, Integer> >() { \n public int compare(Map.Entry<Integer, Integer> o1, \n Map.Entry<Integer, Integer> o2) \n { \n return (o1.getValue()).compareTo(o2.getValue()); \n } \n }); \n \n // put data from sorted list to hashmap \n HashMap<Integer, Integer> temp = new LinkedHashMap<Integer, Integer>(); \n for (Map.Entry<Integer, Integer> aa : list) { \n temp.put(aa.getKey(), aa.getValue()); \n } \n return temp; \n }", "static <K,V extends Comparable<? super V>> SortedSet<Map.Entry<K,V>> entriesSortedByValues(Map<K,V> map) {\n\t\t SortedSet<Map.Entry<K,V>> sortedEntries = new TreeSet<Map.Entry<K,V>>(\n\t\t new Comparator<Map.Entry<K,V>>() {\n\t\t @Override public int compare(Map.Entry<K,V> e1, Map.Entry<K,V> e2) {\n\t\t int res = e1.getValue().compareTo(e2.getValue());\n\t\t return res != 0 ? res : 1;\n\t\t }\n\t\t }\n\t\t );\n\t\t sortedEntries.addAll(map.entrySet());\n\t\t return sortedEntries;\n\t\t}", "public static HashMap<Integer, Double> sortByValue(HashMap<Integer, Double> hm) \n {\n List<Map.Entry<Integer, Double> > list = \n new LinkedList<Map.Entry<Integer, Double> >(hm.entrySet()); \n \n // Sort the list \n Collections.sort(list, new Comparator<Map.Entry<Integer, Double> >() { \n public int compare(Map.Entry<Integer, Double> o1, \n Map.Entry<Integer, Double> o2) \n { \n return (o2.getValue()).compareTo(o1.getValue()); \n } \n }); \n \n // put data from sorted list to hash map \n HashMap<Integer, Double> temp = new LinkedHashMap<Integer, Double>(); \n for (Map.Entry<Integer, Double> aa : list) { \n temp.put(aa.getKey(), aa.getValue()); \n } \n return temp; \n }", "private static Map<Long, Long> sortByComparatorGift(Map<Long, Long> unsortMap) {\n\t\tList<Map.Entry<Long, Long>> list = \n\t\t\tnew LinkedList<Map.Entry<Long, Long>>(unsortMap.entrySet());\n \n\t\t// Sort list with comparator, to compare the Map values\n\t\tComparator<Map.Entry<Long, Long>> comparator;\n\t\tcomparator = Collections.reverseOrder(new Comparator<Map.Entry<Long, Long>>() {\n\t\t\tpublic int compare(Map.Entry<Long, Long> o1,\n Map.Entry<Long, Long> o2) {\n\t\t\t\treturn (o1.getValue()).compareTo(o2.getValue());\n\t\t\t}\n\t\t});\n\t\tCollections.sort(list, comparator);\n \n\t\t// Convert sorted map back to a Map\n\t\tMap<Long, Long> sortedMap = new LinkedHashMap<Long, Long>();\n\t\tfor (Iterator<Map.Entry<Long, Long>> it = list.iterator(); it.hasNext();) {\n\t\t\tMap.Entry<Long, Long> entry = it.next();\n\t\t\tsortedMap.put(entry.getKey(), entry.getValue());\n\t\t}\n\t\treturn sortedMap;\n\t}", "public static LinkedHashMap<Integer, Double> sortHashMapByValues(\r\n \t\t\tSortedMap<Integer, Double> passedMap) {\r\n \t\tList<Integer> mapKeys = new ArrayList<Integer>(passedMap.keySet());\r\n \t\tList<Double> mapValues = new ArrayList<Double>(passedMap.values());\r\n \t\tCollections.sort(mapValues, Collections.reverseOrder());\r\n \t\tCollections.sort(mapKeys, Collections.reverseOrder());\r\n \r\n \t\tLinkedHashMap<Integer, Double> sortedMap = new LinkedHashMap<Integer, Double>();\r\n \r\n \t\tIterator<Double> valueIt = mapValues.iterator();\r\n \t\twhile (valueIt.hasNext()) {\r\n \t\t\tObject val = valueIt.next();\r\n \t\t\tIterator<Integer> keyIt = mapKeys.iterator();\r\n \r\n \t\t\twhile (keyIt.hasNext()) {\r\n \t\t\t\tObject key = keyIt.next();\r\n \t\t\t\tString comp1 = passedMap.get(key).toString();\r\n \t\t\t\tString comp2 = val.toString();\r\n \r\n \t\t\t\tif (comp1.equals(comp2)) {\r\n \t\t\t\t\tpassedMap.remove(key);\r\n \t\t\t\t\tmapKeys.remove(key);\r\n \t\t\t\t\tsortedMap.put((Integer) key, (Double) val);\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn (LinkedHashMap<Integer, Double>) sortedMap;\r\n \t}", "public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) {\r\n List<Entry<K, V>> list = new ArrayList<>(map.entrySet());\r\n list.sort(Entry.comparingByValue());\r\n\r\n Map<K, V> result = new LinkedHashMap<>();\r\n for (Entry<K, V> entry : list) {\r\n result.put(entry.getKey(), entry.getValue());\r\n }\r\n\r\n return result;\r\n }", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tprivate List<Entry> sortByValue(Map<Integer, Long> map) {\n\t List<Entry> list = new LinkedList<Entry>(map.entrySet());\n\t Collections.sort(list, new Comparator() {\n\t public int compare(Object o1, Object o2) {\n\t return ((Comparable) ((Map.Entry) (o1)).getValue())\n\t \t\t .compareTo(((Map.Entry) (o2)).getValue());\n\t }\n\t });\n\t return list;\n\t}", "public static Map<String, Double> sortHashMapVals(Map<String, Double> hm, final CompareUtilsEnum order) {\n\t\tList<Entry<String, Double>> list = new LinkedList<Entry<String, Double>>(hm.entrySet());\n\t\tCollections.sort(list, new Comparator<Entry<String, Double>>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Entry<String, Double> o1, Entry<String, Double> o2) {\n\t\t\t\tif (order == CompareUtilsEnum.INCREASING) {\n\t\t\t\t\treturn o1.getValue().compareTo(o2.getValue());\n\t\t\t\t} else {\n\t\t\t\t\treturn o2.getValue().compareTo(o1.getValue());\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\n\t\t// Maintaining insertion order with the help of LinkedList\n\t\tMap<String, Double> sortedMap = new LinkedHashMap<String, Double>();\n\t\tfor (Entry<String, Double> entry : list) {\n\t\t\tsortedMap.put(entry.getKey(), entry.getValue());\n\t\t}\n\n\t\treturn sortedMap;\n\t}", "public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) {\n List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());\n Collections.sort(list, (o1, o2) -> -(o1.getValue()).compareTo(o2.getValue()));\n\n Map<K, V> result = new LinkedHashMap<>();\n for (Map.Entry<K, V> entry : list) {\n result.put(entry.getKey(), entry.getValue());\n }\n return result;\n }", "public HashMap<String, Double> sortMap(HashMap<String, Double> unsortedVMap){\n List<Map.Entry<String, Double>> list = new LinkedList<Map.Entry<String, Double>>(unsortedVMap.entrySet());\n \n // Sort the list\n Collections.sort(list, new Comparator<Map.Entry<String, Double>>(){\n public int compare(Map.Entry<String, Double> o1, Map.Entry<String, Double> o2){\n return (o1.getValue()).compareTo(o2.getValue());\n }\n });\n \n // Putting data from sorted list to hashmap\n HashMap<String, Double> sortedVMap = new LinkedHashMap<String, Double>();\n for(Map.Entry<String, Double> aa : list){\n sortedVMap.put(aa.getKey(), aa.getValue());\n }\n \n return sortedVMap;\n }", "public static <K, V extends Comparable<? super V>> Map<K, V> \n sortByValue( Map<K, V> map )\n{\n\t LinkedList<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>( map.entrySet() );\n Collections.sort( list, new Comparator<Map.Entry<K, V>>()\n {\n public int compare( Map.Entry<K, V> o1, Map.Entry<K, V> o2 )\n {\n return (o1.getValue()).compareTo( o2.getValue() );\n }\n } );\n\n Map<K, V> result = new LinkedHashMap<K, V>();\n for (Map.Entry<K, V> entry : list)\n {\n result.put( entry.getKey(), entry.getValue() );\n }\n return result;\n}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\t\tprivate static HashMap<String, Integer> sortByValues(HashMap<String, Integer> map, boolean reverse) {\n\t\t\tList list = new LinkedList(map.entrySet());\n\t\t\t// Defined Custom Comparator here\n\t\t\tCollections.sort(list, new Comparator() {\n\t\t\t\tpublic int compare(Object o1, Object o2) {\n\t\t\t\t\treturn ((Comparable) ((Map.Entry) (o1)).getValue())\n\t\t\t\t\t\t\t.compareTo(((Map.Entry) (o2)).getValue());\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (reverse)\n\t\t\t\tCollections.reverse(list);\n\t\t\t// Here I am copying the sorted list in HashMap\n\t\t\t// using LinkedHashMap to preserve the insertion order\n\t\t\tHashMap sortedHashMap = new LinkedHashMap();\n\t\t\tfor (Iterator it = list.iterator(); it.hasNext();) {\n\t\t\t\tMap.Entry entry = (Map.Entry) it.next();\n\t\t\t\tsortedHashMap.put(entry.getKey(), entry.getValue());\n\t\t\t}\n\t\t\treturn sortedHashMap;\n\t\t}", "public static <K, V extends Comparable<? super V>> SortedSet<Map.Entry<K, V>> sortByValuesAscending(\n\t\t\tMap<K, V> map) {\n\t\tSortedSet<Map.Entry<K, V>> sortedEntries = new TreeSet<Map.Entry<K, V>>(\n\t\t\t\tnew Comparator<Map.Entry<K, V>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {\n\t\t\t\t\t\tint result = e1.getValue().compareTo(e2.getValue());\n\t\t\t\t\t\treturn result != 0 ? result : 1; // saves equal entries\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tsortedEntries.addAll(map.entrySet());\n\t\treturn sortedEntries;\n\t}", "public static <K extends Comparable, V extends Comparable> Map<K, V> sortByValue(Map<K, V> map) {\n List<Map.Entry<K,V>> preSort = new LinkedList<Map.Entry<K,V>>(map.entrySet());\n Collections.sort(preSort, new Comparator<Map.Entry<K,V>>() { \n @Override\n public int compare(Map.Entry<K,V> entry1, Map.Entry<K,V> entry2) {\n return entry1.getValue().compareTo(entry2.getValue());\n }\n });\n \n Map<K, V> sortedMap = new LinkedHashMap<K, V>();\n for (Map.Entry<K,V> entry: preSort) {\n \tsortedMap.put(entry.getKey(), entry.getValue());\n }\n return sortedMap;\n }", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tprivate List<Entry<String, Float>> sortByValue(Map map) {\n\t List<Entry<String, Float>> list = new LinkedList(map.entrySet());\n\t Collections.sort(list, new Comparator() {\n\t public int compare(Object o1, Object o2) {\n\t return -((Comparable) ((Map.Entry) (o1)).getValue())\n\t \t\t .compareTo(((Map.Entry) (o2)).getValue());\n\t }\n\t });\n\t return list;\n\t}", "public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) {\r\n\t\treturn map.entrySet().stream().sorted(Map.Entry.comparingByValue(Collections.reverseOrder()))\r\n\t\t\t\t.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));\r\n\t}", "private static <K, V extends Comparable<V>> Map<K, V> sortDescending(final Map<K, V> map) {\n\t\tComparator<K> valueComparator = new Comparator<K>() {\n\t\t\tpublic int compare(K k1, K k2) {\n\t\t\t\tint compare = map.get(k2).compareTo(map.get(k1));\n\t\t\t\tif (compare == 0) return 1;\n\t\t\t\telse return compare;\n\t\t\t}\n\t\t};\n\t\tMap<K, V> sortedByValues = new TreeMap<K, V>(valueComparator);\n\n\t\tsortedByValues.putAll(map);\n\n\t\treturn sortedByValues;\n\t}", "public static HashMap<String, Double> sortByValueAluno(HashMap<String, Double> hm)\n {\n List<Map.Entry<String, Double> > list =\n new LinkedList<>(hm.entrySet());\n\n // Sort the list\n list.sort(Map.Entry.comparingByValue());\n\n // put data from sorted list to hashmap\n HashMap<String, Double> temp = new LinkedHashMap<>();\n for (Map.Entry<String, Double> aa : list) {\n temp.put(aa.getKey(), aa.getValue());\n }\n return temp;\n }", "public static HashMap<String, Integer> sortByValue(HashMap<String, Integer> hm)\n {\n List<Map.Entry<String, Integer> > list =\n new LinkedList<Map.Entry<String, Integer> >(hm.entrySet());\n\n // Sort the list\n Collections.sort(list, new Comparator<Map.Entry<String, Integer> >() {\n public int compare(Map.Entry<String, Integer> o1,\n Map.Entry<String, Integer> o2)\n {\n return (o1.getValue()).compareTo(o2.getValue());\n }\n });\n\n HashMap<String, Integer> temp = new LinkedHashMap<String, Integer>();\n for (Map.Entry<String, Integer> aa : list) {\n temp.put(aa.getKey(), aa.getValue());\n }\n return temp;\n // put data from sorted list to hashmap\n\n }", "public static HashMap<String, Integer> sortByValue(HashMap<String, Integer> hm) {\n List<Map.Entry<String, Integer>> list =\n new LinkedList<Map.Entry<String, Integer>>(hm.entrySet());\n\n // Sort the list\n Collections.sort(list, new Comparator<Map.Entry<String, Integer>>() {\n public int compare(Map.Entry<String, Integer> o1,\n Map.Entry<String, Integer> o2) {\n return (o2.getValue()).compareTo(o1.getValue());\n }\n });\n\n // put data from sorted list to hashmap\n HashMap<String, Integer> temp = new LinkedHashMap<String, Integer>();\n for (Map.Entry<String, Integer> aa : list) {\n temp.put(aa.getKey(), aa.getValue());\n }\n return temp;\n }", "public static <K, V extends Comparable<V>>\n List<Map.Entry<K, V>> entriesSortedByValues(Map<K, V> map) {\n\n List<Map.Entry<K, V>> entryList = new ArrayList<>(map.entrySet());\n entryList.sort((e1, e2) -> e2.getValue().compareTo(e1.getValue()));\n\n return entryList;\n }", "public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) {\n\t\treturn map.entrySet().stream()\n\t\t\t\t.sorted(Map.Entry\n\t\t\t\t\t\t.comparingByValue(Comparator.reverseOrder()))\n\t\t\t\t.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));\n\t}", "public static LinkedHashMap<Integer, Integer> sortByValuesFromMap(\n\t\t\t\t\tMap<Integer, Integer> labelCountMap) {\n\t\t\t\t// long startTime = System.nanoTime();\n\t\t\t\tList<Integer> mapKeys = new ArrayList<Integer>(labelCountMap.keySet());\n\t\t\t\tList<Integer> mapValues = new ArrayList<Integer>(labelCountMap.values());\n\t\t\t\tCollections.sort(mapValues, new MyComparator());\n\n\t\t\t\tCollections.sort(mapKeys);\n\n\t\t\t\tLinkedHashMap<Integer, Integer> sortedMap = new LinkedHashMap<Integer, Integer>();\n\n\t\t\t\tIterator<Integer> valueIt = mapValues.iterator();\n\t\t\t\twhile (valueIt.hasNext()) {\n\t\t\t\t\tInteger val = (Integer) valueIt.next();\n\t\t\t\t\tIterator<Integer> keyIt = mapKeys.iterator();\n\n\t\t\t\t\twhile (keyIt.hasNext()) {\n\t\t\t\t\t\tInteger key = (Integer) keyIt.next();\n\t\t\t\t\t\tInteger val1 = labelCountMap.get(key);\n\t\t\t\t\t\tInteger val2 = val;\n\n\t\t\t\t\t\tif (val2.equals(val1)) {\n\t\t\t\t\t\t\tmapKeys.remove(key);\n\t\t\t\t\t\t\tsortedMap.put((Integer) key, (Integer) val);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t// long endTime = System.nanoTime();\n\t\t\t\t// System.out.println(\"The time taken to sort TF -IDF values is:\"+(endTime-startTime)/Math.pow(10,\n\t\t\t\t// 9));\n\t\t\t\treturn sortedMap;\n\t\t\t}", "public static void main(String[] args) {\n\t\tHashMap<String, String> hm = new HashMap<String, String>();\n\t\thm.put(\"1\", \"2\");\n\t\thm.put(\"0\", \"5\");\n\t\thm.put(\"890\", \"6\");\n\t\thm.put(\"90\", \"3\");\n\t\tArrayList<HashMap> a = new ArrayList<HashMap>();\n\t\t\ta.add(hm);;\t\n\t\tCollections.sort((java.util.List) a);\n\t\tSystem.out.println(hm.values());\n\t}", "public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map)\n\t{\n\t\tList<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>(map.entrySet());\n\t\tCollections.sort(list, new Comparator<Map.Entry<K, V>>()\n\t\t{\n\t\t\tpublic int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2)\n\t\t\t{\n\t\t\t\treturn (o1.getValue()).compareTo(o2.getValue());\n\t\t\t}\n\t\t});\n\t\t\n\t\tMap<K, V> result = new LinkedHashMap<K, V>();\n\t\tfor (Map.Entry<K, V> entry : list)\n\t\t{\n\t\t\tresult.put(entry.getKey(), entry.getValue());\n\t\t}\n\t\treturn result;\n\t}", "public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map) {\n List<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>(map.entrySet());\n\n Collections.sort(list, new Comparator<Map.Entry<K, V>>() {\n public int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2) {\n return (o1.getValue()).compareTo(o2.getValue());\n }\n });\n\n Map<K, V> result = new LinkedHashMap<K, V>();\n for (Map.Entry<K, V> entry : list) {\n result.put(entry.getKey(), entry.getValue());\n }\n return result;\n }", "public LinkedHashMap<Word, Integer> sortByValue() {\n\t\tList<Map.Entry<Word, Integer>> list = new ArrayList<>(result.entrySet());\n\t\tlist.sort(new ValueKeyComparator<Word,Integer>());\n\t\tLinkedHashMap<Word, Integer> sortedMap = new LinkedHashMap<>();\n \tlist.forEach(e -> sortedMap.put(e.getKey(), e.getValue()));\n return sortedMap;\n }", "public static HashMap<Integer, Double> sortByValue(HashMap<Integer, Double> hm)\n {\n // Create a list from elements of HashMap\n List<Map.Entry<Integer, Double> > list =\n new LinkedList<>(hm.entrySet());\n\n // Sort the list\n list.sort(Map.Entry.comparingByValue());\n\n // put data from sorted list to hashmap\n HashMap<Integer, Double> temp = new LinkedHashMap<>();\n for (Map.Entry<Integer, Double> aa : list) {\n temp.put(aa.getKey(), aa.getValue());\n }\n return temp;\n }", "public static <K, V extends Comparable<? super V>> Map<K, V> sortMapByValue(final Map<K, V> mapToSort) {\n List<Map.Entry<K, V>> entries = new ArrayList<Map.Entry<K, V>>(mapToSort.size());\n \n entries.addAll(mapToSort.entrySet());\n \n Collections.sort(entries, new Comparator<Map.Entry<K, V>>() {\n @Override\n public int compare(final Map.Entry<K, V> entry1, final Map.Entry<K, V> entry2) {\n return entry2.getValue().compareTo(entry1.getValue());\n }\n });\n \n Map<K, V> sortedMap = new LinkedHashMap<K, V>();\n int count = 0;\n for (Map.Entry<K, V> entry : entries) {\n sortedMap.put(entry.getKey(), entry.getValue());\n count ++;\n if (count == COUNT_LIMIT) break;\n }\n return sortedMap;\n }", "public void sortbykey(HashMap map1)\n {\n TreeMap<Integer, File> sorted = new TreeMap<>();\n\n // Copy all data from hashMap into TreeMap\n sorted.putAll(map1);\n\n // Display the TreeMap which is naturally sorted\n for (Map.Entry<Integer, File> entry : sorted.entrySet())\n System.out.println(\"Key = \" + entry.getKey() +\n \", Value = \" + entry.getValue());\n }", "public static void hashMapSort(HashMap input){\n Set keys = input.keySet();\n int i = keys.size();\n ArrayList<String> sortedkeys = new ArrayList<>(i);\n sortedkeys.addAll(keys);\n Collections.sort(sortedkeys);\n System.out.println(\"sortedkeys = \" + sortedkeys);\n for (String item : sortedkeys){\n System.out.printf(input +\"%nItem: %s | Quantity: \" + input.get(item)+\"%n\", item);\n }\n\n}", "public static void main(String[] args) {\n\t\t\r\n\t\tMap<Integer, Integer> map =new HashMap<>();\r\n\t\tmap.put(1, 8);\r\n\t\tmap.put(2, 2);\r\n\t\tmap.put(3, 9);\r\n\t\tmap.put(4, 2);\r\n\t\t\r\n\t\t\r\n\t\tSet<Entry<Integer, Integer>> ss = new HashSet<>(map.entrySet());\r\n\t\tList<Entry<Integer, Integer>> ll = new ArrayList<>(map.entrySet());\r\n\t\t\r\n\t\tfor(Map.Entry<Integer, Integer> map1: ll)\r\n\t\t{\r\n\t\t\tSystem.out.println(map1.getKey()+\" :: \"+map1.getValue());\r\n\t\t}\r\n\t\t\r\n\t\tCollections.sort(ll,new SortByValue());\r\n\t\tSystem.out.println(\"-------------------------------\");\r\n\t\t\r\n\t\tfor(Map.Entry<Integer, Integer> map1: ll)\r\n\t\t{\r\n\t\t\tSystem.out.println(map1.getKey()+\" :: \"+map1.getValue());\r\n\t\t}\r\n\r\n\t}", "public static ArrayList<Entry<String, Double>> sortValue(HashMap<String, Double> t_e_f2){\n\t ArrayList<Map.Entry<String, Double>> l = new ArrayList(t_e_f2.entrySet());\n\t Collections.sort(l, new Comparator<Map.Entry<String, Double>>(){\n\n\t public int compare(Map.Entry<String, Double> o1, Map.Entry<String, Double> o2) {\n\t return o1.getValue().compareTo(o2.getValue());\n\t }});\n\t Collections.reverse(l);\n//\t System.out.println(l);\n\t\t return l;\n\t}", "@Override\r\n\t\t\t\tpublic int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {\n\t\t\t\t\treturn (o2.getValue()).compareTo(o1.getValue());\r\n\t\t\t\t}", "public ArrayList<Integer> sortKeysByValue(HashMap<Integer, Double> hm) {\n List<Map.Entry<Integer, Double>> list = new LinkedList<Map.Entry<Integer, Double>>(hm.entrySet());\n\n Collections.sort(list, new Comparator<Map.Entry<Integer, Double>>() {\n @Override\n public int compare(Map.Entry<Integer, Double> o1, Map.Entry<Integer, Double> o2) {\n return (o2.getValue()).compareTo(o1.getValue());\n }\n });\n ArrayList<Integer> keys = new ArrayList<Integer>();\n for (Map.Entry<Integer, Double> i : list) {\n keys.add(i.getKey());\n }\n return keys;\n }", "private Map<String, Object> sortMap(Map<String, Object> map)\n {\n return new TreeMap<>(map);\n }", "public HashMap<String, Integer> sort(HashMap<String, Integer> num_opcode) {\r\n\t\tLinkedHashMap<String, Integer> sortedMap = new LinkedHashMap<>();\r\n\t\tnum_opcode.entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))\r\n\t\t\t\t.forEachOrdered(x -> sortedMap.put(x.getKey(), x.getValue()));\r\n\r\n\t\treturn sortedMap;\r\n\t}", "public static <K, V extends Comparable<? super V>> List<Entry<K, V>> getMapSortedByValue(Map<K, V> map) {\r\n\t\tfinal int size = map.size();\r\n\t\tfinal List<Map.Entry<K, V>> list = new ArrayList<Map.Entry<K, V>>(size);\r\n\t\tlist.addAll(map.entrySet());\r\n\t\tfinal ValueComparator<V> cmp = new ValueComparator<V>();\r\n\t\tCollections.sort(list, cmp);\r\n\t\treturn list;\r\n\t\t/*\r\n\t\tfinal List<K> keys = new ArrayList<K>(size);\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\t\t\tkeys.set(i, list.get(i).getKey());\r\n\t\t}\r\n\t\treturn keys;\r\n\t\t*/\r\n\t}", "public static <K, V extends Comparable<? super V>> SortedSet<Map.Entry<K, V>> sortByValuesDescending(\n\t\t\tMap<K, V> map) {\n\t\tSortedSet<Map.Entry<K, V>> sortedEntries = new TreeSet<Map.Entry<K, V>>(\n\t\t\t\tnew Comparator<Map.Entry<K, V>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic int compare(Map.Entry<K, V> e1, Map.Entry<K, V> e2) {\n\t\t\t\t\t\tint result = e2.getValue().compareTo(e1.getValue());\n\t\t\t\t\t\treturn result != 0 ? result : 1; // saves equal entries\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tsortedEntries.addAll(map.entrySet());\n\t\treturn sortedEntries;\n\t}", "Listof<Pairof<K, V>> sortedKeyVals();", "private Map<String, Integer> sortByValue(ConcurrentHashMap<String, Integer> popularJavaScriptLibrariesMap) {\n List<Map.Entry<String, Integer>> list =\n new LinkedList<>(popularJavaScriptLibrariesMap.entrySet());\n\n // Sort the list\n Collections.sort(list, (o1, o2) -> (o2.getValue()).compareTo(o1.getValue()));\n\n // put data from sorted list to hashmap\n HashMap<String, Integer> temp = new LinkedHashMap<>();\n for (Map.Entry<String, Integer> aa : list) {\n temp.put(aa.getKey(), aa.getValue());\n }\n return temp;\n }", "public static void sortbykey()\n {\n /* List<Integer> sortedKeys = new ArrayList<Integer>(map.keySet());\n Collections.sort(sortedKeys);\n\n for(int key : sortedKeys)\n {\n System.out.println(key +\" \"+map.get(key));\n }*/\n //OR\n\n /* Map<Integer,String> treeMap = new TreeMap<Integer, String>(map);\n\n for(Map.Entry<Integer,String> entry : treeMap.entrySet())\n {\n System.out.println(entry.getKey() +\" \"+entry.getValue());\n }\n*/\n //OR\n Map<Integer,String> treeMap1 = new TreeMap<>((Comparator<Integer>) (o1, o2) -> o1.compareTo(o2));\n\n treeMap1.putAll(map);\n for(Map.Entry<Integer,String> entry : treeMap1.entrySet())\n {\n System.out.println(entry.getKey() +\" \"+entry.getValue());\n }\n }", "public List<Entry<String, Double>> sort()\n\t{\n\t\tList<Entry<String, Double>> list = new ArrayList<Entry<String, Double>>();\n\t\tfor(Entry<String, Double> entry : map.entrySet())\n\t\t{\n\t\t\tlist.add(entry);\n\t\t}\n\n\t\tComparator<Entry<String, Double>> compare = new Comparator<Entry<String, Double>>() {\n\t @Override\n\t public int compare(Entry<String, Double> first, Entry<String, Double> second)\n\t {\n\t \tif (first.getValue() > second.getValue())\n\t \t{\n\t return -1;\n\t }\n\t if (first.getValue() < second.getValue())\n\t {\n\t return 1;\n\t }\n\t return 0;\n\t }\n\t };\n\n\t Collections.sort(list, compare);\n return list;\n\t}", "public static void main(String[] args) {\n\t\tMap<String,Integer> m = new HashMap<String, Integer>();\n\t\tm.put(\"ssid1\", 3);\n\t\tm.put(\"ssid2\", 5);\n\t\tm.put(\"ssid3\", 1);\n\t\tm.put(\"dd\", 10);\n\t\tm.put(\"aa\", 3);\n\t\tSystem.out.println(m);\n\t\tm = sortByValue(m, true);\n\t\tSystem.out.println(m);\n\n\t}", "private static void SortHash(HashMap<String,ArrayList<input>> hashMap,Distribution list)\n\t{\n\t\tCollections.sort(list.First, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Second, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Third, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fourth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fifth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.reverse(list.First);\n\t\tCollections.reverse(list.Second);\n\t\tCollections.reverse(list.Third);\n\t\tCollections.reverse(list.Fourth);\n\t\tCollections.reverse(list.Fifth);\n\t\tputInHashMap(hashMap,list);\n\t}", "private void sortEScores() {\n LinkedHashMap<String, Double> sorted = eScores\n .entrySet()\n .stream()\n .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))\n .collect(\n toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,\n LinkedHashMap::new));\n eScores = sorted;\n }", "public static HashMap<String, String> sortHashMapByComparator(HashMap<String, String> unsortMap) {\n\t\tList<HashMap.Entry<String, String>> list = \n\t\t\tnew LinkedList<HashMap.Entry<String, String>>(unsortMap.entrySet());\n\n\t\t// Sort list with comparator, to compare the Map values\n\t\tCollections.sort(list, new Comparator<HashMap.Entry<String, String>>() {\n\t\t\tpublic int compare(HashMap.Entry<String, String> o1,\n\t\t\t\t\tHashMap.Entry<String, String> o2) {\n\t\t\t\treturn o1.getKey().compareTo(o2.getKey());\n\t\t\t}\n\t\t});\n\n\t\t// Convert sorted map back to a Map\n\t\tHashMap<String, String> sortedMap = new LinkedHashMap<String, String>();\n\t\tfor (Iterator<HashMap.Entry<String, String>> it = list.iterator(); it.hasNext();) {\n\t\t\tHashMap.Entry<String, String> entry = it.next();\n\t\t\tsortedMap.put(entry.getKey(), entry.getValue());\n\t\t}\n\t\treturn sortedMap;\n\t}", "@Override\n\t\tpublic int compare(Object a, Object b) {\n\t\t\tif(hm.get(a)>hm.get(b))\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t\n\t\t}", "private LinkedHashMap sortByValue(LinkedHashMap<Product, Double> linkedHashMap, Comparator<Double> comparator) {\n List<Map.Entry<Product, Double>> entries = new ArrayList<>(linkedHashMap.entrySet());\n LinkedHashMap<Product, Double> sorted = new LinkedHashMap<>();\n entries.stream()\n .sorted(Comparator.comparing(Map.Entry::getValue, comparator))\n .forEachOrdered(entry -> sorted.put(entry.getKey(), entry.getValue()));\n\n return sorted;\n }", "public static LinkedList sortbykey(HashMap map) \n {\n TreeMap<String, Integer> sorted = new TreeMap<String, Integer>(); \n \n // Copy all data from hashMap into TreeMap \n sorted.putAll(map); \n \n LinkedList final_list = new LinkedList();\n // Display the TreeMap which is naturally sorted \n for (Entry<String, Integer> entry : sorted.entrySet()) {\n \tfinal_list.add(entry.getKey());\n //System.out.println(\"Key = \" + entry.getKey() + \n // \", Value = \" + entry.getValue()); \n }\n return final_list;\n }", "public HashMapValueComparator(Map<Object, Object> m){\n\t\tsuper();\n\t\tthis.map = m;\n\t}", "public static void sort(Map<String, Long> map){\n\t\t\n\t\t Set<Entry<String, Long>> entrySet = map.entrySet();\n\t\t ArrayList<Entry<String, Long>> arrayList = new ArrayList<>(entrySet);\n\t\t// Collections.sort(arrayList, Comparator.comparing(null).reversed().t\n\t\t \n\t\t \n\t\t\n\t\tSystem.out.println(arrayList);\n\t}", "public static Map sortByComparator(Map unsortMap) \n\t{\n\n\t\tList list = new LinkedList(unsortMap.entrySet());\n\n\t\t//sort list based on comparator\n\t\tCollections.sort(list, new Comparator() \n\t\t{\n public int compare(Object o1, Object o2) \n\t\t\t{\n\t\t\t\t// return ((Comparable) ((Map.Entry) (o1)).getValue()).compareTo(((Map.Entry) (o2)).getValue());\n\t\t\t\treturn ((Comparable) ((Map.Entry) (o1)).getKey()).compareTo(((Map.Entry) (o2)).getKey());\n\t\t\t}\n\t\t});\n\n //put sorted list into map again\n\t\tMap sortedMap = new LinkedHashMap();\n\t\tfor (Iterator it = list.iterator(); it.hasNext();) \n\t\t{\n\t\t\tMap.Entry entry = (Map.Entry)it.next();\n\t\t\tsortedMap.put(entry.getKey(), entry.getValue());\n\t\t}\n\t\t\n\t\treturn sortedMap;\n\t}", "public static Map sortByComparator(Map diffScalars) {\n\t\tList list = new LinkedList(diffScalars.entrySet());\n\t\tCollections.sort(list, new Comparator() {\n\t\t\tpublic int compare(Object o1, Object o2) {\n\t\t\t\treturn ((Comparable) ((Map.Entry) (o1)).getValue())\n\t\t\t\t\t\t.compareTo(((Map.Entry) (o2)).getValue());\n\t\t\t}\n\t\t});\n\n\t\t// put sorted list into map again\n\t\tMap sortedMap = new LinkedHashMap();\n\t\tfor (Iterator it = list.iterator(); it.hasNext();) {\n\t\t\tMap.Entry entry = (Map.Entry) it.next();\n\t\t\tsortedMap.put(entry.getKey(), entry.getValue());\n\t\t}\n\t\treturn sortedMap;\n\t}", "Map<String, Integer> sortByinlinks(Map<String, Integer> inlinks_sort){\n\tList<Map.Entry<String,Integer>> ranklist = new LinkedList<Map.Entry<String,Integer>>(inlinks_sort.entrySet());\n\tCollections.sort(ranklist, new Comparator<Map.Entry<String, Integer>>(){\n\t\tpublic int compare(Map.Entry<String,Integer> o1, Map.Entry<String,Integer> o2){\n\t\t\treturn o2.getValue().compareTo(o1.getValue() );\n\t\t}\n\t});\n\t\n\tMap<String, Integer> sortedRank = new LinkedHashMap<String,Integer>();\n\tfor(Map.Entry<String, Integer> rank : ranklist){\n\t\tsortedRank.put(rank.getKey(), rank.getValue());\t\t\t\n\t}\n\t\n\treturn sortedRank;\n\t}", "private static Map<String, Double> sortByComparator(Map<String, Double> unsortMap, final boolean order)\n {\n\n List<Entry<String, Double>> list = new LinkedList<Entry<String, Double>>(unsortMap.entrySet());\n\n // Sorting the list based on values\n Collections.sort(list, new Comparator<Entry<String, Double>>()\n {\n public int compare(Entry<String, Double> o1,\n Entry<String, Double> o2)\n {\n if (order)\n {\n return o1.getValue().compareTo(o2.getValue());\n }\n else\n {\n return o2.getValue().compareTo(o1.getValue());\n\n }\n }\n });\n\n int rank = 1;\n // Maintaining insertion order with the help of LinkedList\n Map<String, Double> sortedMap = new LinkedHashMap<String, Double>();\n for (Entry<String, Double> entry : list)\n {\n \tif(rank<=1000){\n \t\n \t\tsortedMap.put(entry.getKey() +\" \"+ String.valueOf(rank), entry.getValue());\n \t\trank++;\n \t}\n \telse break;\n }\n \n //Map<string, Double> updatedRank = new LinkedHashMap<String, Double>();\n\n return sortedMap;\n }", "public void dateHashMapSorted() {\n\t\t//array used to store the key values of the unsorted HashMap\n\t\tLocalDate[] unsortedArr = new LocalDate[SORTINGDATES_SIZE];\n\t\n\t\t//adding all the keys to unsortedArr\n\t\tint i = 0;\n\t\tfor (LocalDate key : map.keySet()) {\n\t\t\t\tunsortedArr[i++] = key;\n\t\t\t}\n\t\t\n\t\tfor (int currIndex = 1; currIndex < unsortedArr.length; currIndex++) {\n\t\t\tLocalDate date = unsortedArr[currIndex];\n\t\t\tint k = currIndex - 1;\n\t\t\t\t\n\t\t\t/*\n\t\t\t * while the index for the array stays above 0 and the element in the previous\n\t\t\t * index is greater than the element at the currentIndex\n\t\t\t */\n\t\t\twhile ((k >= 0) && (unsortedArr[k].isAfter(date))) {\n\t\t\t\t//shifting the elements to the right\n\t\t\t\tunsortedArr[k + 1] = unsortedArr[k];\n\t\t\t\t//decrement x to move the other elements over\n\t\t\t\tk--;\t\n\t\t\t}\n\t\t\tunsortedArr[k + 1] = date;\n\t\t}\n\n\t\tfor (i = 0; i < unsortedArr.length; ++i) {\n\t\t\tSystem.out.println(unsortedArr[i]);\n\t\t}\n\t}", "private static HashMap<Knight, Float> sortByY(HashMap<Knight, Float> hm) {\n List<Map.Entry<Knight, Float>> list =\n new LinkedList<Map.Entry<Knight, Float> >(hm.entrySet());\n\n // Sort the list\n Collections.sort(list, new Comparator<Map.Entry<Knight, Float> >() {\n public int compare(Map.Entry<Knight, Float> o1,\n Map.Entry<Knight, Float> o2)\n {\n return -1*(o1.getValue()).compareTo(o2.getValue());\n }\n });\n\n // put data from sorted list to hashmap\n HashMap<Knight, Float> temp = new LinkedHashMap<Knight, Float>();\n for (Map.Entry<Knight, Float> aa : list) {\n temp.put(aa.getKey(), aa.getValue());\n }\n return temp;\n }", "private LinkedHashMap<String, Integer> sort(LinkedHashMap<String, Integer> unsorted) {\n return unsorted.entrySet().stream()\n .sorted(Map.Entry.comparingByValue())\n .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (v1, v2) -> v1,\n LinkedHashMap::new));\n }", "private static final List<Fooable> sortFooables(\n \t\t\tMap<Fooable, Integer> fooPairs) {\n \t\t// Create a list of Map.Entries based on the input Map\n \t\tList<Map.Entry<Fooable, Integer>> pairList = new ArrayList<>();\n \t\tpairList.addAll(fooPairs.entrySet());\n \n \t\t// Sort the list of Map.Entries containing Fooables and Levenshtein\n \t\t// Distances\n \t\tCollections.sort(pairList,\n \t\t\t\tnew Comparator<Map.Entry<Fooable, Integer>>() {\n \t\t\t\t\t@Override\n \t\t\t\t\tpublic int compare(Entry<Fooable, Integer> o1,\n \t\t\t\t\t\t\tEntry<Fooable, Integer> o2) {\n \t\t\t\t\t\t// Initially sort by Levenshtein Distance\n \t\t\t\t\t\tif (o1.getValue() < o2.getValue())\n \t\t\t\t\t\t\treturn -1;\n \n \t\t\t\t\t\tif (o1.getValue() > o2.getValue())\n \t\t\t\t\t\t\treturn 1;\n \n \t\t\t\t\t\t// Fallback sorting on String comparison\n \t\t\t\t\t\treturn o1.getKey().getName()\n \t\t\t\t\t\t\t\t.compareToIgnoreCase(o2.getKey().getName());\n \t\t\t\t\t}\n \t\t\t\t});\n \n \t\t// Construct a sorted list of Fooables\n \t\tList<Fooable> sortedList = new ArrayList<>();\n \t\tfor (Map.Entry<Fooable, Integer> pair : pairList) {\n \t\t\tsortedList.add(pair.getKey());\n \t\t}\n \n \t\treturn sortedList;\n \t}", "public HashMapValueComparator() {\n\t\tsuper();\n\t}", "public static <K, V extends Comparable<? super V>> Map<K, V> sortDescendantByValue(Map<K, V> map)\n\t{\n\t\tList<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>(map.entrySet());\n\t\tCollections.sort(list, new Comparator<Map.Entry<K, V>>()\n\t\t{\n\t\t\tpublic int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2)\n\t\t\t{\n\t\t\t\treturn (o2.getValue()).compareTo(o1.getValue());\n\t\t\t}\n\t\t});\n\t\t\n\t\t/*\n\t\t * Stop here on 10/13/2019, Bing Li\n\t\t * \n\t\t * In some cases, the return value is expected to be concurrent collections to keep consistent management. But in others, the normal hash is expected for persistent. 10/12/2019, Bing Li\n\t\t * \n\t\t * The testing got problems at the option of 24.\n\t\t * \n\t\t */\n\t\t\n\t\tMap<K, V> result = new LinkedHashMap<K, V>();\n//\t\tMap<K, V> result = new ConcurrentHashMap<K, V>();\n\t\tfor (Map.Entry<K, V> entry : list)\n\t\t{\n\t\t\tresult.put(entry.getKey(), entry.getValue());\n\t\t}\n\t\treturn result;\n\t}", "public static <K, V extends Comparable<V>> Map<K, V> sortMapByValues(Map<K, V> inputMap, final SortOrder sortOrder) {\n\t\tArrayList<Entry<K, V>> entryList = new ArrayList<Entry<K, V>>(inputMap.entrySet());\n\t\tCollections.sort(entryList, new Comparator<Entry<K, V>>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Entry<K, V> entry1, Entry<K, V> entry2) {\n\t\t\t\treturn entry1.getValue().compareTo(entry2.getValue()) * sortOrder.modifier();\n\t\t\t}\n\n\t\t});\n\t\tMap<K, V> sortedMap = new LinkedHashMap<K, V>();\n\t\tfor (Entry<K, V> entry : entryList) {\n\t\t\tsortedMap.put(entry.getKey(), entry.getValue());\n\t\t}\n\t\treturn sortedMap;\n\t}", "public static <K, V extends Comparable<? super V>> Map<K, V> sortByValue(Map<K, V> map, double topCount)\n\t{\n\t\tList<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>(map.entrySet());\n\t\tCollections.sort(list, new Comparator<Map.Entry<K, V>>()\n\t\t{\n\t\t\tpublic int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2)\n\t\t\t{\n\t\t\t\treturn (o1.getValue()).compareTo(o2.getValue());\n\t\t\t}\n\t\t});\n\t\t\n\t\tMap<K, V> result = new LinkedHashMap<K, V>();\n\t\tfor (Map.Entry<K, V> entry : list)\n\t\t{\n\t\t\tresult.put(entry.getKey(), entry.getValue());\n\t\t\tif (result.size() >= topCount)\n\t\t\t{\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public int compare(Map.Entry<String,Integer> o1, Map.Entry<String,Integer> o2){\n return o1.getValue().compareTo(o2.getValue());\n }", "private ArrayList<String> sort(HashMap<String, Double> input){\n\n //initiate new array list from existing keys\n ArrayList<String> sortedCats = new ArrayList<>(input.keySet());\n\n //size of array list\n int n = sortedCats.size();\n\n //placeholder to replace category\n String temp;\n\n //bubble sort algorithm\n for(int i = 0; i < n; i++){\n for(int j = 1; j < (n-i); j++){\n if(input.get(sortedCats.get(j-1)) < input.get(sortedCats.get(j))){\n //swap elements\n temp = sortedCats.get(j-1);\n sortedCats.remove(j-1);\n sortedCats.add(j, temp);\n }\n }\n }\n return sortedCats;\n }", "public HashMap<String, Integer> getOrder(){\n\t\t\n\t\tHashMap<String, Integer> hm2 = getHashMap();\n\t\n\t\tArrayList fq = new ArrayList<>();\n\t\t\n\t\tHashMap<String, Integer> top10 = new HashMap<String, Integer>();\n\t\t\n\t\tfor(String key : hm2.keySet()){\n\t\t\t\n\t\t\tfq.add(hm2.get(key));\n\t\t}\n\t\t// use Collection to get the order of frequency\n\t\tCollections.sort(fq);\n \tCollections.reverse(fq);\n \t\n \tfor(int i = 0; i<11; i++){\n \t\t\n \t\tfor(String key : hm2.keySet()){\n \t\t// make sure the word not equals to balck space\n \t\tif(hm2.get(key) == fq.get(i) && !key.equals(\"\") ){\n \t\t\t\n \t\t top10.put(key, hm2.get(key));\n \t\t\t\t\n \t\t}\n \t}\t\n\t}\n\t\treturn top10;\n\t}", "public ValueComparator(Map map){\n\t\t\tthis.map = map;\n\t\t}", "SortComparator(Map<Integer, Integer> tFreqMap) { \n this.freqMap = tFreqMap; \n }", "@Override\n\t\t\tpublic int compare(Entry<String, Integer> o1, Entry<String, Integer> o2) {\n\t\t\t\treturn o2.getValue().compareTo(o1.getValue());\n\t\t\t}", "public static void main(String[] args) {\n LinkedHashMap<String, Integer> capitals = new LinkedHashMap<>();\n capitals.put(\"Nepal\", 2);\n capitals.put(\"India\", 100);\n capitals.put(\"United States\", 5);\n capitals.put(\"England\", 10);\n capitals.put(\"Australia\", 50);\n capitals.put(\"India\", 100);\n\n // call the sortMap() method to sort the map\n Map<String, Integer> result = sortMap(capitals);\n\n for (Map.Entry<String, Integer> entry : result.entrySet()) {\n System.out.print(\"Key: \" + entry.getKey());\n System.out.println(\" Value: \" + entry.getValue());\n }\n }", "@Override\n public int compare(Map.Entry<String, Integer> o1,\n Map.Entry<String, Integer> o2) {\n return o1.getValue()-o2.getValue();\n }", "public static HashMap<String, Float> sortedMap(HashMap<String, Float> unsorted) {\n\t\tList<Map.Entry<String, Float>> list = new ArrayList<Map.Entry<String, Float>>(unsorted.entrySet());\n\t\tCollections.sort(list, new Comparator<Map.Entry<String, Float>>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Entry<String, Float> o1, Entry<String, Float> o2) {\n\t\t\t\tfloat val1 = o1.getValue();\n\t\t\t\tfloat val2 = o2.getValue();\t\t\n\t\t\t\tif (val1 > val2) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (val1 < val2) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tHashMap<String, Float> sortedMap = new LinkedHashMap<String, Float>();\n\t\tfor (Iterator<Entry<String, Float>> it = list.iterator(); it.hasNext();) {\n\t\t\tMap.Entry<String, Float> entry = (Entry<String, Float>) it.next();\n\t\t\tsortedMap.put(entry.getKey(), entry.getValue());\n\t\t}\n\t\treturn sortedMap;\n\t}", "@Override\r\n\tpublic int compare(Entry<Integer, Integer> o1, Entry<Integer, Integer> o2) {\n\t\treturn o2.getValue().compareTo(o1.getValue());\r\n\t}", "public static HashMap<String, Double> sortByValue(HashMap<String, Double> rankedDocs)\n {\n // Creates a list from the elements of the HashMap\n List<Map.Entry<String, Double> > list =\n new LinkedList<Map.Entry<String, Double> >(rankedDocs.entrySet());\n\n // Sorts the list\n Collections.sort(list, new Comparator<Map.Entry<String, Double> >() {\n public int compare(Map.Entry<String, Double> o1,\n Map.Entry<String, Double> o2)\n {\n return (o2.getValue()).compareTo(o1.getValue());\n }\n });\n\n // puts the data from the sorted list into the HashMap\n HashMap<String, Double> temp = new LinkedHashMap<String, Double>();\n for (Map.Entry<String, Double> aa : list) {\n temp.put(aa.getKey(), aa.getValue());\n }\n return temp;\n }", "@SuppressWarnings(\"ComparatorMethodParameterNotUsed\")\n @Override\n public int compare(Map.Entry<Integer, Integer> entry1, Map.Entry<Integer, Integer> entry2) {\n return entry2.getValue() > entry1.getValue() ? 1 : -1;\n }", "public void dateHashMapSortedDescending() {\n\t\t//array used to store the key values of the unsorted HashMap\n\t\tLocalDate[] unsortedArr = new LocalDate[SORTINGDATES_SIZE];\n\t\t\t\n\t\t//adding all the keys to unsortedArr\n\t\tint i = 0;\n\t\tfor (LocalDate key : map.keySet()) {\n\t\t\tunsortedArr[i++] = key;\n\t\t}\n\t\t\t\t\n\t\tfor (int currIndex = 1; currIndex < unsortedArr.length; currIndex++) {\n\t\t\tLocalDate date = unsortedArr[currIndex];\n\t\t\tint k = currIndex - 1;\n\t\t\t\t\t\t\n\t\t\t/*\n\t\t\t* while the index for the array stays above 0 and the element in the previous\n\t\t\t* index is greater than the element at the currentIndex\n\t\t\t*/\n\t\t\twhile ((k >= 0) && (unsortedArr[k].isBefore(date))) {\n\t\t\t\t//shifting the elements to the right\n\t\t\t\tunsortedArr[k + 1] = unsortedArr[k];\n\t\t\t\t//decrement x to move the other elements over\n\t\t\t\tk--;\t\n\t\t\t}\n\t\t\tunsortedArr[k + 1] = date;\n\t\t}\n\n\t\tfor (i = 0; i < unsortedArr.length; ++i) {\n\t\t\tSystem.out.println(unsortedArr[i]);\n\t\t}\n\t}", "Listof<V> sortedVals();", "public int compare(Map.Entry<String, Integer> o1,\n Map.Entry<String, Integer> o2) {\n return o1.getValue().compareTo(o2.getValue());\n }", "@Override\n \t\t\t\t\tpublic int compare(Entry<Fooable, Integer> o1,\n \t\t\t\t\t\t\tEntry<Fooable, Integer> o2) {\n \t\t\t\t\t\tif (o1.getValue() < o2.getValue())\n \t\t\t\t\t\t\treturn -1;\n \n \t\t\t\t\t\tif (o1.getValue() > o2.getValue())\n \t\t\t\t\t\t\treturn 1;\n \n \t\t\t\t\t\t// Fallback sorting on String comparison\n \t\t\t\t\t\treturn o1.getKey().getName()\n \t\t\t\t\t\t\t\t.compareToIgnoreCase(o2.getKey().getName());\n \t\t\t\t\t}", "public static void iSort(int[]keys, double[] values){\n for(int j = 0;j<keys.length;j++){\n int k = keys[j];\n double v = values[j];\n int i = j - 1;\n while((i>=0)&&(values[i]>v)){\n keys[i+1] = keys[i];\n values[i+1] = values[i];\n i--;\n }\n keys[i+1] = k;\n values[i+1] = v;\n }\n }", "@Override\r\n\tpublic int compare(Map.Entry<Integer, Integer> o1,\r\n\t\t\tMap.Entry<Integer, Integer> o2) {\n\t\treturn o2.getValue() - o1.getValue();\r\n\t}", "public Map<Integer, Integer> getAllSortedCommittedValues() {\n\n LinkedHashMap<Integer, Integer> sortedMap = new LinkedHashMap<>();\n variables.entrySet()\n .stream()\n .sorted(Map.Entry.comparingByKey())\n .forEachOrdered(x -> sortedMap.put(x.getKey(), x.getValue().getKey()));\n\n return sortedMap;\n }" ]
[ "0.77224314", "0.75962603", "0.74931103", "0.7470882", "0.74581534", "0.7443384", "0.74374795", "0.7428125", "0.7337419", "0.72233593", "0.71969616", "0.71769255", "0.71038854", "0.7048397", "0.7021415", "0.70093155", "0.7003645", "0.7003645", "0.7002201", "0.6980485", "0.6971198", "0.69566697", "0.69433933", "0.6908915", "0.6888125", "0.68766165", "0.6844165", "0.6841038", "0.6830245", "0.68260866", "0.6825879", "0.6800874", "0.6790709", "0.6780517", "0.67719764", "0.6745018", "0.6723374", "0.6706054", "0.66890645", "0.6684815", "0.6675021", "0.66577524", "0.66524667", "0.6649581", "0.66214585", "0.6582043", "0.65664977", "0.6544906", "0.654026", "0.6539197", "0.653618", "0.65288085", "0.6521893", "0.65108275", "0.6503423", "0.6443113", "0.6438427", "0.6404734", "0.63939255", "0.6383062", "0.638023", "0.6363392", "0.636023", "0.63354063", "0.6321887", "0.6309397", "0.6305523", "0.63014215", "0.6297483", "0.6289252", "0.6279127", "0.6274244", "0.62574196", "0.6253319", "0.6248528", "0.6234836", "0.6223458", "0.62216884", "0.6204987", "0.6204108", "0.6172179", "0.61289966", "0.6107136", "0.60948557", "0.60927963", "0.60868204", "0.608645", "0.60842055", "0.6073688", "0.6054882", "0.6048065", "0.6023692", "0.6013153", "0.6009871", "0.60049856", "0.5953663", "0.595223", "0.5947895", "0.5939056", "0.5937226" ]
0.74015075
8
method to get exception string with class & method name
public String getExceptionString(Exception e) { StringBuffer sb = new StringBuffer(); int icount = 0; try { sb.append("Exception : "); for (int i = e.getStackTrace().length - 1; i >= 0; i--) { sb.append(e.getStackTrace()[i].getClassName()); sb.append("."); sb.append(e.getStackTrace()[i].getMethodName()); sb.append(" at Line "); sb.append(e.getStackTrace()[i].getLineNumber()); sb.append(" : "); } sb.append(e.getMessage().toUpperCase().replaceAll("JAVA.LANG.", "")); return sb.toString(); } catch (Exception e1) { return (e.toString() + " : " + e1.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getException();", "String getException();", "String getCauseException();", "@Override\r\n\tpublic String toString() {\n\t\treturn \"Exception is..\" + msg;\r\n\t}", "@Override\r\n\tpublic String toString() {\n\t\treturn \"com.cg.Exercise4Exception\"+super.getMessage();\r\n\t}", "public String toString ()\n {\n if (exception != null) {\n return exception.toString();\n } else {\n return super.toString();\n }\n }", "String getOnException(OnException onException);", "@Override\n protected String handleGetExceptionKey()\n {\n\n final String type = this.getExceptionType();\n final int dotIndex = type.lastIndexOf(\".\");\n\n // the dot may not be the last character\n return StringUtilsHelper.toResourceMessageKey((dotIndex < (type.length() - 1)) ? type.substring(dotIndex + 1) : type);\n\n }", "public static String exceptionTypeAndMsg(Exception e) {\n return e.getClass() + \" : \" + e.getMessage();\n }", "java.lang.String getExceptions(int index);", "public static String getCurrentMethodName() {\n Exception e = new Exception();\n StackTraceElement trace = e.fillInStackTrace().getStackTrace()[1];\n String name = trace.getMethodName();\n String className = trace.getClassName();\n int line = trace.getLineNumber();\n return \"[CLASS:\" + className + \" - METHOD:\" + name + \" LINE:\" + line + \"]\";\n }", "private String getStackTrace(Exception ex) {\r\n\t\tStringWriter sw = new StringWriter();\r\n\t\tex.printStackTrace(new PrintWriter(sw));\r\n return sw.toString();\r\n\t}", "String getInvalidMessage();", "public static String getStackTrace() {\n Exception e = new Exception();\n return getStackTrace(e);\n }", "String errorMessage();", "public static String getStackTraceAsString(Exception ex)\n {\n StringWriter errors = new StringWriter();\n ex.printStackTrace(new PrintWriter(errors));\n return errors.toString();\n }", "String getLogStackTrace();", "String getOnExceptionEnd();", "String exceptionToStackTrace( Exception e ) {\n StringWriter stringWriter = new StringWriter();\n PrintWriter printWriter = new PrintWriter(stringWriter);\n e.printStackTrace( printWriter );\n return stringWriter.toString();\n }", "java.lang.String getError();", "java.lang.String getError();", "java.lang.String getError();", "protected abstract String defaultExceptionMessage(TransactionCommand transactionCommand);", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "String getLogRetryStackTrace();", "public static String getExceptionInfo(Exception exception)\n {\n return String.format(\"%s ; %s\", exception.toString(), exception.getStackTrace()[0].toString());\n }", "String getMessage();", "String getMessage();", "String getMessage();", "java.lang.String getErr();", "private String appendExtendedExceptionMsg(String msg, SQLException sqle){\r\n final String GETSQLCA =\"getSqlca\";\r\n String exceptionMsg = new String();\r\n try {\r\n Method sqlcaM2 = sqle.getNextException().getClass()\r\n .getMethod(GETSQLCA,null);\r\n Object sqlca = sqlcaM2.invoke(sqle.getNextException(),\r\n new Object[] {});\r\n Method getSqlErrpMethd = sqlca.getClass().\r\n getMethod(\"getSqlErrp\", null);\r\n Method getSqlWarnMethd = sqlca.getClass().\r\n getMethod(\"getSqlWarn\", null);\r\n Method getSqlErrdMethd = sqlca.getClass().\r\n getMethod(\"getSqlErrd\", null);\r\n exceptionMsg = exceptionMsg.concat( \"SQLCA OUTPUT\" + \r\n \"[Errp=\" +getSqlErrpMethd.invoke(sqlca,new Object[]{})\r\n + \", Errd=\" + Arrays.toString((int[])\r\n (getSqlErrdMethd.invoke(sqlca, new Object[]{}))));\r\n String Warn = new String((char[])getSqlWarnMethd.\r\n invoke(sqlca, new Object[]{}));\r\n if(Warn.trim().length() != 0)\r\n exceptionMsg = exceptionMsg.concat(\", Warn=\" +Warn + \"]\" ); \r\n else\r\n exceptionMsg = exceptionMsg.concat( \"]\" ); \r\n msg = msg.concat(exceptionMsg);\r\n return msg;\r\n } catch (Throwable t) {\r\n return sqle.getMessage();\r\n }\r\n }", "public static String getStackTrace(final Exception ex)\n\t{\n\t\tfinal StringWriter sw = new StringWriter();\n\t\tfinal PrintWriter pw = new PrintWriter(sw, true);\n\t\tex.printStackTrace(pw);\n\t\tpw.flush();\n\t\tsw.flush();\n\t\treturn sw.toString();\n\t}", "public abstract RuntimeException getException(String message);", "@Override public String toString(){\n return \"Logic Parameter Exception\";\n }", "public String getThrowInfo() {\n if (null == throwable) {\n return throwText;\n }\n // return from throwable;\n StringBuffer sb = new StringBuffer();\n StackTraceElement[] stackArray = throwable.getStackTrace();\n for (int i = 0; i < stackArray.length; ++i) {\n StackTraceElement element = stackArray[i];\n sb.append(element.toString() + \"\\n\");\n }\n return sb.toString();\n }", "java.lang.String getErrmsg();", "protected String getCause(Exception e) throws RuntimeException {\n\t\tString className = \"\";\n\t\tObject theClass = null;\n\t\tString errorCode;\n\t\tString msg = \"error.general.sistema\";\n\n\t\t// Establecemos la Excepcion que se ha producido\n\t\tif (e.getCause() != null) {\n\t\t\tclassName = e.getCause().getClass().getName();\n\t\t\ttheClass = e.getCause();\n\t\t\tif (className.equals(\"java.rmi.RemoteException\")) {\n\t\t\t\tif (e.getCause().getCause() != null) {\n\t\t\t\t\tclassName = e.getCause().getCause().getClass().getName();\n\t\t\t\t\ttheClass = e.getCause().getCause();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (theClass instanceof JDBCException) {\n\t\t\tif (((org.hibernate.JDBCException) theClass).getSQLException()\n\t\t\t\t\t.getNextException() != null) {\n\t\t\t\terrorCode = ((org.hibernate.JDBCException) theClass)\n\t\t\t\t\t\t.getSQLException().getNextException().getSQLState();\n\t\t\t} else {\n\t\t\t\terrorCode = ((org.hibernate.JDBCException) theClass)\n\t\t\t\t\t\t.getSQLException().getSQLState();\n\t\t\t}\n\t\t} else {\n\t\t\terrorCode = \"\";\n\t\t}\n\n\t\t// Obtenemos el codigo de error\n\n\t\t// Establecemos el mensaje de error en funcion la Excepcion que hemos\n\t\t// propagado\n\t\tif (!className.equals(\"\")) {\n\t\t\tif (className.equals(\"org.hibernate.StaleObjectStateException\")) {\n\t\t\t\tmsg = \"error.message.modify\";\n\t\t\t} else if (className.equals(\"org.hibernate.ObjectDeletedException\")) {\n\t\t\t\tmsg = \"error.message.delete\";\n\t\t\t} else if (className\n\t\t\t\t\t.equals(\"org.hibernate.ObjectNotFoundException\")) {\n\t\t\t\tmsg = \"error.message.notFound\";\n\t\t\t} else if (className.equals(\"org.hibernate.QueryException\")) {\n\t\t\t\tmsg = \"error.message.query\";\n\t\t\t} else if (className\n\t\t\t\t\t.equals(\"org.hibernate.NonUniqueObjectException\")) {\n\t\t\t\tmsg = \"error.message.nonUniqueObject\";\n\t\t\t} else if (className\n\t\t\t\t\t.equals(\"org.hibernate.NonUniqueResultException\")) {\n\t\t\t\tmsg = \"error.message.nonUniqueResult\";\n\t\t\t} else if (className\n\t\t\t\t\t.equals(\"org.hibernate.PropertyNotFoundException\")) {\n\t\t\t\tmsg = \"error.message.propertyNotFound\";\n\t\t\t} else if (className.equals(\"org.hibernate.PropertyValueException\")) {\n\t\t\t\tmsg = \"error.message.propertyValue\";\n\t\t\t} else if (className\n\t\t\t\t\t.equals(\"org.hibernate.QueryParameterException\")) {\n\t\t\t\tmsg = \"error.message.queryParameter\";\n\t\t\t} else if (className.equals(\"org.hibernate.WrongClassException\")) {\n\t\t\t\tmsg = \"error.message.wrongClass\";\n\t\t\t} else if (className\n\t\t\t\t\t.equals(\"org.hibernate.LazyInitializationException\")) {\n\t\t\t\tmsg = \"error.message.lazyInitialization\";\n\t\t\t} else if (className\n\t\t\t\t\t.equals(\"org.hibernate.exception.ConstraintViolationException\")) {\n\t\t\t\tif (errorCode.equalsIgnoreCase(UNIQUE_VIOLATION_CODE)) {\n\t\t\t\t\tmsg = \"error.message.constraintViolationUnique\";\n\t\t\t\t} else if (errorCode.equalsIgnoreCase(DELETE_VIOLATION_CODE)) {\n\t\t\t\t\tmsg = \"error.message.constraintViolationDelete\";\n\t\t\t\t}\n\t\t\t} else if (className\n\t\t\t\t\t.equals(\"org.hibernate.exception.JDBCConnectionException\")) {\n\t\t\t\tmsg = \"error.message.JDBCConection\";\n\t\t\t} else if (className\n\t\t\t\t\t.equals(\"org.hibernate.exception.SQLGrammarException\")) {\n\t\t\t\tmsg = \"error.message.SQLGrammar\";\n\t\t\t} else if (className\n\t\t\t\t\t.equals(\"org.hibernate.hql.ast.QuerySyntaxException\")) {\n\t\t\t\tmsg = \"error.message.malformedQuery\";\n\t\t\t} else if (className.equals(\"java.sql.BatchUpdateException\")) {\n\t\t\t\tmsg = \"error.message.metodoTransaccional\";\n\t\t\t} else {\n\t\t\t\tmsg = \"error.general.sistema\";\n\t\t\t}\n\t\t} else {\n\t\t\tmsg = \"error.general.sistema\";\n\t\t}\n\t\treturn msg;\n\t}", "public String getMostRecentException();", "private static String callMethodAndLine() {\n\t\tStackTraceElement thisMethodStack = (new Exception()).getStackTrace()[4];\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb\n.append(AT)\n\t\t\t\t.append(thisMethodStack.getClassName() + \".\")\n\t\t\t\t.append(thisMethodStack.getMethodName())\n\t\t\t\t.append(\"(\" + thisMethodStack.getFileName())\n\t\t\t\t.append(\":\" + thisMethodStack.getLineNumber() + \") \");\n\t\treturn sb.toString();\n\t}", "String getErrorMessage(E input);", "private String stackTraceToString( Throwable t ){\n StringWriter writer = new StringWriter();\n PrintWriter printWriter = new PrintWriter( writer );\n t.printStackTrace( printWriter );\n printWriter.flush();\n return writer.toString();\n }", "public String getExceptionType() {\n return this.excType;\n }", "public java.lang.String getException() {\n return exception;\n }", "static public String getStackTrace(Exception e) {\n java.io.StringWriter s = new java.io.StringWriter(); \n e.printStackTrace(new java.io.PrintWriter(s));\n String trace = s.toString();\n \n if(trace==null || trace.length()==0 || trace.equals(\"null\"))\n return e.toString();\n else\n return trace;\n }", "static String handleStackTrace(Throwable ex){\n // add the stack trace message\n StringBuilder builder = new StringBuilder(SPACE);\n builder.append(ex.getMessage());\n builder.append(NEWLINE);\n\n // add each line of the stack trace.\n for (StackTraceElement element : ex.getStackTrace()){\n builder.append(SPACE);\n builder.append(element.toString());\n builder.append(NEWLINE);\n }\n return builder.toString();\n }", "public static String getStackMessage(Throwable exception) {\n\t\tStringWriter sw = new StringWriter();\n\t\tPrintWriter pw = new PrintWriter(sw);\n\t\tpw.print(\" [ \");\n\t\tpw.print(exception.getClass().getName());\n\t\tpw.print(\" ] \");\n\t\texception.printStackTrace(pw);\n\t\treturn sw.toString();\n\t}", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "public String toString()\n {\n StringBuffer buf = new StringBuffer(\"EASInBandExceptionDescriptor\");\n buf.append(\": rfChannel=\").append(this.exception_RF_channel & 0xFF);\n buf.append(\"; qamFrequency=\").append(this.m_exceptionFrequency / 1000000);\n buf.append(\"; programNumber=0x\").append(Integer.toHexString(this.exception_program_number));\n return buf.toString();\n }", "private static String resolveThrowsName(Element el, String fqn, ExpressionTree throwTree) {\n boolean nestedClass = ElementKind.CLASS == el.getKind()\n && NestingKind.TOP_LEVEL != ((TypeElement) el).getNestingKind();\n String insertName = nestedClass ? fqn : throwTree.toString();\n return insertName;\n }", "private void writeExceptions(Method m) {\n Class<?>[] exceptions = m.getExceptionTypes();\n int size = exceptions.length;\n if (exceptions.length == 0)\n return;\n writer.print(\"throws \");\n for (int i = 0; i < size; i++) {\n writer.print(exceptions[i].getCanonicalName());\n if (i != size - 1)\n writer.print(\", \");\n }\n writer.print(\" \");\n }", "static String getExtendedThrowableMessage(Throwable throwable) {\n StringBuilder messageBuilder = new StringBuilder();\n if (throwable == null) {\n return \"\";\n }\n messageBuilder.append(throwable.getClass().getName()).append(\": \");\n messageBuilder.append(throwable.getMessage());\n Throwable cause = throwable.getCause();\n while (cause != null) {\n if (!isDelimiter(messageBuilder.charAt(messageBuilder.length()-1))) {\n messageBuilder.append(\".\");\n }\n messageBuilder.append(\" Caused by \")\n .append(cause.getClass().getName())\n .append(\": \")\n .append(cause.getMessage());\n cause = cause.getCause();\n }\n return messageBuilder.toString();\n }", "public interface ExceptionContext {\n\n String DEFUALT_EX_MSG =\"网络异常\";//默认异常信息\n\n String DEFUALT_EX_CODE =\"500\";//默认异常状态码\n\n String UNKNOW_EX_MSG =\"未知异常\";//未知异常信息\n\n}", "public String getMessage();", "public String getMessage();", "public String getMessage();", "public String getMessage();", "public String getMessage();", "public String getMessage();", "public String getMessage();", "String getGetErrorMessage();", "public String toString() {\n return (\"AgentException occurred with cause: \" + cause);\n }", "private String getStacktraceFromException(Exception e) {\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\t\tPrintStream ps = new PrintStream(baos);\n\t\te.printStackTrace(ps);\n\t\tps.close();\n\t\treturn baos.toString();\n\t}", "public static String getStackTraceAsString(Throwable t) {\n Writer result = new StringWriter();\n PrintWriter printWriter = new PrintWriter(result);\n t.printStackTrace(printWriter);\n return result.toString();\n }", "private static String getCallingMethodInfo()\r\n\t{\r\n\t\tThrowable fakeException = new Throwable();\r\n\t\tStackTraceElement[] stackTrace = fakeException.getStackTrace();\r\n\r\n\t\tif (stackTrace != null && stackTrace.length >= 2)\r\n\t\t{\r\n\t\t\tStackTraceElement s = stackTrace[2];\r\n\t\t\tif (s != null)\r\n\t\t\t{\r\n\t\t\t\treturn s.getFileName() + \"(\" + s.getMethodName() + \":\" + s.getLineNumber() + \"):\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "public static String getStackTrace( Throwable exception ) {\r\n\t\tStringWriter sw = new StringWriter();\r\n\t\tPrintWriter pw = new PrintWriter( sw );\r\n\t\texception.printStackTrace( pw );\r\n\t\treturn sw.toString();\r\n\t}", "public String getExtendedStackTrace() {\n return getExtendedStackTrace(null);\n }", "String getErrorMessage();", "String getErrorMessage();", "public interface ExceptionMessager {\n\n /**\n * Gets the error code (message properties).\n *\n * @return the error code\n */\n public String getErrorCode();\n\n /**\n * Gets the values for value substitute\n *\n * @return the values\n */\n public Object[] getValues();\n}", "String activity_name () throws BaseException;", "String failureReason();", "String message() {\n if (arguments == null || arguments.length == 0) return message; // most case, message is from exception, and without no arguments\n\n var builder = new StringBuilder(256);\n LogManager.FILTER.append(builder, message, arguments);\n return builder.toString();\n }", "String getErrorsString();", "public abstract String getMessage();", "public java.lang.CharSequence getException() {\n return Exception;\n }", "public static String getStackTrace(Exception aInException) {\n\n StringWriter lStringWriter = new StringWriter();\n aInException.printStackTrace(new PrintWriter(lStringWriter));\n return lStringWriter.toString();\n\n }", "public static String getErrorMessage(Exception ex) {\r\n if (ex.getCause() != null) {\r\n return \"cause:\" + ex.getCause().getMessage();\r\n } else {\r\n return ex.getMessage();\r\n }\r\n }", "public String getExceptioninfo() {\n return exceptioninfo;\n }", "public String resource_name () throws BaseException {\n throw new BaseException(\"Not implemented\");\n }", "private String errorMessage() {\n\n StringBuilder strBuilder = new StringBuilder();\n strBuilder.append(eventBasedXorGatewayNode + \" => eventBasedXorGatewayNode \\n\");\n strBuilder.append(intermediateEvent1Node + \" => intermediateEvent1Node \\n\");\n strBuilder.append(intermediateEvent2Node + \" => intermediateEvent2Node \\n\");\n strBuilder.append(endNode1 + \" => endNode1 \\n\");\n strBuilder.append(endNode2 + \" => endNode2 \\n\");\n\n return strBuilder.toString();\n }", "public String getExceptionMessage(Exception e)\n {\n String s = e.getMessage();\n\n return (s == null) ? \"\" : \": \" + s;\n }" ]
[ "0.8019808", "0.8019808", "0.733962", "0.6920058", "0.66937345", "0.65841025", "0.656692", "0.65313786", "0.64800435", "0.6463635", "0.64245015", "0.63578725", "0.63046974", "0.6293853", "0.6280747", "0.6278641", "0.6277364", "0.62636745", "0.62392944", "0.6196774", "0.6196774", "0.6196774", "0.61929995", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6163727", "0.6162177", "0.61117697", "0.60924834", "0.60924834", "0.60924834", "0.60876787", "0.6077735", "0.6060057", "0.6059526", "0.60551065", "0.6053249", "0.60316384", "0.5971262", "0.5970975", "0.596408", "0.5917076", "0.591281", "0.59119374", "0.5910177", "0.5903997", "0.5902971", "0.5887851", "0.5885241", "0.5885241", "0.5885241", "0.5885241", "0.58789104", "0.58763593", "0.58566195", "0.58549756", "0.5845819", "0.5841451", "0.5841451", "0.5841451", "0.5841451", "0.5841451", "0.5841451", "0.5841451", "0.5840327", "0.5838907", "0.5834386", "0.5828766", "0.58131856", "0.58115673", "0.58098006", "0.5807627", "0.5807627", "0.5796111", "0.579545", "0.5777802", "0.5765418", "0.5736627", "0.5735608", "0.57316566", "0.57242113", "0.5709536", "0.5704277", "0.57009184", "0.5700192", "0.5698254" ]
0.66975474
4
LOGGING PRINTING/CONSOLE DISPLAY METHODS
public boolean println(String sMessage) { String sLogFilePath = ""; String sLogFileName = ""; String sLogFolderPath = ""; try { //check for log file name if (gsLogFileName.trim().equalsIgnoreCase("")) { if (user.trim().equalsIgnoreCase("")) { sLogFileName = getDateTime("yyyyMMdd") + ".log"; } else { sLogFileName = getDateTime("yyyyMMdd") + "_" + user + ".log"; } } else { sLogFileName = gsLogFileName; } //check for user log if (user.trim().equalsIgnoreCase("")) { } ///check for log folder path if (gsLogFolderPath.trim().equalsIgnoreCase("")) { sLogFolderPath = gsRootPath + File.separator + "logs"; } else { sLogFolderPath = gsLogFolderPath; } //check for log file path if (gsLogFilePath.trim().equalsIgnoreCase("")) { sLogFilePath = sLogFolderPath + File.separator + sLogFileName; } else { sLogFilePath = gsLogFilePath; } //writing log file println(sMessage, sLogFilePath, false); return true; } catch (Exception exp) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void displayLog() {\n if (!consoleDisplayed) {\n splitter.setDividerLocation(defaultSliderPosition);\n consoleDisplayed=true;\n }\n }", "protected void logToScreen() {\r\n\t\tif (smscListener != null) {\r\n\t\t\tsynchronized (processors) {\r\n\t\t\t\tdisplayInfo = !displayInfo;\r\n\t\t\t\tint procCount = processors.count();\r\n\t\t\t\tSimulatorPDUProcessor proc;\r\n\t\t\t\tfor (int i = 0; i < procCount; i++) {\r\n\t\t\t\t\tproc = (SimulatorPDUProcessor) processors.get(i);\r\n\t\t\t\t\tproc.setDisplayInfo(displayInfo);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfactory.setDisplayInfo(displayInfo);\r\n\t\t}\r\n\t}", "public void printToViewConsole(String arg);", "public void viewLogs() {\n\t}", "public void displayTextToConsole();", "static void print (){\n \t\tSystem.out.println();\r\n \t}", "private static void log(String aMsg){\n\t System.out.println(aMsg);\n\t }", "public interface LogViewer {\n\n\t/**\n\t * General application info.\n\t * @param text\n\t */\n\tvoid info(String text);\n\t\n\t/**\n\t * General error info.\n\t * @param text\n\t */\n\tvoid err(String text);\n\t\n\t/**\n\t * Info related to GA.\n\t * @param text\n\t */\n\tvoid gaInfo(String text);\n\t\n\t/**\n\t * Info related to ANTS.\n\t * @param text\n\t */\n\tvoid antsInfo(String text);\n\t\n\t/**\n\t * Info related to BA.\n\t * @param text\n\t */\n\tvoid baInfo(String text);\n}", "private void print(String msg)\n {\n m_log.log(msg);\n m_vbox.write(\" \" + msg);\n }", "public static void printInfo(){\n }", "public void printInfo(){\n\t}", "public void printInfo(){\n\t}", "private static void print(final String format, final Object...params) {\n // we prefix all our messages with \">>> \" so as to distinguish them from the driver, node and client messages\n final String msg = String.format(\">>> \" + format, params);\n log.info(msg);\n System.out.println(msg);\n }", "private void log(String message) {\r\n\t\tif (AxisDisplaySettingsPanel.printLog && Main.isLoggingEnabled()) {\r\n\t\t\tSystem.out.println(this.getClass().getName() + \".\" + message);\r\n\t\t}\r\n\t}", "void log();", "void showInConsole();", "public static void stdout(){\n\t\tSystem.out.println(\"Buildings Found: \" + buildingsFound);\n\t\tSystem.out.println(\"Pages searched: \"+ pagesSearched);\n\t\tSystem.out.println(\"Time Taken: \" + (endTime - startTime) +\"ms\");\t\n\t}", "private void log(String message) {\r\n\t\tif (ChartFrameSelectParametersMenuActionListener.printLog && Main.isLoggingEnabled()) {\r\n\t\t\tSystem.out.println(this.getClass().getName() + \".\" + message);\r\n\t\t}\r\n\t}", "public LogScrap() {\n\t\tconsumer = bin->Conveyor.LOG.debug(\"{}\",bin);\n\t}", "@Override\n\tpublic void log(String string, String text) {\n\t\tSystem.out.println(\"Loguer dans le console =>\"+text);\n\t}", "void printInfo();", "@VisibleForTesting\n void print();", "@Override\r\n\tpublic void display() {\n\t\tSystem.out.println(\"Displaying...\");\r\n\t}", "private static void log(String msg) {\n System.out.println(msg);\n }", "@Override\n\tpublic void printInfo() {\n\t\tsuper.printInfo();\n\t\tmessage();\n\t\tdoInternet();\n\t\tmailing();\n\t\tcalling();\n\t\twatchingTV();\n\n\t}", "private void log(String pMessage) {\n\t\tif (logging)\n\t\t\tSystem.out.println(pMessage);\n\t}", "public void display() {\n System.out.println(toString());\n }", "public void printLog() {\n Runnable runnable = new Runnable() \n\t{\n @Override\n public void run() \n\t {\n\t\tmainClass os=new mainClass();\n\t\tos.run();\t\t\t\n\t\t\t\t\n }\n };\n\tThread thread = new Thread(runnable);\n thread.start();\n }", "final void out (String msg) { if (m_debugMode) { Logger.println (msg); } }", "public void info()\n {\n System.out.println(toString());\n }", "private void log(String message) {\n System.out.println(message);\n }", "private static void _logInfo ()\n {\n System.err.println (\"Logging is enabled using \" + log.getClass ().getName ());\n }", "final void out (String msg1, String msg2) { if (m_debugMode) { Logger.print (msg1); Logger.println (msg2); } }", "@Override\n public void logs() {\n \n }", "protected void log(Object msg) {\n\t\n\t\tSystem.out.println(\"MusicDataAccessor: \" + msg);\n\t}", "private void display(String msg) {\n\t\tif(cg == null)\n\t\t\tSystem.out.println(msg); // println for Console mode\n\t\telse\n\t\t\tcg.append(msg + \"\\n\"); // Append to, for example, JTextArea in the ClientGUI\n\t}", "public void display() {\n\t\tSystem.out.println(\"display..\");\n\t}", "void printHellow() {\n logger.debug(\"hellow world begin....\");\n logger.info(\"it's a info message\");\n logger.warn(\"it's a warning message\");\n loggerTest.warn(\"from test1 :....\");\n loggerTest.info(\"info from test1 :....\");\n\n // print internal state\n LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();\n StatusPrinter.print(lc);\n }", "public abstract void print(Level level, Object logMessage);", "public void Display() {\n\t\tSystem.out.println(Integer.toHexString(PID) + \"\\t\" + Integer.toString(CreationTime) + \"\\t\"+ Integer.toHexString(CommandCounter) + \"\\t\" + ProcessStatus.toString() \n\t\t+ \"\\t\" + Integer.toString(MemoryVolume) + \"\\t\" + Integer.toHexString(Priority) + \"\\t\" + ((MemorySegments != null)? MemorySegments.toString() : \"null\"));\n\t}", "@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}", "static void log(String text) {\n\t\tif (LoggingConfig.BUFFER_VERBOSE) {\n\t\t\tSystem.out.println(text);\n\t\t}\n\t}", "private void print() {\n printInputMessage();\n printFrequencyTable();\n printCodeTable();\n printEncodedMessage();\n }", "private void log(String message) {\n System.out.println(message);\n }", "public abstract void debug(PrintStream console);", "public void showInformation() {\n\t\tSystem.out.println(\"Title: \" + getTitle());\n\t\tSystem.out.println(\"Time: \" + getTime());\n\t\tSystem.out.println(\"Number: \" + getNumber());\n\t}", "public void print() {\r\n\t\t System.out.println(toString());\r\n\t }", "private static void printDetail() {\n System.out.println(\"Welcome to LockedMe.com\");\n System.out.println(\"Version: 1.0\");\n System.out.println(\"Developer: Sherman Xu\");\n System.out.println(\"[email protected]\");\n }", "public void print(){\t\t\r\n\t\tSystem.out.println(\"===\\nCommit \" + id +\"\\n\"+ Time + \"\\n\" + message + \"\\n\");\r\n\t}", "public void print(){\r\n System.out.println(toString());\r\n }", "public void print() {\n\t\tif(log.isTraceEnabled()) {\n\t\t\tlog.info(\">> print()\");\n\t\t}\n\t\tSystem.out.println(p + \"/\" + q);\n\t\tif(log.isTraceEnabled()) {\n\t\t\tlog.info(\"<< print()\");\n\t\t}\n\t}", "void log() {\n\t\tm_drivetrain.log();\n\t\tm_forklift.log();\n\t}", "public void print()\n {\n System.out.println();\n System.out.println(\"Ticket to \" + destination +\n \" Price : \" + price + \" pence \" + \n \" Issued \" + issueDateTime);\n System.out.println();\n }", "abstract public void printInfo();", "private static void log(String message) {\n System.out.println(message);\n }", "private void logInfo(String msgText) {\n System.out.println (\"[INFO] \" + msgText);\n \n }", "public static void Print() {\n\t\tSystem.out.println(\"Ticks: total \" + totalTicks + \", idle \" + idleTicks + \", system \" + systemTicks + \", user \"\n\t\t\t\t+ userTicks);\n\n\t\tSystem.out.println(\"Disk I/O: reads \" + numDiskReads + \", writes \" + numDiskWrites);\n\t\tSystem.out.println(\"Console I/O: reads \" + numConsoleCharsRead + \", writes \" + numConsoleCharsWritten);\n\t\tSystem.out.println(\"Paging: faults \" + numPageFaults);\n\n\t\tSystem.out.println(\"Network I/O: packets received \" + numPacketsRecvd + \", sent \" + numPacketsSent);\n\t}", "private void print(String message) {\n\n //System.out.println(LocalDateTime.now() + \" \" + message);\n System.out.println(message);\n }", "@Override\n\tvoid showMsg() {\n\t\tSystem.out.println(\"Sample\");\n\t}", "private void log(String msg) {\n\t\tSystem.out.println(new Date() + \": \" + msg);\n\t}", "private void display(String msg) {\n cg.append(msg + \"\\n\");\n }", "public void println();", "protected void log(String msg, PrintStream printStream) {\n printStream.print(\"Continuum \" + getCommandName() + \" - \");\n printStream.println(msg);\n }", "@Override\r\n\tpublic void print() {\n\t}", "private void printHelp() \n {\n Logger.Log(\"You have somehow ended up in this strange, magical land. But really you just want to go home.\");\n Logger.Log(\"\");\n Logger.Log(\"Your command words are:\");\n parser.showCommands();\n Logger.Log(\"You may view your inventory or your companions\");\n }", "public String getLog();", "@Override\r\n\t\t\tpublic void print() {\n\t\t\t\t\r\n\t\t\t}", "private static void log( java.io.PrintStream out, String message )\r\n { // Log message if requested\r\n if (out != null)\r\n {\r\n out.println(message);\r\n }\r\n }", "public void printMessage() {\n printMessage(System.out::print);\n }", "public void print() {\n System.out.println(toString());\n }", "private void logIt(String msg) {\n\tSystem.out.println(\"PLATINUM-SYNC-LOG: \" + msg);\n}", "public void print(String string){\n // make sure that the global weka log picks it up\n System.out.print(string);\n logStatusMessage(string); \n }", "void printMsg(){\n\tdisplay();\n }", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "public void writeLog() {\n\n\t}", "@Override\n\t\tpublic void print() {\n\n\t\t}", "public void display() {\n\t\tSystem.out.println(\"do something...\");\n\t}", "public void printForDebug() {\n\t\tif(Globalconstantable.DEBUG)\n\t\t{\n\t\t\tSystem.out.println(this.getSID());\n\t\t\tSystem.out.println(this.getScores());\n\t\t}\n\t}", "public void print() {\n\t\tSystem.out.println(\"针式打印机打印了\");\n\t\t\n\t}", "private static void consoleOutput() {\n\n Output airportFlightCounter = new AirportFlightCounter(airports);\n Output flightInventory = new FlightInventory(flights);\n Output flightPassengerCounter = new FlightPassengerCounter(flights);\n Output mileageCounter = new MileageCounter(flights, airports);\n\n airportFlightCounter.toConsole();\n flightInventory.toConsole();\n flightPassengerCounter.toConsole();\n mileageCounter.toConsole();\n }", "private static void print(Object msg){\n if (WAMClient.Debug){\n System.out.println(msg);\n }\n\n }", "@Override\n public void print() {\n }", "public void globallog() {\n for (Comm currcomm: allcomms.values()) {\n System.out.println(\"===\");\n System.out.println(\"commit \" + currcomm.getCommitID());\n if (currcomm.getMergepointer() != null) {\n System.out.println(\"Merge: \"\n + currcomm.getParent()\n .getCommitID().substring(0, 7) + \" \"\n + currcomm\n .getMergepointer().getCommitID().substring(0, 7));\n }\n System.out.println(\"Date: \" + currcomm.getDate());\n System.out.println(currcomm.getMessage());\n System.out.println();\n }\n }", "public void printYourself(){\n\t}", "private void printTimer() {\n\t\tif (_verbose) {\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"-- \" + getTimeString() + \" --\");\n\t\t}\n\t}", "@Override\n\tpublic void print() {\n\t\t\n\t}", "public void println() { System.out.println( toString() ); }", "protected void println(String function, String msg) {\r\n if (this.logger != null) {\r\n this.logger.printDebug(msg);\r\n } else {\r\n println(this.getClass(), function, msg);\r\n }\r\n }", "private static void print(String message)\n {\n System.out.println(message);\n }", "public void print() {\n\t\tSystem.out.println(toString());\n\t}", "private static void println(String message, SimpleAttributeSet settings) {print(message + \"\\n\", settings);}", "public void logData(){\n }", "public static void metricsPrintln(String arg0) {\n MDC.clear();\n metricsLogger.info(arg0);\n }", "public void logToConsole(){\n logger.trace(\"Records total: \" + employees.size());\n }", "@Override\n\tpublic void print() {\n\n\t}", "public void printInfo() {\n System.out.println(\"\\n\" + name + \"#\" + id);\n System.out.println(\"Wall clock time: \" + endWallClockTime + \" ms ~ \" + convertFromMillisToSec(endWallClockTime) + \" sec\");\n System.out.println(\"User time: \" + endUserTimeNano + \" ns ~ \" + convertFromNanoToSec(endUserTimeNano) + \" sec\");\n System.out.println(\"System time: \" + endSystemTimeNano + \" ns ~ \" + convertFromNanoToSec(endSystemTimeNano) + \" sec\");\n System.out.println(\"CPU time: \" + (endUserTimeNano + endSystemTimeNano) + \" ns ~ \" + convertFromNanoToSec(endUserTimeNano + endSystemTimeNano) + \" sec\\n\");\n }", "public static void print() {\r\n System.out.println();\r\n }", "public void printDetails() {\r\n\t\tSystem.out.println(\" \");\r\n\t\tSystem.out.println(showtimeId + \" \" + movie.getTitle() + \" starts at \" + startTime.toString());\r\n\t}", "public void logs(Object message) {\n System.out.println(message.toString());\n }", "public void print()\r\n\t{\r\n\t\tSystem.out.println(\"Method name: \" + name);\r\n\t\tSystem.out.println(\"Return type: \" + returnType);\r\n\t\tSystem.out.println(\"Modifiers: \" + modifiers);\r\n\r\n\t\tif(exceptions != null)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"Exceptions: \" + exceptions[0]);\r\n\t\t\tfor(int i = 1; i < exceptions.length; i++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\", \" + exceptions[i]);\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exceptions: none\");\r\n\t\t}\r\n\r\n\t\tif(parameters != null)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"Parameters: \" + parameters[0]);\r\n\t\t\tfor(int i = 1; i < parameters.length; i++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\", \" + parameters[i]);\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Parameters: none\");\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t}" ]
[ "0.6936917", "0.66906995", "0.6653939", "0.66280985", "0.6615863", "0.65833616", "0.6571589", "0.65610766", "0.65484273", "0.6542892", "0.6535205", "0.6535205", "0.64977014", "0.6474593", "0.646485", "0.6462232", "0.64377654", "0.6429682", "0.6418816", "0.64101076", "0.640593", "0.6399692", "0.6383799", "0.6383364", "0.63784325", "0.6338174", "0.63331443", "0.632874", "0.6328494", "0.6326687", "0.6317809", "0.63095284", "0.6298312", "0.62880576", "0.62768275", "0.6275396", "0.62665284", "0.62633437", "0.6257935", "0.625563", "0.6243435", "0.6239529", "0.62206054", "0.62198466", "0.6216869", "0.6214535", "0.62094444", "0.6207803", "0.62067986", "0.620672", "0.6205368", "0.62051755", "0.62001234", "0.6199467", "0.6192694", "0.61889064", "0.61871547", "0.61757296", "0.6170284", "0.61693144", "0.61639124", "0.616035", "0.6143693", "0.6137817", "0.6135741", "0.6129485", "0.61288774", "0.6125013", "0.61243445", "0.61234754", "0.6123076", "0.61215127", "0.6120162", "0.61114967", "0.61114967", "0.61114967", "0.61061794", "0.6103079", "0.60965973", "0.6093103", "0.6089708", "0.6073941", "0.6065502", "0.6058672", "0.60569686", "0.60545105", "0.60527045", "0.605243", "0.60474485", "0.6045732", "0.6034531", "0.6033671", "0.6032138", "0.6029175", "0.6018124", "0.6017354", "0.6004907", "0.60045505", "0.5995246", "0.5994849", "0.59944206" ]
0.0
-1